diff options
Diffstat (limited to 'include/linux')
107 files changed, 3737 insertions, 1379 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 5a5385749e16..f72914db2a11 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -214,7 +214,6 @@ unifdef-y += futex.h | |||
| 214 | unifdef-y += fs.h | 214 | unifdef-y += fs.h |
| 215 | unifdef-y += gameport.h | 215 | unifdef-y += gameport.h |
| 216 | unifdef-y += generic_serial.h | 216 | unifdef-y += generic_serial.h |
| 217 | unifdef-y += hayesesp.h | ||
| 218 | unifdef-y += hdlcdrv.h | 217 | unifdef-y += hdlcdrv.h |
| 219 | unifdef-y += hdlc.h | 218 | unifdef-y += hdlc.h |
| 220 | unifdef-y += hdreg.h | 219 | unifdef-y += hdreg.h |
diff --git a/include/linux/atmel-mci.h b/include/linux/atmel-mci.h index 57b1846a3c87..3e09b345f4d6 100644 --- a/include/linux/atmel-mci.h +++ b/include/linux/atmel-mci.h | |||
| @@ -3,8 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #define ATMEL_MCI_MAX_NR_SLOTS 2 | 4 | #define ATMEL_MCI_MAX_NR_SLOTS 2 |
| 5 | 5 | ||
| 6 | #include <linux/dw_dmac.h> | ||
| 7 | |||
| 8 | /** | 6 | /** |
| 9 | * struct mci_slot_pdata - board-specific per-slot configuration | 7 | * struct mci_slot_pdata - board-specific per-slot configuration |
| 10 | * @bus_width: Number of data lines wired up the slot | 8 | * @bus_width: Number of data lines wired up the slot |
| @@ -34,7 +32,7 @@ struct mci_slot_pdata { | |||
| 34 | * @slot: Per-slot configuration data. | 32 | * @slot: Per-slot configuration data. |
| 35 | */ | 33 | */ |
| 36 | struct mci_platform_data { | 34 | struct mci_platform_data { |
| 37 | struct dw_dma_slave dma_slave; | 35 | struct mci_dma_data *dma_slave; |
| 38 | struct mci_slot_pdata slot[ATMEL_MCI_MAX_NR_SLOTS]; | 36 | struct mci_slot_pdata slot[ATMEL_MCI_MAX_NR_SLOTS]; |
| 39 | }; | 37 | }; |
| 40 | 38 | ||
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 47536197ffdd..e287863ac053 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
| @@ -43,6 +43,8 @@ extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls); | |||
| 43 | 43 | ||
| 44 | #ifdef CONFIG_HOTPLUG_CPU | 44 | #ifdef CONFIG_HOTPLUG_CPU |
| 45 | extern void unregister_cpu(struct cpu *cpu); | 45 | extern void unregister_cpu(struct cpu *cpu); |
| 46 | extern ssize_t arch_cpu_probe(const char *, size_t); | ||
| 47 | extern ssize_t arch_cpu_release(const char *, size_t); | ||
| 46 | #endif | 48 | #endif |
| 47 | struct notifier_block; | 49 | struct notifier_block; |
| 48 | 50 | ||
| @@ -115,6 +117,19 @@ extern void put_online_cpus(void); | |||
| 115 | #define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) | 117 | #define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) |
| 116 | int cpu_down(unsigned int cpu); | 118 | int cpu_down(unsigned int cpu); |
| 117 | 119 | ||
| 120 | #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE | ||
| 121 | extern void cpu_hotplug_driver_lock(void); | ||
| 122 | extern void cpu_hotplug_driver_unlock(void); | ||
| 123 | #else | ||
| 124 | static inline void cpu_hotplug_driver_lock(void) | ||
| 125 | { | ||
| 126 | } | ||
| 127 | |||
| 128 | static inline void cpu_hotplug_driver_unlock(void) | ||
| 129 | { | ||
| 130 | } | ||
| 131 | #endif | ||
| 132 | |||
| 118 | #else /* CONFIG_HOTPLUG_CPU */ | 133 | #else /* CONFIG_HOTPLUG_CPU */ |
| 119 | 134 | ||
| 120 | #define get_online_cpus() do { } while (0) | 135 | #define get_online_cpus() do { } while (0) |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 79a2340d83cd..4de02b10007f 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
| @@ -232,6 +232,7 @@ struct cpufreq_driver { | |||
| 232 | /* optional */ | 232 | /* optional */ |
| 233 | unsigned int (*getavg) (struct cpufreq_policy *policy, | 233 | unsigned int (*getavg) (struct cpufreq_policy *policy, |
| 234 | unsigned int cpu); | 234 | unsigned int cpu); |
| 235 | int (*bios_limit) (int cpu, unsigned int *limit); | ||
| 235 | 236 | ||
| 236 | int (*exit) (struct cpufreq_policy *policy); | 237 | int (*exit) (struct cpufreq_policy *policy); |
| 237 | int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); | 238 | int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 789cf5f920ce..d77b54733c5b 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
| @@ -84,6 +84,7 @@ extern const struct cpumask *const cpu_active_mask; | |||
| 84 | #define num_online_cpus() cpumask_weight(cpu_online_mask) | 84 | #define num_online_cpus() cpumask_weight(cpu_online_mask) |
| 85 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask) | 85 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask) |
| 86 | #define num_present_cpus() cpumask_weight(cpu_present_mask) | 86 | #define num_present_cpus() cpumask_weight(cpu_present_mask) |
| 87 | #define num_active_cpus() cpumask_weight(cpu_active_mask) | ||
| 87 | #define cpu_online(cpu) cpumask_test_cpu((cpu), cpu_online_mask) | 88 | #define cpu_online(cpu) cpumask_test_cpu((cpu), cpu_online_mask) |
| 88 | #define cpu_possible(cpu) cpumask_test_cpu((cpu), cpu_possible_mask) | 89 | #define cpu_possible(cpu) cpumask_test_cpu((cpu), cpu_possible_mask) |
| 89 | #define cpu_present(cpu) cpumask_test_cpu((cpu), cpu_present_mask) | 90 | #define cpu_present(cpu) cpumask_test_cpu((cpu), cpu_present_mask) |
| @@ -92,6 +93,7 @@ extern const struct cpumask *const cpu_active_mask; | |||
| 92 | #define num_online_cpus() 1 | 93 | #define num_online_cpus() 1 |
| 93 | #define num_possible_cpus() 1 | 94 | #define num_possible_cpus() 1 |
| 94 | #define num_present_cpus() 1 | 95 | #define num_present_cpus() 1 |
| 96 | #define num_active_cpus() 1 | ||
| 95 | #define cpu_online(cpu) ((cpu) == 0) | 97 | #define cpu_online(cpu) ((cpu) == 0) |
| 96 | #define cpu_possible(cpu) ((cpu) == 0) | 98 | #define cpu_possible(cpu) ((cpu) == 0) |
| 97 | #define cpu_present(cpu) ((cpu) == 0) | 99 | #define cpu_present(cpu) ((cpu) == 0) |
diff --git a/include/linux/cs5535.h b/include/linux/cs5535.h new file mode 100644 index 000000000000..d5a1d4810b80 --- /dev/null +++ b/include/linux/cs5535.h | |||
| @@ -0,0 +1,172 @@ | |||
| 1 | /* | ||
| 2 | * AMD CS5535/CS5536 definitions | ||
| 3 | * Copyright (C) 2006 Advanced Micro Devices, Inc. | ||
| 4 | * Copyright (C) 2009 Andres Salomon <dilinger@collabora.co.uk> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of version 2 of the GNU General Public License | ||
| 8 | * as published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef _CS5535_H | ||
| 12 | #define _CS5535_H | ||
| 13 | |||
| 14 | /* MSRs */ | ||
| 15 | #define MSR_GLIU_P2D_RO0 0x10000029 | ||
| 16 | |||
| 17 | #define MSR_LX_GLD_MSR_CONFIG 0x48002001 | ||
| 18 | #define MSR_LX_MSR_PADSEL 0x48002011 /* NOT 0x48000011; the data | ||
| 19 | * sheet has the wrong value */ | ||
| 20 | #define MSR_GLCP_SYS_RSTPLL 0x4C000014 | ||
| 21 | #define MSR_GLCP_DOTPLL 0x4C000015 | ||
| 22 | |||
| 23 | #define MSR_LBAR_SMB 0x5140000B | ||
| 24 | #define MSR_LBAR_GPIO 0x5140000C | ||
| 25 | #define MSR_LBAR_MFGPT 0x5140000D | ||
| 26 | #define MSR_LBAR_ACPI 0x5140000E | ||
| 27 | #define MSR_LBAR_PMS 0x5140000F | ||
| 28 | |||
| 29 | #define MSR_DIVIL_SOFT_RESET 0x51400017 | ||
| 30 | |||
| 31 | #define MSR_PIC_YSEL_LOW 0x51400020 | ||
| 32 | #define MSR_PIC_YSEL_HIGH 0x51400021 | ||
| 33 | #define MSR_PIC_ZSEL_LOW 0x51400022 | ||
| 34 | #define MSR_PIC_ZSEL_HIGH 0x51400023 | ||
| 35 | #define MSR_PIC_IRQM_LPC 0x51400025 | ||
| 36 | |||
| 37 | #define MSR_MFGPT_IRQ 0x51400028 | ||
| 38 | #define MSR_MFGPT_NR 0x51400029 | ||
| 39 | #define MSR_MFGPT_SETUP 0x5140002B | ||
| 40 | |||
| 41 | #define MSR_LX_SPARE_MSR 0x80000011 /* DC-specific */ | ||
| 42 | |||
| 43 | #define MSR_GX_GLD_MSR_CONFIG 0xC0002001 | ||
| 44 | #define MSR_GX_MSR_PADSEL 0xC0002011 | ||
| 45 | |||
| 46 | /* resource sizes */ | ||
| 47 | #define LBAR_GPIO_SIZE 0xFF | ||
| 48 | #define LBAR_MFGPT_SIZE 0x40 | ||
| 49 | #define LBAR_ACPI_SIZE 0x40 | ||
| 50 | #define LBAR_PMS_SIZE 0x80 | ||
| 51 | |||
| 52 | /* VSA2 magic values */ | ||
| 53 | #define VSA_VRC_INDEX 0xAC1C | ||
| 54 | #define VSA_VRC_DATA 0xAC1E | ||
| 55 | #define VSA_VR_UNLOCK 0xFC53 /* unlock virtual register */ | ||
| 56 | #define VSA_VR_SIGNATURE 0x0003 | ||
| 57 | #define VSA_VR_MEM_SIZE 0x0200 | ||
| 58 | #define AMD_VSA_SIG 0x4132 /* signature is ascii 'VSA2' */ | ||
| 59 | #define GSW_VSA_SIG 0x534d /* General Software signature */ | ||
| 60 | |||
| 61 | #include <linux/io.h> | ||
| 62 | |||
| 63 | static inline int cs5535_has_vsa2(void) | ||
| 64 | { | ||
| 65 | static int has_vsa2 = -1; | ||
| 66 | |||
| 67 | if (has_vsa2 == -1) { | ||
| 68 | uint16_t val; | ||
| 69 | |||
| 70 | /* | ||
| 71 | * The VSA has virtual registers that we can query for a | ||
| 72 | * signature. | ||
| 73 | */ | ||
| 74 | outw(VSA_VR_UNLOCK, VSA_VRC_INDEX); | ||
| 75 | outw(VSA_VR_SIGNATURE, VSA_VRC_INDEX); | ||
| 76 | |||
| 77 | val = inw(VSA_VRC_DATA); | ||
| 78 | has_vsa2 = (val == AMD_VSA_SIG || val == GSW_VSA_SIG); | ||
| 79 | } | ||
| 80 | |||
| 81 | return has_vsa2; | ||
| 82 | } | ||
| 83 | |||
| 84 | /* GPIOs */ | ||
| 85 | #define GPIO_OUTPUT_VAL 0x00 | ||
| 86 | #define GPIO_OUTPUT_ENABLE 0x04 | ||
| 87 | #define GPIO_OUTPUT_OPEN_DRAIN 0x08 | ||
| 88 | #define GPIO_OUTPUT_INVERT 0x0C | ||
| 89 | #define GPIO_OUTPUT_AUX1 0x10 | ||
| 90 | #define GPIO_OUTPUT_AUX2 0x14 | ||
| 91 | #define GPIO_PULL_UP 0x18 | ||
| 92 | #define GPIO_PULL_DOWN 0x1C | ||
| 93 | #define GPIO_INPUT_ENABLE 0x20 | ||
| 94 | #define GPIO_INPUT_INVERT 0x24 | ||
| 95 | #define GPIO_INPUT_FILTER 0x28 | ||
| 96 | #define GPIO_INPUT_EVENT_COUNT 0x2C | ||
| 97 | #define GPIO_READ_BACK 0x30 | ||
| 98 | #define GPIO_INPUT_AUX1 0x34 | ||
| 99 | #define GPIO_EVENTS_ENABLE 0x38 | ||
| 100 | #define GPIO_LOCK_ENABLE 0x3C | ||
| 101 | #define GPIO_POSITIVE_EDGE_EN 0x40 | ||
| 102 | #define GPIO_NEGATIVE_EDGE_EN 0x44 | ||
| 103 | #define GPIO_POSITIVE_EDGE_STS 0x48 | ||
| 104 | #define GPIO_NEGATIVE_EDGE_STS 0x4C | ||
| 105 | |||
| 106 | #define GPIO_MAP_X 0xE0 | ||
| 107 | #define GPIO_MAP_Y 0xE4 | ||
| 108 | #define GPIO_MAP_Z 0xE8 | ||
| 109 | #define GPIO_MAP_W 0xEC | ||
| 110 | |||
| 111 | void cs5535_gpio_set(unsigned offset, unsigned int reg); | ||
| 112 | void cs5535_gpio_clear(unsigned offset, unsigned int reg); | ||
| 113 | int cs5535_gpio_isset(unsigned offset, unsigned int reg); | ||
| 114 | |||
| 115 | /* MFGPTs */ | ||
| 116 | |||
| 117 | #define MFGPT_MAX_TIMERS 8 | ||
| 118 | #define MFGPT_TIMER_ANY (-1) | ||
| 119 | |||
| 120 | #define MFGPT_DOMAIN_WORKING 1 | ||
| 121 | #define MFGPT_DOMAIN_STANDBY 2 | ||
| 122 | #define MFGPT_DOMAIN_ANY (MFGPT_DOMAIN_WORKING | MFGPT_DOMAIN_STANDBY) | ||
| 123 | |||
| 124 | #define MFGPT_CMP1 0 | ||
| 125 | #define MFGPT_CMP2 1 | ||
| 126 | |||
| 127 | #define MFGPT_EVENT_IRQ 0 | ||
| 128 | #define MFGPT_EVENT_NMI 1 | ||
| 129 | #define MFGPT_EVENT_RESET 3 | ||
| 130 | |||
| 131 | #define MFGPT_REG_CMP1 0 | ||
| 132 | #define MFGPT_REG_CMP2 2 | ||
| 133 | #define MFGPT_REG_COUNTER 4 | ||
| 134 | #define MFGPT_REG_SETUP 6 | ||
| 135 | |||
| 136 | #define MFGPT_SETUP_CNTEN (1 << 15) | ||
| 137 | #define MFGPT_SETUP_CMP2 (1 << 14) | ||
| 138 | #define MFGPT_SETUP_CMP1 (1 << 13) | ||
| 139 | #define MFGPT_SETUP_SETUP (1 << 12) | ||
| 140 | #define MFGPT_SETUP_STOPEN (1 << 11) | ||
| 141 | #define MFGPT_SETUP_EXTEN (1 << 10) | ||
| 142 | #define MFGPT_SETUP_REVEN (1 << 5) | ||
| 143 | #define MFGPT_SETUP_CLKSEL (1 << 4) | ||
| 144 | |||
| 145 | struct cs5535_mfgpt_timer; | ||
| 146 | |||
| 147 | extern uint16_t cs5535_mfgpt_read(struct cs5535_mfgpt_timer *timer, | ||
| 148 | uint16_t reg); | ||
| 149 | extern void cs5535_mfgpt_write(struct cs5535_mfgpt_timer *timer, uint16_t reg, | ||
| 150 | uint16_t value); | ||
| 151 | |||
| 152 | extern int cs5535_mfgpt_toggle_event(struct cs5535_mfgpt_timer *timer, int cmp, | ||
| 153 | int event, int enable); | ||
| 154 | extern int cs5535_mfgpt_set_irq(struct cs5535_mfgpt_timer *timer, int cmp, | ||
| 155 | int *irq, int enable); | ||
| 156 | extern struct cs5535_mfgpt_timer *cs5535_mfgpt_alloc_timer(int timer, | ||
| 157 | int domain); | ||
| 158 | extern void cs5535_mfgpt_free_timer(struct cs5535_mfgpt_timer *timer); | ||
| 159 | |||
| 160 | static inline int cs5535_mfgpt_setup_irq(struct cs5535_mfgpt_timer *timer, | ||
| 161 | int cmp, int *irq) | ||
| 162 | { | ||
| 163 | return cs5535_mfgpt_set_irq(timer, cmp, irq, 1); | ||
| 164 | } | ||
| 165 | |||
| 166 | static inline int cs5535_mfgpt_release_irq(struct cs5535_mfgpt_timer *timer, | ||
| 167 | int cmp, int *irq) | ||
| 168 | { | ||
| 169 | return cs5535_mfgpt_set_irq(timer, cmp, irq, 0); | ||
| 170 | } | ||
| 171 | |||
| 172 | #endif | ||
diff --git a/include/linux/ctype.h b/include/linux/ctype.h index afa36392297a..a3d6ee0044f9 100644 --- a/include/linux/ctype.h +++ b/include/linux/ctype.h | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #define _X 0x40 /* hex digit */ | 15 | #define _X 0x40 /* hex digit */ |
| 16 | #define _SP 0x80 /* hard space (0x20) */ | 16 | #define _SP 0x80 /* hard space (0x20) */ |
| 17 | 17 | ||
| 18 | extern unsigned char _ctype[]; | 18 | extern const unsigned char _ctype[]; |
| 19 | 19 | ||
| 20 | #define __ismask(x) (_ctype[(int)(unsigned char)(x)]) | 20 | #define __ismask(x) (_ctype[(int)(unsigned char)(x)]) |
| 21 | 21 | ||
| @@ -27,6 +27,7 @@ extern unsigned char _ctype[]; | |||
| 27 | #define islower(c) ((__ismask(c)&(_L)) != 0) | 27 | #define islower(c) ((__ismask(c)&(_L)) != 0) |
| 28 | #define isprint(c) ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0) | 28 | #define isprint(c) ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0) |
| 29 | #define ispunct(c) ((__ismask(c)&(_P)) != 0) | 29 | #define ispunct(c) ((__ismask(c)&(_P)) != 0) |
| 30 | /* Note: isspace() must return false for %NUL-terminator */ | ||
| 30 | #define isspace(c) ((__ismask(c)&(_S)) != 0) | 31 | #define isspace(c) ((__ismask(c)&(_S)) != 0) |
| 31 | #define isupper(c) ((__ismask(c)&(_U)) != 0) | 32 | #define isupper(c) ((__ismask(c)&(_U)) != 0) |
| 32 | #define isxdigit(c) ((__ismask(c)&(_D|_X)) != 0) | 33 | #define isxdigit(c) ((__ismask(c)&(_D|_X)) != 0) |
diff --git a/include/linux/device.h b/include/linux/device.h index 2ea3e4921812..2a73d9bcbc9c 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -558,7 +558,7 @@ extern void wait_for_device_probe(void); | |||
| 558 | #ifdef CONFIG_DEVTMPFS | 558 | #ifdef CONFIG_DEVTMPFS |
| 559 | extern int devtmpfs_create_node(struct device *dev); | 559 | extern int devtmpfs_create_node(struct device *dev); |
| 560 | extern int devtmpfs_delete_node(struct device *dev); | 560 | extern int devtmpfs_delete_node(struct device *dev); |
| 561 | extern int devtmpfs_mount(const char *mountpoint); | 561 | extern int devtmpfs_mount(const char *mntdir); |
| 562 | #else | 562 | #else |
| 563 | static inline int devtmpfs_create_node(struct device *dev) { return 0; } | 563 | static inline int devtmpfs_create_node(struct device *dev) { return 0; } |
| 564 | static inline int devtmpfs_delete_node(struct device *dev) { return 0; } | 564 | static inline int devtmpfs_delete_node(struct device *dev) { return 0; } |
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index a0d9422a1569..f8c2e1767500 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h | |||
| @@ -57,8 +57,7 @@ extern int ddebug_remove_module(char *mod_name); | |||
| 57 | { KBUILD_MODNAME, __func__, __FILE__, fmt, DEBUG_HASH, \ | 57 | { KBUILD_MODNAME, __func__, __FILE__, fmt, DEBUG_HASH, \ |
| 58 | DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \ | 58 | DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \ |
| 59 | if (__dynamic_dbg_enabled(descriptor)) \ | 59 | if (__dynamic_dbg_enabled(descriptor)) \ |
| 60 | printk(KERN_DEBUG KBUILD_MODNAME ":" pr_fmt(fmt), \ | 60 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \ |
| 61 | ##__VA_ARGS__); \ | ||
| 62 | } while (0) | 61 | } while (0) |
| 63 | 62 | ||
| 64 | 63 | ||
| @@ -69,9 +68,7 @@ extern int ddebug_remove_module(char *mod_name); | |||
| 69 | { KBUILD_MODNAME, __func__, __FILE__, fmt, DEBUG_HASH, \ | 68 | { KBUILD_MODNAME, __func__, __FILE__, fmt, DEBUG_HASH, \ |
| 70 | DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \ | 69 | DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \ |
| 71 | if (__dynamic_dbg_enabled(descriptor)) \ | 70 | if (__dynamic_dbg_enabled(descriptor)) \ |
| 72 | dev_printk(KERN_DEBUG, dev, \ | 71 | dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \ |
| 73 | KBUILD_MODNAME ": " fmt, \ | ||
| 74 | ##__VA_ARGS__); \ | ||
| 75 | } while (0) | 72 | } while (0) |
| 76 | 73 | ||
| 77 | #else | 74 | #else |
| @@ -81,8 +78,10 @@ static inline int ddebug_remove_module(char *mod) | |||
| 81 | return 0; | 78 | return 0; |
| 82 | } | 79 | } |
| 83 | 80 | ||
| 84 | #define dynamic_pr_debug(fmt, ...) do { } while (0) | 81 | #define dynamic_pr_debug(fmt, ...) \ |
| 85 | #define dynamic_dev_dbg(dev, format, ...) do { } while (0) | 82 | do { if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); } while (0) |
| 83 | #define dynamic_dev_dbg(dev, format, ...) \ | ||
| 84 | do { if (0) dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); } while (0) | ||
| 86 | #endif | 85 | #endif |
| 87 | 86 | ||
| 88 | #endif | 87 | #endif |
diff --git a/include/linux/efi.h b/include/linux/efi.h index ce4581fbc08b..fb737bc19a8c 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
| @@ -280,11 +280,7 @@ efi_guidcmp (efi_guid_t left, efi_guid_t right) | |||
| 280 | static inline char * | 280 | static inline char * |
| 281 | efi_guid_unparse(efi_guid_t *guid, char *out) | 281 | efi_guid_unparse(efi_guid_t *guid, char *out) |
| 282 | { | 282 | { |
| 283 | sprintf(out, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", | 283 | sprintf(out, "%pUl", guid->b); |
| 284 | guid->b[3], guid->b[2], guid->b[1], guid->b[0], | ||
| 285 | guid->b[5], guid->b[4], guid->b[7], guid->b[6], | ||
| 286 | guid->b[8], guid->b[9], guid->b[10], guid->b[11], | ||
| 287 | guid->b[12], guid->b[13], guid->b[14], guid->b[15]); | ||
| 288 | return out; | 284 | return out; |
| 289 | } | 285 | } |
| 290 | 286 | ||
diff --git a/include/linux/err.h b/include/linux/err.h index ec87f3142bf3..1b12642636c7 100644 --- a/include/linux/err.h +++ b/include/linux/err.h | |||
| @@ -34,6 +34,11 @@ static inline long IS_ERR(const void *ptr) | |||
| 34 | return IS_ERR_VALUE((unsigned long)ptr); | 34 | return IS_ERR_VALUE((unsigned long)ptr); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | static inline long IS_ERR_OR_NULL(const void *ptr) | ||
| 38 | { | ||
| 39 | return !ptr || IS_ERR_VALUE((unsigned long)ptr); | ||
| 40 | } | ||
| 41 | |||
| 37 | /** | 42 | /** |
| 38 | * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type | 43 | * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type |
| 39 | * @ptr: The pointer to cast. | 44 | * @ptr: The pointer to cast. |
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 121720d74e15..2dfa7076e8b6 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h | |||
| @@ -565,14 +565,14 @@ struct ext2_dir_entry_2 { | |||
| 565 | * other bits are reserved for now. | 565 | * other bits are reserved for now. |
| 566 | */ | 566 | */ |
| 567 | enum { | 567 | enum { |
| 568 | EXT2_FT_UNKNOWN, | 568 | EXT2_FT_UNKNOWN = 0, |
| 569 | EXT2_FT_REG_FILE, | 569 | EXT2_FT_REG_FILE = 1, |
| 570 | EXT2_FT_DIR, | 570 | EXT2_FT_DIR = 2, |
| 571 | EXT2_FT_CHRDEV, | 571 | EXT2_FT_CHRDEV = 3, |
| 572 | EXT2_FT_BLKDEV, | 572 | EXT2_FT_BLKDEV = 4, |
| 573 | EXT2_FT_FIFO, | 573 | EXT2_FT_FIFO = 5, |
| 574 | EXT2_FT_SOCK, | 574 | EXT2_FT_SOCK = 6, |
| 575 | EXT2_FT_SYMLINK, | 575 | EXT2_FT_SYMLINK = 7, |
| 576 | EXT2_FT_MAX | 576 | EXT2_FT_MAX |
| 577 | }; | 577 | }; |
| 578 | 578 | ||
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 7499b3667798..6b049030fbe6 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
| @@ -918,6 +918,8 @@ extern void ext3_abort (struct super_block *, const char *, const char *, ...) | |||
| 918 | __attribute__ ((format (printf, 3, 4))); | 918 | __attribute__ ((format (printf, 3, 4))); |
| 919 | extern void ext3_warning (struct super_block *, const char *, const char *, ...) | 919 | extern void ext3_warning (struct super_block *, const char *, const char *, ...) |
| 920 | __attribute__ ((format (printf, 3, 4))); | 920 | __attribute__ ((format (printf, 3, 4))); |
| 921 | extern void ext3_msg(struct super_block *, const char *, const char *, ...) | ||
| 922 | __attribute__ ((format (printf, 3, 4))); | ||
| 921 | extern void ext3_update_dynamic_rev (struct super_block *sb); | 923 | extern void ext3_update_dynamic_rev (struct super_block *sb); |
| 922 | 924 | ||
| 923 | #define ext3_std_error(sb, errno) \ | 925 | #define ext3_std_error(sb, errno) \ |
diff --git a/include/linux/fb.h b/include/linux/fb.h index de9c722e7b90..369767bd873e 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
| @@ -763,6 +763,7 @@ struct fb_tile_ops { | |||
| 763 | * takes over; acceleration engine should be in a quiescent state */ | 763 | * takes over; acceleration engine should be in a quiescent state */ |
| 764 | 764 | ||
| 765 | /* hints */ | 765 | /* hints */ |
| 766 | #define FBINFO_VIRTFB 0x0004 /* FB is System RAM, not device. */ | ||
| 766 | #define FBINFO_PARTIAL_PAN_OK 0x0040 /* otw use pan only for double-buffering */ | 767 | #define FBINFO_PARTIAL_PAN_OK 0x0040 /* otw use pan only for double-buffering */ |
| 767 | #define FBINFO_READS_FAST 0x0080 /* soft-copy faster than rendering */ | 768 | #define FBINFO_READS_FAST 0x0080 /* soft-copy faster than rendering */ |
| 768 | 769 | ||
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index d31544628436..043811f0d277 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
| 5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
| 6 | #include <linux/compiler.h> | 6 | #include <linux/compiler.h> |
| 7 | #include <linux/gfp.h> | ||
| 7 | 8 | ||
| 8 | #define FW_ACTION_NOHOTPLUG 0 | 9 | #define FW_ACTION_NOHOTPLUG 0 |
| 9 | #define FW_ACTION_HOTPLUG 1 | 10 | #define FW_ACTION_HOTPLUG 1 |
| @@ -38,7 +39,7 @@ int request_firmware(const struct firmware **fw, const char *name, | |||
| 38 | struct device *device); | 39 | struct device *device); |
| 39 | int request_firmware_nowait( | 40 | int request_firmware_nowait( |
| 40 | struct module *module, int uevent, | 41 | struct module *module, int uevent, |
| 41 | const char *name, struct device *device, void *context, | 42 | const char *name, struct device *device, gfp_t gfp, void *context, |
| 42 | void (*cont)(const struct firmware *fw, void *context)); | 43 | void (*cont)(const struct firmware *fw, void *context)); |
| 43 | 44 | ||
| 44 | void release_firmware(const struct firmware *fw); | 45 | void release_firmware(const struct firmware *fw); |
| @@ -51,7 +52,7 @@ static inline int request_firmware(const struct firmware **fw, | |||
| 51 | } | 52 | } |
| 52 | static inline int request_firmware_nowait( | 53 | static inline int request_firmware_nowait( |
| 53 | struct module *module, int uevent, | 54 | struct module *module, int uevent, |
| 54 | const char *name, struct device *device, void *context, | 55 | const char *name, struct device *device, gfp_t gfp, void *context, |
| 55 | void (*cont)(const struct firmware *fw, void *context)) | 56 | void (*cont)(const struct firmware *fw, void *context)) |
| 56 | { | 57 | { |
| 57 | return -EINVAL; | 58 | return -EINVAL; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 891f7d642e5c..a057f48eb156 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -2091,8 +2091,6 @@ extern int filemap_fdatawait_range(struct address_space *, loff_t lstart, | |||
| 2091 | extern int filemap_write_and_wait(struct address_space *mapping); | 2091 | extern int filemap_write_and_wait(struct address_space *mapping); |
| 2092 | extern int filemap_write_and_wait_range(struct address_space *mapping, | 2092 | extern int filemap_write_and_wait_range(struct address_space *mapping, |
| 2093 | loff_t lstart, loff_t lend); | 2093 | loff_t lstart, loff_t lend); |
| 2094 | extern int wait_on_page_writeback_range(struct address_space *mapping, | ||
| 2095 | pgoff_t start, pgoff_t end); | ||
| 2096 | extern int __filemap_fdatawrite_range(struct address_space *mapping, | 2094 | extern int __filemap_fdatawrite_range(struct address_space *mapping, |
| 2097 | loff_t start, loff_t end, int sync_mode); | 2095 | loff_t start, loff_t end, int sync_mode); |
| 2098 | extern int filemap_fdatawrite_range(struct address_space *mapping, | 2096 | extern int filemap_fdatawrite_range(struct address_space *mapping, |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 43fc95d822d5..28e33fea5107 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
| @@ -74,7 +74,12 @@ struct spi_device; | |||
| 74 | struct fsl_spi_platform_data { | 74 | struct fsl_spi_platform_data { |
| 75 | u32 initial_spmode; /* initial SPMODE value */ | 75 | u32 initial_spmode; /* initial SPMODE value */ |
| 76 | s16 bus_num; | 76 | s16 bus_num; |
| 77 | bool qe_mode; | 77 | unsigned int flags; |
| 78 | #define SPI_QE_CPU_MODE (1 << 0) /* QE CPU ("PIO") mode */ | ||
| 79 | #define SPI_CPM_MODE (1 << 1) /* CPM/QE ("DMA") mode */ | ||
| 80 | #define SPI_CPM1 (1 << 2) /* SPI unit is in CPM1 block */ | ||
| 81 | #define SPI_CPM2 (1 << 3) /* SPI unit is in CPM2 block */ | ||
| 82 | #define SPI_QE (1 << 4) /* SPI unit is in QE block */ | ||
| 78 | /* board specific information */ | 83 | /* board specific information */ |
| 79 | u16 max_chipselect; | 84 | u16 max_chipselect; |
| 80 | void (*cs_control)(struct spi_device *spi, bool on); | 85 | void (*cs_control)(struct spi_device *spi, bool on); |
| @@ -90,6 +95,10 @@ struct mpc8xx_pcmcia_ops { | |||
| 90 | * lead to a deep sleep (i.e. power removed from the core, | 95 | * lead to a deep sleep (i.e. power removed from the core, |
| 91 | * instead of just the clock). | 96 | * instead of just the clock). |
| 92 | */ | 97 | */ |
| 98 | #if defined(CONFIG_PPC_83xx) && defined(CONFIG_SUSPEND) | ||
| 93 | int fsl_deep_sleep(void); | 99 | int fsl_deep_sleep(void); |
| 100 | #else | ||
| 101 | static inline int fsl_deep_sleep(void) { return 0; } | ||
| 102 | #endif | ||
| 94 | 103 | ||
| 95 | #endif /* _FSL_DEVICE_H_ */ | 104 | #endif /* _FSL_DEVICE_H_ */ |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 47bbdf9c38d0..38f8d6553831 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -57,6 +57,7 @@ struct trace_iterator { | |||
| 57 | /* The below is zeroed out in pipe_read */ | 57 | /* The below is zeroed out in pipe_read */ |
| 58 | struct trace_seq seq; | 58 | struct trace_seq seq; |
| 59 | struct trace_entry *ent; | 59 | struct trace_entry *ent; |
| 60 | int leftover; | ||
| 60 | int cpu; | 61 | int cpu; |
| 61 | u64 ts; | 62 | u64 ts; |
| 62 | 63 | ||
diff --git a/include/linux/gigaset_dev.h b/include/linux/gigaset_dev.h index 5dc4a316ca37..258ba82937e7 100644 --- a/include/linux/gigaset_dev.h +++ b/include/linux/gigaset_dev.h | |||
| @@ -16,15 +16,23 @@ | |||
| 16 | 16 | ||
| 17 | #include <linux/ioctl.h> | 17 | #include <linux/ioctl.h> |
| 18 | 18 | ||
| 19 | /* The magic IOCTL value for this interface. */ | ||
| 19 | #define GIGASET_IOCTL 0x47 | 20 | #define GIGASET_IOCTL 0x47 |
| 20 | 21 | ||
| 21 | #define GIGVER_DRIVER 0 | 22 | /* enable/disable device control via character device (lock out ISDN subsys) */ |
| 22 | #define GIGVER_COMPAT 1 | 23 | #define GIGASET_REDIR _IOWR(GIGASET_IOCTL, 0, int) |
| 23 | #define GIGVER_FWBASE 2 | ||
| 24 | 24 | ||
| 25 | #define GIGASET_REDIR _IOWR (GIGASET_IOCTL, 0, int) | 25 | /* enable adapter configuration mode (M10x only) */ |
| 26 | #define GIGASET_CONFIG _IOWR (GIGASET_IOCTL, 1, int) | 26 | #define GIGASET_CONFIG _IOWR(GIGASET_IOCTL, 1, int) |
| 27 | #define GIGASET_BRKCHARS _IOW (GIGASET_IOCTL, 2, unsigned char[6]) //FIXME [6] okay? | 27 | |
| 28 | #define GIGASET_VERSION _IOWR (GIGASET_IOCTL, 3, unsigned[4]) | 28 | /* set break characters (M105 only) */ |
| 29 | #define GIGASET_BRKCHARS _IOW(GIGASET_IOCTL, 2, unsigned char[6]) | ||
| 30 | |||
| 31 | /* get version information selected by arg[0] */ | ||
| 32 | #define GIGASET_VERSION _IOWR(GIGASET_IOCTL, 3, unsigned[4]) | ||
| 33 | /* values for GIGASET_VERSION arg[0] */ | ||
| 34 | #define GIGVER_DRIVER 0 /* get driver version */ | ||
| 35 | #define GIGVER_COMPAT 1 /* get interface compatibility version */ | ||
| 36 | #define GIGVER_FWBASE 2 /* get base station firmware version */ | ||
| 29 | 37 | ||
| 30 | #endif | 38 | #endif |
diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h deleted file mode 100644 index 92b08cfe4a75..000000000000 --- a/include/linux/hayesesp.h +++ /dev/null | |||
| @@ -1,114 +0,0 @@ | |||
| 1 | #ifndef HAYESESP_H | ||
| 2 | #define HAYESESP_H | ||
| 3 | |||
| 4 | struct hayes_esp_config { | ||
| 5 | short flow_on; | ||
| 6 | short flow_off; | ||
| 7 | short rx_trigger; | ||
| 8 | short tx_trigger; | ||
| 9 | short pio_threshold; | ||
| 10 | unsigned char rx_timeout; | ||
| 11 | char dma_channel; | ||
| 12 | }; | ||
| 13 | |||
| 14 | #ifdef __KERNEL__ | ||
| 15 | |||
| 16 | #define ESP_DMA_CHANNEL 0 | ||
| 17 | #define ESP_RX_TRIGGER 768 | ||
| 18 | #define ESP_TX_TRIGGER 768 | ||
| 19 | #define ESP_FLOW_OFF 1016 | ||
| 20 | #define ESP_FLOW_ON 944 | ||
| 21 | #define ESP_RX_TMOUT 128 | ||
| 22 | #define ESP_PIO_THRESHOLD 32 | ||
| 23 | |||
| 24 | #define ESP_IN_MAJOR 57 /* major dev # for dial in */ | ||
| 25 | #define ESP_OUT_MAJOR 58 /* major dev # for dial out */ | ||
| 26 | #define ESPC_SCALE 3 | ||
| 27 | #define UART_ESI_BASE 0x00 | ||
| 28 | #define UART_ESI_SID 0x01 | ||
| 29 | #define UART_ESI_RX 0x02 | ||
| 30 | #define UART_ESI_TX 0x02 | ||
| 31 | #define UART_ESI_CMD1 0x04 | ||
| 32 | #define UART_ESI_CMD2 0x05 | ||
| 33 | #define UART_ESI_STAT1 0x04 | ||
| 34 | #define UART_ESI_STAT2 0x05 | ||
| 35 | #define UART_ESI_RWS 0x07 | ||
| 36 | |||
| 37 | #define UART_IER_DMA_TMOUT 0x80 | ||
| 38 | #define UART_IER_DMA_TC 0x08 | ||
| 39 | |||
| 40 | #define ESI_SET_IRQ 0x04 | ||
| 41 | #define ESI_SET_DMA_TMOUT 0x05 | ||
| 42 | #define ESI_SET_SRV_MASK 0x06 | ||
| 43 | #define ESI_SET_ERR_MASK 0x07 | ||
| 44 | #define ESI_SET_FLOW_CNTL 0x08 | ||
| 45 | #define ESI_SET_FLOW_CHARS 0x09 | ||
| 46 | #define ESI_SET_FLOW_LVL 0x0a | ||
| 47 | #define ESI_SET_TRIGGER 0x0b | ||
| 48 | #define ESI_SET_RX_TIMEOUT 0x0c | ||
| 49 | #define ESI_SET_FLOW_TMOUT 0x0d | ||
| 50 | #define ESI_WRITE_UART 0x0e | ||
| 51 | #define ESI_READ_UART 0x0f | ||
| 52 | #define ESI_SET_MODE 0x10 | ||
| 53 | #define ESI_GET_ERR_STAT 0x12 | ||
| 54 | #define ESI_GET_UART_STAT 0x13 | ||
| 55 | #define ESI_GET_RX_AVAIL 0x14 | ||
| 56 | #define ESI_GET_TX_AVAIL 0x15 | ||
| 57 | #define ESI_START_DMA_RX 0x16 | ||
| 58 | #define ESI_START_DMA_TX 0x17 | ||
| 59 | #define ESI_ISSUE_BREAK 0x1a | ||
| 60 | #define ESI_FLUSH_RX 0x1b | ||
| 61 | #define ESI_FLUSH_TX 0x1c | ||
| 62 | #define ESI_SET_BAUD 0x1d | ||
| 63 | #define ESI_SET_ENH_IRQ 0x1f | ||
| 64 | #define ESI_SET_REINTR 0x20 | ||
| 65 | #define ESI_SET_PRESCALAR 0x23 | ||
| 66 | #define ESI_NO_COMMAND 0xff | ||
| 67 | |||
| 68 | #define ESP_STAT_RX_TIMEOUT 0x01 | ||
| 69 | #define ESP_STAT_DMA_RX 0x02 | ||
| 70 | #define ESP_STAT_DMA_TX 0x04 | ||
| 71 | #define ESP_STAT_NEVER_DMA 0x08 | ||
| 72 | #define ESP_STAT_USE_PIO 0x10 | ||
| 73 | |||
| 74 | #define ESP_MAGIC 0x53ee | ||
| 75 | #define ESP_XMIT_SIZE 4096 | ||
| 76 | |||
| 77 | struct esp_struct { | ||
| 78 | int magic; | ||
| 79 | struct tty_port port; | ||
| 80 | spinlock_t lock; | ||
| 81 | int io_port; | ||
| 82 | int irq; | ||
| 83 | int read_status_mask; | ||
| 84 | int ignore_status_mask; | ||
| 85 | int timeout; | ||
| 86 | int stat_flags; | ||
| 87 | int custom_divisor; | ||
| 88 | int close_delay; | ||
| 89 | unsigned short closing_wait; | ||
| 90 | unsigned short closing_wait2; | ||
| 91 | int IER; /* Interrupt Enable Register */ | ||
| 92 | int MCR; /* Modem control register */ | ||
| 93 | unsigned long last_active; | ||
| 94 | int line; | ||
| 95 | unsigned char *xmit_buf; | ||
| 96 | int xmit_head; | ||
| 97 | int xmit_tail; | ||
| 98 | int xmit_cnt; | ||
| 99 | wait_queue_head_t break_wait; | ||
| 100 | struct async_icount icount; /* kernel counters for the 4 input interrupts */ | ||
| 101 | struct hayes_esp_config config; /* port configuration */ | ||
| 102 | struct esp_struct *next_port; /* For the linked list */ | ||
| 103 | }; | ||
| 104 | |||
| 105 | struct esp_pio_buffer { | ||
| 106 | unsigned char data[1024]; | ||
| 107 | struct esp_pio_buffer *next; | ||
| 108 | }; | ||
| 109 | |||
| 110 | #endif /* __KERNEL__ */ | ||
| 111 | |||
| 112 | |||
| 113 | #endif /* ESP_H */ | ||
| 114 | |||
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 9bace4b9f4fe..5d86fb2309d2 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
| @@ -162,18 +162,23 @@ struct hrtimer_clock_base { | |||
| 162 | * @expires_next: absolute time of the next event which was scheduled | 162 | * @expires_next: absolute time of the next event which was scheduled |
| 163 | * via clock_set_next_event() | 163 | * via clock_set_next_event() |
| 164 | * @hres_active: State of high resolution mode | 164 | * @hres_active: State of high resolution mode |
| 165 | * @check_clocks: Indictator, when set evaluate time source and clock | 165 | * @hang_detected: The last hrtimer interrupt detected a hang |
| 166 | * event devices whether high resolution mode can be | 166 | * @nr_events: Total number of hrtimer interrupt events |
| 167 | * activated. | 167 | * @nr_retries: Total number of hrtimer interrupt retries |
| 168 | * @nr_events: Total number of timer interrupt events | 168 | * @nr_hangs: Total number of hrtimer interrupt hangs |
| 169 | * @max_hang_time: Maximum time spent in hrtimer_interrupt | ||
| 169 | */ | 170 | */ |
| 170 | struct hrtimer_cpu_base { | 171 | struct hrtimer_cpu_base { |
| 171 | spinlock_t lock; | 172 | raw_spinlock_t lock; |
| 172 | struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; | 173 | struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; |
| 173 | #ifdef CONFIG_HIGH_RES_TIMERS | 174 | #ifdef CONFIG_HIGH_RES_TIMERS |
| 174 | ktime_t expires_next; | 175 | ktime_t expires_next; |
| 175 | int hres_active; | 176 | int hres_active; |
| 177 | int hang_detected; | ||
| 176 | unsigned long nr_events; | 178 | unsigned long nr_events; |
| 179 | unsigned long nr_retries; | ||
| 180 | unsigned long nr_hangs; | ||
| 181 | ktime_t max_hang_time; | ||
| 177 | #endif | 182 | #endif |
| 178 | }; | 183 | }; |
| 179 | 184 | ||
| @@ -435,47 +440,4 @@ extern u64 ktime_divns(const ktime_t kt, s64 div); | |||
| 435 | /* Show pending timers: */ | 440 | /* Show pending timers: */ |
| 436 | extern void sysrq_timer_list_show(void); | 441 | extern void sysrq_timer_list_show(void); |
| 437 | 442 | ||
| 438 | /* | ||
| 439 | * Timer-statistics info: | ||
| 440 | */ | ||
| 441 | #ifdef CONFIG_TIMER_STATS | ||
| 442 | |||
| 443 | extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, | ||
| 444 | void *timerf, char *comm, | ||
| 445 | unsigned int timer_flag); | ||
| 446 | |||
| 447 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) | ||
| 448 | { | ||
| 449 | if (likely(!timer_stats_active)) | ||
| 450 | return; | ||
| 451 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, | ||
| 452 | timer->function, timer->start_comm, 0); | ||
| 453 | } | ||
| 454 | |||
| 455 | extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer, | ||
| 456 | void *addr); | ||
| 457 | |||
| 458 | static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) | ||
| 459 | { | ||
| 460 | __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0)); | ||
| 461 | } | ||
| 462 | |||
| 463 | static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer) | ||
| 464 | { | ||
| 465 | timer->start_site = NULL; | ||
| 466 | } | ||
| 467 | #else | ||
| 468 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) | ||
| 469 | { | ||
| 470 | } | ||
| 471 | |||
| 472 | static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) | ||
| 473 | { | ||
| 474 | } | ||
| 475 | |||
| 476 | static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer) | ||
| 477 | { | ||
| 478 | } | ||
| 479 | #endif | ||
| 480 | |||
| 481 | #endif | 443 | #endif |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 41a59afc70fa..78b4bc64c006 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -23,6 +23,12 @@ void reset_vma_resv_huge_pages(struct vm_area_struct *vma); | |||
| 23 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); | 23 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
| 24 | int hugetlb_overcommit_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); | 24 | int hugetlb_overcommit_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
| 25 | int hugetlb_treat_movable_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); | 25 | int hugetlb_treat_movable_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
| 26 | |||
| 27 | #ifdef CONFIG_NUMA | ||
| 28 | int hugetlb_mempolicy_sysctl_handler(struct ctl_table *, int, | ||
| 29 | void __user *, size_t *, loff_t *); | ||
| 30 | #endif | ||
| 31 | |||
| 26 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); | 32 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); |
| 27 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, | 33 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, |
| 28 | struct page **, struct vm_area_struct **, | 34 | struct page **, struct vm_area_struct **, |
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index a03daed08c59..41235c93e4e9 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h | |||
| @@ -20,19 +20,18 @@ enum { | |||
| 20 | 20 | ||
| 21 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 21 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
| 22 | 22 | ||
| 23 | /* As it's for in-kernel or ptrace use, we want it to be pinned */ | ||
| 24 | #define DEFINE_BREAKPOINT_ATTR(name) \ | ||
| 25 | struct perf_event_attr name = { \ | ||
| 26 | .type = PERF_TYPE_BREAKPOINT, \ | ||
| 27 | .size = sizeof(name), \ | ||
| 28 | .pinned = 1, \ | ||
| 29 | }; | ||
| 30 | |||
| 31 | static inline void hw_breakpoint_init(struct perf_event_attr *attr) | 23 | static inline void hw_breakpoint_init(struct perf_event_attr *attr) |
| 32 | { | 24 | { |
| 25 | memset(attr, 0, sizeof(*attr)); | ||
| 26 | |||
| 33 | attr->type = PERF_TYPE_BREAKPOINT; | 27 | attr->type = PERF_TYPE_BREAKPOINT; |
| 34 | attr->size = sizeof(*attr); | 28 | attr->size = sizeof(*attr); |
| 29 | /* | ||
| 30 | * As it's for in-kernel or ptrace use, we want it to be pinned | ||
| 31 | * and to call its callback every hits. | ||
| 32 | */ | ||
| 35 | attr->pinned = 1; | 33 | attr->pinned = 1; |
| 34 | attr->sample_period = 1; | ||
| 36 | } | 35 | } |
| 37 | 36 | ||
| 38 | static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) | 37 | static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) |
| @@ -52,27 +51,24 @@ static inline int hw_breakpoint_len(struct perf_event *bp) | |||
| 52 | 51 | ||
| 53 | extern struct perf_event * | 52 | extern struct perf_event * |
| 54 | register_user_hw_breakpoint(struct perf_event_attr *attr, | 53 | register_user_hw_breakpoint(struct perf_event_attr *attr, |
| 55 | perf_callback_t triggered, | 54 | perf_overflow_handler_t triggered, |
| 56 | struct task_struct *tsk); | 55 | struct task_struct *tsk); |
| 57 | 56 | ||
| 58 | /* FIXME: only change from the attr, and don't unregister */ | 57 | /* FIXME: only change from the attr, and don't unregister */ |
| 59 | extern struct perf_event * | 58 | extern int |
| 60 | modify_user_hw_breakpoint(struct perf_event *bp, | 59 | modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr); |
| 61 | struct perf_event_attr *attr, | ||
| 62 | perf_callback_t triggered, | ||
| 63 | struct task_struct *tsk); | ||
| 64 | 60 | ||
| 65 | /* | 61 | /* |
| 66 | * Kernel breakpoints are not associated with any particular thread. | 62 | * Kernel breakpoints are not associated with any particular thread. |
| 67 | */ | 63 | */ |
| 68 | extern struct perf_event * | 64 | extern struct perf_event * |
| 69 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | 65 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, |
| 70 | perf_callback_t triggered, | 66 | perf_overflow_handler_t triggered, |
| 71 | int cpu); | 67 | int cpu); |
| 72 | 68 | ||
| 73 | extern struct perf_event ** | 69 | extern struct perf_event ** |
| 74 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | 70 | register_wide_hw_breakpoint(struct perf_event_attr *attr, |
| 75 | perf_callback_t triggered); | 71 | perf_overflow_handler_t triggered); |
| 76 | 72 | ||
| 77 | extern int register_perf_hw_breakpoint(struct perf_event *bp); | 73 | extern int register_perf_hw_breakpoint(struct perf_event *bp); |
| 78 | extern int __register_perf_hw_breakpoint(struct perf_event *bp); | 74 | extern int __register_perf_hw_breakpoint(struct perf_event *bp); |
| @@ -93,20 +89,18 @@ static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp) | |||
| 93 | 89 | ||
| 94 | static inline struct perf_event * | 90 | static inline struct perf_event * |
| 95 | register_user_hw_breakpoint(struct perf_event_attr *attr, | 91 | register_user_hw_breakpoint(struct perf_event_attr *attr, |
| 96 | perf_callback_t triggered, | 92 | perf_overflow_handler_t triggered, |
| 97 | struct task_struct *tsk) { return NULL; } | 93 | struct task_struct *tsk) { return NULL; } |
| 98 | static inline struct perf_event * | 94 | static inline int |
| 99 | modify_user_hw_breakpoint(struct perf_event *bp, | 95 | modify_user_hw_breakpoint(struct perf_event *bp, |
| 100 | struct perf_event_attr *attr, | 96 | struct perf_event_attr *attr) { return -ENOSYS; } |
| 101 | perf_callback_t triggered, | ||
| 102 | struct task_struct *tsk) { return NULL; } | ||
| 103 | static inline struct perf_event * | 97 | static inline struct perf_event * |
| 104 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | 98 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, |
| 105 | perf_callback_t triggered, | 99 | perf_overflow_handler_t triggered, |
| 106 | int cpu) { return NULL; } | 100 | int cpu) { return NULL; } |
| 107 | static inline struct perf_event ** | 101 | static inline struct perf_event ** |
| 108 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | 102 | register_wide_hw_breakpoint(struct perf_event_attr *attr, |
| 109 | perf_callback_t triggered) { return NULL; } | 103 | perf_overflow_handler_t triggered) { return NULL; } |
| 110 | static inline int | 104 | static inline int |
| 111 | register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } | 105 | register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } |
| 112 | static inline int | 106 | static inline int |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 419ab546b266..02fc617782ef 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -110,7 +110,7 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | |||
| 110 | * @driver: Device driver model driver | 110 | * @driver: Device driver model driver |
| 111 | * @id_table: List of I2C devices supported by this driver | 111 | * @id_table: List of I2C devices supported by this driver |
| 112 | * @detect: Callback for device detection | 112 | * @detect: Callback for device detection |
| 113 | * @address_data: The I2C addresses to probe (for detect) | 113 | * @address_list: The I2C addresses to probe (for detect) |
| 114 | * @clients: List of detected clients we created (for i2c-core use only) | 114 | * @clients: List of detected clients we created (for i2c-core use only) |
| 115 | * | 115 | * |
| 116 | * The driver.owner field should be set to the module owner of this driver. | 116 | * The driver.owner field should be set to the module owner of this driver. |
| @@ -161,8 +161,8 @@ struct i2c_driver { | |||
| 161 | const struct i2c_device_id *id_table; | 161 | const struct i2c_device_id *id_table; |
| 162 | 162 | ||
| 163 | /* Device detection callback for automatic device creation */ | 163 | /* Device detection callback for automatic device creation */ |
| 164 | int (*detect)(struct i2c_client *, int kind, struct i2c_board_info *); | 164 | int (*detect)(struct i2c_client *, struct i2c_board_info *); |
| 165 | const struct i2c_client_address_data *address_data; | 165 | const unsigned short *address_list; |
| 166 | struct list_head clients; | 166 | struct list_head clients; |
| 167 | }; | 167 | }; |
| 168 | #define to_i2c_driver(d) container_of(d, struct i2c_driver, driver) | 168 | #define to_i2c_driver(d) container_of(d, struct i2c_driver, driver) |
| @@ -391,14 +391,6 @@ static inline void i2c_unlock_adapter(struct i2c_adapter *adapter) | |||
| 391 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ | 391 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ |
| 392 | #define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ | 392 | #define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ |
| 393 | 393 | ||
| 394 | /* i2c_client_address_data is the struct for holding default client | ||
| 395 | * addresses for a driver and for the parameters supplied on the | ||
| 396 | * command line | ||
| 397 | */ | ||
| 398 | struct i2c_client_address_data { | ||
| 399 | const unsigned short *normal_i2c; | ||
| 400 | }; | ||
| 401 | |||
| 402 | /* Internal numbers to terminate lists */ | 394 | /* Internal numbers to terminate lists */ |
| 403 | #define I2C_CLIENT_END 0xfffeU | 395 | #define I2C_CLIENT_END 0xfffeU |
| 404 | 396 | ||
| @@ -576,82 +568,4 @@ union i2c_smbus_data { | |||
| 576 | #define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ | 568 | #define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ |
| 577 | #define I2C_SMBUS_I2C_BLOCK_DATA 8 | 569 | #define I2C_SMBUS_I2C_BLOCK_DATA 8 |
| 578 | 570 | ||
| 579 | |||
| 580 | #ifdef __KERNEL__ | ||
| 581 | |||
| 582 | /* These defines are used for probing i2c client addresses */ | ||
| 583 | /* The length of the option lists */ | ||
| 584 | #define I2C_CLIENT_MAX_OPTS 48 | ||
| 585 | |||
| 586 | /* Default fill of many variables */ | ||
| 587 | #define I2C_CLIENT_DEFAULTS {I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \ | ||
| 588 | I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \ | ||
| 589 | I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \ | ||
| 590 | I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \ | ||
| 591 | I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \ | ||
| 592 | I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \ | ||
| 593 | I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \ | ||
| 594 | I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \ | ||
| 595 | I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \ | ||
| 596 | I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \ | ||
| 597 | I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \ | ||
| 598 | I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \ | ||
| 599 | I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \ | ||
| 600 | I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \ | ||
| 601 | I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \ | ||
| 602 | I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END} | ||
| 603 | |||
| 604 | /* I2C_CLIENT_MODULE_PARM creates a module parameter, and puts it in the | ||
| 605 | module header */ | ||
| 606 | |||
| 607 | #define I2C_CLIENT_MODULE_PARM(var,desc) \ | ||
| 608 | static unsigned short var[I2C_CLIENT_MAX_OPTS] = I2C_CLIENT_DEFAULTS; \ | ||
| 609 | static unsigned int var##_num; \ | ||
| 610 | module_param_array(var, short, &var##_num, 0); \ | ||
| 611 | MODULE_PARM_DESC(var, desc) | ||
| 612 | |||
| 613 | #define I2C_CLIENT_INSMOD_COMMON \ | ||
| 614 | static const struct i2c_client_address_data addr_data = { \ | ||
| 615 | .normal_i2c = normal_i2c, \ | ||
| 616 | } | ||
| 617 | |||
| 618 | /* These are the ones you want to use in your own drivers. Pick the one | ||
| 619 | which matches the number of devices the driver differenciates between. */ | ||
| 620 | #define I2C_CLIENT_INSMOD \ | ||
| 621 | I2C_CLIENT_INSMOD_COMMON | ||
| 622 | |||
| 623 | #define I2C_CLIENT_INSMOD_1(chip1) \ | ||
| 624 | enum chips { any_chip, chip1 }; \ | ||
| 625 | I2C_CLIENT_INSMOD_COMMON | ||
| 626 | |||
| 627 | #define I2C_CLIENT_INSMOD_2(chip1, chip2) \ | ||
| 628 | enum chips { any_chip, chip1, chip2 }; \ | ||
| 629 | I2C_CLIENT_INSMOD_COMMON | ||
| 630 | |||
| 631 | #define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ | ||
| 632 | enum chips { any_chip, chip1, chip2, chip3 }; \ | ||
| 633 | I2C_CLIENT_INSMOD_COMMON | ||
| 634 | |||
| 635 | #define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \ | ||
| 636 | enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ | ||
| 637 | I2C_CLIENT_INSMOD_COMMON | ||
| 638 | |||
| 639 | #define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \ | ||
| 640 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ | ||
| 641 | I2C_CLIENT_INSMOD_COMMON | ||
| 642 | |||
| 643 | #define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \ | ||
| 644 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ | ||
| 645 | I2C_CLIENT_INSMOD_COMMON | ||
| 646 | |||
| 647 | #define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \ | ||
| 648 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | ||
| 649 | chip7 }; \ | ||
| 650 | I2C_CLIENT_INSMOD_COMMON | ||
| 651 | |||
| 652 | #define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \ | ||
| 653 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | ||
| 654 | chip7, chip8 }; \ | ||
| 655 | I2C_CLIENT_INSMOD_COMMON | ||
| 656 | #endif /* __KERNEL__ */ | ||
| 657 | #endif /* _LINUX_I2C_H */ | 571 | #endif /* _LINUX_I2C_H */ |
diff --git a/include/linux/i2c/tps65010.h b/include/linux/i2c/tps65010.h index 918c5354d9b8..08aa92278d71 100644 --- a/include/linux/i2c/tps65010.h +++ b/include/linux/i2c/tps65010.h | |||
| @@ -72,6 +72,21 @@ | |||
| 72 | #define TPS_VDCDC1 0x0c | 72 | #define TPS_VDCDC1 0x0c |
| 73 | # define TPS_ENABLE_LP (1 << 3) | 73 | # define TPS_ENABLE_LP (1 << 3) |
| 74 | #define TPS_VDCDC2 0x0d | 74 | #define TPS_VDCDC2 0x0d |
| 75 | # define TPS_LP_COREOFF (1 << 7) | ||
| 76 | # define TPS_VCORE_1_8V (7<<4) | ||
| 77 | # define TPS_VCORE_1_5V (6 << 4) | ||
| 78 | # define TPS_VCORE_1_4V (5 << 4) | ||
| 79 | # define TPS_VCORE_1_3V (4 << 4) | ||
| 80 | # define TPS_VCORE_1_2V (3 << 4) | ||
| 81 | # define TPS_VCORE_1_1V (2 << 4) | ||
| 82 | # define TPS_VCORE_1_0V (1 << 4) | ||
| 83 | # define TPS_VCORE_0_85V (0 << 4) | ||
| 84 | # define TPS_VCORE_LP_1_2V (3 << 2) | ||
| 85 | # define TPS_VCORE_LP_1_1V (2 << 2) | ||
| 86 | # define TPS_VCORE_LP_1_0V (1 << 2) | ||
| 87 | # define TPS_VCORE_LP_0_85V (0 << 2) | ||
| 88 | # define TPS_VIB (1 << 1) | ||
| 89 | # define TPS_VCORE_DISCH (1 << 0) | ||
| 75 | #define TPS_VREGS1 0x0e | 90 | #define TPS_VREGS1 0x0e |
| 76 | # define TPS_LDO2_ENABLE (1 << 7) | 91 | # define TPS_LDO2_ENABLE (1 << 7) |
| 77 | # define TPS_LDO2_OFF (1 << 6) | 92 | # define TPS_LDO2_OFF (1 << 6) |
| @@ -152,6 +167,10 @@ extern int tps65010_config_vregs1(unsigned value); | |||
| 152 | */ | 167 | */ |
| 153 | extern int tps65013_set_low_pwr(unsigned mode); | 168 | extern int tps65013_set_low_pwr(unsigned mode); |
| 154 | 169 | ||
| 170 | /* tps65010_set_vdcdc2 | ||
| 171 | * value to be written to VDCDC2 | ||
| 172 | */ | ||
| 173 | extern int tps65010_config_vdcdc2(unsigned value); | ||
| 155 | 174 | ||
| 156 | struct i2c_client; | 175 | struct i2c_client; |
| 157 | 176 | ||
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl.h index 5306a759cbde..bf1c5be1f5b6 100644 --- a/include/linux/i2c/twl4030.h +++ b/include/linux/i2c/twl.h | |||
| @@ -22,8 +22,8 @@ | |||
| 22 | * | 22 | * |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | #ifndef __TWL4030_H_ | 25 | #ifndef __TWL_H_ |
| 26 | #define __TWL4030_H_ | 26 | #define __TWL_H_ |
| 27 | 27 | ||
| 28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
| 29 | #include <linux/input/matrix_keypad.h> | 29 | #include <linux/input/matrix_keypad.h> |
| @@ -61,28 +61,112 @@ | |||
| 61 | #define TWL4030_MODULE_PWMA 0x0E | 61 | #define TWL4030_MODULE_PWMA 0x0E |
| 62 | #define TWL4030_MODULE_PWMB 0x0F | 62 | #define TWL4030_MODULE_PWMB 0x0F |
| 63 | 63 | ||
| 64 | #define TWL5031_MODULE_ACCESSORY 0x10 | ||
| 65 | #define TWL5031_MODULE_INTERRUPTS 0x11 | ||
| 66 | |||
| 64 | /* Slave 3 (i2c address 0x4b) */ | 67 | /* Slave 3 (i2c address 0x4b) */ |
| 65 | #define TWL4030_MODULE_BACKUP 0x10 | 68 | #define TWL4030_MODULE_BACKUP 0x12 |
| 66 | #define TWL4030_MODULE_INT 0x11 | 69 | #define TWL4030_MODULE_INT 0x13 |
| 67 | #define TWL4030_MODULE_PM_MASTER 0x12 | 70 | #define TWL4030_MODULE_PM_MASTER 0x14 |
| 68 | #define TWL4030_MODULE_PM_RECEIVER 0x13 | 71 | #define TWL4030_MODULE_PM_RECEIVER 0x15 |
| 69 | #define TWL4030_MODULE_RTC 0x14 | 72 | #define TWL4030_MODULE_RTC 0x16 |
| 70 | #define TWL4030_MODULE_SECURED_REG 0x15 | 73 | #define TWL4030_MODULE_SECURED_REG 0x17 |
| 74 | |||
| 75 | #define TWL_MODULE_USB TWL4030_MODULE_USB | ||
| 76 | #define TWL_MODULE_AUDIO_VOICE TWL4030_MODULE_AUDIO_VOICE | ||
| 77 | #define TWL_MODULE_PIH TWL4030_MODULE_PIH | ||
| 78 | #define TWL_MODULE_MADC TWL4030_MODULE_MADC | ||
| 79 | #define TWL_MODULE_MAIN_CHARGE TWL4030_MODULE_MAIN_CHARGE | ||
| 80 | #define TWL_MODULE_PM_MASTER TWL4030_MODULE_PM_MASTER | ||
| 81 | #define TWL_MODULE_PM_RECEIVER TWL4030_MODULE_PM_RECEIVER | ||
| 82 | #define TWL_MODULE_RTC TWL4030_MODULE_RTC | ||
| 83 | |||
| 84 | #define GPIO_INTR_OFFSET 0 | ||
| 85 | #define KEYPAD_INTR_OFFSET 1 | ||
| 86 | #define BCI_INTR_OFFSET 2 | ||
| 87 | #define MADC_INTR_OFFSET 3 | ||
| 88 | #define USB_INTR_OFFSET 4 | ||
| 89 | #define BCI_PRES_INTR_OFFSET 9 | ||
| 90 | #define USB_PRES_INTR_OFFSET 10 | ||
| 91 | #define RTC_INTR_OFFSET 11 | ||
| 92 | |||
| 93 | /* | ||
| 94 | * Offset from TWL6030_IRQ_BASE / pdata->irq_base | ||
| 95 | */ | ||
| 96 | #define PWR_INTR_OFFSET 0 | ||
| 97 | #define HOTDIE_INTR_OFFSET 12 | ||
| 98 | #define SMPSLDO_INTR_OFFSET 13 | ||
| 99 | #define BATDETECT_INTR_OFFSET 14 | ||
| 100 | #define SIMDETECT_INTR_OFFSET 15 | ||
| 101 | #define MMCDETECT_INTR_OFFSET 16 | ||
| 102 | #define GASGAUGE_INTR_OFFSET 17 | ||
| 103 | #define USBOTG_INTR_OFFSET 4 | ||
| 104 | #define CHARGER_INTR_OFFSET 2 | ||
| 105 | #define RSV_INTR_OFFSET 0 | ||
| 106 | |||
| 107 | /* INT register offsets */ | ||
| 108 | #define REG_INT_STS_A 0x00 | ||
| 109 | #define REG_INT_STS_B 0x01 | ||
| 110 | #define REG_INT_STS_C 0x02 | ||
| 111 | |||
| 112 | #define REG_INT_MSK_LINE_A 0x03 | ||
| 113 | #define REG_INT_MSK_LINE_B 0x04 | ||
| 114 | #define REG_INT_MSK_LINE_C 0x05 | ||
| 115 | |||
| 116 | #define REG_INT_MSK_STS_A 0x06 | ||
| 117 | #define REG_INT_MSK_STS_B 0x07 | ||
| 118 | #define REG_INT_MSK_STS_C 0x08 | ||
| 119 | |||
| 120 | /* MASK INT REG GROUP A */ | ||
| 121 | #define TWL6030_PWR_INT_MASK 0x07 | ||
| 122 | #define TWL6030_RTC_INT_MASK 0x18 | ||
| 123 | #define TWL6030_HOTDIE_INT_MASK 0x20 | ||
| 124 | #define TWL6030_SMPSLDOA_INT_MASK 0xC0 | ||
| 125 | |||
| 126 | /* MASK INT REG GROUP B */ | ||
| 127 | #define TWL6030_SMPSLDOB_INT_MASK 0x01 | ||
| 128 | #define TWL6030_BATDETECT_INT_MASK 0x02 | ||
| 129 | #define TWL6030_SIMDETECT_INT_MASK 0x04 | ||
| 130 | #define TWL6030_MMCDETECT_INT_MASK 0x08 | ||
| 131 | #define TWL6030_GPADC_INT_MASK 0x60 | ||
| 132 | #define TWL6030_GASGAUGE_INT_MASK 0x80 | ||
| 133 | |||
| 134 | /* MASK INT REG GROUP C */ | ||
| 135 | #define TWL6030_USBOTG_INT_MASK 0x0F | ||
| 136 | #define TWL6030_CHARGER_CTRL_INT_MASK 0x10 | ||
| 137 | #define TWL6030_CHARGER_FAULT_INT_MASK 0x60 | ||
| 138 | |||
| 139 | |||
| 140 | #define TWL4030_CLASS_ID 0x4030 | ||
| 141 | #define TWL6030_CLASS_ID 0x6030 | ||
| 142 | unsigned int twl_rev(void); | ||
| 143 | #define GET_TWL_REV (twl_rev()) | ||
| 144 | #define TWL_CLASS_IS(class, id) \ | ||
| 145 | static inline int twl_class_is_ ##class(void) \ | ||
| 146 | { \ | ||
| 147 | return ((id) == (GET_TWL_REV)) ? 1 : 0; \ | ||
| 148 | } | ||
| 149 | |||
| 150 | TWL_CLASS_IS(4030, TWL4030_CLASS_ID) | ||
| 151 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) | ||
| 71 | 152 | ||
| 72 | /* | 153 | /* |
| 73 | * Read and write single 8-bit registers | 154 | * Read and write single 8-bit registers |
| 74 | */ | 155 | */ |
| 75 | int twl4030_i2c_write_u8(u8 mod_no, u8 val, u8 reg); | 156 | int twl_i2c_write_u8(u8 mod_no, u8 val, u8 reg); |
| 76 | int twl4030_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); | 157 | int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); |
| 77 | 158 | ||
| 78 | /* | 159 | /* |
| 79 | * Read and write several 8-bit registers at once. | 160 | * Read and write several 8-bit registers at once. |
| 80 | * | 161 | * |
| 81 | * IMPORTANT: For twl4030_i2c_write(), allocate num_bytes + 1 | 162 | * IMPORTANT: For twl_i2c_write(), allocate num_bytes + 1 |
| 82 | * for the value, and populate your data starting at offset 1. | 163 | * for the value, and populate your data starting at offset 1. |
| 83 | */ | 164 | */ |
| 84 | int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | 165 | int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
| 85 | int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | 166 | int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
| 167 | |||
| 168 | int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); | ||
| 169 | int twl6030_interrupt_mask(u8 bit_mask, u8 offset); | ||
| 86 | 170 | ||
| 87 | /*----------------------------------------------------------------------*/ | 171 | /*----------------------------------------------------------------------*/ |
| 88 | 172 | ||
| @@ -221,6 +305,38 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | |||
| 221 | 305 | ||
| 222 | /*----------------------------------------------------------------------*/ | 306 | /*----------------------------------------------------------------------*/ |
| 223 | 307 | ||
| 308 | /* | ||
| 309 | * Accessory Interrupts | ||
| 310 | */ | ||
| 311 | #define TWL5031_ACIIMR_LSB 0x05 | ||
| 312 | #define TWL5031_ACIIMR_MSB 0x06 | ||
| 313 | #define TWL5031_ACIIDR_LSB 0x07 | ||
| 314 | #define TWL5031_ACIIDR_MSB 0x08 | ||
| 315 | #define TWL5031_ACCISR1 0x0F | ||
| 316 | #define TWL5031_ACCIMR1 0x10 | ||
| 317 | #define TWL5031_ACCISR2 0x11 | ||
| 318 | #define TWL5031_ACCIMR2 0x12 | ||
| 319 | #define TWL5031_ACCSIR 0x13 | ||
| 320 | #define TWL5031_ACCEDR1 0x14 | ||
| 321 | #define TWL5031_ACCSIHCTRL 0x15 | ||
| 322 | |||
| 323 | /*----------------------------------------------------------------------*/ | ||
| 324 | |||
| 325 | /* | ||
| 326 | * Battery Charger Controller | ||
| 327 | */ | ||
| 328 | |||
| 329 | #define TWL5031_INTERRUPTS_BCIISR1 0x0 | ||
| 330 | #define TWL5031_INTERRUPTS_BCIIMR1 0x1 | ||
| 331 | #define TWL5031_INTERRUPTS_BCIISR2 0x2 | ||
| 332 | #define TWL5031_INTERRUPTS_BCIIMR2 0x3 | ||
| 333 | #define TWL5031_INTERRUPTS_BCISIR 0x4 | ||
| 334 | #define TWL5031_INTERRUPTS_BCIEDR1 0x5 | ||
| 335 | #define TWL5031_INTERRUPTS_BCIEDR2 0x6 | ||
| 336 | #define TWL5031_INTERRUPTS_BCISIHCTRL 0x7 | ||
| 337 | |||
| 338 | /*----------------------------------------------------------------------*/ | ||
| 339 | |||
| 224 | /* Power bus message definitions */ | 340 | /* Power bus message definitions */ |
| 225 | 341 | ||
| 226 | /* The TWL4030/5030 splits its power-management resources (the various | 342 | /* The TWL4030/5030 splits its power-management resources (the various |
| @@ -250,6 +366,7 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | |||
| 250 | 366 | ||
| 251 | #define RES_TYPE_ALL 0x7 | 367 | #define RES_TYPE_ALL 0x7 |
| 252 | 368 | ||
| 369 | /* Resource states */ | ||
| 253 | #define RES_STATE_WRST 0xF | 370 | #define RES_STATE_WRST 0xF |
| 254 | #define RES_STATE_ACTIVE 0xE | 371 | #define RES_STATE_ACTIVE 0xE |
| 255 | #define RES_STATE_SLEEP 0x8 | 372 | #define RES_STATE_SLEEP 0x8 |
| @@ -310,8 +427,18 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | |||
| 310 | #define MSG_SINGULAR(devgrp, id, state) \ | 427 | #define MSG_SINGULAR(devgrp, id, state) \ |
| 311 | ((devgrp) << 13 | 0 << 12 | (id) << 4 | (state)) | 428 | ((devgrp) << 13 | 0 << 12 | (id) << 4 | (state)) |
| 312 | 429 | ||
| 430 | #define MSG_BROADCAST_ALL(devgrp, state) \ | ||
| 431 | ((devgrp) << 5 | (state)) | ||
| 432 | |||
| 433 | #define MSG_BROADCAST_REF MSG_BROADCAST_ALL | ||
| 434 | #define MSG_BROADCAST_PROV MSG_BROADCAST_ALL | ||
| 435 | #define MSG_BROADCAST__CLK_RST MSG_BROADCAST_ALL | ||
| 313 | /*----------------------------------------------------------------------*/ | 436 | /*----------------------------------------------------------------------*/ |
| 314 | 437 | ||
| 438 | struct twl4030_clock_init_data { | ||
| 439 | bool ck32k_lowpwr_enable; | ||
| 440 | }; | ||
| 441 | |||
| 315 | struct twl4030_bci_platform_data { | 442 | struct twl4030_bci_platform_data { |
| 316 | int *battery_tmp_tbl; | 443 | int *battery_tmp_tbl; |
| 317 | unsigned int tblsize; | 444 | unsigned int tblsize; |
| @@ -391,12 +518,15 @@ struct twl4030_resconfig { | |||
| 391 | u8 devgroup; /* Processor group that Power resource belongs to */ | 518 | u8 devgroup; /* Processor group that Power resource belongs to */ |
| 392 | u8 type; /* Power resource addressed, 6 / broadcast message */ | 519 | u8 type; /* Power resource addressed, 6 / broadcast message */ |
| 393 | u8 type2; /* Power resource addressed, 3 / broadcast message */ | 520 | u8 type2; /* Power resource addressed, 3 / broadcast message */ |
| 521 | u8 remap_off; /* off state remapping */ | ||
| 522 | u8 remap_sleep; /* sleep state remapping */ | ||
| 394 | }; | 523 | }; |
| 395 | 524 | ||
| 396 | struct twl4030_power_data { | 525 | struct twl4030_power_data { |
| 397 | struct twl4030_script **scripts; | 526 | struct twl4030_script **scripts; |
| 398 | unsigned num; | 527 | unsigned num; |
| 399 | struct twl4030_resconfig *resource_config; | 528 | struct twl4030_resconfig *resource_config; |
| 529 | #define TWL4030_RESCONFIG_UNDEF ((u8)-1) | ||
| 400 | }; | 530 | }; |
| 401 | 531 | ||
| 402 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); | 532 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); |
| @@ -421,6 +551,7 @@ struct twl4030_codec_data { | |||
| 421 | 551 | ||
| 422 | struct twl4030_platform_data { | 552 | struct twl4030_platform_data { |
| 423 | unsigned irq_base, irq_end; | 553 | unsigned irq_base, irq_end; |
| 554 | struct twl4030_clock_init_data *clock; | ||
| 424 | struct twl4030_bci_platform_data *bci; | 555 | struct twl4030_bci_platform_data *bci; |
| 425 | struct twl4030_gpio_platform_data *gpio; | 556 | struct twl4030_gpio_platform_data *gpio; |
| 426 | struct twl4030_madc_platform_data *madc; | 557 | struct twl4030_madc_platform_data *madc; |
| @@ -429,19 +560,31 @@ struct twl4030_platform_data { | |||
| 429 | struct twl4030_power_data *power; | 560 | struct twl4030_power_data *power; |
| 430 | struct twl4030_codec_data *codec; | 561 | struct twl4030_codec_data *codec; |
| 431 | 562 | ||
| 432 | /* LDO regulators */ | 563 | /* Common LDO regulators for TWL4030/TWL6030 */ |
| 433 | struct regulator_init_data *vdac; | 564 | struct regulator_init_data *vdac; |
| 565 | struct regulator_init_data *vaux1; | ||
| 566 | struct regulator_init_data *vaux2; | ||
| 567 | struct regulator_init_data *vaux3; | ||
| 568 | /* TWL4030 LDO regulators */ | ||
| 434 | struct regulator_init_data *vpll1; | 569 | struct regulator_init_data *vpll1; |
| 435 | struct regulator_init_data *vpll2; | 570 | struct regulator_init_data *vpll2; |
| 436 | struct regulator_init_data *vmmc1; | 571 | struct regulator_init_data *vmmc1; |
| 437 | struct regulator_init_data *vmmc2; | 572 | struct regulator_init_data *vmmc2; |
| 438 | struct regulator_init_data *vsim; | 573 | struct regulator_init_data *vsim; |
| 439 | struct regulator_init_data *vaux1; | ||
| 440 | struct regulator_init_data *vaux2; | ||
| 441 | struct regulator_init_data *vaux3; | ||
| 442 | struct regulator_init_data *vaux4; | 574 | struct regulator_init_data *vaux4; |
| 443 | 575 | struct regulator_init_data *vio; | |
| 444 | /* REVISIT more to come ... _nothing_ should be hard-wired */ | 576 | struct regulator_init_data *vdd1; |
| 577 | struct regulator_init_data *vdd2; | ||
| 578 | struct regulator_init_data *vintana1; | ||
| 579 | struct regulator_init_data *vintana2; | ||
| 580 | struct regulator_init_data *vintdig; | ||
| 581 | /* TWL6030 LDO regulators */ | ||
| 582 | struct regulator_init_data *vmmc; | ||
| 583 | struct regulator_init_data *vpp; | ||
| 584 | struct regulator_init_data *vusim; | ||
| 585 | struct regulator_init_data *vana; | ||
| 586 | struct regulator_init_data *vcxio; | ||
| 587 | struct regulator_init_data *vusb; | ||
| 445 | }; | 588 | }; |
| 446 | 589 | ||
| 447 | /*----------------------------------------------------------------------*/ | 590 | /*----------------------------------------------------------------------*/ |
| @@ -473,6 +616,7 @@ int twl4030_sih_setup(int module); | |||
| 473 | * VIO is generally fixed. | 616 | * VIO is generally fixed. |
| 474 | */ | 617 | */ |
| 475 | 618 | ||
| 619 | /* TWL4030 SMPS/LDO's */ | ||
| 476 | /* EXTERNAL dc-to-dc buck converters */ | 620 | /* EXTERNAL dc-to-dc buck converters */ |
| 477 | #define TWL4030_REG_VDD1 0 | 621 | #define TWL4030_REG_VDD1 0 |
| 478 | #define TWL4030_REG_VDD2 1 | 622 | #define TWL4030_REG_VDD2 1 |
| @@ -499,4 +643,31 @@ int twl4030_sih_setup(int module); | |||
| 499 | #define TWL4030_REG_VUSB1V8 18 | 643 | #define TWL4030_REG_VUSB1V8 18 |
| 500 | #define TWL4030_REG_VUSB3V1 19 | 644 | #define TWL4030_REG_VUSB3V1 19 |
| 501 | 645 | ||
| 646 | /* TWL6030 SMPS/LDO's */ | ||
| 647 | /* EXTERNAL dc-to-dc buck convertor contollable via SR */ | ||
| 648 | #define TWL6030_REG_VDD1 30 | ||
| 649 | #define TWL6030_REG_VDD2 31 | ||
| 650 | #define TWL6030_REG_VDD3 32 | ||
| 651 | |||
| 652 | /* Non SR compliant dc-to-dc buck convertors */ | ||
| 653 | #define TWL6030_REG_VMEM 33 | ||
| 654 | #define TWL6030_REG_V2V1 34 | ||
| 655 | #define TWL6030_REG_V1V29 35 | ||
| 656 | #define TWL6030_REG_V1V8 36 | ||
| 657 | |||
| 658 | /* EXTERNAL LDOs */ | ||
| 659 | #define TWL6030_REG_VAUX1_6030 37 | ||
| 660 | #define TWL6030_REG_VAUX2_6030 38 | ||
| 661 | #define TWL6030_REG_VAUX3_6030 39 | ||
| 662 | #define TWL6030_REG_VMMC 40 | ||
| 663 | #define TWL6030_REG_VPP 41 | ||
| 664 | #define TWL6030_REG_VUSIM 42 | ||
| 665 | #define TWL6030_REG_VANA 43 | ||
| 666 | #define TWL6030_REG_VCXIO 44 | ||
| 667 | #define TWL6030_REG_VDAC 45 | ||
| 668 | #define TWL6030_REG_VUSB 46 | ||
| 669 | |||
| 670 | /* INTERNAL LDOs */ | ||
| 671 | #define TWL6030_REG_VRTC 47 | ||
| 672 | |||
| 502 | #endif /* End of __TWL4030_H */ | 673 | #endif /* End of __TWL4030_H */ |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 005e1525ab86..299b4121f914 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
| @@ -137,8 +137,6 @@ extern struct ctl_table ether_table[]; | |||
| 137 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); | 137 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); |
| 138 | 138 | ||
| 139 | #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" | 139 | #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" |
| 140 | #define MAC_BUF_SIZE 18 | ||
| 141 | #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] | ||
| 142 | 140 | ||
| 143 | #endif | 141 | #endif |
| 144 | 142 | ||
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 8d10aa7fd4c9..5ed8b9c50355 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
| @@ -111,6 +111,12 @@ extern struct cred init_cred; | |||
| 111 | # define INIT_PERF_EVENTS(tsk) | 111 | # define INIT_PERF_EVENTS(tsk) |
| 112 | #endif | 112 | #endif |
| 113 | 113 | ||
| 114 | #ifdef CONFIG_FS_JOURNAL_INFO | ||
| 115 | #define INIT_JOURNAL_INFO .journal_info = NULL, | ||
| 116 | #else | ||
| 117 | #define INIT_JOURNAL_INFO | ||
| 118 | #endif | ||
| 119 | |||
| 114 | /* | 120 | /* |
| 115 | * INIT_TASK is used to set up the first task table, touch at | 121 | * INIT_TASK is used to set up the first task table, touch at |
| 116 | * your own risk!. Base=0, limit=0x1fffff (=2MB) | 122 | * your own risk!. Base=0, limit=0x1fffff (=2MB) |
| @@ -162,10 +168,9 @@ extern struct cred init_cred; | |||
| 162 | .signal = {{0}}}, \ | 168 | .signal = {{0}}}, \ |
| 163 | .blocked = {{0}}, \ | 169 | .blocked = {{0}}, \ |
| 164 | .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \ | 170 | .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \ |
| 165 | .journal_info = NULL, \ | ||
| 166 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ | 171 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ |
| 167 | .fs_excl = ATOMIC_INIT(0), \ | 172 | .fs_excl = ATOMIC_INIT(0), \ |
| 168 | .pi_lock = __SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ | 173 | .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ |
| 169 | .timer_slack_ns = 50000, /* 50 usec default slack */ \ | 174 | .timer_slack_ns = 50000, /* 50 usec default slack */ \ |
| 170 | .pids = { \ | 175 | .pids = { \ |
| 171 | [PIDTYPE_PID] = INIT_PID_LINK(PIDTYPE_PID), \ | 176 | [PIDTYPE_PID] = INIT_PID_LINK(PIDTYPE_PID), \ |
| @@ -173,6 +178,7 @@ extern struct cred init_cred; | |||
| 173 | [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ | 178 | [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ |
| 174 | }, \ | 179 | }, \ |
| 175 | .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ | 180 | .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ |
| 181 | INIT_JOURNAL_INFO \ | ||
| 176 | INIT_IDS \ | 182 | INIT_IDS \ |
| 177 | INIT_PERF_EVENTS(tsk) \ | 183 | INIT_PERF_EVENTS(tsk) \ |
| 178 | INIT_TRACE_IRQFLAGS \ | 184 | INIT_TRACE_IRQFLAGS \ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index a287cfc0b1a6..451481c082b5 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
| @@ -192,7 +192,7 @@ struct irq_desc { | |||
| 192 | unsigned int irq_count; /* For detecting broken IRQs */ | 192 | unsigned int irq_count; /* For detecting broken IRQs */ |
| 193 | unsigned long last_unhandled; /* Aging timer for unhandled count */ | 193 | unsigned long last_unhandled; /* Aging timer for unhandled count */ |
| 194 | unsigned int irqs_unhandled; | 194 | unsigned int irqs_unhandled; |
| 195 | spinlock_t lock; | 195 | raw_spinlock_t lock; |
| 196 | #ifdef CONFIG_SMP | 196 | #ifdef CONFIG_SMP |
| 197 | cpumask_var_t affinity; | 197 | cpumask_var_t affinity; |
| 198 | unsigned int node; | 198 | unsigned int node; |
diff --git a/include/linux/isicom.h b/include/linux/isicom.h index bbd42197298f..b92e05650639 100644 --- a/include/linux/isicom.h +++ b/include/linux/isicom.h | |||
| @@ -67,6 +67,7 @@ | |||
| 67 | 67 | ||
| 68 | #define FIRMWARE_LOADED 0x0001 | 68 | #define FIRMWARE_LOADED 0x0001 |
| 69 | #define BOARD_ACTIVE 0x0002 | 69 | #define BOARD_ACTIVE 0x0002 |
| 70 | #define BOARD_INIT 0x0004 | ||
| 70 | 71 | ||
| 71 | /* isi_port status bitmap */ | 72 | /* isi_port status bitmap */ |
| 72 | 73 | ||
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 792274269f2b..d8e9b3d1c23c 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
| @@ -107,18 +107,6 @@ static inline void print_symbol(const char *fmt, unsigned long addr) | |||
| 107 | __builtin_extract_return_addr((void *)addr)); | 107 | __builtin_extract_return_addr((void *)addr)); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | /* | ||
| 111 | * Pretty-print a function pointer. This function is deprecated. | ||
| 112 | * Please use the "%pF" vsprintf format instead. | ||
| 113 | */ | ||
| 114 | static inline void __deprecated print_fn_descriptor_symbol(const char *fmt, void *addr) | ||
| 115 | { | ||
| 116 | #if defined(CONFIG_IA64) || defined(CONFIG_PPC64) | ||
| 117 | addr = *(void **)addr; | ||
| 118 | #endif | ||
| 119 | print_symbol(fmt, (unsigned long)addr); | ||
| 120 | } | ||
| 121 | |||
| 122 | static inline void print_ip_sym(unsigned long ip) | 110 | static inline void print_ip_sym(unsigned long ip) |
| 123 | { | 111 | { |
| 124 | printk("[<%p>] %pS\n", (void *) ip, (void *) ip); | 112 | printk("[<%p>] %pS\n", (void *) ip, (void *) ip); |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 3fa4c590cf12..4d9c916d06d9 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -251,10 +251,10 @@ extern int printk_delay_msec; | |||
| 251 | * Print a one-time message (analogous to WARN_ONCE() et al): | 251 | * Print a one-time message (analogous to WARN_ONCE() et al): |
| 252 | */ | 252 | */ |
| 253 | #define printk_once(x...) ({ \ | 253 | #define printk_once(x...) ({ \ |
| 254 | static bool __print_once = true; \ | 254 | static bool __print_once; \ |
| 255 | \ | 255 | \ |
| 256 | if (__print_once) { \ | 256 | if (!__print_once) { \ |
| 257 | __print_once = false; \ | 257 | __print_once = true; \ |
| 258 | printk(x); \ | 258 | printk(x); \ |
| 259 | } \ | 259 | } \ |
| 260 | }) | 260 | }) |
| @@ -397,15 +397,58 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
| 397 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | 397 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
| 398 | #elif defined(CONFIG_DYNAMIC_DEBUG) | 398 | #elif defined(CONFIG_DYNAMIC_DEBUG) |
| 399 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ | 399 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ |
| 400 | #define pr_debug(fmt, ...) do { \ | 400 | #define pr_debug(fmt, ...) \ |
| 401 | dynamic_pr_debug(fmt, ##__VA_ARGS__); \ | 401 | dynamic_pr_debug(fmt, ##__VA_ARGS__) |
| 402 | } while (0) | ||
| 403 | #else | 402 | #else |
| 404 | #define pr_debug(fmt, ...) \ | 403 | #define pr_debug(fmt, ...) \ |
| 405 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | 404 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) |
| 406 | #endif | 405 | #endif |
| 407 | 406 | ||
| 408 | /* | 407 | /* |
| 408 | * ratelimited messages with local ratelimit_state, | ||
| 409 | * no local ratelimit_state used in the !PRINTK case | ||
| 410 | */ | ||
| 411 | #ifdef CONFIG_PRINTK | ||
| 412 | #define printk_ratelimited(fmt, ...) ({ \ | ||
| 413 | static struct ratelimit_state _rs = { \ | ||
| 414 | .interval = DEFAULT_RATELIMIT_INTERVAL, \ | ||
| 415 | .burst = DEFAULT_RATELIMIT_BURST, \ | ||
| 416 | }; \ | ||
| 417 | \ | ||
| 418 | if (!__ratelimit(&_rs)) \ | ||
| 419 | printk(fmt, ##__VA_ARGS__); \ | ||
| 420 | }) | ||
| 421 | #else | ||
| 422 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
| 423 | #define printk_ratelimited printk | ||
| 424 | #endif | ||
| 425 | |||
| 426 | #define pr_emerg_ratelimited(fmt, ...) \ | ||
| 427 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 428 | #define pr_alert_ratelimited(fmt, ...) \ | ||
| 429 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 430 | #define pr_crit_ratelimited(fmt, ...) \ | ||
| 431 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 432 | #define pr_err_ratelimited(fmt, ...) \ | ||
| 433 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
| 434 | #define pr_warning_ratelimited(fmt, ...) \ | ||
| 435 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
| 436 | #define pr_notice_ratelimited(fmt, ...) \ | ||
| 437 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
| 438 | #define pr_info_ratelimited(fmt, ...) \ | ||
| 439 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
| 440 | /* no pr_cont_ratelimited, don't do that... */ | ||
| 441 | /* If you are writing a driver, please use dev_dbg instead */ | ||
| 442 | #if defined(DEBUG) | ||
| 443 | #define pr_debug_ratelimited(fmt, ...) \ | ||
| 444 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 445 | #else | ||
| 446 | #define pr_debug_ratelimited(fmt, ...) \ | ||
| 447 | ({ if (0) printk_ratelimited(KERN_DEBUG pr_fmt(fmt), \ | ||
| 448 | ##__VA_ARGS__); 0; }) | ||
| 449 | #endif | ||
| 450 | |||
| 451 | /* | ||
| 409 | * General tracing related utility functions - trace_printk(), | 452 | * General tracing related utility functions - trace_printk(), |
| 410 | * tracing_on/tracing_off and tracing_start()/tracing_stop | 453 | * tracing_on/tracing_off and tracing_start()/tracing_stop |
| 411 | * | 454 | * |
diff --git a/include/linux/ksm.h b/include/linux/ksm.h index a485c14ecd5d..bed5f16ba827 100644 --- a/include/linux/ksm.h +++ b/include/linux/ksm.h | |||
| @@ -9,8 +9,12 @@ | |||
| 9 | 9 | ||
| 10 | #include <linux/bitops.h> | 10 | #include <linux/bitops.h> |
| 11 | #include <linux/mm.h> | 11 | #include <linux/mm.h> |
| 12 | #include <linux/pagemap.h> | ||
| 13 | #include <linux/rmap.h> | ||
| 12 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
| 13 | #include <linux/vmstat.h> | 15 | |
| 16 | struct stable_node; | ||
| 17 | struct mem_cgroup; | ||
| 14 | 18 | ||
| 15 | #ifdef CONFIG_KSM | 19 | #ifdef CONFIG_KSM |
| 16 | int ksm_madvise(struct vm_area_struct *vma, unsigned long start, | 20 | int ksm_madvise(struct vm_area_struct *vma, unsigned long start, |
| @@ -34,23 +38,60 @@ static inline void ksm_exit(struct mm_struct *mm) | |||
| 34 | /* | 38 | /* |
| 35 | * A KSM page is one of those write-protected "shared pages" or "merged pages" | 39 | * A KSM page is one of those write-protected "shared pages" or "merged pages" |
| 36 | * which KSM maps into multiple mms, wherever identical anonymous page content | 40 | * which KSM maps into multiple mms, wherever identical anonymous page content |
| 37 | * is found in VM_MERGEABLE vmas. It's a PageAnon page, with NULL anon_vma. | 41 | * is found in VM_MERGEABLE vmas. It's a PageAnon page, pointing not to any |
| 42 | * anon_vma, but to that page's node of the stable tree. | ||
| 38 | */ | 43 | */ |
| 39 | static inline int PageKsm(struct page *page) | 44 | static inline int PageKsm(struct page *page) |
| 40 | { | 45 | { |
| 41 | return ((unsigned long)page->mapping == PAGE_MAPPING_ANON); | 46 | return ((unsigned long)page->mapping & PAGE_MAPPING_FLAGS) == |
| 47 | (PAGE_MAPPING_ANON | PAGE_MAPPING_KSM); | ||
| 48 | } | ||
| 49 | |||
| 50 | static inline struct stable_node *page_stable_node(struct page *page) | ||
| 51 | { | ||
| 52 | return PageKsm(page) ? page_rmapping(page) : NULL; | ||
| 53 | } | ||
| 54 | |||
| 55 | static inline void set_page_stable_node(struct page *page, | ||
| 56 | struct stable_node *stable_node) | ||
| 57 | { | ||
| 58 | page->mapping = (void *)stable_node + | ||
| 59 | (PAGE_MAPPING_ANON | PAGE_MAPPING_KSM); | ||
| 42 | } | 60 | } |
| 43 | 61 | ||
| 44 | /* | 62 | /* |
| 45 | * But we have to avoid the checking which page_add_anon_rmap() performs. | 63 | * When do_swap_page() first faults in from swap what used to be a KSM page, |
| 64 | * no problem, it will be assigned to this vma's anon_vma; but thereafter, | ||
| 65 | * it might be faulted into a different anon_vma (or perhaps to a different | ||
| 66 | * offset in the same anon_vma). do_swap_page() cannot do all the locking | ||
| 67 | * needed to reconstitute a cross-anon_vma KSM page: for now it has to make | ||
| 68 | * a copy, and leave remerging the pages to a later pass of ksmd. | ||
| 69 | * | ||
| 70 | * We'd like to make this conditional on vma->vm_flags & VM_MERGEABLE, | ||
| 71 | * but what if the vma was unmerged while the page was swapped out? | ||
| 46 | */ | 72 | */ |
| 47 | static inline void page_add_ksm_rmap(struct page *page) | 73 | struct page *ksm_does_need_to_copy(struct page *page, |
| 74 | struct vm_area_struct *vma, unsigned long address); | ||
| 75 | static inline struct page *ksm_might_need_to_copy(struct page *page, | ||
| 76 | struct vm_area_struct *vma, unsigned long address) | ||
| 48 | { | 77 | { |
| 49 | if (atomic_inc_and_test(&page->_mapcount)) { | 78 | struct anon_vma *anon_vma = page_anon_vma(page); |
| 50 | page->mapping = (void *) PAGE_MAPPING_ANON; | 79 | |
| 51 | __inc_zone_page_state(page, NR_ANON_PAGES); | 80 | if (!anon_vma || |
| 52 | } | 81 | (anon_vma == vma->anon_vma && |
| 82 | page->index == linear_page_index(vma, address))) | ||
| 83 | return page; | ||
| 84 | |||
| 85 | return ksm_does_need_to_copy(page, vma, address); | ||
| 53 | } | 86 | } |
| 87 | |||
| 88 | int page_referenced_ksm(struct page *page, | ||
| 89 | struct mem_cgroup *memcg, unsigned long *vm_flags); | ||
| 90 | int try_to_unmap_ksm(struct page *page, enum ttu_flags flags); | ||
| 91 | int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page *, | ||
| 92 | struct vm_area_struct *, unsigned long, void *), void *arg); | ||
| 93 | void ksm_migrate_page(struct page *newpage, struct page *oldpage); | ||
| 94 | |||
| 54 | #else /* !CONFIG_KSM */ | 95 | #else /* !CONFIG_KSM */ |
| 55 | 96 | ||
| 56 | static inline int ksm_madvise(struct vm_area_struct *vma, unsigned long start, | 97 | static inline int ksm_madvise(struct vm_area_struct *vma, unsigned long start, |
| @@ -73,7 +114,32 @@ static inline int PageKsm(struct page *page) | |||
| 73 | return 0; | 114 | return 0; |
| 74 | } | 115 | } |
| 75 | 116 | ||
| 76 | /* No stub required for page_add_ksm_rmap(page) */ | 117 | static inline struct page *ksm_might_need_to_copy(struct page *page, |
| 118 | struct vm_area_struct *vma, unsigned long address) | ||
| 119 | { | ||
| 120 | return page; | ||
| 121 | } | ||
| 122 | |||
| 123 | static inline int page_referenced_ksm(struct page *page, | ||
| 124 | struct mem_cgroup *memcg, unsigned long *vm_flags) | ||
| 125 | { | ||
| 126 | return 0; | ||
| 127 | } | ||
| 128 | |||
| 129 | static inline int try_to_unmap_ksm(struct page *page, enum ttu_flags flags) | ||
| 130 | { | ||
| 131 | return 0; | ||
| 132 | } | ||
| 133 | |||
| 134 | static inline int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page*, | ||
| 135 | struct vm_area_struct *, unsigned long, void *), void *arg) | ||
| 136 | { | ||
| 137 | return 0; | ||
| 138 | } | ||
| 139 | |||
| 140 | static inline void ksm_migrate_page(struct page *newpage, struct page *oldpage) | ||
| 141 | { | ||
| 142 | } | ||
| 77 | #endif /* !CONFIG_KSM */ | 143 | #endif /* !CONFIG_KSM */ |
| 78 | 144 | ||
| 79 | #endif | 145 | #endif /* __LINUX_KSM_H */ |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 2d241da07236..a24de0b1858e 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
| @@ -496,6 +496,7 @@ struct kvm_ioeventfd { | |||
| 496 | #define KVM_CAP_VCPU_EVENTS 41 | 496 | #define KVM_CAP_VCPU_EVENTS 41 |
| 497 | #endif | 497 | #endif |
| 498 | #define KVM_CAP_S390_PSW 42 | 498 | #define KVM_CAP_S390_PSW 42 |
| 499 | #define KVM_CAP_PPC_SEGSTATE 43 | ||
| 499 | 500 | ||
| 500 | #ifdef KVM_CAP_IRQ_ROUTING | 501 | #ifdef KVM_CAP_IRQ_ROUTING |
| 501 | 502 | ||
diff --git a/include/linux/lis3lv02d.h b/include/linux/lis3lv02d.h index 3cc2f2c53e4c..f1ca0dcc1628 100644 --- a/include/linux/lis3lv02d.h +++ b/include/linux/lis3lv02d.h | |||
| @@ -43,6 +43,21 @@ struct lis3lv02d_platform_data { | |||
| 43 | #define LIS3_WAKEUP_Z_HI (1 << 5) | 43 | #define LIS3_WAKEUP_Z_HI (1 << 5) |
| 44 | unsigned char wakeup_flags; | 44 | unsigned char wakeup_flags; |
| 45 | unsigned char wakeup_thresh; | 45 | unsigned char wakeup_thresh; |
| 46 | #define LIS3_NO_MAP 0 | ||
| 47 | #define LIS3_DEV_X 1 | ||
| 48 | #define LIS3_DEV_Y 2 | ||
| 49 | #define LIS3_DEV_Z 3 | ||
| 50 | #define LIS3_INV_DEV_X -1 | ||
| 51 | #define LIS3_INV_DEV_Y -2 | ||
| 52 | #define LIS3_INV_DEV_Z -3 | ||
| 53 | s8 axis_x; | ||
| 54 | s8 axis_y; | ||
| 55 | s8 axis_z; | ||
| 56 | int (*setup_resources)(void); | ||
| 57 | int (*release_resources)(void); | ||
| 58 | /* Limits for selftest are specified in chip data sheet */ | ||
| 59 | s16 st_min_limits[3]; /* min pass limit x, y, z */ | ||
| 60 | s16 st_max_limits[3]; /* max pass limit x, y, z */ | ||
| 46 | }; | 61 | }; |
| 47 | 62 | ||
| 48 | #endif /* __LIS3LV02D_H_ */ | 63 | #endif /* __LIS3LV02D_H_ */ |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index fed969281a41..35b07b773e6c 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
| @@ -69,7 +69,6 @@ extern void online_page(struct page *page); | |||
| 69 | /* VM interface that may be used by firmware interface */ | 69 | /* VM interface that may be used by firmware interface */ |
| 70 | extern int online_pages(unsigned long, unsigned long); | 70 | extern int online_pages(unsigned long, unsigned long); |
| 71 | extern void __offline_isolated_pages(unsigned long, unsigned long); | 71 | extern void __offline_isolated_pages(unsigned long, unsigned long); |
| 72 | extern int offline_pages(unsigned long, unsigned long, unsigned long); | ||
| 73 | 72 | ||
| 74 | /* reasonably generic interface to expand the physical pages in a zone */ | 73 | /* reasonably generic interface to expand the physical pages in a zone */ |
| 75 | extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn, | 74 | extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn, |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 085c903fe0f1..1cc966cd3e5f 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
| @@ -201,6 +201,7 @@ extern void mpol_fix_fork_child_flag(struct task_struct *p); | |||
| 201 | extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, | 201 | extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, |
| 202 | unsigned long addr, gfp_t gfp_flags, | 202 | unsigned long addr, gfp_t gfp_flags, |
| 203 | struct mempolicy **mpol, nodemask_t **nodemask); | 203 | struct mempolicy **mpol, nodemask_t **nodemask); |
| 204 | extern bool init_nodemask_of_mempolicy(nodemask_t *mask); | ||
| 204 | extern unsigned slab_node(struct mempolicy *policy); | 205 | extern unsigned slab_node(struct mempolicy *policy); |
| 205 | 206 | ||
| 206 | extern enum zone_type policy_zone; | 207 | extern enum zone_type policy_zone; |
| @@ -328,6 +329,8 @@ static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, | |||
| 328 | return node_zonelist(0, gfp_flags); | 329 | return node_zonelist(0, gfp_flags); |
| 329 | } | 330 | } |
| 330 | 331 | ||
| 332 | static inline bool init_nodemask_of_mempolicy(nodemask_t *m) { return false; } | ||
| 333 | |||
| 331 | static inline int do_migrate_pages(struct mm_struct *mm, | 334 | static inline int do_migrate_pages(struct mm_struct *mm, |
| 332 | const nodemask_t *from_nodes, | 335 | const nodemask_t *from_nodes, |
| 333 | const nodemask_t *to_nodes, int flags) | 336 | const nodemask_t *to_nodes, int flags) |
diff --git a/include/linux/mfd/88pm8607.h b/include/linux/mfd/88pm8607.h new file mode 100644 index 000000000000..f41b428d2cec --- /dev/null +++ b/include/linux/mfd/88pm8607.h | |||
| @@ -0,0 +1,217 @@ | |||
| 1 | /* | ||
| 2 | * Marvell 88PM8607 Interface | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009 Marvell International Ltd. | ||
| 5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __LINUX_MFD_88PM8607_H | ||
| 13 | #define __LINUX_MFD_88PM8607_H | ||
| 14 | |||
| 15 | enum { | ||
| 16 | PM8607_ID_BUCK1 = 0, | ||
| 17 | PM8607_ID_BUCK2, | ||
| 18 | PM8607_ID_BUCK3, | ||
| 19 | |||
| 20 | PM8607_ID_LDO1, | ||
| 21 | PM8607_ID_LDO2, | ||
| 22 | PM8607_ID_LDO3, | ||
| 23 | PM8607_ID_LDO4, | ||
| 24 | PM8607_ID_LDO5, | ||
| 25 | PM8607_ID_LDO6, | ||
| 26 | PM8607_ID_LDO7, | ||
| 27 | PM8607_ID_LDO8, | ||
| 28 | PM8607_ID_LDO9, | ||
| 29 | PM8607_ID_LDO10, | ||
| 30 | PM8607_ID_LDO12, | ||
| 31 | PM8607_ID_LDO14, | ||
| 32 | |||
| 33 | PM8607_ID_RG_MAX, | ||
| 34 | }; | ||
| 35 | |||
| 36 | #define CHIP_ID (0x40) | ||
| 37 | #define CHIP_ID_MASK (0xF8) | ||
| 38 | |||
| 39 | /* Interrupt Registers */ | ||
| 40 | #define PM8607_STATUS_1 (0x01) | ||
| 41 | #define PM8607_STATUS_2 (0x02) | ||
| 42 | #define PM8607_INT_STATUS1 (0x03) | ||
| 43 | #define PM8607_INT_STATUS2 (0x04) | ||
| 44 | #define PM8607_INT_STATUS3 (0x05) | ||
| 45 | #define PM8607_INT_MASK_1 (0x06) | ||
| 46 | #define PM8607_INT_MASK_2 (0x07) | ||
| 47 | #define PM8607_INT_MASK_3 (0x08) | ||
| 48 | |||
| 49 | /* Regulator Control Registers */ | ||
| 50 | #define PM8607_LDO1 (0x10) | ||
| 51 | #define PM8607_LDO2 (0x11) | ||
| 52 | #define PM8607_LDO3 (0x12) | ||
| 53 | #define PM8607_LDO4 (0x13) | ||
| 54 | #define PM8607_LDO5 (0x14) | ||
| 55 | #define PM8607_LDO6 (0x15) | ||
| 56 | #define PM8607_LDO7 (0x16) | ||
| 57 | #define PM8607_LDO8 (0x17) | ||
| 58 | #define PM8607_LDO9 (0x18) | ||
| 59 | #define PM8607_LDO10 (0x19) | ||
| 60 | #define PM8607_LDO12 (0x1A) | ||
| 61 | #define PM8607_LDO14 (0x1B) | ||
| 62 | #define PM8607_SLEEP_MODE1 (0x1C) | ||
| 63 | #define PM8607_SLEEP_MODE2 (0x1D) | ||
| 64 | #define PM8607_SLEEP_MODE3 (0x1E) | ||
| 65 | #define PM8607_SLEEP_MODE4 (0x1F) | ||
| 66 | #define PM8607_GO (0x20) | ||
| 67 | #define PM8607_SLEEP_BUCK1 (0x21) | ||
| 68 | #define PM8607_SLEEP_BUCK2 (0x22) | ||
| 69 | #define PM8607_SLEEP_BUCK3 (0x23) | ||
| 70 | #define PM8607_BUCK1 (0x24) | ||
| 71 | #define PM8607_BUCK2 (0x25) | ||
| 72 | #define PM8607_BUCK3 (0x26) | ||
| 73 | #define PM8607_BUCK_CONTROLS (0x27) | ||
| 74 | #define PM8607_SUPPLIES_EN11 (0x2B) | ||
| 75 | #define PM8607_SUPPLIES_EN12 (0x2C) | ||
| 76 | #define PM8607_GROUP1 (0x2D) | ||
| 77 | #define PM8607_GROUP2 (0x2E) | ||
| 78 | #define PM8607_GROUP3 (0x2F) | ||
| 79 | #define PM8607_GROUP4 (0x30) | ||
| 80 | #define PM8607_GROUP5 (0x31) | ||
| 81 | #define PM8607_GROUP6 (0x32) | ||
| 82 | #define PM8607_SUPPLIES_EN21 (0x33) | ||
| 83 | #define PM8607_SUPPLIES_EN22 (0x34) | ||
| 84 | |||
| 85 | /* RTC Control Registers */ | ||
| 86 | #define PM8607_RTC1 (0xA0) | ||
| 87 | #define PM8607_RTC_COUNTER1 (0xA1) | ||
| 88 | #define PM8607_RTC_COUNTER2 (0xA2) | ||
| 89 | #define PM8607_RTC_COUNTER3 (0xA3) | ||
| 90 | #define PM8607_RTC_COUNTER4 (0xA4) | ||
| 91 | #define PM8607_RTC_EXPIRE1 (0xA5) | ||
| 92 | #define PM8607_RTC_EXPIRE2 (0xA6) | ||
| 93 | #define PM8607_RTC_EXPIRE3 (0xA7) | ||
| 94 | #define PM8607_RTC_EXPIRE4 (0xA8) | ||
| 95 | #define PM8607_RTC_TRIM1 (0xA9) | ||
| 96 | #define PM8607_RTC_TRIM2 (0xAA) | ||
| 97 | #define PM8607_RTC_TRIM3 (0xAB) | ||
| 98 | #define PM8607_RTC_TRIM4 (0xAC) | ||
| 99 | #define PM8607_RTC_MISC1 (0xAD) | ||
| 100 | #define PM8607_RTC_MISC2 (0xAE) | ||
| 101 | #define PM8607_RTC_MISC3 (0xAF) | ||
| 102 | |||
| 103 | /* Misc Registers */ | ||
| 104 | #define PM8607_CHIP_ID (0x00) | ||
| 105 | #define PM8607_LDO1 (0x10) | ||
| 106 | #define PM8607_DVC3 (0x26) | ||
| 107 | #define PM8607_MISC1 (0x40) | ||
| 108 | |||
| 109 | /* bit definitions for PM8607 events */ | ||
| 110 | #define PM8607_EVENT_ONKEY (1 << 0) | ||
| 111 | #define PM8607_EVENT_EXTON (1 << 1) | ||
| 112 | #define PM8607_EVENT_CHG (1 << 2) | ||
| 113 | #define PM8607_EVENT_BAT (1 << 3) | ||
| 114 | #define PM8607_EVENT_RTC (1 << 4) | ||
| 115 | #define PM8607_EVENT_CC (1 << 5) | ||
| 116 | #define PM8607_EVENT_VBAT (1 << 8) | ||
| 117 | #define PM8607_EVENT_VCHG (1 << 9) | ||
| 118 | #define PM8607_EVENT_VSYS (1 << 10) | ||
| 119 | #define PM8607_EVENT_TINT (1 << 11) | ||
| 120 | #define PM8607_EVENT_GPADC0 (1 << 12) | ||
| 121 | #define PM8607_EVENT_GPADC1 (1 << 13) | ||
| 122 | #define PM8607_EVENT_GPADC2 (1 << 14) | ||
| 123 | #define PM8607_EVENT_GPADC3 (1 << 15) | ||
| 124 | #define PM8607_EVENT_AUDIO_SHORT (1 << 16) | ||
| 125 | #define PM8607_EVENT_PEN (1 << 17) | ||
| 126 | #define PM8607_EVENT_HEADSET (1 << 18) | ||
| 127 | #define PM8607_EVENT_HOOK (1 << 19) | ||
| 128 | #define PM8607_EVENT_MICIN (1 << 20) | ||
| 129 | #define PM8607_EVENT_CHG_TIMEOUT (1 << 21) | ||
| 130 | #define PM8607_EVENT_CHG_DONE (1 << 22) | ||
| 131 | #define PM8607_EVENT_CHG_FAULT (1 << 23) | ||
| 132 | |||
| 133 | /* bit definitions of Status Query Interface */ | ||
| 134 | #define PM8607_STATUS_CC (1 << 3) | ||
| 135 | #define PM8607_STATUS_PEN (1 << 4) | ||
| 136 | #define PM8607_STATUS_HEADSET (1 << 5) | ||
| 137 | #define PM8607_STATUS_HOOK (1 << 6) | ||
| 138 | #define PM8607_STATUS_MICIN (1 << 7) | ||
| 139 | #define PM8607_STATUS_ONKEY (1 << 8) | ||
| 140 | #define PM8607_STATUS_EXTON (1 << 9) | ||
| 141 | #define PM8607_STATUS_CHG (1 << 10) | ||
| 142 | #define PM8607_STATUS_BAT (1 << 11) | ||
| 143 | #define PM8607_STATUS_VBUS (1 << 12) | ||
| 144 | #define PM8607_STATUS_OV (1 << 13) | ||
| 145 | |||
| 146 | /* bit definitions of BUCK3 */ | ||
| 147 | #define PM8607_BUCK3_DOUBLE (1 << 6) | ||
| 148 | |||
| 149 | /* bit definitions of Misc1 */ | ||
| 150 | #define PM8607_MISC1_PI2C (1 << 0) | ||
| 151 | |||
| 152 | /* Interrupt Number in 88PM8607 */ | ||
| 153 | enum { | ||
| 154 | PM8607_IRQ_ONKEY = 0, | ||
| 155 | PM8607_IRQ_EXTON, | ||
| 156 | PM8607_IRQ_CHG, | ||
| 157 | PM8607_IRQ_BAT, | ||
| 158 | PM8607_IRQ_RTC, | ||
| 159 | PM8607_IRQ_VBAT = 8, | ||
| 160 | PM8607_IRQ_VCHG, | ||
| 161 | PM8607_IRQ_VSYS, | ||
| 162 | PM8607_IRQ_TINT, | ||
| 163 | PM8607_IRQ_GPADC0, | ||
| 164 | PM8607_IRQ_GPADC1, | ||
| 165 | PM8607_IRQ_GPADC2, | ||
| 166 | PM8607_IRQ_GPADC3, | ||
| 167 | PM8607_IRQ_AUDIO_SHORT = 16, | ||
| 168 | PM8607_IRQ_PEN, | ||
| 169 | PM8607_IRQ_HEADSET, | ||
| 170 | PM8607_IRQ_HOOK, | ||
| 171 | PM8607_IRQ_MICIN, | ||
| 172 | PM8607_IRQ_CHG_FAIL, | ||
| 173 | PM8607_IRQ_CHG_DONE, | ||
| 174 | PM8607_IRQ_CHG_FAULT, | ||
| 175 | }; | ||
| 176 | |||
| 177 | enum { | ||
| 178 | PM8607_CHIP_A0 = 0x40, | ||
| 179 | PM8607_CHIP_A1 = 0x41, | ||
| 180 | PM8607_CHIP_B0 = 0x48, | ||
| 181 | }; | ||
| 182 | |||
| 183 | |||
| 184 | struct pm8607_chip { | ||
| 185 | struct device *dev; | ||
| 186 | struct mutex io_lock; | ||
| 187 | struct i2c_client *client; | ||
| 188 | |||
| 189 | int (*read)(struct pm8607_chip *chip, int reg, int bytes, void *dest); | ||
| 190 | int (*write)(struct pm8607_chip *chip, int reg, int bytes, void *src); | ||
| 191 | |||
| 192 | int buck3_double; /* DVC ramp slope double */ | ||
| 193 | unsigned char chip_id; | ||
| 194 | |||
| 195 | }; | ||
| 196 | |||
| 197 | #define PM8607_MAX_REGULATOR 15 /* 3 Bucks, 12 LDOs */ | ||
| 198 | |||
| 199 | enum { | ||
| 200 | GI2C_PORT = 0, | ||
| 201 | PI2C_PORT, | ||
| 202 | }; | ||
| 203 | |||
| 204 | struct pm8607_platform_data { | ||
| 205 | int i2c_port; /* Controlled by GI2C or PI2C */ | ||
| 206 | struct regulator_init_data *regulator[PM8607_MAX_REGULATOR]; | ||
| 207 | }; | ||
| 208 | |||
| 209 | extern int pm8607_reg_read(struct pm8607_chip *, int); | ||
| 210 | extern int pm8607_reg_write(struct pm8607_chip *, int, unsigned char); | ||
| 211 | extern int pm8607_bulk_read(struct pm8607_chip *, int, int, | ||
| 212 | unsigned char *); | ||
| 213 | extern int pm8607_bulk_write(struct pm8607_chip *, int, int, | ||
| 214 | unsigned char *); | ||
| 215 | extern int pm8607_set_bits(struct pm8607_chip *, int, unsigned char, | ||
| 216 | unsigned char); | ||
| 217 | #endif /* __LINUX_MFD_88PM8607_H */ | ||
diff --git a/include/linux/mfd/ab4500.h b/include/linux/mfd/ab4500.h new file mode 100644 index 000000000000..a42a7033ae53 --- /dev/null +++ b/include/linux/mfd/ab4500.h | |||
| @@ -0,0 +1,262 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2009 ST-Ericsson | ||
| 3 | * | ||
| 4 | * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com> | ||
| 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 | * AB4500 device core funtions, for client access | ||
| 11 | */ | ||
| 12 | #ifndef MFD_AB4500_H | ||
| 13 | #define MFD_AB4500_H | ||
| 14 | |||
| 15 | #include <linux/device.h> | ||
| 16 | |||
| 17 | /* | ||
| 18 | * AB4500 bank addresses | ||
| 19 | */ | ||
| 20 | #define AB4500_SYS_CTRL1_BLOCK 0x1 | ||
| 21 | #define AB4500_SYS_CTRL2_BLOCK 0x2 | ||
| 22 | #define AB4500_REGU_CTRL1 0x3 | ||
| 23 | #define AB4500_REGU_CTRL2 0x4 | ||
| 24 | #define AB4500_USB 0x5 | ||
| 25 | #define AB4500_TVOUT 0x6 | ||
| 26 | #define AB4500_DBI 0x7 | ||
| 27 | #define AB4500_ECI_AV_ACC 0x8 | ||
| 28 | #define AB4500_RESERVED 0x9 | ||
| 29 | #define AB4500_GPADC 0xA | ||
| 30 | #define AB4500_CHARGER 0xB | ||
| 31 | #define AB4500_GAS_GAUGE 0xC | ||
| 32 | #define AB4500_AUDIO 0xD | ||
| 33 | #define AB4500_INTERRUPT 0xE | ||
| 34 | #define AB4500_RTC 0xF | ||
| 35 | #define AB4500_MISC 0x10 | ||
| 36 | #define AB4500_DEBUG 0x12 | ||
| 37 | #define AB4500_PROD_TEST 0x13 | ||
| 38 | #define AB4500_OTP_EMUL 0x15 | ||
| 39 | |||
| 40 | /* | ||
| 41 | * System control 1 register offsets. | ||
| 42 | * Bank = 0x01 | ||
| 43 | */ | ||
| 44 | #define AB4500_TURNON_STAT_REG 0x0100 | ||
| 45 | #define AB4500_RESET_STAT_REG 0x0101 | ||
| 46 | #define AB4500_PONKEY1_PRESS_STAT_REG 0x0102 | ||
| 47 | |||
| 48 | #define AB4500_FSM_STAT1_REG 0x0140 | ||
| 49 | #define AB4500_FSM_STAT2_REG 0x0141 | ||
| 50 | #define AB4500_SYSCLK_REQ_STAT_REG 0x0142 | ||
| 51 | #define AB4500_USB_STAT1_REG 0x0143 | ||
| 52 | #define AB4500_USB_STAT2_REG 0x0144 | ||
| 53 | #define AB4500_STATUS_SPARE1_REG 0x0145 | ||
| 54 | #define AB4500_STATUS_SPARE2_REG 0x0146 | ||
| 55 | |||
| 56 | #define AB4500_CTRL1_REG 0x0180 | ||
| 57 | #define AB4500_CTRL2_REG 0x0181 | ||
| 58 | |||
| 59 | /* | ||
| 60 | * System control 2 register offsets. | ||
| 61 | * bank = 0x02 | ||
| 62 | */ | ||
| 63 | #define AB4500_CTRL3_REG 0x0200 | ||
| 64 | #define AB4500_MAIN_WDOG_CTRL_REG 0x0201 | ||
| 65 | #define AB4500_MAIN_WDOG_TIMER_REG 0x0202 | ||
| 66 | #define AB4500_LOW_BAT_REG 0x0203 | ||
| 67 | #define AB4500_BATT_OK_REG 0x0204 | ||
| 68 | #define AB4500_SYSCLK_TIMER_REG 0x0205 | ||
| 69 | #define AB4500_SMPSCLK_CTRL_REG 0x0206 | ||
| 70 | #define AB4500_SMPSCLK_SEL1_REG 0x0207 | ||
| 71 | #define AB4500_SMPSCLK_SEL2_REG 0x0208 | ||
| 72 | #define AB4500_SMPSCLK_SEL3_REG 0x0209 | ||
| 73 | #define AB4500_SYSULPCLK_CONF_REG 0x020A | ||
| 74 | #define AB4500_SYSULPCLK_CTRL1_REG 0x020B | ||
| 75 | #define AB4500_SYSCLK_CTRL_REG 0x020C | ||
| 76 | #define AB4500_SYSCLK_REQ1_VALID_REG 0x020D | ||
| 77 | #define AB4500_SYSCLK_REQ_VALID_REG 0x020E | ||
| 78 | #define AB4500_SYSCTRL_SPARE_REG 0x020F | ||
| 79 | #define AB4500_PAD_CONF_REG 0x0210 | ||
| 80 | |||
| 81 | /* | ||
| 82 | * Regu control1 register offsets | ||
| 83 | * Bank = 0x03 | ||
| 84 | */ | ||
| 85 | #define AB4500_REGU_SERIAL_CTRL1_REG 0x0300 | ||
| 86 | #define AB4500_REGU_SERIAL_CTRL2_REG 0x0301 | ||
| 87 | #define AB4500_REGU_SERIAL_CTRL3_REG 0x0302 | ||
| 88 | #define AB4500_REGU_REQ_CTRL1_REG 0x0303 | ||
| 89 | #define AB4500_REGU_REQ_CTRL2_REG 0x0304 | ||
| 90 | #define AB4500_REGU_REQ_CTRL3_REG 0x0305 | ||
| 91 | #define AB4500_REGU_REQ_CTRL4_REG 0x0306 | ||
| 92 | #define AB4500_REGU_MISC1_REG 0x0380 | ||
| 93 | #define AB4500_REGU_OTGSUPPLY_CTRL_REG 0x0381 | ||
| 94 | #define AB4500_REGU_VUSB_CTRL_REG 0x0382 | ||
| 95 | #define AB4500_REGU_VAUDIO_SUPPLY_REG 0x0383 | ||
| 96 | #define AB4500_REGU_CTRL1_SPARE_REG 0x0384 | ||
| 97 | |||
| 98 | /* | ||
| 99 | * Regu control2 Vmod register offsets | ||
| 100 | */ | ||
| 101 | #define AB4500_REGU_VMOD_REGU_REG 0x0440 | ||
| 102 | #define AB4500_REGU_VMOD_SEL1_REG 0x0441 | ||
| 103 | #define AB4500_REGU_VMOD_SEL2_REG 0x0442 | ||
| 104 | #define AB4500_REGU_CTRL_DISCH_REG 0x0443 | ||
| 105 | #define AB4500_REGU_CTRL_DISCH2_REG 0x0444 | ||
| 106 | |||
| 107 | /* | ||
| 108 | * USB/ULPI register offsets | ||
| 109 | * Bank : 0x5 | ||
| 110 | */ | ||
| 111 | #define AB4500_USB_LINE_STAT_REG 0x0580 | ||
| 112 | #define AB4500_USB_LINE_CTRL1_REG 0x0581 | ||
| 113 | #define AB4500_USB_LINE_CTRL2_REG 0x0582 | ||
| 114 | #define AB4500_USB_LINE_CTRL3_REG 0x0583 | ||
| 115 | #define AB4500_USB_LINE_CTRL4_REG 0x0584 | ||
| 116 | #define AB4500_USB_LINE_CTRL5_REG 0x0585 | ||
| 117 | #define AB4500_USB_OTG_CTRL_REG 0x0587 | ||
| 118 | #define AB4500_USB_OTG_STAT_REG 0x0588 | ||
| 119 | #define AB4500_USB_OTG_STAT_REG 0x0588 | ||
| 120 | #define AB4500_USB_CTRL_SPARE_REG 0x0589 | ||
| 121 | #define AB4500_USB_PHY_CTRL_REG 0x058A | ||
| 122 | |||
| 123 | /* | ||
| 124 | * TVOUT / CTRL register offsets | ||
| 125 | * Bank : 0x06 | ||
| 126 | */ | ||
| 127 | #define AB4500_TVOUT_CTRL_REG 0x0680 | ||
| 128 | |||
| 129 | /* | ||
| 130 | * DBI register offsets | ||
| 131 | * Bank : 0x07 | ||
| 132 | */ | ||
| 133 | #define AB4500_DBI_REG1_REG 0x0700 | ||
| 134 | #define AB4500_DBI_REG2_REG 0x0701 | ||
| 135 | |||
| 136 | /* | ||
| 137 | * ECI regsiter offsets | ||
| 138 | * Bank : 0x08 | ||
| 139 | */ | ||
| 140 | #define AB4500_ECI_CTRL_REG 0x0800 | ||
| 141 | #define AB4500_ECI_HOOKLEVEL_REG 0x0801 | ||
| 142 | #define AB4500_ECI_DATAOUT_REG 0x0802 | ||
| 143 | #define AB4500_ECI_DATAIN_REG 0x0803 | ||
| 144 | |||
| 145 | /* | ||
| 146 | * AV Connector register offsets | ||
| 147 | * Bank : 0x08 | ||
| 148 | */ | ||
| 149 | #define AB4500_AV_CONN_REG 0x0840 | ||
| 150 | |||
| 151 | /* | ||
| 152 | * Accessory detection register offsets | ||
| 153 | * Bank : 0x08 | ||
| 154 | */ | ||
| 155 | #define AB4500_ACC_DET_DB1_REG 0x0880 | ||
| 156 | #define AB4500_ACC_DET_DB2_REG 0x0881 | ||
| 157 | |||
| 158 | /* | ||
| 159 | * GPADC register offsets | ||
| 160 | * Bank : 0x0A | ||
| 161 | */ | ||
| 162 | #define AB4500_GPADC_CTRL1_REG 0x0A00 | ||
| 163 | #define AB4500_GPADC_CTRL2_REG 0x0A01 | ||
| 164 | #define AB4500_GPADC_CTRL3_REG 0x0A02 | ||
| 165 | #define AB4500_GPADC_AUTO_TIMER_REG 0x0A03 | ||
| 166 | #define AB4500_GPADC_STAT_REG 0x0A04 | ||
| 167 | #define AB4500_GPADC_MANDATAL_REG 0x0A05 | ||
| 168 | #define AB4500_GPADC_MANDATAH_REG 0x0A06 | ||
| 169 | #define AB4500_GPADC_AUTODATAL_REG 0x0A07 | ||
| 170 | #define AB4500_GPADC_AUTODATAH_REG 0x0A08 | ||
| 171 | #define AB4500_GPADC_MUX_CTRL_REG 0x0A09 | ||
| 172 | |||
| 173 | /* | ||
| 174 | * Charger / status register offfsets | ||
| 175 | * Bank : 0x0B | ||
| 176 | */ | ||
| 177 | #define AB4500_CH_STATUS1_REG 0x0B00 | ||
| 178 | #define AB4500_CH_STATUS2_REG 0x0B01 | ||
| 179 | #define AB4500_CH_USBCH_STAT1_REG 0x0B02 | ||
| 180 | #define AB4500_CH_USBCH_STAT2_REG 0x0B03 | ||
| 181 | #define AB4500_CH_FSM_STAT_REG 0x0B04 | ||
| 182 | #define AB4500_CH_STAT_REG 0x0B05 | ||
| 183 | |||
| 184 | /* | ||
| 185 | * Charger / control register offfsets | ||
| 186 | * Bank : 0x0B | ||
| 187 | */ | ||
| 188 | #define AB4500_CH_VOLT_LVL_REG 0x0B40 | ||
| 189 | |||
| 190 | /* | ||
| 191 | * Charger / main control register offfsets | ||
| 192 | * Bank : 0x0B | ||
| 193 | */ | ||
| 194 | #define AB4500_MCH_CTRL1 0x0B80 | ||
| 195 | #define AB4500_MCH_CTRL2 0x0B81 | ||
| 196 | #define AB4500_MCH_IPT_CURLVL_REG 0x0B82 | ||
| 197 | #define AB4500_CH_WD_REG 0x0B83 | ||
| 198 | |||
| 199 | /* | ||
| 200 | * Charger / USB control register offsets | ||
| 201 | * Bank : 0x0B | ||
| 202 | */ | ||
| 203 | #define AB4500_USBCH_CTRL1_REG 0x0BC0 | ||
| 204 | #define AB4500_USBCH_CTRL2_REG 0x0BC1 | ||
| 205 | #define AB4500_USBCH_IPT_CRNTLVL_REG 0x0BC2 | ||
| 206 | |||
| 207 | /* | ||
| 208 | * RTC bank register offsets | ||
| 209 | * Bank : 0xF | ||
| 210 | */ | ||
| 211 | #define AB4500_RTC_SOFF_STAT_REG 0x0F00 | ||
| 212 | #define AB4500_RTC_CC_CONF_REG 0x0F01 | ||
| 213 | #define AB4500_RTC_READ_REQ_REG 0x0F02 | ||
| 214 | #define AB4500_RTC_WATCH_TSECMID_REG 0x0F03 | ||
| 215 | #define AB4500_RTC_WATCH_TSECHI_REG 0x0F04 | ||
| 216 | #define AB4500_RTC_WATCH_TMIN_LOW_REG 0x0F05 | ||
| 217 | #define AB4500_RTC_WATCH_TMIN_MID_REG 0x0F06 | ||
| 218 | #define AB4500_RTC_WATCH_TMIN_HI_REG 0x0F07 | ||
| 219 | #define AB4500_RTC_ALRM_MIN_LOW_REG 0x0F08 | ||
| 220 | #define AB4500_RTC_ALRM_MIN_MID_REG 0x0F09 | ||
| 221 | #define AB4500_RTC_ALRM_MIN_HI_REG 0x0F0A | ||
| 222 | #define AB4500_RTC_STAT_REG 0x0F0B | ||
| 223 | #define AB4500_RTC_BKUP_CHG_REG 0x0F0C | ||
| 224 | #define AB4500_RTC_FORCE_BKUP_REG 0x0F0D | ||
| 225 | #define AB4500_RTC_CALIB_REG 0x0F0E | ||
| 226 | #define AB4500_RTC_SWITCH_STAT_REG 0x0F0F | ||
| 227 | |||
| 228 | /* | ||
| 229 | * PWM Out generators | ||
| 230 | * Bank: 0x10 | ||
| 231 | */ | ||
| 232 | #define AB4500_PWM_OUT_CTRL1_REG 0x1060 | ||
| 233 | #define AB4500_PWM_OUT_CTRL2_REG 0x1061 | ||
| 234 | #define AB4500_PWM_OUT_CTRL3_REG 0x1062 | ||
| 235 | #define AB4500_PWM_OUT_CTRL4_REG 0x1063 | ||
| 236 | #define AB4500_PWM_OUT_CTRL5_REG 0x1064 | ||
| 237 | #define AB4500_PWM_OUT_CTRL6_REG 0x1065 | ||
| 238 | #define AB4500_PWM_OUT_CTRL7_REG 0x1066 | ||
| 239 | |||
| 240 | #define AB4500_I2C_PAD_CTRL_REG 0x1067 | ||
| 241 | #define AB4500_REV_REG 0x1080 | ||
| 242 | |||
| 243 | /** | ||
| 244 | * struct ab4500 | ||
| 245 | * @spi: spi device structure | ||
| 246 | * @tx_buf: transmit buffer | ||
| 247 | * @rx_buf: receive buffer | ||
| 248 | * @lock: sync primitive | ||
| 249 | */ | ||
| 250 | struct ab4500 { | ||
| 251 | struct spi_device *spi; | ||
| 252 | unsigned long tx_buf[4]; | ||
| 253 | unsigned long rx_buf[4]; | ||
| 254 | struct mutex lock; | ||
| 255 | }; | ||
| 256 | |||
| 257 | int ab4500_write(struct ab4500 *ab4500, unsigned char block, | ||
| 258 | unsigned long addr, unsigned char data); | ||
| 259 | int ab4500_read(struct ab4500 *ab4500, unsigned char block, | ||
| 260 | unsigned long addr); | ||
| 261 | |||
| 262 | #endif /* MFD_AB4500_H */ | ||
diff --git a/include/linux/mfd/adp5520.h b/include/linux/mfd/adp5520.h new file mode 100644 index 000000000000..ac37558a4673 --- /dev/null +++ b/include/linux/mfd/adp5520.h | |||
| @@ -0,0 +1,299 @@ | |||
| 1 | /* | ||
| 2 | * Definitions and platform data for Analog Devices | ||
| 3 | * ADP5520/ADP5501 MFD PMICs (Backlight, LED, GPIO and Keys) | ||
| 4 | * | ||
| 5 | * Copyright 2009 Analog Devices Inc. | ||
| 6 | * | ||
| 7 | * Licensed under the GPL-2 or later. | ||
| 8 | */ | ||
| 9 | |||
| 10 | |||
| 11 | #ifndef __LINUX_MFD_ADP5520_H | ||
| 12 | #define __LINUX_MFD_ADP5520_H | ||
| 13 | |||
| 14 | #define ID_ADP5520 5520 | ||
| 15 | #define ID_ADP5501 5501 | ||
| 16 | |||
| 17 | /* | ||
| 18 | * ADP5520/ADP5501 Register Map | ||
| 19 | */ | ||
| 20 | |||
| 21 | #define ADP5520_MODE_STATUS 0x00 | ||
| 22 | #define ADP5520_INTERRUPT_ENABLE 0x01 | ||
| 23 | #define ADP5520_BL_CONTROL 0x02 | ||
| 24 | #define ADP5520_BL_TIME 0x03 | ||
| 25 | #define ADP5520_BL_FADE 0x04 | ||
| 26 | #define ADP5520_DAYLIGHT_MAX 0x05 | ||
| 27 | #define ADP5520_DAYLIGHT_DIM 0x06 | ||
| 28 | #define ADP5520_OFFICE_MAX 0x07 | ||
| 29 | #define ADP5520_OFFICE_DIM 0x08 | ||
| 30 | #define ADP5520_DARK_MAX 0x09 | ||
| 31 | #define ADP5520_DARK_DIM 0x0A | ||
| 32 | #define ADP5520_BL_VALUE 0x0B | ||
| 33 | #define ADP5520_ALS_CMPR_CFG 0x0C | ||
| 34 | #define ADP5520_L2_TRIP 0x0D | ||
| 35 | #define ADP5520_L2_HYS 0x0E | ||
| 36 | #define ADP5520_L3_TRIP 0x0F | ||
| 37 | #define ADP5520_L3_HYS 0x10 | ||
| 38 | #define ADP5520_LED_CONTROL 0x11 | ||
| 39 | #define ADP5520_LED_TIME 0x12 | ||
| 40 | #define ADP5520_LED_FADE 0x13 | ||
| 41 | #define ADP5520_LED1_CURRENT 0x14 | ||
| 42 | #define ADP5520_LED2_CURRENT 0x15 | ||
| 43 | #define ADP5520_LED3_CURRENT 0x16 | ||
| 44 | |||
| 45 | /* | ||
| 46 | * ADP5520 Register Map | ||
| 47 | */ | ||
| 48 | |||
| 49 | #define ADP5520_GPIO_CFG_1 0x17 | ||
| 50 | #define ADP5520_GPIO_CFG_2 0x18 | ||
| 51 | #define ADP5520_GPIO_IN 0x19 | ||
| 52 | #define ADP5520_GPIO_OUT 0x1A | ||
| 53 | #define ADP5520_GPIO_INT_EN 0x1B | ||
| 54 | #define ADP5520_GPIO_INT_STAT 0x1C | ||
| 55 | #define ADP5520_GPIO_INT_LVL 0x1D | ||
| 56 | #define ADP5520_GPIO_DEBOUNCE 0x1E | ||
| 57 | #define ADP5520_GPIO_PULLUP 0x1F | ||
| 58 | #define ADP5520_KP_INT_STAT_1 0x20 | ||
| 59 | #define ADP5520_KP_INT_STAT_2 0x21 | ||
| 60 | #define ADP5520_KR_INT_STAT_1 0x22 | ||
| 61 | #define ADP5520_KR_INT_STAT_2 0x23 | ||
| 62 | #define ADP5520_KEY_STAT_1 0x24 | ||
| 63 | #define ADP5520_KEY_STAT_2 0x25 | ||
| 64 | |||
| 65 | /* | ||
| 66 | * MODE_STATUS bits | ||
| 67 | */ | ||
| 68 | |||
| 69 | #define ADP5520_nSTNBY (1 << 7) | ||
| 70 | #define ADP5520_BL_EN (1 << 6) | ||
| 71 | #define ADP5520_DIM_EN (1 << 5) | ||
| 72 | #define ADP5520_OVP_INT (1 << 4) | ||
| 73 | #define ADP5520_CMPR_INT (1 << 3) | ||
| 74 | #define ADP5520_GPI_INT (1 << 2) | ||
| 75 | #define ADP5520_KR_INT (1 << 1) | ||
| 76 | #define ADP5520_KP_INT (1 << 0) | ||
| 77 | |||
| 78 | /* | ||
| 79 | * INTERRUPT_ENABLE bits | ||
| 80 | */ | ||
| 81 | |||
| 82 | #define ADP5520_AUTO_LD_EN (1 << 4) | ||
| 83 | #define ADP5520_CMPR_IEN (1 << 3) | ||
| 84 | #define ADP5520_OVP_IEN (1 << 2) | ||
| 85 | #define ADP5520_KR_IEN (1 << 1) | ||
| 86 | #define ADP5520_KP_IEN (1 << 0) | ||
| 87 | |||
| 88 | /* | ||
| 89 | * BL_CONTROL bits | ||
| 90 | */ | ||
| 91 | |||
| 92 | #define ADP5520_BL_LVL ((x) << 5) | ||
| 93 | #define ADP5520_BL_LAW ((x) << 4) | ||
| 94 | #define ADP5520_BL_AUTO_ADJ (1 << 3) | ||
| 95 | #define ADP5520_OVP_EN (1 << 2) | ||
| 96 | #define ADP5520_FOVR (1 << 1) | ||
| 97 | #define ADP5520_KP_BL_EN (1 << 0) | ||
| 98 | |||
| 99 | /* | ||
| 100 | * ALS_CMPR_CFG bits | ||
| 101 | */ | ||
| 102 | |||
| 103 | #define ADP5520_L3_OUT (1 << 3) | ||
| 104 | #define ADP5520_L2_OUT (1 << 2) | ||
| 105 | #define ADP5520_L3_EN (1 << 1) | ||
| 106 | |||
| 107 | #define ADP5020_MAX_BRIGHTNESS 0x7F | ||
| 108 | |||
| 109 | #define FADE_VAL(in, out) ((0xF & (in)) | ((0xF & (out)) << 4)) | ||
| 110 | #define BL_CTRL_VAL(law, auto) (((1 & (auto)) << 3) | ((0x3 & (law)) << 4)) | ||
| 111 | #define ALS_CMPR_CFG_VAL(filt, l3_en) (((0x7 & filt) << 5) | l3_en) | ||
| 112 | |||
| 113 | /* | ||
| 114 | * LEDs subdevice bits and masks | ||
| 115 | */ | ||
| 116 | |||
| 117 | #define ADP5520_01_MAXLEDS 3 | ||
| 118 | |||
| 119 | #define ADP5520_FLAG_LED_MASK 0x3 | ||
| 120 | #define ADP5520_FLAG_OFFT_SHIFT 8 | ||
| 121 | #define ADP5520_FLAG_OFFT_MASK 0x3 | ||
| 122 | |||
| 123 | #define ADP5520_R3_MODE (1 << 5) | ||
| 124 | #define ADP5520_C3_MODE (1 << 4) | ||
| 125 | #define ADP5520_LED_LAW (1 << 3) | ||
| 126 | #define ADP5520_LED3_EN (1 << 2) | ||
| 127 | #define ADP5520_LED2_EN (1 << 1) | ||
| 128 | #define ADP5520_LED1_EN (1 << 0) | ||
| 129 | |||
| 130 | /* | ||
| 131 | * GPIO subdevice bits and masks | ||
| 132 | */ | ||
| 133 | |||
| 134 | #define ADP5520_MAXGPIOS 8 | ||
| 135 | |||
| 136 | #define ADP5520_GPIO_C3 (1 << 7) /* LED2 or GPIO7 aka C3 */ | ||
| 137 | #define ADP5520_GPIO_C2 (1 << 6) | ||
| 138 | #define ADP5520_GPIO_C1 (1 << 5) | ||
| 139 | #define ADP5520_GPIO_C0 (1 << 4) | ||
| 140 | #define ADP5520_GPIO_R3 (1 << 3) /* LED3 or GPIO3 aka R3 */ | ||
| 141 | #define ADP5520_GPIO_R2 (1 << 2) | ||
| 142 | #define ADP5520_GPIO_R1 (1 << 1) | ||
| 143 | #define ADP5520_GPIO_R0 (1 << 0) | ||
| 144 | |||
| 145 | struct adp5520_gpio_platform_data { | ||
| 146 | unsigned gpio_start; | ||
| 147 | u8 gpio_en_mask; | ||
| 148 | u8 gpio_pullup_mask; | ||
| 149 | }; | ||
| 150 | |||
| 151 | /* | ||
| 152 | * Keypad subdevice bits and masks | ||
| 153 | */ | ||
| 154 | |||
| 155 | #define ADP5520_MAXKEYS 16 | ||
| 156 | |||
| 157 | #define ADP5520_COL_C3 (1 << 7) /* LED2 or GPIO7 aka C3 */ | ||
| 158 | #define ADP5520_COL_C2 (1 << 6) | ||
| 159 | #define ADP5520_COL_C1 (1 << 5) | ||
| 160 | #define ADP5520_COL_C0 (1 << 4) | ||
| 161 | #define ADP5520_ROW_R3 (1 << 3) /* LED3 or GPIO3 aka R3 */ | ||
| 162 | #define ADP5520_ROW_R2 (1 << 2) | ||
| 163 | #define ADP5520_ROW_R1 (1 << 1) | ||
| 164 | #define ADP5520_ROW_R0 (1 << 0) | ||
| 165 | |||
| 166 | #define ADP5520_KEY(row, col) (col + row * 4) | ||
| 167 | #define ADP5520_KEYMAPSIZE ADP5520_MAXKEYS | ||
| 168 | |||
| 169 | struct adp5520_keys_platform_data { | ||
| 170 | int rows_en_mask; /* Number of rows */ | ||
| 171 | int cols_en_mask; /* Number of columns */ | ||
| 172 | const unsigned short *keymap; /* Pointer to keymap */ | ||
| 173 | unsigned short keymapsize; /* Keymap size */ | ||
| 174 | unsigned repeat:1; /* Enable key repeat */ | ||
| 175 | }; | ||
| 176 | |||
| 177 | |||
| 178 | /* | ||
| 179 | * LEDs subdevice platform data | ||
| 180 | */ | ||
| 181 | |||
| 182 | #define FLAG_ID_ADP5520_LED1_ADP5501_LED0 1 /* ADP5520 PIN ILED */ | ||
| 183 | #define FLAG_ID_ADP5520_LED2_ADP5501_LED1 2 /* ADP5520 PIN C3 */ | ||
| 184 | #define FLAG_ID_ADP5520_LED3_ADP5501_LED2 3 /* ADP5520 PIN R3 */ | ||
| 185 | |||
| 186 | #define ADP5520_LED_DIS_BLINK (0 << ADP5520_FLAG_OFFT_SHIFT) | ||
| 187 | #define ADP5520_LED_OFFT_600ms (1 << ADP5520_FLAG_OFFT_SHIFT) | ||
| 188 | #define ADP5520_LED_OFFT_800ms (2 << ADP5520_FLAG_OFFT_SHIFT) | ||
| 189 | #define ADP5520_LED_OFFT_1200ms (3 << ADP5520_FLAG_OFFT_SHIFT) | ||
| 190 | |||
| 191 | #define ADP5520_LED_ONT_200ms 0 | ||
| 192 | #define ADP5520_LED_ONT_600ms 1 | ||
| 193 | #define ADP5520_LED_ONT_800ms 2 | ||
| 194 | #define ADP5520_LED_ONT_1200ms 3 | ||
| 195 | |||
| 196 | struct adp5520_leds_platform_data { | ||
| 197 | int num_leds; | ||
| 198 | struct led_info *leds; | ||
| 199 | u8 fade_in; /* Backlight Fade-In Timer */ | ||
| 200 | u8 fade_out; /* Backlight Fade-Out Timer */ | ||
| 201 | u8 led_on_time; | ||
| 202 | }; | ||
| 203 | |||
| 204 | /* | ||
| 205 | * Backlight subdevice platform data | ||
| 206 | */ | ||
| 207 | |||
| 208 | #define ADP5520_FADE_T_DIS 0 /* Fade Timer Disabled */ | ||
| 209 | #define ADP5520_FADE_T_300ms 1 /* 0.3 Sec */ | ||
| 210 | #define ADP5520_FADE_T_600ms 2 | ||
| 211 | #define ADP5520_FADE_T_900ms 3 | ||
| 212 | #define ADP5520_FADE_T_1200ms 4 | ||
| 213 | #define ADP5520_FADE_T_1500ms 5 | ||
| 214 | #define ADP5520_FADE_T_1800ms 6 | ||
| 215 | #define ADP5520_FADE_T_2100ms 7 | ||
| 216 | #define ADP5520_FADE_T_2400ms 8 | ||
| 217 | #define ADP5520_FADE_T_2700ms 9 | ||
| 218 | #define ADP5520_FADE_T_3000ms 10 | ||
| 219 | #define ADP5520_FADE_T_3500ms 11 | ||
| 220 | #define ADP5520_FADE_T_4000ms 12 | ||
| 221 | #define ADP5520_FADE_T_4500ms 13 | ||
| 222 | #define ADP5520_FADE_T_5000ms 14 | ||
| 223 | #define ADP5520_FADE_T_5500ms 15 /* 5.5 Sec */ | ||
| 224 | |||
| 225 | #define ADP5520_BL_LAW_LINEAR 0 | ||
| 226 | #define ADP5520_BL_LAW_SQUARE 1 | ||
| 227 | #define ADP5520_BL_LAW_CUBIC1 2 | ||
| 228 | #define ADP5520_BL_LAW_CUBIC2 3 | ||
| 229 | |||
| 230 | #define ADP5520_BL_AMBL_FILT_80ms 0 /* Light sensor filter time */ | ||
| 231 | #define ADP5520_BL_AMBL_FILT_160ms 1 | ||
| 232 | #define ADP5520_BL_AMBL_FILT_320ms 2 | ||
| 233 | #define ADP5520_BL_AMBL_FILT_640ms 3 | ||
| 234 | #define ADP5520_BL_AMBL_FILT_1280ms 4 | ||
| 235 | #define ADP5520_BL_AMBL_FILT_2560ms 5 | ||
| 236 | #define ADP5520_BL_AMBL_FILT_5120ms 6 | ||
| 237 | #define ADP5520_BL_AMBL_FILT_10240ms 7 /* 10.24 sec */ | ||
| 238 | |||
| 239 | /* | ||
| 240 | * Blacklight current 0..30mA | ||
| 241 | */ | ||
| 242 | #define ADP5520_BL_CUR_mA(I) ((I * 127) / 30) | ||
| 243 | |||
| 244 | /* | ||
| 245 | * L2 comparator current 0..1000uA | ||
| 246 | */ | ||
| 247 | #define ADP5520_L2_COMP_CURR_uA(I) ((I * 255) / 1000) | ||
| 248 | |||
| 249 | /* | ||
| 250 | * L3 comparator current 0..127uA | ||
| 251 | */ | ||
| 252 | #define ADP5520_L3_COMP_CURR_uA(I) ((I * 255) / 127) | ||
| 253 | |||
| 254 | struct adp5520_backlight_platform_data { | ||
| 255 | u8 fade_in; /* Backlight Fade-In Timer */ | ||
| 256 | u8 fade_out; /* Backlight Fade-Out Timer */ | ||
| 257 | u8 fade_led_law; /* fade-on/fade-off transfer characteristic */ | ||
| 258 | |||
| 259 | u8 en_ambl_sens; /* 1 = enable ambient light sensor */ | ||
| 260 | u8 abml_filt; /* Light sensor filter time */ | ||
| 261 | u8 l1_daylight_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 262 | u8 l1_daylight_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 263 | u8 l2_office_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 264 | u8 l2_office_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 265 | u8 l3_dark_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 266 | u8 l3_dark_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 267 | u8 l2_trip; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1000 uA */ | ||
| 268 | u8 l2_hyst; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1000 uA */ | ||
| 269 | u8 l3_trip; /* use L3_COMP_CURR_uA(I) 0 <= I <= 127 uA */ | ||
| 270 | u8 l3_hyst; /* use L3_COMP_CURR_uA(I) 0 <= I <= 127 uA */ | ||
| 271 | }; | ||
| 272 | |||
| 273 | /* | ||
| 274 | * MFD chip platform data | ||
| 275 | */ | ||
| 276 | |||
| 277 | struct adp5520_platform_data { | ||
| 278 | struct adp5520_keys_platform_data *keys; | ||
| 279 | struct adp5520_gpio_platform_data *gpio; | ||
| 280 | struct adp5520_leds_platform_data *leds; | ||
| 281 | struct adp5520_backlight_platform_data *backlight; | ||
| 282 | }; | ||
| 283 | |||
| 284 | /* | ||
| 285 | * MFD chip functions | ||
| 286 | */ | ||
| 287 | |||
| 288 | extern int adp5520_read(struct device *dev, int reg, uint8_t *val); | ||
| 289 | extern int adp5520_write(struct device *dev, int reg, u8 val); | ||
| 290 | extern int adp5520_clr_bits(struct device *dev, int reg, uint8_t bit_mask); | ||
| 291 | extern int adp5520_set_bits(struct device *dev, int reg, uint8_t bit_mask); | ||
| 292 | |||
| 293 | extern int adp5520_register_notifier(struct device *dev, | ||
| 294 | struct notifier_block *nb, unsigned int events); | ||
| 295 | |||
| 296 | extern int adp5520_unregister_notifier(struct device *dev, | ||
| 297 | struct notifier_block *nb, unsigned int events); | ||
| 298 | |||
| 299 | #endif /* __LINUX_MFD_ADP5520_H */ | ||
diff --git a/include/linux/mfd/ezx-pcap.h b/include/linux/mfd/ezx-pcap.h index 3402042ddc31..40c372165f3e 100644 --- a/include/linux/mfd/ezx-pcap.h +++ b/include/linux/mfd/ezx-pcap.h | |||
| @@ -231,9 +231,6 @@ void pcap_set_ts_bits(struct pcap_chip *, u32); | |||
| 231 | #define PCAP_LED_4MA 1 | 231 | #define PCAP_LED_4MA 1 |
| 232 | #define PCAP_LED_5MA 2 | 232 | #define PCAP_LED_5MA 2 |
| 233 | #define PCAP_LED_9MA 3 | 233 | #define PCAP_LED_9MA 3 |
| 234 | #define PCAP_LED_GPIO_VAL_MASK 0x00ffffff | ||
| 235 | #define PCAP_LED_GPIO_EN 0x01000000 | ||
| 236 | #define PCAP_LED_GPIO_INVERT 0x02000000 | ||
| 237 | #define PCAP_LED_T_MASK 0xf | 234 | #define PCAP_LED_T_MASK 0xf |
| 238 | #define PCAP_LED_C_MASK 0x3 | 235 | #define PCAP_LED_C_MASK 0x3 |
| 239 | #define PCAP_BL_MASK 0x1f | 236 | #define PCAP_BL_MASK 0x1f |
diff --git a/include/linux/mfd/mc13783-private.h b/include/linux/mfd/mc13783-private.h index 47e698cb0f16..95cf9360553f 100644 --- a/include/linux/mfd/mc13783-private.h +++ b/include/linux/mfd/mc13783-private.h | |||
| @@ -24,52 +24,23 @@ | |||
| 24 | 24 | ||
| 25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
| 26 | #include <linux/mfd/mc13783.h> | 26 | #include <linux/mfd/mc13783.h> |
| 27 | #include <linux/workqueue.h> | ||
| 28 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
| 29 | 28 | #include <linux/interrupt.h> | |
| 30 | struct mc13783_irq { | ||
| 31 | void (*handler)(int, void *); | ||
| 32 | void *data; | ||
| 33 | }; | ||
| 34 | |||
| 35 | #define MC13783_NUM_IRQ 2 | ||
| 36 | #define MC13783_IRQ_TS 0 | ||
| 37 | #define MC13783_IRQ_REGULATOR 1 | ||
| 38 | |||
| 39 | #define MC13783_ADC_MODE_TS 1 | ||
| 40 | #define MC13783_ADC_MODE_SINGLE_CHAN 2 | ||
| 41 | #define MC13783_ADC_MODE_MULT_CHAN 3 | ||
| 42 | 29 | ||
| 43 | struct mc13783 { | 30 | struct mc13783 { |
| 44 | int revision; | 31 | struct spi_device *spidev; |
| 45 | struct device *dev; | 32 | struct mutex lock; |
| 46 | struct spi_device *spi_device; | ||
| 47 | |||
| 48 | int (*read_dev)(void *data, char reg, int count, u32 *dst); | ||
| 49 | int (*write_dev)(void *data, char reg, int count, const u32 *src); | ||
| 50 | |||
| 51 | struct mutex io_lock; | ||
| 52 | void *io_data; | ||
| 53 | int irq; | 33 | int irq; |
| 54 | unsigned int flags; | 34 | int flags; |
| 55 | 35 | ||
| 56 | struct mc13783_irq irq_handler[MC13783_NUM_IRQ]; | 36 | irq_handler_t irqhandler[MC13783_NUM_IRQ]; |
| 57 | struct work_struct work; | 37 | void *irqdata[MC13783_NUM_IRQ]; |
| 58 | struct completion adc_done; | ||
| 59 | unsigned int ts_active; | ||
| 60 | struct mutex adc_conv_lock; | ||
| 61 | 38 | ||
| 39 | /* XXX these should go as platformdata to the regulator subdevice */ | ||
| 62 | struct mc13783_regulator_init_data *regulators; | 40 | struct mc13783_regulator_init_data *regulators; |
| 63 | int num_regulators; | 41 | int num_regulators; |
| 64 | }; | 42 | }; |
| 65 | 43 | ||
| 66 | int mc13783_reg_read(struct mc13783 *, int reg_num, u32 *); | ||
| 67 | int mc13783_reg_write(struct mc13783 *, int, u32); | ||
| 68 | int mc13783_set_bits(struct mc13783 *, int, u32, u32); | ||
| 69 | int mc13783_free_irq(struct mc13783 *mc13783, int irq); | ||
| 70 | int mc13783_register_irq(struct mc13783 *mc13783, int irq, | ||
| 71 | void (*handler) (int, void *), void *data); | ||
| 72 | |||
| 73 | #define MC13783_REG_INTERRUPT_STATUS_0 0 | 44 | #define MC13783_REG_INTERRUPT_STATUS_0 0 |
| 74 | #define MC13783_REG_INTERRUPT_MASK_0 1 | 45 | #define MC13783_REG_INTERRUPT_MASK_0 1 |
| 75 | #define MC13783_REG_INTERRUPT_SENSE_0 2 | 46 | #define MC13783_REG_INTERRUPT_SENSE_0 2 |
| @@ -136,55 +107,6 @@ int mc13783_register_irq(struct mc13783 *mc13783, int irq, | |||
| 136 | #define MC13783_REG_TEST_3 63 | 107 | #define MC13783_REG_TEST_3 63 |
| 137 | #define MC13783_REG_NB 64 | 108 | #define MC13783_REG_NB 64 |
| 138 | 109 | ||
| 139 | |||
| 140 | /* | ||
| 141 | * Interrupt Status | ||
| 142 | */ | ||
| 143 | #define MC13783_INT_STAT_ADCDONEI (1 << 0) | ||
| 144 | #define MC13783_INT_STAT_ADCBISDONEI (1 << 1) | ||
| 145 | #define MC13783_INT_STAT_TSI (1 << 2) | ||
| 146 | #define MC13783_INT_STAT_WHIGHI (1 << 3) | ||
| 147 | #define MC13783_INT_STAT_WLOWI (1 << 4) | ||
| 148 | #define MC13783_INT_STAT_CHGDETI (1 << 6) | ||
| 149 | #define MC13783_INT_STAT_CHGOVI (1 << 7) | ||
| 150 | #define MC13783_INT_STAT_CHGREVI (1 << 8) | ||
| 151 | #define MC13783_INT_STAT_CHGSHORTI (1 << 9) | ||
| 152 | #define MC13783_INT_STAT_CCCVI (1 << 10) | ||
| 153 | #define MC13783_INT_STAT_CHGCURRI (1 << 11) | ||
| 154 | #define MC13783_INT_STAT_BPONI (1 << 12) | ||
| 155 | #define MC13783_INT_STAT_LOBATLI (1 << 13) | ||
| 156 | #define MC13783_INT_STAT_LOBATHI (1 << 14) | ||
| 157 | #define MC13783_INT_STAT_UDPI (1 << 15) | ||
| 158 | #define MC13783_INT_STAT_USBI (1 << 16) | ||
| 159 | #define MC13783_INT_STAT_IDI (1 << 19) | ||
| 160 | #define MC13783_INT_STAT_Unused (1 << 20) | ||
| 161 | #define MC13783_INT_STAT_SE1I (1 << 21) | ||
| 162 | #define MC13783_INT_STAT_CKDETI (1 << 22) | ||
| 163 | #define MC13783_INT_STAT_UDMI (1 << 23) | ||
| 164 | |||
| 165 | /* | ||
| 166 | * Interrupt Mask | ||
| 167 | */ | ||
| 168 | #define MC13783_INT_MASK_ADCDONEM (1 << 0) | ||
| 169 | #define MC13783_INT_MASK_ADCBISDONEM (1 << 1) | ||
| 170 | #define MC13783_INT_MASK_TSM (1 << 2) | ||
| 171 | #define MC13783_INT_MASK_WHIGHM (1 << 3) | ||
| 172 | #define MC13783_INT_MASK_WLOWM (1 << 4) | ||
| 173 | #define MC13783_INT_MASK_CHGDETM (1 << 6) | ||
| 174 | #define MC13783_INT_MASK_CHGOVM (1 << 7) | ||
| 175 | #define MC13783_INT_MASK_CHGREVM (1 << 8) | ||
| 176 | #define MC13783_INT_MASK_CHGSHORTM (1 << 9) | ||
| 177 | #define MC13783_INT_MASK_CCCVM (1 << 10) | ||
| 178 | #define MC13783_INT_MASK_CHGCURRM (1 << 11) | ||
| 179 | #define MC13783_INT_MASK_BPONM (1 << 12) | ||
| 180 | #define MC13783_INT_MASK_LOBATLM (1 << 13) | ||
| 181 | #define MC13783_INT_MASK_LOBATHM (1 << 14) | ||
| 182 | #define MC13783_INT_MASK_UDPM (1 << 15) | ||
| 183 | #define MC13783_INT_MASK_USBM (1 << 16) | ||
| 184 | #define MC13783_INT_MASK_IDM (1 << 19) | ||
| 185 | #define MC13783_INT_MASK_SE1M (1 << 21) | ||
| 186 | #define MC13783_INT_MASK_CKDETM (1 << 22) | ||
| 187 | |||
| 188 | /* | 110 | /* |
| 189 | * Reg Regulator Mode 0 | 111 | * Reg Regulator Mode 0 |
| 190 | */ | 112 | */ |
| @@ -284,113 +206,15 @@ int mc13783_register_irq(struct mc13783 *mc13783, int irq, | |||
| 284 | #define MC13783_SWCTRL_SW3_STBY (1 << 21) | 206 | #define MC13783_SWCTRL_SW3_STBY (1 << 21) |
| 285 | #define MC13783_SWCTRL_SW3_MODE (1 << 22) | 207 | #define MC13783_SWCTRL_SW3_MODE (1 << 22) |
| 286 | 208 | ||
| 287 | /* | 209 | static inline int mc13783_set_bits(struct mc13783 *mc13783, unsigned int offset, |
| 288 | * ADC/Touch | 210 | u32 mask, u32 val) |
| 289 | */ | 211 | { |
| 290 | #define MC13783_ADC0_LICELLCON (1 << 0) | 212 | int ret; |
| 291 | #define MC13783_ADC0_CHRGICON (1 << 1) | 213 | mc13783_lock(mc13783); |
| 292 | #define MC13783_ADC0_BATICON (1 << 2) | 214 | ret = mc13783_reg_rmw(mc13783, offset, mask, val); |
| 293 | #define MC13783_ADC0_RTHEN (1 << 3) | 215 | mc13783_unlock(mc13783); |
| 294 | #define MC13783_ADC0_DTHEN (1 << 4) | ||
| 295 | #define MC13783_ADC0_UIDEN (1 << 5) | ||
| 296 | #define MC13783_ADC0_ADOUTEN (1 << 6) | ||
| 297 | #define MC13783_ADC0_ADOUTPER (1 << 7) | ||
| 298 | #define MC13783_ADC0_ADREFEN (1 << 10) | ||
| 299 | #define MC13783_ADC0_ADREFMODE (1 << 11) | ||
| 300 | #define MC13783_ADC0_TSMOD0 (1 << 12) | ||
| 301 | #define MC13783_ADC0_TSMOD1 (1 << 13) | ||
| 302 | #define MC13783_ADC0_TSMOD2 (1 << 14) | ||
| 303 | #define MC13783_ADC0_CHRGRAWDIV (1 << 15) | ||
| 304 | #define MC13783_ADC0_ADINC1 (1 << 16) | ||
| 305 | #define MC13783_ADC0_ADINC2 (1 << 17) | ||
| 306 | #define MC13783_ADC0_WCOMP (1 << 18) | ||
| 307 | #define MC13783_ADC0_ADCBIS0 (1 << 23) | ||
| 308 | |||
| 309 | #define MC13783_ADC1_ADEN (1 << 0) | ||
| 310 | #define MC13783_ADC1_RAND (1 << 1) | ||
| 311 | #define MC13783_ADC1_ADSEL (1 << 3) | ||
| 312 | #define MC13783_ADC1_TRIGMASK (1 << 4) | ||
| 313 | #define MC13783_ADC1_ADA10 (1 << 5) | ||
| 314 | #define MC13783_ADC1_ADA11 (1 << 6) | ||
| 315 | #define MC13783_ADC1_ADA12 (1 << 7) | ||
| 316 | #define MC13783_ADC1_ADA20 (1 << 8) | ||
| 317 | #define MC13783_ADC1_ADA21 (1 << 9) | ||
| 318 | #define MC13783_ADC1_ADA22 (1 << 10) | ||
| 319 | #define MC13783_ADC1_ATO0 (1 << 11) | ||
| 320 | #define MC13783_ADC1_ATO1 (1 << 12) | ||
| 321 | #define MC13783_ADC1_ATO2 (1 << 13) | ||
| 322 | #define MC13783_ADC1_ATO3 (1 << 14) | ||
| 323 | #define MC13783_ADC1_ATO4 (1 << 15) | ||
| 324 | #define MC13783_ADC1_ATO5 (1 << 16) | ||
| 325 | #define MC13783_ADC1_ATO6 (1 << 17) | ||
| 326 | #define MC13783_ADC1_ATO7 (1 << 18) | ||
| 327 | #define MC13783_ADC1_ATOX (1 << 19) | ||
| 328 | #define MC13783_ADC1_ASC (1 << 20) | ||
| 329 | #define MC13783_ADC1_ADTRIGIGN (1 << 21) | ||
| 330 | #define MC13783_ADC1_ADONESHOT (1 << 22) | ||
| 331 | #define MC13783_ADC1_ADCBIS1 (1 << 23) | ||
| 332 | |||
| 333 | #define MC13783_ADC1_CHAN0_SHIFT 5 | ||
| 334 | #define MC13783_ADC1_CHAN1_SHIFT 8 | ||
| 335 | |||
| 336 | #define MC13783_ADC2_ADD10 (1 << 2) | ||
| 337 | #define MC13783_ADC2_ADD11 (1 << 3) | ||
| 338 | #define MC13783_ADC2_ADD12 (1 << 4) | ||
| 339 | #define MC13783_ADC2_ADD13 (1 << 5) | ||
| 340 | #define MC13783_ADC2_ADD14 (1 << 6) | ||
| 341 | #define MC13783_ADC2_ADD15 (1 << 7) | ||
| 342 | #define MC13783_ADC2_ADD16 (1 << 8) | ||
| 343 | #define MC13783_ADC2_ADD17 (1 << 9) | ||
| 344 | #define MC13783_ADC2_ADD18 (1 << 10) | ||
| 345 | #define MC13783_ADC2_ADD19 (1 << 11) | ||
| 346 | #define MC13783_ADC2_ADD20 (1 << 14) | ||
| 347 | #define MC13783_ADC2_ADD21 (1 << 15) | ||
| 348 | #define MC13783_ADC2_ADD22 (1 << 16) | ||
| 349 | #define MC13783_ADC2_ADD23 (1 << 17) | ||
| 350 | #define MC13783_ADC2_ADD24 (1 << 18) | ||
| 351 | #define MC13783_ADC2_ADD25 (1 << 19) | ||
| 352 | #define MC13783_ADC2_ADD26 (1 << 20) | ||
| 353 | #define MC13783_ADC2_ADD27 (1 << 21) | ||
| 354 | #define MC13783_ADC2_ADD28 (1 << 22) | ||
| 355 | #define MC13783_ADC2_ADD29 (1 << 23) | ||
| 356 | 216 | ||
| 357 | #define MC13783_ADC3_WHIGH0 (1 << 0) | 217 | return ret; |
| 358 | #define MC13783_ADC3_WHIGH1 (1 << 1) | 218 | } |
| 359 | #define MC13783_ADC3_WHIGH2 (1 << 2) | ||
| 360 | #define MC13783_ADC3_WHIGH3 (1 << 3) | ||
| 361 | #define MC13783_ADC3_WHIGH4 (1 << 4) | ||
| 362 | #define MC13783_ADC3_WHIGH5 (1 << 5) | ||
| 363 | #define MC13783_ADC3_ICID0 (1 << 6) | ||
| 364 | #define MC13783_ADC3_ICID1 (1 << 7) | ||
| 365 | #define MC13783_ADC3_ICID2 (1 << 8) | ||
| 366 | #define MC13783_ADC3_WLOW0 (1 << 9) | ||
| 367 | #define MC13783_ADC3_WLOW1 (1 << 10) | ||
| 368 | #define MC13783_ADC3_WLOW2 (1 << 11) | ||
| 369 | #define MC13783_ADC3_WLOW3 (1 << 12) | ||
| 370 | #define MC13783_ADC3_WLOW4 (1 << 13) | ||
| 371 | #define MC13783_ADC3_WLOW5 (1 << 14) | ||
| 372 | #define MC13783_ADC3_ADCBIS2 (1 << 23) | ||
| 373 | |||
| 374 | #define MC13783_ADC4_ADDBIS10 (1 << 2) | ||
| 375 | #define MC13783_ADC4_ADDBIS11 (1 << 3) | ||
| 376 | #define MC13783_ADC4_ADDBIS12 (1 << 4) | ||
| 377 | #define MC13783_ADC4_ADDBIS13 (1 << 5) | ||
| 378 | #define MC13783_ADC4_ADDBIS14 (1 << 6) | ||
| 379 | #define MC13783_ADC4_ADDBIS15 (1 << 7) | ||
| 380 | #define MC13783_ADC4_ADDBIS16 (1 << 8) | ||
| 381 | #define MC13783_ADC4_ADDBIS17 (1 << 9) | ||
| 382 | #define MC13783_ADC4_ADDBIS18 (1 << 10) | ||
| 383 | #define MC13783_ADC4_ADDBIS19 (1 << 11) | ||
| 384 | #define MC13783_ADC4_ADDBIS20 (1 << 14) | ||
| 385 | #define MC13783_ADC4_ADDBIS21 (1 << 15) | ||
| 386 | #define MC13783_ADC4_ADDBIS22 (1 << 16) | ||
| 387 | #define MC13783_ADC4_ADDBIS23 (1 << 17) | ||
| 388 | #define MC13783_ADC4_ADDBIS24 (1 << 18) | ||
| 389 | #define MC13783_ADC4_ADDBIS25 (1 << 19) | ||
| 390 | #define MC13783_ADC4_ADDBIS26 (1 << 20) | ||
| 391 | #define MC13783_ADC4_ADDBIS27 (1 << 21) | ||
| 392 | #define MC13783_ADC4_ADDBIS28 (1 << 22) | ||
| 393 | #define MC13783_ADC4_ADDBIS29 (1 << 23) | ||
| 394 | 219 | ||
| 395 | #endif /* __LINUX_MFD_MC13783_PRIV_H */ | 220 | #endif /* __LINUX_MFD_MC13783_PRIV_H */ |
| 396 | |||
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h index b3a2a7243573..35680409b8cf 100644 --- a/include/linux/mfd/mc13783.h +++ b/include/linux/mfd/mc13783.h | |||
| @@ -1,28 +1,50 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de> | 2 | * Copyright 2009 Pengutronix |
| 3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
| 3 | * | 4 | * |
| 4 | * Initial development of this code was funded by | 5 | * This program is free software; you can redistribute it and/or modify it under |
| 5 | * Phytec Messtechnik GmbH, http://www.phytec.de | 6 | * the terms of the GNU General Public License version 2 as published by the |
| 6 | * | 7 | * Free Software Foundation. |
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 20 | */ | 8 | */ |
| 9 | #ifndef __LINUX_MFD_MC13783_H | ||
| 10 | #define __LINUX_MFD_MC13783_H | ||
| 21 | 11 | ||
| 22 | #ifndef __INCLUDE_LINUX_MFD_MC13783_H | 12 | #include <linux/interrupt.h> |
| 23 | #define __INCLUDE_LINUX_MFD_MC13783_H | ||
| 24 | 13 | ||
| 25 | struct mc13783; | 14 | struct mc13783; |
| 15 | |||
| 16 | void mc13783_lock(struct mc13783 *mc13783); | ||
| 17 | void mc13783_unlock(struct mc13783 *mc13783); | ||
| 18 | |||
| 19 | int mc13783_reg_read(struct mc13783 *mc13783, unsigned int offset, u32 *val); | ||
| 20 | int mc13783_reg_write(struct mc13783 *mc13783, unsigned int offset, u32 val); | ||
| 21 | int mc13783_reg_rmw(struct mc13783 *mc13783, unsigned int offset, | ||
| 22 | u32 mask, u32 val); | ||
| 23 | |||
| 24 | int mc13783_irq_request(struct mc13783 *mc13783, int irq, | ||
| 25 | irq_handler_t handler, const char *name, void *dev); | ||
| 26 | int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq, | ||
| 27 | irq_handler_t handler, const char *name, void *dev); | ||
| 28 | int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev); | ||
| 29 | int mc13783_ackirq(struct mc13783 *mc13783, int irq); | ||
| 30 | |||
| 31 | int mc13783_mask(struct mc13783 *mc13783, int irq); | ||
| 32 | int mc13783_unmask(struct mc13783 *mc13783, int irq); | ||
| 33 | |||
| 34 | #define MC13783_ADC0 43 | ||
| 35 | #define MC13783_ADC0_ADREFEN (1 << 10) | ||
| 36 | #define MC13783_ADC0_ADREFMODE (1 << 11) | ||
| 37 | #define MC13783_ADC0_TSMOD0 (1 << 12) | ||
| 38 | #define MC13783_ADC0_TSMOD1 (1 << 13) | ||
| 39 | #define MC13783_ADC0_TSMOD2 (1 << 14) | ||
| 40 | #define MC13783_ADC0_ADINC1 (1 << 16) | ||
| 41 | #define MC13783_ADC0_ADINC2 (1 << 17) | ||
| 42 | |||
| 43 | #define MC13783_ADC0_TSMOD_MASK (MC13783_ADC0_TSMOD0 | \ | ||
| 44 | MC13783_ADC0_TSMOD1 | \ | ||
| 45 | MC13783_ADC0_TSMOD2) | ||
| 46 | |||
| 47 | /* to be cleaned up */ | ||
| 26 | struct regulator_init_data; | 48 | struct regulator_init_data; |
| 27 | 49 | ||
| 28 | struct mc13783_regulator_init_data { | 50 | struct mc13783_regulator_init_data { |
| @@ -30,23 +52,30 @@ struct mc13783_regulator_init_data { | |||
| 30 | struct regulator_init_data *init_data; | 52 | struct regulator_init_data *init_data; |
| 31 | }; | 53 | }; |
| 32 | 54 | ||
| 33 | struct mc13783_platform_data { | 55 | struct mc13783_regulator_platform_data { |
| 34 | struct mc13783_regulator_init_data *regulators; | ||
| 35 | int num_regulators; | 56 | int num_regulators; |
| 36 | unsigned int flags; | 57 | struct mc13783_regulator_init_data *regulators; |
| 37 | }; | 58 | }; |
| 38 | 59 | ||
| 39 | /* mc13783_platform_data flags */ | 60 | struct mc13783_platform_data { |
| 61 | int num_regulators; | ||
| 62 | struct mc13783_regulator_init_data *regulators; | ||
| 63 | |||
| 40 | #define MC13783_USE_TOUCHSCREEN (1 << 0) | 64 | #define MC13783_USE_TOUCHSCREEN (1 << 0) |
| 41 | #define MC13783_USE_CODEC (1 << 1) | 65 | #define MC13783_USE_CODEC (1 << 1) |
| 42 | #define MC13783_USE_ADC (1 << 2) | 66 | #define MC13783_USE_ADC (1 << 2) |
| 43 | #define MC13783_USE_RTC (1 << 3) | 67 | #define MC13783_USE_RTC (1 << 3) |
| 44 | #define MC13783_USE_REGULATOR (1 << 4) | 68 | #define MC13783_USE_REGULATOR (1 << 4) |
| 69 | unsigned int flags; | ||
| 70 | }; | ||
| 71 | |||
| 72 | #define MC13783_ADC_MODE_TS 1 | ||
| 73 | #define MC13783_ADC_MODE_SINGLE_CHAN 2 | ||
| 74 | #define MC13783_ADC_MODE_MULT_CHAN 3 | ||
| 45 | 75 | ||
| 46 | int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, | 76 | int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, |
| 47 | unsigned int channel, unsigned int *sample); | 77 | unsigned int channel, unsigned int *sample); |
| 48 | 78 | ||
| 49 | void mc13783_adc_set_ts_status(struct mc13783 *mc13783, unsigned int status); | ||
| 50 | 79 | ||
| 51 | #define MC13783_SW_SW1A 0 | 80 | #define MC13783_SW_SW1A 0 |
| 52 | #define MC13783_SW_SW1B 1 | 81 | #define MC13783_SW_SW1B 1 |
| @@ -80,5 +109,46 @@ void mc13783_adc_set_ts_status(struct mc13783 *mc13783, unsigned int status); | |||
| 80 | #define MC13783_REGU_V3 29 | 109 | #define MC13783_REGU_V3 29 |
| 81 | #define MC13783_REGU_V4 30 | 110 | #define MC13783_REGU_V4 30 |
| 82 | 111 | ||
| 83 | #endif /* __INCLUDE_LINUX_MFD_MC13783_H */ | 112 | #define MC13783_IRQ_ADCDONE 0 |
| 113 | #define MC13783_IRQ_ADCBISDONE 1 | ||
| 114 | #define MC13783_IRQ_TS 2 | ||
| 115 | #define MC13783_IRQ_WHIGH 3 | ||
| 116 | #define MC13783_IRQ_WLOW 4 | ||
| 117 | #define MC13783_IRQ_CHGDET 6 | ||
| 118 | #define MC13783_IRQ_CHGOV 7 | ||
| 119 | #define MC13783_IRQ_CHGREV 8 | ||
| 120 | #define MC13783_IRQ_CHGSHORT 9 | ||
| 121 | #define MC13783_IRQ_CCCV 10 | ||
| 122 | #define MC13783_IRQ_CHGCURR 11 | ||
| 123 | #define MC13783_IRQ_BPON 12 | ||
| 124 | #define MC13783_IRQ_LOBATL 13 | ||
| 125 | #define MC13783_IRQ_LOBATH 14 | ||
| 126 | #define MC13783_IRQ_UDP 15 | ||
| 127 | #define MC13783_IRQ_USB 16 | ||
| 128 | #define MC13783_IRQ_ID 19 | ||
| 129 | #define MC13783_IRQ_SE1 21 | ||
| 130 | #define MC13783_IRQ_CKDET 22 | ||
| 131 | #define MC13783_IRQ_UDM 23 | ||
| 132 | #define MC13783_IRQ_1HZ 24 | ||
| 133 | #define MC13783_IRQ_TODA 25 | ||
| 134 | #define MC13783_IRQ_ONOFD1 27 | ||
| 135 | #define MC13783_IRQ_ONOFD2 28 | ||
| 136 | #define MC13783_IRQ_ONOFD3 29 | ||
| 137 | #define MC13783_IRQ_SYSRST 30 | ||
| 138 | #define MC13783_IRQ_RTCRST 31 | ||
| 139 | #define MC13783_IRQ_PC 32 | ||
| 140 | #define MC13783_IRQ_WARM 33 | ||
| 141 | #define MC13783_IRQ_MEMHLD 34 | ||
| 142 | #define MC13783_IRQ_PWRRDY 35 | ||
| 143 | #define MC13783_IRQ_THWARNL 36 | ||
| 144 | #define MC13783_IRQ_THWARNH 37 | ||
| 145 | #define MC13783_IRQ_CLK 38 | ||
| 146 | #define MC13783_IRQ_SEMAF 39 | ||
| 147 | #define MC13783_IRQ_MC2B 41 | ||
| 148 | #define MC13783_IRQ_HSDET 42 | ||
| 149 | #define MC13783_IRQ_HSL 43 | ||
| 150 | #define MC13783_IRQ_ALSPTH 44 | ||
| 151 | #define MC13783_IRQ_AHSSHORT 45 | ||
| 152 | #define MC13783_NUM_IRQ 46 | ||
| 84 | 153 | ||
| 154 | #endif /* __LINUX_MFD_MC13783_H */ | ||
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h index 9aba7b779fbc..3398bd9aab11 100644 --- a/include/linux/mfd/pcf50633/core.h +++ b/include/linux/mfd/pcf50633/core.h | |||
| @@ -29,7 +29,12 @@ struct pcf50633_platform_data { | |||
| 29 | char **batteries; | 29 | char **batteries; |
| 30 | int num_batteries; | 30 | int num_batteries; |
| 31 | 31 | ||
| 32 | int charging_restart_interval; | 32 | /* |
| 33 | * Should be set accordingly to the reference resistor used, see | ||
| 34 | * I_{ch(ref)} charger reference current in the pcf50633 User | ||
| 35 | * Manual. | ||
| 36 | */ | ||
| 37 | int charger_reference_current_ma; | ||
| 33 | 38 | ||
| 34 | /* Callbacks */ | 39 | /* Callbacks */ |
| 35 | void (*probe_done)(struct pcf50633 *); | 40 | void (*probe_done)(struct pcf50633 *); |
| @@ -40,10 +45,6 @@ struct pcf50633_platform_data { | |||
| 40 | u8 resumers[5]; | 45 | u8 resumers[5]; |
| 41 | }; | 46 | }; |
| 42 | 47 | ||
| 43 | struct pcf50633_subdev_pdata { | ||
| 44 | struct pcf50633 *pcf; | ||
| 45 | }; | ||
| 46 | |||
| 47 | struct pcf50633_irq { | 48 | struct pcf50633_irq { |
| 48 | void (*handler) (int, void *); | 49 | void (*handler) (int, void *); |
| 49 | void *data; | 50 | void *data; |
| @@ -217,5 +218,9 @@ enum pcf50633_reg_int5 { | |||
| 217 | #define PCF50633_REG_LEDCTL 0x2a | 218 | #define PCF50633_REG_LEDCTL 0x2a |
| 218 | #define PCF50633_REG_LEDDIM 0x2b | 219 | #define PCF50633_REG_LEDDIM 0x2b |
| 219 | 220 | ||
| 220 | #endif | 221 | static inline struct pcf50633 *dev_to_pcf50633(struct device *dev) |
| 222 | { | ||
| 223 | return dev_get_drvdata(dev); | ||
| 224 | } | ||
| 221 | 225 | ||
| 226 | #endif | ||
diff --git a/include/linux/mfd/pcf50633/mbc.h b/include/linux/mfd/pcf50633/mbc.h index 4119579acf2c..df4f5fa88de3 100644 --- a/include/linux/mfd/pcf50633/mbc.h +++ b/include/linux/mfd/pcf50633/mbc.h | |||
| @@ -128,6 +128,7 @@ enum pcf50633_reg_mbcs3 { | |||
| 128 | int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma); | 128 | int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma); |
| 129 | 129 | ||
| 130 | int pcf50633_mbc_get_status(struct pcf50633 *); | 130 | int pcf50633_mbc_get_status(struct pcf50633 *); |
| 131 | int pcf50633_mbc_get_usb_online_status(struct pcf50633 *); | ||
| 131 | 132 | ||
| 132 | #endif | 133 | #endif |
| 133 | 134 | ||
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index 91eb493bf14c..5184b79c700b 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #define __MFD_WM831X_CORE_H__ | 16 | #define __MFD_WM831X_CORE_H__ |
| 17 | 17 | ||
| 18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
| 19 | #include <linux/workqueue.h> | ||
| 20 | 19 | ||
| 21 | /* | 20 | /* |
| 22 | * Register values. | 21 | * Register values. |
| @@ -117,6 +116,7 @@ | |||
| 117 | #define WM831X_DC3_SLEEP_CONTROL 0x4063 | 116 | #define WM831X_DC3_SLEEP_CONTROL 0x4063 |
| 118 | #define WM831X_DC4_CONTROL 0x4064 | 117 | #define WM831X_DC4_CONTROL 0x4064 |
| 119 | #define WM831X_DC4_SLEEP_CONTROL 0x4065 | 118 | #define WM831X_DC4_SLEEP_CONTROL 0x4065 |
| 119 | #define WM832X_DC4_SLEEP_CONTROL 0x4067 | ||
| 120 | #define WM831X_EPE1_CONTROL 0x4066 | 120 | #define WM831X_EPE1_CONTROL 0x4066 |
| 121 | #define WM831X_EPE2_CONTROL 0x4067 | 121 | #define WM831X_EPE2_CONTROL 0x4067 |
| 122 | #define WM831X_LDO1_CONTROL 0x4068 | 122 | #define WM831X_LDO1_CONTROL 0x4068 |
| @@ -235,6 +235,8 @@ | |||
| 235 | 235 | ||
| 236 | struct regulator_dev; | 236 | struct regulator_dev; |
| 237 | 237 | ||
| 238 | #define WM831X_NUM_IRQ_REGS 5 | ||
| 239 | |||
| 238 | struct wm831x { | 240 | struct wm831x { |
| 239 | struct mutex io_lock; | 241 | struct mutex io_lock; |
| 240 | 242 | ||
| @@ -248,10 +250,11 @@ struct wm831x { | |||
| 248 | 250 | ||
| 249 | int irq; /* Our chip IRQ */ | 251 | int irq; /* Our chip IRQ */ |
| 250 | struct mutex irq_lock; | 252 | struct mutex irq_lock; |
| 251 | struct workqueue_struct *irq_wq; | ||
| 252 | struct work_struct irq_work; | ||
| 253 | unsigned int irq_base; | 253 | unsigned int irq_base; |
| 254 | int irq_masks[5]; | 254 | int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */ |
| 255 | int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ | ||
| 256 | |||
| 257 | int num_gpio; | ||
| 255 | 258 | ||
| 256 | struct mutex auxadc_lock; | 259 | struct mutex auxadc_lock; |
| 257 | 260 | ||
| @@ -278,12 +281,30 @@ int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg, | |||
| 278 | int wm831x_irq_init(struct wm831x *wm831x, int irq); | 281 | int wm831x_irq_init(struct wm831x *wm831x, int irq); |
| 279 | void wm831x_irq_exit(struct wm831x *wm831x); | 282 | void wm831x_irq_exit(struct wm831x *wm831x); |
| 280 | 283 | ||
| 281 | int __must_check wm831x_request_irq(struct wm831x *wm831x, | 284 | static inline int __must_check wm831x_request_irq(struct wm831x *wm831x, |
| 282 | unsigned int irq, irq_handler_t handler, | 285 | unsigned int irq, |
| 283 | unsigned long flags, const char *name, | 286 | irq_handler_t handler, |
| 284 | void *dev); | 287 | unsigned long flags, |
| 285 | void wm831x_free_irq(struct wm831x *wm831x, unsigned int, void *); | 288 | const char *name, |
| 286 | void wm831x_disable_irq(struct wm831x *wm831x, int irq); | 289 | void *dev) |
| 287 | void wm831x_enable_irq(struct wm831x *wm831x, int irq); | 290 | { |
| 291 | return request_threaded_irq(irq, NULL, handler, flags, name, dev); | ||
| 292 | } | ||
| 293 | |||
| 294 | static inline void wm831x_free_irq(struct wm831x *wm831x, | ||
| 295 | unsigned int irq, void *dev) | ||
| 296 | { | ||
| 297 | free_irq(irq, dev); | ||
| 298 | } | ||
| 299 | |||
| 300 | static inline void wm831x_disable_irq(struct wm831x *wm831x, int irq) | ||
| 301 | { | ||
| 302 | disable_irq(irq); | ||
| 303 | } | ||
| 304 | |||
| 305 | static inline void wm831x_enable_irq(struct wm831x *wm831x, int irq) | ||
| 306 | { | ||
| 307 | enable_irq(irq); | ||
| 308 | } | ||
| 288 | 309 | ||
| 289 | #endif | 310 | #endif |
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h index 90d820260aad..415c228743d5 100644 --- a/include/linux/mfd/wm831x/pdata.h +++ b/include/linux/mfd/wm831x/pdata.h | |||
| @@ -91,6 +91,7 @@ struct wm831x_pdata { | |||
| 91 | /** Called after subdevices are set up */ | 91 | /** Called after subdevices are set up */ |
| 92 | int (*post_init)(struct wm831x *wm831x); | 92 | int (*post_init)(struct wm831x *wm831x); |
| 93 | 93 | ||
| 94 | int irq_base; | ||
| 94 | int gpio_base; | 95 | int gpio_base; |
| 95 | struct wm831x_backlight_pdata *backlight; | 96 | struct wm831x_backlight_pdata *backlight; |
| 96 | struct wm831x_backup_pdata *backup; | 97 | struct wm831x_backup_pdata *backup; |
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h index 1d595de6a055..43868899bf49 100644 --- a/include/linux/mfd/wm8350/core.h +++ b/include/linux/mfd/wm8350/core.h | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 17 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
| 18 | #include <linux/workqueue.h> | 18 | #include <linux/interrupt.h> |
| 19 | 19 | ||
| 20 | #include <linux/mfd/wm8350/audio.h> | 20 | #include <linux/mfd/wm8350/audio.h> |
| 21 | #include <linux/mfd/wm8350/gpio.h> | 21 | #include <linux/mfd/wm8350/gpio.h> |
| @@ -601,7 +601,7 @@ extern const u16 wm8352_mode3_defaults[]; | |||
| 601 | struct wm8350; | 601 | struct wm8350; |
| 602 | 602 | ||
| 603 | struct wm8350_irq { | 603 | struct wm8350_irq { |
| 604 | void (*handler) (struct wm8350 *, int, void *); | 604 | irq_handler_t handler; |
| 605 | void *data; | 605 | void *data; |
| 606 | }; | 606 | }; |
| 607 | 607 | ||
| @@ -646,10 +646,12 @@ struct wm8350 { | |||
| 646 | * @init: Function called during driver initialisation. Should be | 646 | * @init: Function called during driver initialisation. Should be |
| 647 | * used by the platform to configure GPIO functions and similar. | 647 | * used by the platform to configure GPIO functions and similar. |
| 648 | * @irq_high: Set if WM8350 IRQ is active high. | 648 | * @irq_high: Set if WM8350 IRQ is active high. |
| 649 | * @irq_base: Base IRQ for genirq (not currently used). | ||
| 649 | */ | 650 | */ |
| 650 | struct wm8350_platform_data { | 651 | struct wm8350_platform_data { |
| 651 | int (*init)(struct wm8350 *wm8350); | 652 | int (*init)(struct wm8350 *wm8350); |
| 652 | int irq_high; | 653 | int irq_high; |
| 654 | int irq_base; | ||
| 653 | }; | 655 | }; |
| 654 | 656 | ||
| 655 | 657 | ||
| @@ -676,11 +678,13 @@ int wm8350_block_write(struct wm8350 *wm8350, int reg, int size, u16 *src); | |||
| 676 | * WM8350 internal interrupts | 678 | * WM8350 internal interrupts |
| 677 | */ | 679 | */ |
| 678 | int wm8350_register_irq(struct wm8350 *wm8350, int irq, | 680 | int wm8350_register_irq(struct wm8350 *wm8350, int irq, |
| 679 | void (*handler) (struct wm8350 *, int, void *), | 681 | irq_handler_t handler, unsigned long flags, |
| 680 | void *data); | 682 | const char *name, void *data); |
| 681 | int wm8350_free_irq(struct wm8350 *wm8350, int irq); | 683 | int wm8350_free_irq(struct wm8350 *wm8350, int irq); |
| 682 | int wm8350_mask_irq(struct wm8350 *wm8350, int irq); | 684 | int wm8350_mask_irq(struct wm8350 *wm8350, int irq); |
| 683 | int wm8350_unmask_irq(struct wm8350 *wm8350, int irq); | 685 | int wm8350_unmask_irq(struct wm8350 *wm8350, int irq); |
| 684 | 686 | int wm8350_irq_init(struct wm8350 *wm8350, int irq, | |
| 687 | struct wm8350_platform_data *pdata); | ||
| 688 | int wm8350_irq_exit(struct wm8350 *wm8350); | ||
| 685 | 689 | ||
| 686 | #endif | 690 | #endif |
diff --git a/include/linux/mfd/wm8350/gpio.h b/include/linux/mfd/wm8350/gpio.h index ed91e8f5d298..71af3d6ebe9d 100644 --- a/include/linux/mfd/wm8350/gpio.h +++ b/include/linux/mfd/wm8350/gpio.h | |||
| @@ -173,6 +173,24 @@ | |||
| 173 | #define WM8350_GPIO_DEBOUNCE_ON 1 | 173 | #define WM8350_GPIO_DEBOUNCE_ON 1 |
| 174 | 174 | ||
| 175 | /* | 175 | /* |
| 176 | * R30 (0x1E) - GPIO Interrupt Status | ||
| 177 | */ | ||
| 178 | #define WM8350_GP12_EINT 0x1000 | ||
| 179 | #define WM8350_GP11_EINT 0x0800 | ||
| 180 | #define WM8350_GP10_EINT 0x0400 | ||
| 181 | #define WM8350_GP9_EINT 0x0200 | ||
| 182 | #define WM8350_GP8_EINT 0x0100 | ||
| 183 | #define WM8350_GP7_EINT 0x0080 | ||
| 184 | #define WM8350_GP6_EINT 0x0040 | ||
| 185 | #define WM8350_GP5_EINT 0x0020 | ||
| 186 | #define WM8350_GP4_EINT 0x0010 | ||
| 187 | #define WM8350_GP3_EINT 0x0008 | ||
| 188 | #define WM8350_GP2_EINT 0x0004 | ||
| 189 | #define WM8350_GP1_EINT 0x0002 | ||
| 190 | #define WM8350_GP0_EINT 0x0001 | ||
| 191 | |||
| 192 | |||
| 193 | /* | ||
| 176 | * R128 (0x80) - GPIO Debounce | 194 | * R128 (0x80) - GPIO Debounce |
| 177 | */ | 195 | */ |
| 178 | #define WM8350_GP12_DB 0x1000 | 196 | #define WM8350_GP12_DB 0x1000 |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 527602cdea1c..7f085c97c799 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
| @@ -12,7 +12,8 @@ typedef struct page *new_page_t(struct page *, unsigned long private, int **); | |||
| 12 | extern int putback_lru_pages(struct list_head *l); | 12 | extern int putback_lru_pages(struct list_head *l); |
| 13 | extern int migrate_page(struct address_space *, | 13 | extern int migrate_page(struct address_space *, |
| 14 | struct page *, struct page *); | 14 | struct page *, struct page *); |
| 15 | extern int migrate_pages(struct list_head *l, new_page_t x, unsigned long); | 15 | extern int migrate_pages(struct list_head *l, new_page_t x, |
| 16 | unsigned long private, int offlining); | ||
| 16 | 17 | ||
| 17 | extern int fail_migrate_page(struct address_space *, | 18 | extern int fail_migrate_page(struct address_space *, |
| 18 | struct page *, struct page *); | 19 | struct page *, struct page *); |
| @@ -26,10 +27,7 @@ extern int migrate_vmas(struct mm_struct *mm, | |||
| 26 | 27 | ||
| 27 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | 28 | static inline int putback_lru_pages(struct list_head *l) { return 0; } |
| 28 | static inline int migrate_pages(struct list_head *l, new_page_t x, | 29 | static inline int migrate_pages(struct list_head *l, new_page_t x, |
| 29 | unsigned long private) { return -ENOSYS; } | 30 | unsigned long private, int offlining) { return -ENOSYS; } |
| 30 | |||
| 31 | static inline int migrate_pages_to(struct list_head *pagelist, | ||
| 32 | struct vm_area_struct *vma, int dest) { return 0; } | ||
| 33 | 31 | ||
| 34 | static inline int migrate_prep(void) { return -ENOSYS; } | 32 | static inline int migrate_prep(void) { return -ENOSYS; } |
| 35 | 33 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 24c395694f4d..9d65ae4ba0e0 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -620,13 +620,22 @@ void page_address_init(void); | |||
| 620 | /* | 620 | /* |
| 621 | * On an anonymous page mapped into a user virtual memory area, | 621 | * On an anonymous page mapped into a user virtual memory area, |
| 622 | * page->mapping points to its anon_vma, not to a struct address_space; | 622 | * page->mapping points to its anon_vma, not to a struct address_space; |
| 623 | * with the PAGE_MAPPING_ANON bit set to distinguish it. | 623 | * with the PAGE_MAPPING_ANON bit set to distinguish it. See rmap.h. |
| 624 | * | ||
| 625 | * On an anonymous page in a VM_MERGEABLE area, if CONFIG_KSM is enabled, | ||
| 626 | * the PAGE_MAPPING_KSM bit may be set along with the PAGE_MAPPING_ANON bit; | ||
| 627 | * and then page->mapping points, not to an anon_vma, but to a private | ||
| 628 | * structure which KSM associates with that merged page. See ksm.h. | ||
| 629 | * | ||
| 630 | * PAGE_MAPPING_KSM without PAGE_MAPPING_ANON is currently never used. | ||
| 624 | * | 631 | * |
| 625 | * Please note that, confusingly, "page_mapping" refers to the inode | 632 | * Please note that, confusingly, "page_mapping" refers to the inode |
| 626 | * address_space which maps the page from disk; whereas "page_mapped" | 633 | * address_space which maps the page from disk; whereas "page_mapped" |
| 627 | * refers to user virtual address space into which the page is mapped. | 634 | * refers to user virtual address space into which the page is mapped. |
| 628 | */ | 635 | */ |
| 629 | #define PAGE_MAPPING_ANON 1 | 636 | #define PAGE_MAPPING_ANON 1 |
| 637 | #define PAGE_MAPPING_KSM 2 | ||
| 638 | #define PAGE_MAPPING_FLAGS (PAGE_MAPPING_ANON | PAGE_MAPPING_KSM) | ||
| 630 | 639 | ||
| 631 | extern struct address_space swapper_space; | 640 | extern struct address_space swapper_space; |
| 632 | static inline struct address_space *page_mapping(struct page *page) | 641 | static inline struct address_space *page_mapping(struct page *page) |
| @@ -634,16 +643,19 @@ static inline struct address_space *page_mapping(struct page *page) | |||
| 634 | struct address_space *mapping = page->mapping; | 643 | struct address_space *mapping = page->mapping; |
| 635 | 644 | ||
| 636 | VM_BUG_ON(PageSlab(page)); | 645 | VM_BUG_ON(PageSlab(page)); |
| 637 | #ifdef CONFIG_SWAP | ||
| 638 | if (unlikely(PageSwapCache(page))) | 646 | if (unlikely(PageSwapCache(page))) |
| 639 | mapping = &swapper_space; | 647 | mapping = &swapper_space; |
| 640 | else | 648 | else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON)) |
| 641 | #endif | ||
| 642 | if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON)) | ||
| 643 | mapping = NULL; | 649 | mapping = NULL; |
| 644 | return mapping; | 650 | return mapping; |
| 645 | } | 651 | } |
| 646 | 652 | ||
| 653 | /* Neutral page->mapping pointer to address_space or anon_vma or other */ | ||
| 654 | static inline void *page_rmapping(struct page *page) | ||
| 655 | { | ||
| 656 | return (void *)((unsigned long)page->mapping & ~PAGE_MAPPING_FLAGS); | ||
| 657 | } | ||
| 658 | |||
| 647 | static inline int PageAnon(struct page *page) | 659 | static inline int PageAnon(struct page *page) |
| 648 | { | 660 | { |
| 649 | return ((unsigned long)page->mapping & PAGE_MAPPING_ANON) != 0; | 661 | return ((unsigned long)page->mapping & PAGE_MAPPING_ANON) != 0; |
| @@ -758,6 +770,7 @@ unsigned long unmap_vmas(struct mmu_gather **tlb, | |||
| 758 | * @pmd_entry: if set, called for each non-empty PMD (3rd-level) entry | 770 | * @pmd_entry: if set, called for each non-empty PMD (3rd-level) entry |
| 759 | * @pte_entry: if set, called for each non-empty PTE (4th-level) entry | 771 | * @pte_entry: if set, called for each non-empty PTE (4th-level) entry |
| 760 | * @pte_hole: if set, called for each hole at all levels | 772 | * @pte_hole: if set, called for each hole at all levels |
| 773 | * @hugetlb_entry: if set, called for each hugetlb entry | ||
| 761 | * | 774 | * |
| 762 | * (see walk_page_range for more details) | 775 | * (see walk_page_range for more details) |
| 763 | */ | 776 | */ |
| @@ -767,6 +780,8 @@ struct mm_walk { | |||
| 767 | int (*pmd_entry)(pmd_t *, unsigned long, unsigned long, struct mm_walk *); | 780 | int (*pmd_entry)(pmd_t *, unsigned long, unsigned long, struct mm_walk *); |
| 768 | int (*pte_entry)(pte_t *, unsigned long, unsigned long, struct mm_walk *); | 781 | int (*pte_entry)(pte_t *, unsigned long, unsigned long, struct mm_walk *); |
| 769 | int (*pte_hole)(unsigned long, unsigned long, struct mm_walk *); | 782 | int (*pte_hole)(unsigned long, unsigned long, struct mm_walk *); |
| 783 | int (*hugetlb_entry)(pte_t *, unsigned long, unsigned long, | ||
| 784 | struct mm_walk *); | ||
| 770 | struct mm_struct *mm; | 785 | struct mm_struct *mm; |
| 771 | void *private; | 786 | void *private; |
| 772 | }; | 787 | }; |
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h index 6913b71d9ab2..b31bd9e9bca3 100644 --- a/include/linux/mtd/ubi.h +++ b/include/linux/mtd/ubi.h | |||
| @@ -174,6 +174,8 @@ void ubi_get_volume_info(struct ubi_volume_desc *desc, | |||
| 174 | struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode); | 174 | struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode); |
| 175 | struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, | 175 | struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, |
| 176 | int mode); | 176 | int mode); |
| 177 | struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode); | ||
| 178 | |||
| 177 | int ubi_register_volume_notifier(struct notifier_block *nb, | 179 | int ubi_register_volume_notifier(struct notifier_block *nb, |
| 178 | int ignore_existing); | 180 | int ignore_existing); |
| 179 | int ubi_unregister_volume_notifier(struct notifier_block *nb); | 181 | int ubi_unregister_volume_notifier(struct notifier_block *nb); |
diff --git a/include/linux/namei.h b/include/linux/namei.h index ec0f607b364a..028946750289 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
| @@ -76,7 +76,6 @@ extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); | |||
| 76 | extern void release_open_intent(struct nameidata *); | 76 | extern void release_open_intent(struct nameidata *); |
| 77 | 77 | ||
| 78 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); | 78 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); |
| 79 | extern struct dentry *lookup_one_noperm(const char *, struct dentry *); | ||
| 80 | 79 | ||
| 81 | extern int follow_down(struct path *); | 80 | extern int follow_down(struct path *); |
| 82 | extern int follow_up(struct path *); | 81 | extern int follow_up(struct path *); |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index c4c060208109..9b8299af3741 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -128,6 +128,8 @@ | |||
| 128 | #define SEQ4_STATUS_RECALLABLE_STATE_REVOKED 0x00000040 | 128 | #define SEQ4_STATUS_RECALLABLE_STATE_REVOKED 0x00000040 |
| 129 | #define SEQ4_STATUS_LEASE_MOVED 0x00000080 | 129 | #define SEQ4_STATUS_LEASE_MOVED 0x00000080 |
| 130 | #define SEQ4_STATUS_RESTART_RECLAIM_NEEDED 0x00000100 | 130 | #define SEQ4_STATUS_RESTART_RECLAIM_NEEDED 0x00000100 |
| 131 | #define SEQ4_STATUS_CB_PATH_DOWN_SESSION 0x00000200 | ||
| 132 | #define SEQ4_STATUS_BACKCHANNEL_FAULT 0x00000400 | ||
| 131 | 133 | ||
| 132 | #define NFS4_MAX_UINT64 (~(u64)0) | 134 | #define NFS4_MAX_UINT64 (~(u64)0) |
| 133 | 135 | ||
| @@ -528,6 +530,7 @@ enum { | |||
| 528 | NFSPROC4_CLNT_DESTROY_SESSION, | 530 | NFSPROC4_CLNT_DESTROY_SESSION, |
| 529 | NFSPROC4_CLNT_SEQUENCE, | 531 | NFSPROC4_CLNT_SEQUENCE, |
| 530 | NFSPROC4_CLNT_GET_LEASE_TIME, | 532 | NFSPROC4_CLNT_GET_LEASE_TIME, |
| 533 | NFSPROC4_CLNT_RECLAIM_COMPLETE, | ||
| 531 | }; | 534 | }; |
| 532 | 535 | ||
| 533 | /* nfs41 types */ | 536 | /* nfs41 types */ |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 320569eabe3b..34fc6be5bfcf 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
| @@ -209,6 +209,7 @@ struct nfs4_session { | |||
| 209 | unsigned long session_state; | 209 | unsigned long session_state; |
| 210 | u32 hash_alg; | 210 | u32 hash_alg; |
| 211 | u32 ssv_len; | 211 | u32 ssv_len; |
| 212 | struct completion complete; | ||
| 212 | 213 | ||
| 213 | /* The fore and back channel */ | 214 | /* The fore and back channel */ |
| 214 | struct nfs4_channel_attrs fc_attrs; | 215 | struct nfs4_channel_attrs fc_attrs; |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 62f63fb0c4c8..51071b335751 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -170,8 +170,9 @@ struct nfs4_sequence_args { | |||
| 170 | struct nfs4_sequence_res { | 170 | struct nfs4_sequence_res { |
| 171 | struct nfs4_session *sr_session; | 171 | struct nfs4_session *sr_session; |
| 172 | u8 sr_slotid; /* slot used to send request */ | 172 | u8 sr_slotid; /* slot used to send request */ |
| 173 | unsigned long sr_renewal_time; | ||
| 174 | int sr_status; /* sequence operation status */ | 173 | int sr_status; /* sequence operation status */ |
| 174 | unsigned long sr_renewal_time; | ||
| 175 | u32 sr_status_flags; | ||
| 175 | }; | 176 | }; |
| 176 | 177 | ||
| 177 | struct nfs4_get_lease_time_args { | 178 | struct nfs4_get_lease_time_args { |
| @@ -938,6 +939,16 @@ struct nfs41_create_session_args { | |||
| 938 | struct nfs41_create_session_res { | 939 | struct nfs41_create_session_res { |
| 939 | struct nfs_client *client; | 940 | struct nfs_client *client; |
| 940 | }; | 941 | }; |
| 942 | |||
| 943 | struct nfs41_reclaim_complete_args { | ||
| 944 | /* In the future extend to include curr_fh for use with migration */ | ||
| 945 | unsigned char one_fs:1; | ||
| 946 | struct nfs4_sequence_args seq_args; | ||
| 947 | }; | ||
| 948 | |||
| 949 | struct nfs41_reclaim_complete_res { | ||
| 950 | struct nfs4_sequence_res seq_res; | ||
| 951 | }; | ||
| 941 | #endif /* CONFIG_NFS_V4_1 */ | 952 | #endif /* CONFIG_NFS_V4_1 */ |
| 942 | 953 | ||
| 943 | struct nfs_page; | 954 | struct nfs_page; |
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h index ce520402e840..3fe02cf8b65a 100644 --- a/include/linux/nilfs2_fs.h +++ b/include/linux/nilfs2_fs.h | |||
| @@ -151,6 +151,8 @@ struct nilfs_super_root { | |||
| 151 | #define NILFS_MOUNT_BARRIER 0x1000 /* Use block barriers */ | 151 | #define NILFS_MOUNT_BARRIER 0x1000 /* Use block barriers */ |
| 152 | #define NILFS_MOUNT_STRICT_ORDER 0x2000 /* Apply strict in-order | 152 | #define NILFS_MOUNT_STRICT_ORDER 0x2000 /* Apply strict in-order |
| 153 | semantics also for data */ | 153 | semantics also for data */ |
| 154 | #define NILFS_MOUNT_NORECOVERY 0x4000 /* Disable write access during | ||
| 155 | mount-time recovery */ | ||
| 154 | 156 | ||
| 155 | 157 | ||
| 156 | /** | 158 | /** |
| @@ -403,6 +405,28 @@ struct nilfs_segment_summary { | |||
| 403 | #define NILFS_SS_GC 0x0010 /* segment written for cleaner operation */ | 405 | #define NILFS_SS_GC 0x0010 /* segment written for cleaner operation */ |
| 404 | 406 | ||
| 405 | /** | 407 | /** |
| 408 | * struct nilfs_btree_node - B-tree node | ||
| 409 | * @bn_flags: flags | ||
| 410 | * @bn_level: level | ||
| 411 | * @bn_nchildren: number of children | ||
| 412 | * @bn_pad: padding | ||
| 413 | */ | ||
| 414 | struct nilfs_btree_node { | ||
| 415 | __u8 bn_flags; | ||
| 416 | __u8 bn_level; | ||
| 417 | __le16 bn_nchildren; | ||
| 418 | __le32 bn_pad; | ||
| 419 | }; | ||
| 420 | |||
| 421 | /* flags */ | ||
| 422 | #define NILFS_BTREE_NODE_ROOT 0x01 | ||
| 423 | |||
| 424 | /* level */ | ||
| 425 | #define NILFS_BTREE_LEVEL_DATA 0 | ||
| 426 | #define NILFS_BTREE_LEVEL_NODE_MIN (NILFS_BTREE_LEVEL_DATA + 1) | ||
| 427 | #define NILFS_BTREE_LEVEL_MAX 14 | ||
| 428 | |||
| 429 | /** | ||
| 406 | * struct nilfs_palloc_group_desc - block group descriptor | 430 | * struct nilfs_palloc_group_desc - block group descriptor |
| 407 | * @pg_nfrees: number of free entries in block group | 431 | * @pg_nfrees: number of free entries in block group |
| 408 | */ | 432 | */ |
diff --git a/include/linux/node.h b/include/linux/node.h index 681a697b9a86..06292dac3eab 100644 --- a/include/linux/node.h +++ b/include/linux/node.h | |||
| @@ -21,13 +21,19 @@ | |||
| 21 | 21 | ||
| 22 | #include <linux/sysdev.h> | 22 | #include <linux/sysdev.h> |
| 23 | #include <linux/cpumask.h> | 23 | #include <linux/cpumask.h> |
| 24 | #include <linux/workqueue.h> | ||
| 24 | 25 | ||
| 25 | struct node { | 26 | struct node { |
| 26 | struct sys_device sysdev; | 27 | struct sys_device sysdev; |
| 28 | |||
| 29 | #if defined(CONFIG_MEMORY_HOTPLUG_SPARSE) && defined(CONFIG_HUGETLBFS) | ||
| 30 | struct work_struct node_work; | ||
| 31 | #endif | ||
| 27 | }; | 32 | }; |
| 28 | 33 | ||
| 29 | struct memory_block; | 34 | struct memory_block; |
| 30 | extern struct node node_devices[]; | 35 | extern struct node node_devices[]; |
| 36 | typedef void (*node_registration_func_t)(struct node *); | ||
| 31 | 37 | ||
| 32 | extern int register_node(struct node *, int, struct node *); | 38 | extern int register_node(struct node *, int, struct node *); |
| 33 | extern void unregister_node(struct node *node); | 39 | extern void unregister_node(struct node *node); |
| @@ -39,6 +45,11 @@ extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid); | |||
| 39 | extern int register_mem_sect_under_node(struct memory_block *mem_blk, | 45 | extern int register_mem_sect_under_node(struct memory_block *mem_blk, |
| 40 | int nid); | 46 | int nid); |
| 41 | extern int unregister_mem_sect_under_nodes(struct memory_block *mem_blk); | 47 | extern int unregister_mem_sect_under_nodes(struct memory_block *mem_blk); |
| 48 | |||
| 49 | #ifdef CONFIG_HUGETLBFS | ||
| 50 | extern void register_hugetlbfs_with_node(node_registration_func_t doregister, | ||
| 51 | node_registration_func_t unregister); | ||
| 52 | #endif | ||
| 42 | #else | 53 | #else |
| 43 | static inline int register_one_node(int nid) | 54 | static inline int register_one_node(int nid) |
| 44 | { | 55 | { |
| @@ -65,6 +76,11 @@ static inline int unregister_mem_sect_under_nodes(struct memory_block *mem_blk) | |||
| 65 | { | 76 | { |
| 66 | return 0; | 77 | return 0; |
| 67 | } | 78 | } |
| 79 | |||
| 80 | static inline void register_hugetlbfs_with_node(node_registration_func_t reg, | ||
| 81 | node_registration_func_t unreg) | ||
| 82 | { | ||
| 83 | } | ||
| 68 | #endif | 84 | #endif |
| 69 | 85 | ||
| 70 | #define to_node(sys_device) container_of(sys_device, struct node, sysdev) | 86 | #define to_node(sys_device) container_of(sys_device, struct node, sysdev) |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index b359c4a9ec9e..454997cccbd8 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
| @@ -245,14 +245,19 @@ static inline int __next_node(int n, const nodemask_t *srcp) | |||
| 245 | return min_t(int,MAX_NUMNODES,find_next_bit(srcp->bits, MAX_NUMNODES, n+1)); | 245 | return min_t(int,MAX_NUMNODES,find_next_bit(srcp->bits, MAX_NUMNODES, n+1)); |
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | static inline void init_nodemask_of_node(nodemask_t *mask, int node) | ||
| 249 | { | ||
| 250 | nodes_clear(*mask); | ||
| 251 | node_set(node, *mask); | ||
| 252 | } | ||
| 253 | |||
| 248 | #define nodemask_of_node(node) \ | 254 | #define nodemask_of_node(node) \ |
| 249 | ({ \ | 255 | ({ \ |
| 250 | typeof(_unused_nodemask_arg_) m; \ | 256 | typeof(_unused_nodemask_arg_) m; \ |
| 251 | if (sizeof(m) == sizeof(unsigned long)) { \ | 257 | if (sizeof(m) == sizeof(unsigned long)) { \ |
| 252 | m.bits[0] = 1UL<<(node); \ | 258 | m.bits[0] = 1UL << (node); \ |
| 253 | } else { \ | 259 | } else { \ |
| 254 | nodes_clear(m); \ | 260 | init_nodemask_of_node(&m, (node)); \ |
| 255 | node_set((node), m); \ | ||
| 256 | } \ | 261 | } \ |
| 257 | m; \ | 262 | m; \ |
| 258 | }) | 263 | }) |
| @@ -480,15 +485,17 @@ static inline int num_node_state(enum node_states state) | |||
| 480 | #define for_each_online_node(node) for_each_node_state(node, N_ONLINE) | 485 | #define for_each_online_node(node) for_each_node_state(node, N_ONLINE) |
| 481 | 486 | ||
| 482 | /* | 487 | /* |
| 483 | * For nodemask scrach area.(See CPUMASK_ALLOC() in cpumask.h) | 488 | * For nodemask scrach area. |
| 489 | * NODEMASK_ALLOC(type, name) allocates an object with a specified type and | ||
| 490 | * name. | ||
| 484 | */ | 491 | */ |
| 485 | 492 | #if NODES_SHIFT > 8 /* nodemask_t > 256 bytes */ | |
| 486 | #if NODES_SHIFT > 8 /* nodemask_t > 64 bytes */ | 493 | #define NODEMASK_ALLOC(type, name, gfp_flags) \ |
| 487 | #define NODEMASK_ALLOC(x, m) struct x *m = kmalloc(sizeof(*m), GFP_KERNEL) | 494 | type *name = kmalloc(sizeof(*name), gfp_flags) |
| 488 | #define NODEMASK_FREE(m) kfree(m) | 495 | #define NODEMASK_FREE(m) kfree(m) |
| 489 | #else | 496 | #else |
| 490 | #define NODEMASK_ALLOC(x, m) struct x _m, *m = &_m | 497 | #define NODEMASK_ALLOC(type, name, gfp_flags) type _name, *name = &_name |
| 491 | #define NODEMASK_FREE(m) | 498 | #define NODEMASK_FREE(m) do {} while (0) |
| 492 | #endif | 499 | #endif |
| 493 | 500 | ||
| 494 | /* A example struture for using NODEMASK_ALLOC, used in mempolicy. */ | 501 | /* A example struture for using NODEMASK_ALLOC, used in mempolicy. */ |
| @@ -497,8 +504,10 @@ struct nodemask_scratch { | |||
| 497 | nodemask_t mask2; | 504 | nodemask_t mask2; |
| 498 | }; | 505 | }; |
| 499 | 506 | ||
| 500 | #define NODEMASK_SCRATCH(x) NODEMASK_ALLOC(nodemask_scratch, x) | 507 | #define NODEMASK_SCRATCH(x) \ |
| 501 | #define NODEMASK_SCRATCH_FREE(x) NODEMASK_FREE(x) | 508 | NODEMASK_ALLOC(struct nodemask_scratch, x, \ |
| 509 | GFP_KERNEL | __GFP_NORETRY) | ||
| 510 | #define NODEMASK_SCRATCH_FREE(x) NODEMASK_FREE(x) | ||
| 502 | 511 | ||
| 503 | 512 | ||
| 504 | #endif /* __LINUX_NODEMASK_H */ | 513 | #endif /* __LINUX_NODEMASK_H */ |
diff --git a/include/linux/numa.h b/include/linux/numa.h index a31a7301b159..3aaa31603a86 100644 --- a/include/linux/numa.h +++ b/include/linux/numa.h | |||
| @@ -10,4 +10,6 @@ | |||
| 10 | 10 | ||
| 11 | #define MAX_NUMNODES (1 << NODES_SHIFT) | 11 | #define MAX_NUMNODES (1 << NODES_SHIFT) |
| 12 | 12 | ||
| 13 | #define NUMA_NO_NODE (-1) | ||
| 14 | |||
| 13 | #endif /* _LINUX_NUMA_H */ | 15 | #endif /* _LINUX_NUMA_H */ |
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h new file mode 100644 index 000000000000..f46c40ac6d45 --- /dev/null +++ b/include/linux/omapfb.h | |||
| @@ -0,0 +1,251 @@ | |||
| 1 | /* | ||
| 2 | * File: include/linux/omapfb.h | ||
| 3 | * | ||
| 4 | * Framebuffer driver for TI OMAP boards | ||
| 5 | * | ||
| 6 | * Copyright (C) 2004 Nokia Corporation | ||
| 7 | * Author: Imre Deak <imre.deak@nokia.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify it | ||
| 10 | * under the terms of the GNU General Public License as published by the | ||
| 11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 12 | * option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, but | ||
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 17 | * General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License along | ||
| 20 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 21 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef __LINUX_OMAPFB_H__ | ||
| 25 | #define __LINUX_OMAPFB_H__ | ||
| 26 | |||
| 27 | #include <linux/fb.h> | ||
| 28 | #include <linux/ioctl.h> | ||
| 29 | #include <linux/types.h> | ||
| 30 | |||
| 31 | /* IOCTL commands. */ | ||
| 32 | |||
| 33 | #define OMAP_IOW(num, dtype) _IOW('O', num, dtype) | ||
| 34 | #define OMAP_IOR(num, dtype) _IOR('O', num, dtype) | ||
| 35 | #define OMAP_IOWR(num, dtype) _IOWR('O', num, dtype) | ||
| 36 | #define OMAP_IO(num) _IO('O', num) | ||
| 37 | |||
| 38 | #define OMAPFB_MIRROR OMAP_IOW(31, int) | ||
| 39 | #define OMAPFB_SYNC_GFX OMAP_IO(37) | ||
| 40 | #define OMAPFB_VSYNC OMAP_IO(38) | ||
| 41 | #define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int) | ||
| 42 | #define OMAPFB_GET_CAPS OMAP_IOR(42, struct omapfb_caps) | ||
| 43 | #define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int) | ||
| 44 | #define OMAPFB_LCD_TEST OMAP_IOW(45, int) | ||
| 45 | #define OMAPFB_CTRL_TEST OMAP_IOW(46, int) | ||
| 46 | #define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old) | ||
| 47 | #define OMAPFB_SET_COLOR_KEY OMAP_IOW(50, struct omapfb_color_key) | ||
| 48 | #define OMAPFB_GET_COLOR_KEY OMAP_IOW(51, struct omapfb_color_key) | ||
| 49 | #define OMAPFB_SETUP_PLANE OMAP_IOW(52, struct omapfb_plane_info) | ||
| 50 | #define OMAPFB_QUERY_PLANE OMAP_IOW(53, struct omapfb_plane_info) | ||
| 51 | #define OMAPFB_UPDATE_WINDOW OMAP_IOW(54, struct omapfb_update_window) | ||
| 52 | #define OMAPFB_SETUP_MEM OMAP_IOW(55, struct omapfb_mem_info) | ||
| 53 | #define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info) | ||
| 54 | #define OMAPFB_WAITFORVSYNC OMAP_IO(57) | ||
| 55 | #define OMAPFB_MEMORY_READ OMAP_IOR(58, struct omapfb_memory_read) | ||
| 56 | #define OMAPFB_GET_OVERLAY_COLORMODE OMAP_IOR(59, struct omapfb_ovl_colormode) | ||
| 57 | #define OMAPFB_WAITFORGO OMAP_IO(60) | ||
| 58 | #define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info) | ||
| 59 | #define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info) | ||
| 60 | |||
| 61 | #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff | ||
| 62 | #define OMAPFB_CAPS_LCDC_MASK 0x00fff000 | ||
| 63 | #define OMAPFB_CAPS_PANEL_MASK 0xff000000 | ||
| 64 | |||
| 65 | #define OMAPFB_CAPS_MANUAL_UPDATE 0x00001000 | ||
| 66 | #define OMAPFB_CAPS_TEARSYNC 0x00002000 | ||
| 67 | #define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000 | ||
| 68 | #define OMAPFB_CAPS_PLANE_SCALE 0x00008000 | ||
| 69 | #define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE 0x00010000 | ||
| 70 | #define OMAPFB_CAPS_WINDOW_SCALE 0x00020000 | ||
| 71 | #define OMAPFB_CAPS_WINDOW_OVERLAY 0x00040000 | ||
| 72 | #define OMAPFB_CAPS_WINDOW_ROTATE 0x00080000 | ||
| 73 | #define OMAPFB_CAPS_SET_BACKLIGHT 0x01000000 | ||
| 74 | |||
| 75 | /* Values from DSP must map to lower 16-bits */ | ||
| 76 | #define OMAPFB_FORMAT_MASK 0x00ff | ||
| 77 | #define OMAPFB_FORMAT_FLAG_DOUBLE 0x0100 | ||
| 78 | #define OMAPFB_FORMAT_FLAG_TEARSYNC 0x0200 | ||
| 79 | #define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400 | ||
| 80 | #define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY 0x0800 | ||
| 81 | #define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY 0x1000 | ||
| 82 | |||
| 83 | #define OMAPFB_MEMTYPE_SDRAM 0 | ||
| 84 | #define OMAPFB_MEMTYPE_SRAM 1 | ||
| 85 | #define OMAPFB_MEMTYPE_MAX 1 | ||
| 86 | |||
| 87 | enum omapfb_color_format { | ||
| 88 | OMAPFB_COLOR_RGB565 = 0, | ||
| 89 | OMAPFB_COLOR_YUV422, | ||
| 90 | OMAPFB_COLOR_YUV420, | ||
| 91 | OMAPFB_COLOR_CLUT_8BPP, | ||
| 92 | OMAPFB_COLOR_CLUT_4BPP, | ||
| 93 | OMAPFB_COLOR_CLUT_2BPP, | ||
| 94 | OMAPFB_COLOR_CLUT_1BPP, | ||
| 95 | OMAPFB_COLOR_RGB444, | ||
| 96 | OMAPFB_COLOR_YUY422, | ||
| 97 | |||
| 98 | OMAPFB_COLOR_ARGB16, | ||
| 99 | OMAPFB_COLOR_RGB24U, /* RGB24, 32-bit container */ | ||
| 100 | OMAPFB_COLOR_RGB24P, /* RGB24, 24-bit container */ | ||
| 101 | OMAPFB_COLOR_ARGB32, | ||
| 102 | OMAPFB_COLOR_RGBA32, | ||
| 103 | OMAPFB_COLOR_RGBX32, | ||
| 104 | }; | ||
| 105 | |||
| 106 | struct omapfb_update_window { | ||
| 107 | __u32 x, y; | ||
| 108 | __u32 width, height; | ||
| 109 | __u32 format; | ||
| 110 | __u32 out_x, out_y; | ||
| 111 | __u32 out_width, out_height; | ||
| 112 | __u32 reserved[8]; | ||
| 113 | }; | ||
| 114 | |||
| 115 | struct omapfb_update_window_old { | ||
| 116 | __u32 x, y; | ||
| 117 | __u32 width, height; | ||
| 118 | __u32 format; | ||
| 119 | }; | ||
| 120 | |||
| 121 | enum omapfb_plane { | ||
| 122 | OMAPFB_PLANE_GFX = 0, | ||
| 123 | OMAPFB_PLANE_VID1, | ||
| 124 | OMAPFB_PLANE_VID2, | ||
| 125 | }; | ||
| 126 | |||
| 127 | enum omapfb_channel_out { | ||
| 128 | OMAPFB_CHANNEL_OUT_LCD = 0, | ||
| 129 | OMAPFB_CHANNEL_OUT_DIGIT, | ||
| 130 | }; | ||
| 131 | |||
| 132 | struct omapfb_plane_info { | ||
| 133 | __u32 pos_x; | ||
| 134 | __u32 pos_y; | ||
| 135 | __u8 enabled; | ||
| 136 | __u8 channel_out; | ||
| 137 | __u8 mirror; | ||
| 138 | __u8 reserved1; | ||
| 139 | __u32 out_width; | ||
| 140 | __u32 out_height; | ||
| 141 | __u32 reserved2[12]; | ||
| 142 | }; | ||
| 143 | |||
| 144 | struct omapfb_mem_info { | ||
| 145 | __u32 size; | ||
| 146 | __u8 type; | ||
| 147 | __u8 reserved[3]; | ||
| 148 | }; | ||
| 149 | |||
| 150 | struct omapfb_caps { | ||
| 151 | __u32 ctrl; | ||
| 152 | __u32 plane_color; | ||
| 153 | __u32 wnd_color; | ||
| 154 | }; | ||
| 155 | |||
| 156 | enum omapfb_color_key_type { | ||
| 157 | OMAPFB_COLOR_KEY_DISABLED = 0, | ||
| 158 | OMAPFB_COLOR_KEY_GFX_DST, | ||
| 159 | OMAPFB_COLOR_KEY_VID_SRC, | ||
| 160 | }; | ||
| 161 | |||
| 162 | struct omapfb_color_key { | ||
| 163 | __u8 channel_out; | ||
| 164 | __u32 background; | ||
| 165 | __u32 trans_key; | ||
| 166 | __u8 key_type; | ||
| 167 | }; | ||
| 168 | |||
| 169 | enum omapfb_update_mode { | ||
| 170 | OMAPFB_UPDATE_DISABLED = 0, | ||
| 171 | OMAPFB_AUTO_UPDATE, | ||
| 172 | OMAPFB_MANUAL_UPDATE | ||
| 173 | }; | ||
| 174 | |||
| 175 | struct omapfb_memory_read { | ||
| 176 | __u16 x; | ||
| 177 | __u16 y; | ||
| 178 | __u16 w; | ||
| 179 | __u16 h; | ||
| 180 | size_t buffer_size; | ||
| 181 | void __user *buffer; | ||
| 182 | }; | ||
| 183 | |||
| 184 | struct omapfb_ovl_colormode { | ||
| 185 | __u8 overlay_idx; | ||
| 186 | __u8 mode_idx; | ||
| 187 | __u32 bits_per_pixel; | ||
| 188 | __u32 nonstd; | ||
| 189 | struct fb_bitfield red; | ||
| 190 | struct fb_bitfield green; | ||
| 191 | struct fb_bitfield blue; | ||
| 192 | struct fb_bitfield transp; | ||
| 193 | }; | ||
| 194 | |||
| 195 | struct omapfb_vram_info { | ||
| 196 | __u32 total; | ||
| 197 | __u32 free; | ||
| 198 | __u32 largest_free_block; | ||
| 199 | __u32 reserved[5]; | ||
| 200 | }; | ||
| 201 | |||
| 202 | struct omapfb_tearsync_info { | ||
| 203 | __u8 enabled; | ||
| 204 | __u8 reserved1[3]; | ||
| 205 | __u16 line; | ||
| 206 | __u16 reserved2; | ||
| 207 | }; | ||
| 208 | |||
| 209 | #ifdef __KERNEL__ | ||
| 210 | |||
| 211 | #include <plat/board.h> | ||
| 212 | |||
| 213 | #ifdef CONFIG_ARCH_OMAP1 | ||
| 214 | #define OMAPFB_PLANE_NUM 1 | ||
| 215 | #else | ||
| 216 | #define OMAPFB_PLANE_NUM 3 | ||
| 217 | #endif | ||
| 218 | |||
| 219 | struct omapfb_mem_region { | ||
| 220 | u32 paddr; | ||
| 221 | void __iomem *vaddr; | ||
| 222 | unsigned long size; | ||
| 223 | u8 type; /* OMAPFB_PLANE_MEM_* */ | ||
| 224 | enum omapfb_color_format format;/* OMAPFB_COLOR_* */ | ||
| 225 | unsigned format_used:1; /* Must be set when format is set. | ||
| 226 | * Needed b/c of the badly chosen 0 | ||
| 227 | * base for OMAPFB_COLOR_* values | ||
| 228 | */ | ||
| 229 | unsigned alloc:1; /* allocated by the driver */ | ||
| 230 | unsigned map:1; /* kernel mapped by the driver */ | ||
| 231 | }; | ||
| 232 | |||
| 233 | struct omapfb_mem_desc { | ||
| 234 | int region_cnt; | ||
| 235 | struct omapfb_mem_region region[OMAPFB_PLANE_NUM]; | ||
| 236 | }; | ||
| 237 | |||
| 238 | struct omapfb_platform_data { | ||
| 239 | struct omap_lcd_config lcd; | ||
| 240 | struct omapfb_mem_desc mem_desc; | ||
| 241 | void *ctrl_platform_data; | ||
| 242 | }; | ||
| 243 | |||
| 244 | /* in arch/arm/plat-omap/fb.c */ | ||
| 245 | extern void omapfb_set_platform_data(struct omapfb_platform_data *data); | ||
| 246 | extern void omapfb_set_ctrl_platform_data(void *pdata); | ||
| 247 | extern void omapfb_reserve_sdram(void); | ||
| 248 | |||
| 249 | #endif | ||
| 250 | |||
| 251 | #endif /* __OMAPFB_H */ | ||
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 6b202b173955..49e907bd067f 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
| @@ -99,7 +99,7 @@ enum pageflags { | |||
| 99 | PG_buddy, /* Page is free, on buddy lists */ | 99 | PG_buddy, /* Page is free, on buddy lists */ |
| 100 | PG_swapbacked, /* Page is backed by RAM/swap */ | 100 | PG_swapbacked, /* Page is backed by RAM/swap */ |
| 101 | PG_unevictable, /* Page is "unevictable" */ | 101 | PG_unevictable, /* Page is "unevictable" */ |
| 102 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT | 102 | #ifdef CONFIG_MMU |
| 103 | PG_mlocked, /* Page is vma mlocked */ | 103 | PG_mlocked, /* Page is vma mlocked */ |
| 104 | #endif | 104 | #endif |
| 105 | #ifdef CONFIG_ARCH_USES_PG_UNCACHED | 105 | #ifdef CONFIG_ARCH_USES_PG_UNCACHED |
| @@ -259,12 +259,10 @@ PAGEFLAG_FALSE(SwapCache) | |||
| 259 | PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable) | 259 | PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable) |
| 260 | TESTCLEARFLAG(Unevictable, unevictable) | 260 | TESTCLEARFLAG(Unevictable, unevictable) |
| 261 | 261 | ||
| 262 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT | 262 | #ifdef CONFIG_MMU |
| 263 | #define MLOCK_PAGES 1 | ||
| 264 | PAGEFLAG(Mlocked, mlocked) __CLEARPAGEFLAG(Mlocked, mlocked) | 263 | PAGEFLAG(Mlocked, mlocked) __CLEARPAGEFLAG(Mlocked, mlocked) |
| 265 | TESTSCFLAG(Mlocked, mlocked) __TESTCLEARFLAG(Mlocked, mlocked) | 264 | TESTSCFLAG(Mlocked, mlocked) __TESTCLEARFLAG(Mlocked, mlocked) |
| 266 | #else | 265 | #else |
| 267 | #define MLOCK_PAGES 0 | ||
| 268 | PAGEFLAG_FALSE(Mlocked) SETPAGEFLAG_NOOP(Mlocked) | 266 | PAGEFLAG_FALSE(Mlocked) SETPAGEFLAG_NOOP(Mlocked) |
| 269 | TESTCLEARFLAG_FALSE(Mlocked) __TESTCLEARFLAG_FALSE(Mlocked) | 267 | TESTCLEARFLAG_FALSE(Mlocked) __TESTCLEARFLAG_FALSE(Mlocked) |
| 270 | #endif | 268 | #endif |
| @@ -393,7 +391,7 @@ static inline void __ClearPageTail(struct page *page) | |||
| 393 | 391 | ||
| 394 | #endif /* !PAGEFLAGS_EXTENDED */ | 392 | #endif /* !PAGEFLAGS_EXTENDED */ |
| 395 | 393 | ||
| 396 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT | 394 | #ifdef CONFIG_MMU |
| 397 | #define __PG_MLOCKED (1 << PG_mlocked) | 395 | #define __PG_MLOCKED (1 << PG_mlocked) |
| 398 | #else | 396 | #else |
| 399 | #define __PG_MLOCKED 0 | 397 | #define __PG_MLOCKED 0 |
diff --git a/include/linux/pci.h b/include/linux/pci.h index f5c7cd343e56..bf1e67080849 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -218,6 +218,7 @@ struct pci_dev { | |||
| 218 | unsigned int class; /* 3 bytes: (base,sub,prog-if) */ | 218 | unsigned int class; /* 3 bytes: (base,sub,prog-if) */ |
| 219 | u8 revision; /* PCI revision, low byte of class word */ | 219 | u8 revision; /* PCI revision, low byte of class word */ |
| 220 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ | 220 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ |
| 221 | u8 pcie_cap; /* PCI-E capability offset */ | ||
| 221 | u8 pcie_type; /* PCI-E device/port type */ | 222 | u8 pcie_type; /* PCI-E device/port type */ |
| 222 | u8 rom_base_reg; /* which config register controls the ROM */ | 223 | u8 rom_base_reg; /* which config register controls the ROM */ |
| 223 | u8 pin; /* which interrupt pin this device uses */ | 224 | u8 pin; /* which interrupt pin this device uses */ |
| @@ -280,6 +281,7 @@ struct pci_dev { | |||
| 280 | unsigned int is_virtfn:1; | 281 | unsigned int is_virtfn:1; |
| 281 | unsigned int reset_fn:1; | 282 | unsigned int reset_fn:1; |
| 282 | unsigned int is_hotplug_bridge:1; | 283 | unsigned int is_hotplug_bridge:1; |
| 284 | unsigned int aer_firmware_first:1; | ||
| 283 | pci_dev_flags_t dev_flags; | 285 | pci_dev_flags_t dev_flags; |
| 284 | atomic_t enable_cnt; /* pci_enable_device has been called */ | 286 | atomic_t enable_cnt; /* pci_enable_device has been called */ |
| 285 | 287 | ||
| @@ -635,7 +637,13 @@ struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, | |||
| 635 | unsigned int ss_vendor, unsigned int ss_device, | 637 | unsigned int ss_vendor, unsigned int ss_device, |
| 636 | struct pci_dev *from); | 638 | struct pci_dev *from); |
| 637 | struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); | 639 | struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); |
| 638 | struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); | 640 | struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus, |
| 641 | unsigned int devfn); | ||
| 642 | static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, | ||
| 643 | unsigned int devfn) | ||
| 644 | { | ||
| 645 | return pci_get_domain_bus_and_slot(0, bus, devfn); | ||
| 646 | } | ||
| 639 | struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); | 647 | struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); |
| 640 | int pci_dev_present(const struct pci_device_id *ids); | 648 | int pci_dev_present(const struct pci_device_id *ids); |
| 641 | 649 | ||
| @@ -701,6 +709,7 @@ void pci_disable_device(struct pci_dev *dev); | |||
| 701 | void pci_set_master(struct pci_dev *dev); | 709 | void pci_set_master(struct pci_dev *dev); |
| 702 | void pci_clear_master(struct pci_dev *dev); | 710 | void pci_clear_master(struct pci_dev *dev); |
| 703 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); | 711 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); |
| 712 | int pci_set_cacheline_size(struct pci_dev *dev); | ||
| 704 | #define HAVE_PCI_SET_MWI | 713 | #define HAVE_PCI_SET_MWI |
| 705 | int __must_check pci_set_mwi(struct pci_dev *dev); | 714 | int __must_check pci_set_mwi(struct pci_dev *dev); |
| 706 | int pci_try_set_mwi(struct pci_dev *dev); | 715 | int pci_try_set_mwi(struct pci_dev *dev); |
| @@ -1246,6 +1255,8 @@ extern int pci_pci_problems; | |||
| 1246 | 1255 | ||
| 1247 | extern unsigned long pci_cardbus_io_size; | 1256 | extern unsigned long pci_cardbus_io_size; |
| 1248 | extern unsigned long pci_cardbus_mem_size; | 1257 | extern unsigned long pci_cardbus_mem_size; |
| 1258 | extern u8 __devinitdata pci_dfl_cache_line_size; | ||
| 1259 | extern u8 pci_cache_line_size; | ||
| 1249 | 1260 | ||
| 1250 | extern unsigned long pci_hotplug_io_size; | 1261 | extern unsigned long pci_hotplug_io_size; |
| 1251 | extern unsigned long pci_hotplug_mem_size; | 1262 | extern unsigned long pci_hotplug_mem_size; |
| @@ -1290,5 +1301,34 @@ extern void pci_hp_create_module_link(struct pci_slot *pci_slot); | |||
| 1290 | extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); | 1301 | extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); |
| 1291 | #endif | 1302 | #endif |
| 1292 | 1303 | ||
| 1304 | /** | ||
| 1305 | * pci_pcie_cap - get the saved PCIe capability offset | ||
| 1306 | * @dev: PCI device | ||
| 1307 | * | ||
| 1308 | * PCIe capability offset is calculated at PCI device initialization | ||
| 1309 | * time and saved in the data structure. This function returns saved | ||
| 1310 | * PCIe capability offset. Using this instead of pci_find_capability() | ||
| 1311 | * reduces unnecessary search in the PCI configuration space. If you | ||
| 1312 | * need to calculate PCIe capability offset from raw device for some | ||
| 1313 | * reasons, please use pci_find_capability() instead. | ||
| 1314 | */ | ||
| 1315 | static inline int pci_pcie_cap(struct pci_dev *dev) | ||
| 1316 | { | ||
| 1317 | return dev->pcie_cap; | ||
| 1318 | } | ||
| 1319 | |||
| 1320 | /** | ||
| 1321 | * pci_is_pcie - check if the PCI device is PCI Express capable | ||
| 1322 | * @dev: PCI device | ||
| 1323 | * | ||
| 1324 | * Retrun true if the PCI device is PCI Express capable, false otherwise. | ||
| 1325 | */ | ||
| 1326 | static inline bool pci_is_pcie(struct pci_dev *dev) | ||
| 1327 | { | ||
| 1328 | return !!pci_pcie_cap(dev); | ||
| 1329 | } | ||
| 1330 | |||
| 1331 | void pci_request_acs(void); | ||
| 1332 | |||
| 1293 | #endif /* __KERNEL__ */ | 1333 | #endif /* __KERNEL__ */ |
| 1294 | #endif /* LINUX_PCI_H */ | 1334 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index eae1f864c934..cca8a044e2b6 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -2295,6 +2295,20 @@ | |||
| 2295 | #define PCI_DEVICE_ID_MPC8536 0x0051 | 2295 | #define PCI_DEVICE_ID_MPC8536 0x0051 |
| 2296 | #define PCI_DEVICE_ID_P2020E 0x0070 | 2296 | #define PCI_DEVICE_ID_P2020E 0x0070 |
| 2297 | #define PCI_DEVICE_ID_P2020 0x0071 | 2297 | #define PCI_DEVICE_ID_P2020 0x0071 |
| 2298 | #define PCI_DEVICE_ID_P2010E 0x0078 | ||
| 2299 | #define PCI_DEVICE_ID_P2010 0x0079 | ||
| 2300 | #define PCI_DEVICE_ID_P1020E 0x0100 | ||
| 2301 | #define PCI_DEVICE_ID_P1020 0x0101 | ||
| 2302 | #define PCI_DEVICE_ID_P1011E 0x0108 | ||
| 2303 | #define PCI_DEVICE_ID_P1011 0x0109 | ||
| 2304 | #define PCI_DEVICE_ID_P1022E 0x0110 | ||
| 2305 | #define PCI_DEVICE_ID_P1022 0x0111 | ||
| 2306 | #define PCI_DEVICE_ID_P1013E 0x0118 | ||
| 2307 | #define PCI_DEVICE_ID_P1013 0x0119 | ||
| 2308 | #define PCI_DEVICE_ID_P4080E 0x0400 | ||
| 2309 | #define PCI_DEVICE_ID_P4080 0x0401 | ||
| 2310 | #define PCI_DEVICE_ID_P4040E 0x0408 | ||
| 2311 | #define PCI_DEVICE_ID_P4040 0x0409 | ||
| 2298 | #define PCI_DEVICE_ID_MPC8641 0x7010 | 2312 | #define PCI_DEVICE_ID_MPC8641 0x7010 |
| 2299 | #define PCI_DEVICE_ID_MPC8641D 0x7011 | 2313 | #define PCI_DEVICE_ID_MPC8641D 0x7011 |
| 2300 | #define PCI_DEVICE_ID_MPC8610 0x7018 | 2314 | #define PCI_DEVICE_ID_MPC8610 0x7018 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index dd0bed4f1cf0..9f2ad0aa3c39 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
| @@ -365,6 +365,11 @@ | |||
| 365 | #define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ | 365 | #define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ |
| 366 | #define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ | 366 | #define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ |
| 367 | 367 | ||
| 368 | /* PCI Bridge Subsystem ID registers */ | ||
| 369 | |||
| 370 | #define PCI_SSVID_VENDOR_ID 4 /* PCI-Bridge subsystem vendor id register */ | ||
| 371 | #define PCI_SSVID_DEVICE_ID 6 /* PCI-Bridge subsystem device id register */ | ||
| 372 | |||
| 368 | /* PCI Express capability registers */ | 373 | /* PCI Express capability registers */ |
| 369 | 374 | ||
| 370 | #define PCI_EXP_FLAGS 2 /* Capabilities register */ | 375 | #define PCI_EXP_FLAGS 2 /* Capabilities register */ |
| @@ -502,6 +507,7 @@ | |||
| 502 | #define PCI_EXT_CAP_ID_VC 2 | 507 | #define PCI_EXT_CAP_ID_VC 2 |
| 503 | #define PCI_EXT_CAP_ID_DSN 3 | 508 | #define PCI_EXT_CAP_ID_DSN 3 |
| 504 | #define PCI_EXT_CAP_ID_PWR 4 | 509 | #define PCI_EXT_CAP_ID_PWR 4 |
| 510 | #define PCI_EXT_CAP_ID_ACS 13 | ||
| 505 | #define PCI_EXT_CAP_ID_ARI 14 | 511 | #define PCI_EXT_CAP_ID_ARI 14 |
| 506 | #define PCI_EXT_CAP_ID_ATS 15 | 512 | #define PCI_EXT_CAP_ID_ATS 15 |
| 507 | #define PCI_EXT_CAP_ID_SRIOV 16 | 513 | #define PCI_EXT_CAP_ID_SRIOV 16 |
| @@ -662,4 +668,16 @@ | |||
| 662 | #define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ | 668 | #define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ |
| 663 | #define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ | 669 | #define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ |
| 664 | 670 | ||
| 671 | /* Access Control Service */ | ||
| 672 | #define PCI_ACS_CAP 0x04 /* ACS Capability Register */ | ||
| 673 | #define PCI_ACS_SV 0x01 /* Source Validation */ | ||
| 674 | #define PCI_ACS_TB 0x02 /* Translation Blocking */ | ||
| 675 | #define PCI_ACS_RR 0x04 /* P2P Request Redirect */ | ||
| 676 | #define PCI_ACS_CR 0x08 /* P2P Completion Redirect */ | ||
| 677 | #define PCI_ACS_UF 0x10 /* Upstream Forwarding */ | ||
| 678 | #define PCI_ACS_EC 0x20 /* P2P Egress Control */ | ||
| 679 | #define PCI_ACS_DT 0x40 /* Direct Translated P2P */ | ||
| 680 | #define PCI_ACS_CTRL 0x06 /* ACS Control Register */ | ||
| 681 | #define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */ | ||
| 682 | |||
| 665 | #endif /* LINUX_PCI_REGS_H */ | 683 | #endif /* LINUX_PCI_REGS_H */ |
diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h index b4c79545330b..6775532b92a9 100644 --- a/include/linux/pcieport_if.h +++ b/include/linux/pcieport_if.h | |||
| @@ -10,10 +10,7 @@ | |||
| 10 | #define _PCIEPORT_IF_H_ | 10 | #define _PCIEPORT_IF_H_ |
| 11 | 11 | ||
| 12 | /* Port Type */ | 12 | /* Port Type */ |
| 13 | #define PCIE_RC_PORT 4 /* Root port of RC */ | 13 | #define PCIE_ANY_PORT (~0) |
| 14 | #define PCIE_SW_UPSTREAM_PORT 5 /* Upstream port of Switch */ | ||
| 15 | #define PCIE_SW_DOWNSTREAM_PORT 6 /* Downstream port of Switch */ | ||
| 16 | #define PCIE_ANY_PORT 7 | ||
| 17 | 14 | ||
| 18 | /* Service Type */ | 15 | /* Service Type */ |
| 19 | #define PCIE_PORT_SERVICE_PME_SHIFT 0 /* Power Management Event */ | 16 | #define PCIE_PORT_SERVICE_PME_SHIFT 0 /* Power Management Event */ |
| @@ -25,17 +22,6 @@ | |||
| 25 | #define PCIE_PORT_SERVICE_VC_SHIFT 3 /* Virtual Channel */ | 22 | #define PCIE_PORT_SERVICE_VC_SHIFT 3 /* Virtual Channel */ |
| 26 | #define PCIE_PORT_SERVICE_VC (1 << PCIE_PORT_SERVICE_VC_SHIFT) | 23 | #define PCIE_PORT_SERVICE_VC (1 << PCIE_PORT_SERVICE_VC_SHIFT) |
| 27 | 24 | ||
| 28 | /* Root/Upstream/Downstream Port's Interrupt Mode */ | ||
| 29 | #define PCIE_PORT_NO_IRQ (-1) | ||
| 30 | #define PCIE_PORT_INTx_MODE 0 | ||
| 31 | #define PCIE_PORT_MSI_MODE 1 | ||
| 32 | #define PCIE_PORT_MSIX_MODE 2 | ||
| 33 | |||
| 34 | struct pcie_port_data { | ||
| 35 | int port_type; /* Type of the port */ | ||
| 36 | int port_irq_mode; /* [0:INTx | 1:MSI | 2:MSI-X] */ | ||
| 37 | }; | ||
| 38 | |||
| 39 | struct pcie_device { | 25 | struct pcie_device { |
| 40 | int irq; /* Service IRQ/MSI/MSI-X Vector */ | 26 | int irq; /* Service IRQ/MSI/MSI-X Vector */ |
| 41 | struct pci_dev *port; /* Root/Upstream/Downstream Port */ | 27 | struct pci_dev *port; /* Root/Upstream/Downstream Port */ |
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 9bd03193ecd4..5a5d6ce4bd55 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
| @@ -60,6 +60,7 @@ | |||
| 60 | 60 | ||
| 61 | #define DEFINE_PER_CPU_SECTION(type, name, sec) \ | 61 | #define DEFINE_PER_CPU_SECTION(type, name, sec) \ |
| 62 | __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ | 62 | __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ |
| 63 | extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ | ||
| 63 | __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ | 64 | __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ |
| 64 | __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ | 65 | __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ |
| 65 | __typeof__(type) per_cpu__##name | 66 | __typeof__(type) per_cpu__##name |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 878836ca999c..cf5efbcf716c 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
| @@ -34,8 +34,6 @@ | |||
| 34 | 34 | ||
| 35 | #ifdef CONFIG_SMP | 35 | #ifdef CONFIG_SMP |
| 36 | 36 | ||
| 37 | #ifndef CONFIG_HAVE_LEGACY_PER_CPU_AREA | ||
| 38 | |||
| 39 | /* minimum unit size, also is the maximum supported allocation size */ | 37 | /* minimum unit size, also is the maximum supported allocation size */ |
| 40 | #define PCPU_MIN_UNIT_SIZE PFN_ALIGN(64 << 10) | 38 | #define PCPU_MIN_UNIT_SIZE PFN_ALIGN(64 << 10) |
| 41 | 39 | ||
| @@ -130,30 +128,9 @@ extern int __init pcpu_page_first_chunk(size_t reserved_size, | |||
| 130 | #define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))) | 128 | #define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))) |
| 131 | 129 | ||
| 132 | extern void *__alloc_reserved_percpu(size_t size, size_t align); | 130 | extern void *__alloc_reserved_percpu(size_t size, size_t align); |
| 133 | |||
| 134 | #else /* CONFIG_HAVE_LEGACY_PER_CPU_AREA */ | ||
| 135 | |||
| 136 | struct percpu_data { | ||
| 137 | void *ptrs[1]; | ||
| 138 | }; | ||
| 139 | |||
| 140 | /* pointer disguising messes up the kmemleak objects tracking */ | ||
| 141 | #ifndef CONFIG_DEBUG_KMEMLEAK | ||
| 142 | #define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata) | ||
| 143 | #else | ||
| 144 | #define __percpu_disguise(pdata) (struct percpu_data *)(pdata) | ||
| 145 | #endif | ||
| 146 | |||
| 147 | #define per_cpu_ptr(ptr, cpu) \ | ||
| 148 | ({ \ | ||
| 149 | struct percpu_data *__p = __percpu_disguise(ptr); \ | ||
| 150 | (__typeof__(ptr))__p->ptrs[(cpu)]; \ | ||
| 151 | }) | ||
| 152 | |||
| 153 | #endif /* CONFIG_HAVE_LEGACY_PER_CPU_AREA */ | ||
| 154 | |||
| 155 | extern void *__alloc_percpu(size_t size, size_t align); | 131 | extern void *__alloc_percpu(size_t size, size_t align); |
| 156 | extern void free_percpu(void *__pdata); | 132 | extern void free_percpu(void *__pdata); |
| 133 | extern phys_addr_t per_cpu_ptr_to_phys(void *addr); | ||
| 157 | 134 | ||
| 158 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA | 135 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA |
| 159 | extern void __init setup_per_cpu_areas(void); | 136 | extern void __init setup_per_cpu_areas(void); |
| @@ -179,6 +156,11 @@ static inline void free_percpu(void *p) | |||
| 179 | kfree(p); | 156 | kfree(p); |
| 180 | } | 157 | } |
| 181 | 158 | ||
| 159 | static inline phys_addr_t per_cpu_ptr_to_phys(void *addr) | ||
| 160 | { | ||
| 161 | return __pa(addr); | ||
| 162 | } | ||
| 163 | |||
| 182 | static inline void __init setup_per_cpu_areas(void) { } | 164 | static inline void __init setup_per_cpu_areas(void) { } |
| 183 | 165 | ||
| 184 | static inline void *pcpu_lpage_remapped(void *kaddr) | 166 | static inline void *pcpu_lpage_remapped(void *kaddr) |
| @@ -188,8 +170,8 @@ static inline void *pcpu_lpage_remapped(void *kaddr) | |||
| 188 | 170 | ||
| 189 | #endif /* CONFIG_SMP */ | 171 | #endif /* CONFIG_SMP */ |
| 190 | 172 | ||
| 191 | #define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \ | 173 | #define alloc_percpu(type) \ |
| 192 | __alignof__(type)) | 174 | (typeof(type) *)__alloc_percpu(sizeof(type), __alignof__(type)) |
| 193 | 175 | ||
| 194 | /* | 176 | /* |
| 195 | * Optional methods for optimized non-lvalue per-cpu variable access. | 177 | * Optional methods for optimized non-lvalue per-cpu variable access. |
| @@ -243,4 +225,404 @@ do { \ | |||
| 243 | # define percpu_xor(var, val) __percpu_generic_to_op(var, (val), ^=) | 225 | # define percpu_xor(var, val) __percpu_generic_to_op(var, (val), ^=) |
| 244 | #endif | 226 | #endif |
| 245 | 227 | ||
| 228 | /* | ||
| 229 | * Branching function to split up a function into a set of functions that | ||
| 230 | * are called for different scalar sizes of the objects handled. | ||
| 231 | */ | ||
| 232 | |||
| 233 | extern void __bad_size_call_parameter(void); | ||
| 234 | |||
| 235 | #define __pcpu_size_call_return(stem, variable) \ | ||
| 236 | ({ typeof(variable) pscr_ret__; \ | ||
| 237 | switch(sizeof(variable)) { \ | ||
| 238 | case 1: pscr_ret__ = stem##1(variable);break; \ | ||
| 239 | case 2: pscr_ret__ = stem##2(variable);break; \ | ||
| 240 | case 4: pscr_ret__ = stem##4(variable);break; \ | ||
| 241 | case 8: pscr_ret__ = stem##8(variable);break; \ | ||
| 242 | default: \ | ||
| 243 | __bad_size_call_parameter();break; \ | ||
| 244 | } \ | ||
| 245 | pscr_ret__; \ | ||
| 246 | }) | ||
| 247 | |||
| 248 | #define __pcpu_size_call(stem, variable, ...) \ | ||
| 249 | do { \ | ||
| 250 | switch(sizeof(variable)) { \ | ||
| 251 | case 1: stem##1(variable, __VA_ARGS__);break; \ | ||
| 252 | case 2: stem##2(variable, __VA_ARGS__);break; \ | ||
| 253 | case 4: stem##4(variable, __VA_ARGS__);break; \ | ||
| 254 | case 8: stem##8(variable, __VA_ARGS__);break; \ | ||
| 255 | default: \ | ||
| 256 | __bad_size_call_parameter();break; \ | ||
| 257 | } \ | ||
| 258 | } while (0) | ||
| 259 | |||
| 260 | /* | ||
| 261 | * Optimized manipulation for memory allocated through the per cpu | ||
| 262 | * allocator or for addresses of per cpu variables (can be determined | ||
| 263 | * using per_cpu_var(xx). | ||
| 264 | * | ||
| 265 | * These operation guarantee exclusivity of access for other operations | ||
| 266 | * on the *same* processor. The assumption is that per cpu data is only | ||
| 267 | * accessed by a single processor instance (the current one). | ||
| 268 | * | ||
| 269 | * The first group is used for accesses that must be done in a | ||
| 270 | * preemption safe way since we know that the context is not preempt | ||
| 271 | * safe. Interrupts may occur. If the interrupt modifies the variable | ||
| 272 | * too then RMW actions will not be reliable. | ||
| 273 | * | ||
| 274 | * The arch code can provide optimized functions in two ways: | ||
| 275 | * | ||
| 276 | * 1. Override the function completely. F.e. define this_cpu_add(). | ||
| 277 | * The arch must then ensure that the various scalar format passed | ||
| 278 | * are handled correctly. | ||
| 279 | * | ||
| 280 | * 2. Provide functions for certain scalar sizes. F.e. provide | ||
| 281 | * this_cpu_add_2() to provide per cpu atomic operations for 2 byte | ||
| 282 | * sized RMW actions. If arch code does not provide operations for | ||
| 283 | * a scalar size then the fallback in the generic code will be | ||
| 284 | * used. | ||
| 285 | */ | ||
| 286 | |||
| 287 | #define _this_cpu_generic_read(pcp) \ | ||
| 288 | ({ typeof(pcp) ret__; \ | ||
| 289 | preempt_disable(); \ | ||
| 290 | ret__ = *this_cpu_ptr(&(pcp)); \ | ||
| 291 | preempt_enable(); \ | ||
| 292 | ret__; \ | ||
| 293 | }) | ||
| 294 | |||
| 295 | #ifndef this_cpu_read | ||
| 296 | # ifndef this_cpu_read_1 | ||
| 297 | # define this_cpu_read_1(pcp) _this_cpu_generic_read(pcp) | ||
| 298 | # endif | ||
| 299 | # ifndef this_cpu_read_2 | ||
| 300 | # define this_cpu_read_2(pcp) _this_cpu_generic_read(pcp) | ||
| 301 | # endif | ||
| 302 | # ifndef this_cpu_read_4 | ||
| 303 | # define this_cpu_read_4(pcp) _this_cpu_generic_read(pcp) | ||
| 304 | # endif | ||
| 305 | # ifndef this_cpu_read_8 | ||
| 306 | # define this_cpu_read_8(pcp) _this_cpu_generic_read(pcp) | ||
| 307 | # endif | ||
| 308 | # define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, (pcp)) | ||
| 309 | #endif | ||
| 310 | |||
| 311 | #define _this_cpu_generic_to_op(pcp, val, op) \ | ||
| 312 | do { \ | ||
| 313 | preempt_disable(); \ | ||
| 314 | *__this_cpu_ptr(&pcp) op val; \ | ||
| 315 | preempt_enable(); \ | ||
| 316 | } while (0) | ||
| 317 | |||
| 318 | #ifndef this_cpu_write | ||
| 319 | # ifndef this_cpu_write_1 | ||
| 320 | # define this_cpu_write_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) | ||
| 321 | # endif | ||
| 322 | # ifndef this_cpu_write_2 | ||
| 323 | # define this_cpu_write_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) | ||
| 324 | # endif | ||
| 325 | # ifndef this_cpu_write_4 | ||
| 326 | # define this_cpu_write_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) | ||
| 327 | # endif | ||
| 328 | # ifndef this_cpu_write_8 | ||
| 329 | # define this_cpu_write_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) | ||
| 330 | # endif | ||
| 331 | # define this_cpu_write(pcp, val) __pcpu_size_call(this_cpu_write_, (pcp), (val)) | ||
| 332 | #endif | ||
| 333 | |||
| 334 | #ifndef this_cpu_add | ||
| 335 | # ifndef this_cpu_add_1 | ||
| 336 | # define this_cpu_add_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) | ||
| 337 | # endif | ||
| 338 | # ifndef this_cpu_add_2 | ||
| 339 | # define this_cpu_add_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) | ||
| 340 | # endif | ||
| 341 | # ifndef this_cpu_add_4 | ||
| 342 | # define this_cpu_add_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) | ||
| 343 | # endif | ||
| 344 | # ifndef this_cpu_add_8 | ||
| 345 | # define this_cpu_add_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) | ||
| 346 | # endif | ||
| 347 | # define this_cpu_add(pcp, val) __pcpu_size_call(this_cpu_add_, (pcp), (val)) | ||
| 348 | #endif | ||
| 349 | |||
| 350 | #ifndef this_cpu_sub | ||
| 351 | # define this_cpu_sub(pcp, val) this_cpu_add((pcp), -(val)) | ||
| 352 | #endif | ||
| 353 | |||
| 354 | #ifndef this_cpu_inc | ||
| 355 | # define this_cpu_inc(pcp) this_cpu_add((pcp), 1) | ||
| 356 | #endif | ||
| 357 | |||
| 358 | #ifndef this_cpu_dec | ||
| 359 | # define this_cpu_dec(pcp) this_cpu_sub((pcp), 1) | ||
| 360 | #endif | ||
| 361 | |||
| 362 | #ifndef this_cpu_and | ||
| 363 | # ifndef this_cpu_and_1 | ||
| 364 | # define this_cpu_and_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) | ||
| 365 | # endif | ||
| 366 | # ifndef this_cpu_and_2 | ||
| 367 | # define this_cpu_and_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) | ||
| 368 | # endif | ||
| 369 | # ifndef this_cpu_and_4 | ||
| 370 | # define this_cpu_and_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) | ||
| 371 | # endif | ||
| 372 | # ifndef this_cpu_and_8 | ||
| 373 | # define this_cpu_and_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) | ||
| 374 | # endif | ||
| 375 | # define this_cpu_and(pcp, val) __pcpu_size_call(this_cpu_and_, (pcp), (val)) | ||
| 376 | #endif | ||
| 377 | |||
| 378 | #ifndef this_cpu_or | ||
| 379 | # ifndef this_cpu_or_1 | ||
| 380 | # define this_cpu_or_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) | ||
| 381 | # endif | ||
| 382 | # ifndef this_cpu_or_2 | ||
| 383 | # define this_cpu_or_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) | ||
| 384 | # endif | ||
| 385 | # ifndef this_cpu_or_4 | ||
| 386 | # define this_cpu_or_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) | ||
| 387 | # endif | ||
| 388 | # ifndef this_cpu_or_8 | ||
| 389 | # define this_cpu_or_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) | ||
| 390 | # endif | ||
| 391 | # define this_cpu_or(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) | ||
| 392 | #endif | ||
| 393 | |||
| 394 | #ifndef this_cpu_xor | ||
| 395 | # ifndef this_cpu_xor_1 | ||
| 396 | # define this_cpu_xor_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 397 | # endif | ||
| 398 | # ifndef this_cpu_xor_2 | ||
| 399 | # define this_cpu_xor_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 400 | # endif | ||
| 401 | # ifndef this_cpu_xor_4 | ||
| 402 | # define this_cpu_xor_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 403 | # endif | ||
| 404 | # ifndef this_cpu_xor_8 | ||
| 405 | # define this_cpu_xor_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 406 | # endif | ||
| 407 | # define this_cpu_xor(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) | ||
| 408 | #endif | ||
| 409 | |||
| 410 | /* | ||
| 411 | * Generic percpu operations that do not require preemption handling. | ||
| 412 | * Either we do not care about races or the caller has the | ||
| 413 | * responsibility of handling preemptions issues. Arch code can still | ||
| 414 | * override these instructions since the arch per cpu code may be more | ||
| 415 | * efficient and may actually get race freeness for free (that is the | ||
| 416 | * case for x86 for example). | ||
| 417 | * | ||
| 418 | * If there is no other protection through preempt disable and/or | ||
| 419 | * disabling interupts then one of these RMW operations can show unexpected | ||
| 420 | * behavior because the execution thread was rescheduled on another processor | ||
| 421 | * or an interrupt occurred and the same percpu variable was modified from | ||
| 422 | * the interrupt context. | ||
| 423 | */ | ||
| 424 | #ifndef __this_cpu_read | ||
| 425 | # ifndef __this_cpu_read_1 | ||
| 426 | # define __this_cpu_read_1(pcp) (*__this_cpu_ptr(&(pcp))) | ||
| 427 | # endif | ||
| 428 | # ifndef __this_cpu_read_2 | ||
| 429 | # define __this_cpu_read_2(pcp) (*__this_cpu_ptr(&(pcp))) | ||
| 430 | # endif | ||
| 431 | # ifndef __this_cpu_read_4 | ||
| 432 | # define __this_cpu_read_4(pcp) (*__this_cpu_ptr(&(pcp))) | ||
| 433 | # endif | ||
| 434 | # ifndef __this_cpu_read_8 | ||
| 435 | # define __this_cpu_read_8(pcp) (*__this_cpu_ptr(&(pcp))) | ||
| 436 | # endif | ||
| 437 | # define __this_cpu_read(pcp) __pcpu_size_call_return(__this_cpu_read_, (pcp)) | ||
| 438 | #endif | ||
| 439 | |||
| 440 | #define __this_cpu_generic_to_op(pcp, val, op) \ | ||
| 441 | do { \ | ||
| 442 | *__this_cpu_ptr(&(pcp)) op val; \ | ||
| 443 | } while (0) | ||
| 444 | |||
| 445 | #ifndef __this_cpu_write | ||
| 446 | # ifndef __this_cpu_write_1 | ||
| 447 | # define __this_cpu_write_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), =) | ||
| 448 | # endif | ||
| 449 | # ifndef __this_cpu_write_2 | ||
| 450 | # define __this_cpu_write_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), =) | ||
| 451 | # endif | ||
| 452 | # ifndef __this_cpu_write_4 | ||
| 453 | # define __this_cpu_write_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), =) | ||
| 454 | # endif | ||
| 455 | # ifndef __this_cpu_write_8 | ||
| 456 | # define __this_cpu_write_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), =) | ||
| 457 | # endif | ||
| 458 | # define __this_cpu_write(pcp, val) __pcpu_size_call(__this_cpu_write_, (pcp), (val)) | ||
| 459 | #endif | ||
| 460 | |||
| 461 | #ifndef __this_cpu_add | ||
| 462 | # ifndef __this_cpu_add_1 | ||
| 463 | # define __this_cpu_add_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=) | ||
| 464 | # endif | ||
| 465 | # ifndef __this_cpu_add_2 | ||
| 466 | # define __this_cpu_add_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=) | ||
| 467 | # endif | ||
| 468 | # ifndef __this_cpu_add_4 | ||
| 469 | # define __this_cpu_add_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=) | ||
| 470 | # endif | ||
| 471 | # ifndef __this_cpu_add_8 | ||
| 472 | # define __this_cpu_add_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=) | ||
| 473 | # endif | ||
| 474 | # define __this_cpu_add(pcp, val) __pcpu_size_call(__this_cpu_add_, (pcp), (val)) | ||
| 475 | #endif | ||
| 476 | |||
| 477 | #ifndef __this_cpu_sub | ||
| 478 | # define __this_cpu_sub(pcp, val) __this_cpu_add((pcp), -(val)) | ||
| 479 | #endif | ||
| 480 | |||
| 481 | #ifndef __this_cpu_inc | ||
| 482 | # define __this_cpu_inc(pcp) __this_cpu_add((pcp), 1) | ||
| 483 | #endif | ||
| 484 | |||
| 485 | #ifndef __this_cpu_dec | ||
| 486 | # define __this_cpu_dec(pcp) __this_cpu_sub((pcp), 1) | ||
| 487 | #endif | ||
| 488 | |||
| 489 | #ifndef __this_cpu_and | ||
| 490 | # ifndef __this_cpu_and_1 | ||
| 491 | # define __this_cpu_and_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=) | ||
| 492 | # endif | ||
| 493 | # ifndef __this_cpu_and_2 | ||
| 494 | # define __this_cpu_and_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=) | ||
| 495 | # endif | ||
| 496 | # ifndef __this_cpu_and_4 | ||
| 497 | # define __this_cpu_and_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=) | ||
| 498 | # endif | ||
| 499 | # ifndef __this_cpu_and_8 | ||
| 500 | # define __this_cpu_and_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=) | ||
| 501 | # endif | ||
| 502 | # define __this_cpu_and(pcp, val) __pcpu_size_call(__this_cpu_and_, (pcp), (val)) | ||
| 503 | #endif | ||
| 504 | |||
| 505 | #ifndef __this_cpu_or | ||
| 506 | # ifndef __this_cpu_or_1 | ||
| 507 | # define __this_cpu_or_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=) | ||
| 508 | # endif | ||
| 509 | # ifndef __this_cpu_or_2 | ||
| 510 | # define __this_cpu_or_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=) | ||
| 511 | # endif | ||
| 512 | # ifndef __this_cpu_or_4 | ||
| 513 | # define __this_cpu_or_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=) | ||
| 514 | # endif | ||
| 515 | # ifndef __this_cpu_or_8 | ||
| 516 | # define __this_cpu_or_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=) | ||
| 517 | # endif | ||
| 518 | # define __this_cpu_or(pcp, val) __pcpu_size_call(__this_cpu_or_, (pcp), (val)) | ||
| 519 | #endif | ||
| 520 | |||
| 521 | #ifndef __this_cpu_xor | ||
| 522 | # ifndef __this_cpu_xor_1 | ||
| 523 | # define __this_cpu_xor_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 524 | # endif | ||
| 525 | # ifndef __this_cpu_xor_2 | ||
| 526 | # define __this_cpu_xor_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 527 | # endif | ||
| 528 | # ifndef __this_cpu_xor_4 | ||
| 529 | # define __this_cpu_xor_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 530 | # endif | ||
| 531 | # ifndef __this_cpu_xor_8 | ||
| 532 | # define __this_cpu_xor_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 533 | # endif | ||
| 534 | # define __this_cpu_xor(pcp, val) __pcpu_size_call(__this_cpu_xor_, (pcp), (val)) | ||
| 535 | #endif | ||
| 536 | |||
| 537 | /* | ||
| 538 | * IRQ safe versions of the per cpu RMW operations. Note that these operations | ||
| 539 | * are *not* safe against modification of the same variable from another | ||
| 540 | * processors (which one gets when using regular atomic operations) | ||
| 541 | . They are guaranteed to be atomic vs. local interrupts and | ||
| 542 | * preemption only. | ||
| 543 | */ | ||
| 544 | #define irqsafe_cpu_generic_to_op(pcp, val, op) \ | ||
| 545 | do { \ | ||
| 546 | unsigned long flags; \ | ||
| 547 | local_irq_save(flags); \ | ||
| 548 | *__this_cpu_ptr(&(pcp)) op val; \ | ||
| 549 | local_irq_restore(flags); \ | ||
| 550 | } while (0) | ||
| 551 | |||
| 552 | #ifndef irqsafe_cpu_add | ||
| 553 | # ifndef irqsafe_cpu_add_1 | ||
| 554 | # define irqsafe_cpu_add_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=) | ||
| 555 | # endif | ||
| 556 | # ifndef irqsafe_cpu_add_2 | ||
| 557 | # define irqsafe_cpu_add_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=) | ||
| 558 | # endif | ||
| 559 | # ifndef irqsafe_cpu_add_4 | ||
| 560 | # define irqsafe_cpu_add_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=) | ||
| 561 | # endif | ||
| 562 | # ifndef irqsafe_cpu_add_8 | ||
| 563 | # define irqsafe_cpu_add_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=) | ||
| 564 | # endif | ||
| 565 | # define irqsafe_cpu_add(pcp, val) __pcpu_size_call(irqsafe_cpu_add_, (pcp), (val)) | ||
| 566 | #endif | ||
| 567 | |||
| 568 | #ifndef irqsafe_cpu_sub | ||
| 569 | # define irqsafe_cpu_sub(pcp, val) irqsafe_cpu_add((pcp), -(val)) | ||
| 570 | #endif | ||
| 571 | |||
| 572 | #ifndef irqsafe_cpu_inc | ||
| 573 | # define irqsafe_cpu_inc(pcp) irqsafe_cpu_add((pcp), 1) | ||
| 574 | #endif | ||
| 575 | |||
| 576 | #ifndef irqsafe_cpu_dec | ||
| 577 | # define irqsafe_cpu_dec(pcp) irqsafe_cpu_sub((pcp), 1) | ||
| 578 | #endif | ||
| 579 | |||
| 580 | #ifndef irqsafe_cpu_and | ||
| 581 | # ifndef irqsafe_cpu_and_1 | ||
| 582 | # define irqsafe_cpu_and_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=) | ||
| 583 | # endif | ||
| 584 | # ifndef irqsafe_cpu_and_2 | ||
| 585 | # define irqsafe_cpu_and_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=) | ||
| 586 | # endif | ||
| 587 | # ifndef irqsafe_cpu_and_4 | ||
| 588 | # define irqsafe_cpu_and_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=) | ||
| 589 | # endif | ||
| 590 | # ifndef irqsafe_cpu_and_8 | ||
| 591 | # define irqsafe_cpu_and_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=) | ||
| 592 | # endif | ||
| 593 | # define irqsafe_cpu_and(pcp, val) __pcpu_size_call(irqsafe_cpu_and_, (val)) | ||
| 594 | #endif | ||
| 595 | |||
| 596 | #ifndef irqsafe_cpu_or | ||
| 597 | # ifndef irqsafe_cpu_or_1 | ||
| 598 | # define irqsafe_cpu_or_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=) | ||
| 599 | # endif | ||
| 600 | # ifndef irqsafe_cpu_or_2 | ||
| 601 | # define irqsafe_cpu_or_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=) | ||
| 602 | # endif | ||
| 603 | # ifndef irqsafe_cpu_or_4 | ||
| 604 | # define irqsafe_cpu_or_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=) | ||
| 605 | # endif | ||
| 606 | # ifndef irqsafe_cpu_or_8 | ||
| 607 | # define irqsafe_cpu_or_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=) | ||
| 608 | # endif | ||
| 609 | # define irqsafe_cpu_or(pcp, val) __pcpu_size_call(irqsafe_cpu_or_, (val)) | ||
| 610 | #endif | ||
| 611 | |||
| 612 | #ifndef irqsafe_cpu_xor | ||
| 613 | # ifndef irqsafe_cpu_xor_1 | ||
| 614 | # define irqsafe_cpu_xor_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=) | ||
| 615 | # endif | ||
| 616 | # ifndef irqsafe_cpu_xor_2 | ||
| 617 | # define irqsafe_cpu_xor_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=) | ||
| 618 | # endif | ||
| 619 | # ifndef irqsafe_cpu_xor_4 | ||
| 620 | # define irqsafe_cpu_xor_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=) | ||
| 621 | # endif | ||
| 622 | # ifndef irqsafe_cpu_xor_8 | ||
| 623 | # define irqsafe_cpu_xor_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=) | ||
| 624 | # endif | ||
| 625 | # define irqsafe_cpu_xor(pcp, val) __pcpu_size_call(irqsafe_cpu_xor_, (val)) | ||
| 626 | #endif | ||
| 627 | |||
| 246 | #endif /* __LINUX_PERCPU_H */ | 628 | #endif /* __LINUX_PERCPU_H */ |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 43adbd7f0010..da7bdc23f279 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -18,10 +18,6 @@ | |||
| 18 | #include <linux/ioctl.h> | 18 | #include <linux/ioctl.h> |
| 19 | #include <asm/byteorder.h> | 19 | #include <asm/byteorder.h> |
| 20 | 20 | ||
| 21 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
| 22 | #include <asm/hw_breakpoint.h> | ||
| 23 | #endif | ||
| 24 | |||
| 25 | /* | 21 | /* |
| 26 | * User-space ABI bits: | 22 | * User-space ABI bits: |
| 27 | */ | 23 | */ |
| @@ -215,12 +211,12 @@ struct perf_event_attr { | |||
| 215 | __u32 wakeup_watermark; /* bytes before wakeup */ | 211 | __u32 wakeup_watermark; /* bytes before wakeup */ |
| 216 | }; | 212 | }; |
| 217 | 213 | ||
| 218 | union { | 214 | struct { /* Hardware breakpoint info */ |
| 219 | struct { /* Hardware breakpoint info */ | 215 | __u64 bp_addr; |
| 220 | __u64 bp_addr; | 216 | __u32 bp_type; |
| 221 | __u32 bp_type; | 217 | __u32 bp_len; |
| 222 | __u32 bp_len; | 218 | __u64 __bp_reserved_1; |
| 223 | }; | 219 | __u64 __bp_reserved_2; |
| 224 | }; | 220 | }; |
| 225 | 221 | ||
| 226 | __u32 __reserved_2; | 222 | __u32 __reserved_2; |
| @@ -451,6 +447,10 @@ enum perf_callchain_context { | |||
| 451 | # include <asm/perf_event.h> | 447 | # include <asm/perf_event.h> |
| 452 | #endif | 448 | #endif |
| 453 | 449 | ||
| 450 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
| 451 | #include <asm/hw_breakpoint.h> | ||
| 452 | #endif | ||
| 453 | |||
| 454 | #include <linux/list.h> | 454 | #include <linux/list.h> |
| 455 | #include <linux/mutex.h> | 455 | #include <linux/mutex.h> |
| 456 | #include <linux/rculist.h> | 456 | #include <linux/rculist.h> |
| @@ -565,10 +565,12 @@ struct perf_pending_entry { | |||
| 565 | void (*func)(struct perf_pending_entry *); | 565 | void (*func)(struct perf_pending_entry *); |
| 566 | }; | 566 | }; |
| 567 | 567 | ||
| 568 | typedef void (*perf_callback_t)(struct perf_event *, void *); | ||
| 569 | |||
| 570 | struct perf_sample_data; | 568 | struct perf_sample_data; |
| 571 | 569 | ||
| 570 | typedef void (*perf_overflow_handler_t)(struct perf_event *, int, | ||
| 571 | struct perf_sample_data *, | ||
| 572 | struct pt_regs *regs); | ||
| 573 | |||
| 572 | /** | 574 | /** |
| 573 | * struct perf_event - performance event kernel representation: | 575 | * struct perf_event - performance event kernel representation: |
| 574 | */ | 576 | */ |
| @@ -660,18 +662,12 @@ struct perf_event { | |||
| 660 | struct pid_namespace *ns; | 662 | struct pid_namespace *ns; |
| 661 | u64 id; | 663 | u64 id; |
| 662 | 664 | ||
| 663 | void (*overflow_handler)(struct perf_event *event, | 665 | perf_overflow_handler_t overflow_handler; |
| 664 | int nmi, struct perf_sample_data *data, | ||
| 665 | struct pt_regs *regs); | ||
| 666 | 666 | ||
| 667 | #ifdef CONFIG_EVENT_PROFILE | 667 | #ifdef CONFIG_EVENT_PROFILE |
| 668 | struct event_filter *filter; | 668 | struct event_filter *filter; |
| 669 | #endif | 669 | #endif |
| 670 | 670 | ||
| 671 | perf_callback_t callback; | ||
| 672 | |||
| 673 | perf_callback_t event_callback; | ||
| 674 | |||
| 675 | #endif /* CONFIG_PERF_EVENTS */ | 671 | #endif /* CONFIG_PERF_EVENTS */ |
| 676 | }; | 672 | }; |
| 677 | 673 | ||
| @@ -685,7 +681,7 @@ struct perf_event_context { | |||
| 685 | * Protect the states of the events in the list, | 681 | * Protect the states of the events in the list, |
| 686 | * nr_active, and the list: | 682 | * nr_active, and the list: |
| 687 | */ | 683 | */ |
| 688 | spinlock_t lock; | 684 | raw_spinlock_t lock; |
| 689 | /* | 685 | /* |
| 690 | * Protect the list of events. Locking either mutex or lock | 686 | * Protect the list of events. Locking either mutex or lock |
| 691 | * is sufficient to ensure the list doesn't change; to change | 687 | * is sufficient to ensure the list doesn't change; to change |
| @@ -781,7 +777,7 @@ extern struct perf_event * | |||
| 781 | perf_event_create_kernel_counter(struct perf_event_attr *attr, | 777 | perf_event_create_kernel_counter(struct perf_event_attr *attr, |
| 782 | int cpu, | 778 | int cpu, |
| 783 | pid_t pid, | 779 | pid_t pid, |
| 784 | perf_callback_t callback); | 780 | perf_overflow_handler_t callback); |
| 785 | extern u64 perf_event_read_value(struct perf_event *event, | 781 | extern u64 perf_event_read_value(struct perf_event *event, |
| 786 | u64 *enabled, u64 *running); | 782 | u64 *enabled, u64 *running); |
| 787 | 783 | ||
| @@ -876,6 +872,8 @@ extern void perf_output_copy(struct perf_output_handle *handle, | |||
| 876 | const void *buf, unsigned int len); | 872 | const void *buf, unsigned int len); |
| 877 | extern int perf_swevent_get_recursion_context(void); | 873 | extern int perf_swevent_get_recursion_context(void); |
| 878 | extern void perf_swevent_put_recursion_context(int rctx); | 874 | extern void perf_swevent_put_recursion_context(int rctx); |
| 875 | extern void perf_event_enable(struct perf_event *event); | ||
| 876 | extern void perf_event_disable(struct perf_event *event); | ||
| 879 | #else | 877 | #else |
| 880 | static inline void | 878 | static inline void |
| 881 | perf_event_task_sched_in(struct task_struct *task, int cpu) { } | 879 | perf_event_task_sched_in(struct task_struct *task, int cpu) { } |
| @@ -906,7 +904,8 @@ static inline void perf_event_fork(struct task_struct *tsk) { } | |||
| 906 | static inline void perf_event_init(void) { } | 904 | static inline void perf_event_init(void) { } |
| 907 | static inline int perf_swevent_get_recursion_context(void) { return -1; } | 905 | static inline int perf_swevent_get_recursion_context(void) { return -1; } |
| 908 | static inline void perf_swevent_put_recursion_context(int rctx) { } | 906 | static inline void perf_swevent_put_recursion_context(int rctx) { } |
| 909 | 907 | static inline void perf_event_enable(struct perf_event *event) { } | |
| 908 | static inline void perf_event_disable(struct perf_event *event) { } | ||
| 910 | #endif | 909 | #endif |
| 911 | 910 | ||
| 912 | #define perf_output_put(handle, x) \ | 911 | #define perf_output_put(handle, x) \ |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 3c6675c2444b..71ff887ca44e 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -83,6 +83,8 @@ struct early_platform_driver { | |||
| 83 | struct platform_driver *pdrv; | 83 | struct platform_driver *pdrv; |
| 84 | struct list_head list; | 84 | struct list_head list; |
| 85 | int requested_id; | 85 | int requested_id; |
| 86 | char *buffer; | ||
| 87 | int bufsize; | ||
| 86 | }; | 88 | }; |
| 87 | 89 | ||
| 88 | #define EARLY_PLATFORM_ID_UNSET -2 | 90 | #define EARLY_PLATFORM_ID_UNSET -2 |
| @@ -102,21 +104,29 @@ extern int early_platform_driver_probe(char *class_str, | |||
| 102 | int nr_probe, int user_only); | 104 | int nr_probe, int user_only); |
| 103 | extern void early_platform_cleanup(void); | 105 | extern void early_platform_cleanup(void); |
| 104 | 106 | ||
| 107 | #define early_platform_init(class_string, platdrv) \ | ||
| 108 | early_platform_init_buffer(class_string, platdrv, NULL, 0) | ||
| 105 | 109 | ||
| 106 | #ifndef MODULE | 110 | #ifndef MODULE |
| 107 | #define early_platform_init(class_string, platform_driver) \ | 111 | #define early_platform_init_buffer(class_string, platdrv, buf, bufsiz) \ |
| 108 | static __initdata struct early_platform_driver early_driver = { \ | 112 | static __initdata struct early_platform_driver early_driver = { \ |
| 109 | .class_str = class_string, \ | 113 | .class_str = class_string, \ |
| 110 | .pdrv = platform_driver, \ | 114 | .buffer = buf, \ |
| 115 | .bufsize = bufsiz, \ | ||
| 116 | .pdrv = platdrv, \ | ||
| 111 | .requested_id = EARLY_PLATFORM_ID_UNSET, \ | 117 | .requested_id = EARLY_PLATFORM_ID_UNSET, \ |
| 112 | }; \ | 118 | }; \ |
| 113 | static int __init early_platform_driver_setup_func(char *buf) \ | 119 | static int __init early_platform_driver_setup_func(char *buffer) \ |
| 114 | { \ | 120 | { \ |
| 115 | return early_platform_driver_register(&early_driver, buf); \ | 121 | return early_platform_driver_register(&early_driver, buffer); \ |
| 116 | } \ | 122 | } \ |
| 117 | early_param(class_string, early_platform_driver_setup_func) | 123 | early_param(class_string, early_platform_driver_setup_func) |
| 118 | #else /* MODULE */ | 124 | #else /* MODULE */ |
| 119 | #define early_platform_init(class_string, platform_driver) | 125 | #define early_platform_init_buffer(class_string, platdrv, buf, bufsiz) \ |
| 126 | static inline char *early_platform_driver_setup_func(void) \ | ||
| 127 | { \ | ||
| 128 | return bufsiz ? buf : NULL; \ | ||
| 129 | } | ||
| 120 | #endif /* MODULE */ | 130 | #endif /* MODULE */ |
| 121 | 131 | ||
| 122 | #endif /* _PLATFORM_DEVICE_H_ */ | 132 | #endif /* _PLATFORM_DEVICE_H_ */ |
diff --git a/include/linux/plist.h b/include/linux/plist.h index 45926d77d6ac..8227f717c70f 100644 --- a/include/linux/plist.h +++ b/include/linux/plist.h | |||
| @@ -81,7 +81,8 @@ struct plist_head { | |||
| 81 | struct list_head prio_list; | 81 | struct list_head prio_list; |
| 82 | struct list_head node_list; | 82 | struct list_head node_list; |
| 83 | #ifdef CONFIG_DEBUG_PI_LIST | 83 | #ifdef CONFIG_DEBUG_PI_LIST |
| 84 | spinlock_t *lock; | 84 | raw_spinlock_t *rawlock; |
| 85 | spinlock_t *spinlock; | ||
| 85 | #endif | 86 | #endif |
| 86 | }; | 87 | }; |
| 87 | 88 | ||
| @@ -91,9 +92,11 @@ struct plist_node { | |||
| 91 | }; | 92 | }; |
| 92 | 93 | ||
| 93 | #ifdef CONFIG_DEBUG_PI_LIST | 94 | #ifdef CONFIG_DEBUG_PI_LIST |
| 94 | # define PLIST_HEAD_LOCK_INIT(_lock) .lock = _lock | 95 | # define PLIST_HEAD_LOCK_INIT(_lock) .spinlock = _lock |
| 96 | # define PLIST_HEAD_LOCK_INIT_RAW(_lock) .rawlock = _lock | ||
| 95 | #else | 97 | #else |
| 96 | # define PLIST_HEAD_LOCK_INIT(_lock) | 98 | # define PLIST_HEAD_LOCK_INIT(_lock) |
| 99 | # define PLIST_HEAD_LOCK_INIT_RAW(_lock) | ||
| 97 | #endif | 100 | #endif |
| 98 | 101 | ||
| 99 | #define _PLIST_HEAD_INIT(head) \ | 102 | #define _PLIST_HEAD_INIT(head) \ |
| @@ -107,11 +110,22 @@ struct plist_node { | |||
| 107 | */ | 110 | */ |
| 108 | #define PLIST_HEAD_INIT(head, _lock) \ | 111 | #define PLIST_HEAD_INIT(head, _lock) \ |
| 109 | { \ | 112 | { \ |
| 110 | _PLIST_HEAD_INIT(head), \ | 113 | _PLIST_HEAD_INIT(head), \ |
| 111 | PLIST_HEAD_LOCK_INIT(&(_lock)) \ | 114 | PLIST_HEAD_LOCK_INIT(&(_lock)) \ |
| 112 | } | 115 | } |
| 113 | 116 | ||
| 114 | /** | 117 | /** |
| 118 | * PLIST_HEAD_INIT_RAW - static struct plist_head initializer | ||
| 119 | * @head: struct plist_head variable name | ||
| 120 | * @_lock: lock to initialize for this list | ||
| 121 | */ | ||
| 122 | #define PLIST_HEAD_INIT_RAW(head, _lock) \ | ||
| 123 | { \ | ||
| 124 | _PLIST_HEAD_INIT(head), \ | ||
| 125 | PLIST_HEAD_LOCK_INIT_RAW(&(_lock)) \ | ||
| 126 | } | ||
| 127 | |||
| 128 | /** | ||
| 115 | * PLIST_NODE_INIT - static struct plist_node initializer | 129 | * PLIST_NODE_INIT - static struct plist_node initializer |
| 116 | * @node: struct plist_node variable name | 130 | * @node: struct plist_node variable name |
| 117 | * @__prio: initial node priority | 131 | * @__prio: initial node priority |
| @@ -119,13 +133,13 @@ struct plist_node { | |||
| 119 | #define PLIST_NODE_INIT(node, __prio) \ | 133 | #define PLIST_NODE_INIT(node, __prio) \ |
| 120 | { \ | 134 | { \ |
| 121 | .prio = (__prio), \ | 135 | .prio = (__prio), \ |
| 122 | .plist = { _PLIST_HEAD_INIT((node).plist) }, \ | 136 | .plist = { _PLIST_HEAD_INIT((node).plist) }, \ |
| 123 | } | 137 | } |
| 124 | 138 | ||
| 125 | /** | 139 | /** |
| 126 | * plist_head_init - dynamic struct plist_head initializer | 140 | * plist_head_init - dynamic struct plist_head initializer |
| 127 | * @head: &struct plist_head pointer | 141 | * @head: &struct plist_head pointer |
| 128 | * @lock: list spinlock, remembered for debugging | 142 | * @lock: spinlock protecting the list (debugging) |
| 129 | */ | 143 | */ |
| 130 | static inline void | 144 | static inline void |
| 131 | plist_head_init(struct plist_head *head, spinlock_t *lock) | 145 | plist_head_init(struct plist_head *head, spinlock_t *lock) |
| @@ -133,7 +147,24 @@ plist_head_init(struct plist_head *head, spinlock_t *lock) | |||
| 133 | INIT_LIST_HEAD(&head->prio_list); | 147 | INIT_LIST_HEAD(&head->prio_list); |
| 134 | INIT_LIST_HEAD(&head->node_list); | 148 | INIT_LIST_HEAD(&head->node_list); |
| 135 | #ifdef CONFIG_DEBUG_PI_LIST | 149 | #ifdef CONFIG_DEBUG_PI_LIST |
| 136 | head->lock = lock; | 150 | head->spinlock = lock; |
| 151 | head->rawlock = NULL; | ||
| 152 | #endif | ||
| 153 | } | ||
| 154 | |||
| 155 | /** | ||
| 156 | * plist_head_init_raw - dynamic struct plist_head initializer | ||
| 157 | * @head: &struct plist_head pointer | ||
| 158 | * @lock: raw_spinlock protecting the list (debugging) | ||
| 159 | */ | ||
| 160 | static inline void | ||
| 161 | plist_head_init_raw(struct plist_head *head, raw_spinlock_t *lock) | ||
| 162 | { | ||
| 163 | INIT_LIST_HEAD(&head->prio_list); | ||
| 164 | INIT_LIST_HEAD(&head->node_list); | ||
| 165 | #ifdef CONFIG_DEBUG_PI_LIST | ||
| 166 | head->rawlock = lock; | ||
| 167 | head->spinlock = NULL; | ||
| 137 | #endif | 168 | #endif |
| 138 | } | 169 | } |
| 139 | 170 | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 0d65934246af..198b8f9fe05e 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -219,7 +219,7 @@ struct dev_pm_ops { | |||
| 219 | * to RAM and hibernation. | 219 | * to RAM and hibernation. |
| 220 | */ | 220 | */ |
| 221 | #define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ | 221 | #define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ |
| 222 | struct dev_pm_ops name = { \ | 222 | const struct dev_pm_ops name = { \ |
| 223 | .suspend = suspend_fn, \ | 223 | .suspend = suspend_fn, \ |
| 224 | .resume = resume_fn, \ | 224 | .resume = resume_fn, \ |
| 225 | .freeze = suspend_fn, \ | 225 | .freeze = suspend_fn, \ |
diff --git a/include/linux/quota.h b/include/linux/quota.h index ce9a9b2e5cd4..e70e62194243 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
| @@ -73,6 +73,8 @@ | |||
| 73 | /* Quota format type IDs */ | 73 | /* Quota format type IDs */ |
| 74 | #define QFMT_VFS_OLD 1 | 74 | #define QFMT_VFS_OLD 1 |
| 75 | #define QFMT_VFS_V0 2 | 75 | #define QFMT_VFS_V0 2 |
| 76 | #define QFMT_OCFS2 3 | ||
| 77 | #define QFMT_VFS_V1 4 | ||
| 76 | 78 | ||
| 77 | /* Size of block in which space limits are passed through the quota | 79 | /* Size of block in which space limits are passed through the quota |
| 78 | * interface */ | 80 | * interface */ |
| @@ -334,7 +336,7 @@ struct quotactl_ops { | |||
| 334 | 336 | ||
| 335 | struct quota_format_type { | 337 | struct quota_format_type { |
| 336 | int qf_fmt_id; /* Quota format id */ | 338 | int qf_fmt_id; /* Quota format id */ |
| 337 | struct quota_format_ops *qf_ops; /* Operations of format */ | 339 | const struct quota_format_ops *qf_ops; /* Operations of format */ |
| 338 | struct module *qf_owner; /* Module implementing quota format */ | 340 | struct module *qf_owner; /* Module implementing quota format */ |
| 339 | struct quota_format_type *qf_next; | 341 | struct quota_format_type *qf_next; |
| 340 | }; | 342 | }; |
| @@ -394,7 +396,7 @@ struct quota_info { | |||
| 394 | struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */ | 396 | struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */ |
| 395 | struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */ | 397 | struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */ |
| 396 | struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ | 398 | struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ |
| 397 | struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ | 399 | const struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ |
| 398 | }; | 400 | }; |
| 399 | 401 | ||
| 400 | int register_quota_format(struct quota_format_type *fmt); | 402 | int register_quota_format(struct quota_format_type *fmt); |
diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h index d92480f8285c..1cbbd2c11aa9 100644 --- a/include/linux/raid/pq.h +++ b/include/linux/raid/pq.h | |||
| @@ -78,6 +78,25 @@ struct raid6_calls { | |||
| 78 | /* Selected algorithm */ | 78 | /* Selected algorithm */ |
| 79 | extern struct raid6_calls raid6_call; | 79 | extern struct raid6_calls raid6_call; |
| 80 | 80 | ||
| 81 | /* Various routine sets */ | ||
| 82 | extern const struct raid6_calls raid6_intx1; | ||
| 83 | extern const struct raid6_calls raid6_intx2; | ||
| 84 | extern const struct raid6_calls raid6_intx4; | ||
| 85 | extern const struct raid6_calls raid6_intx8; | ||
| 86 | extern const struct raid6_calls raid6_intx16; | ||
| 87 | extern const struct raid6_calls raid6_intx32; | ||
| 88 | extern const struct raid6_calls raid6_mmxx1; | ||
| 89 | extern const struct raid6_calls raid6_mmxx2; | ||
| 90 | extern const struct raid6_calls raid6_sse1x1; | ||
| 91 | extern const struct raid6_calls raid6_sse1x2; | ||
| 92 | extern const struct raid6_calls raid6_sse2x1; | ||
| 93 | extern const struct raid6_calls raid6_sse2x2; | ||
| 94 | extern const struct raid6_calls raid6_sse2x4; | ||
| 95 | extern const struct raid6_calls raid6_altivec1; | ||
| 96 | extern const struct raid6_calls raid6_altivec2; | ||
| 97 | extern const struct raid6_calls raid6_altivec4; | ||
| 98 | extern const struct raid6_calls raid6_altivec8; | ||
| 99 | |||
| 81 | /* Algorithm list */ | 100 | /* Algorithm list */ |
| 82 | extern const struct raid6_calls * const raid6_algos[]; | 101 | extern const struct raid6_calls * const raid6_algos[]; |
| 83 | int raid6_select_algo(void); | 102 | int raid6_select_algo(void); |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index cb0ba7032609..b019ae64e2ab 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
| @@ -26,6 +26,9 @@ | |||
| 26 | */ | 26 | */ |
| 27 | struct anon_vma { | 27 | struct anon_vma { |
| 28 | spinlock_t lock; /* Serialize access to vma list */ | 28 | spinlock_t lock; /* Serialize access to vma list */ |
| 29 | #ifdef CONFIG_KSM | ||
| 30 | atomic_t ksm_refcount; | ||
| 31 | #endif | ||
| 29 | /* | 32 | /* |
| 30 | * NOTE: the LSB of the head.next is set by | 33 | * NOTE: the LSB of the head.next is set by |
| 31 | * mm_take_all_locks() _after_ taking the above lock. So the | 34 | * mm_take_all_locks() _after_ taking the above lock. So the |
| @@ -38,6 +41,34 @@ struct anon_vma { | |||
| 38 | }; | 41 | }; |
| 39 | 42 | ||
| 40 | #ifdef CONFIG_MMU | 43 | #ifdef CONFIG_MMU |
| 44 | #ifdef CONFIG_KSM | ||
| 45 | static inline void ksm_refcount_init(struct anon_vma *anon_vma) | ||
| 46 | { | ||
| 47 | atomic_set(&anon_vma->ksm_refcount, 0); | ||
| 48 | } | ||
| 49 | |||
| 50 | static inline int ksm_refcount(struct anon_vma *anon_vma) | ||
| 51 | { | ||
| 52 | return atomic_read(&anon_vma->ksm_refcount); | ||
| 53 | } | ||
| 54 | #else | ||
| 55 | static inline void ksm_refcount_init(struct anon_vma *anon_vma) | ||
| 56 | { | ||
| 57 | } | ||
| 58 | |||
| 59 | static inline int ksm_refcount(struct anon_vma *anon_vma) | ||
| 60 | { | ||
| 61 | return 0; | ||
| 62 | } | ||
| 63 | #endif /* CONFIG_KSM */ | ||
| 64 | |||
| 65 | static inline struct anon_vma *page_anon_vma(struct page *page) | ||
| 66 | { | ||
| 67 | if (((unsigned long)page->mapping & PAGE_MAPPING_FLAGS) != | ||
| 68 | PAGE_MAPPING_ANON) | ||
| 69 | return NULL; | ||
| 70 | return page_rmapping(page); | ||
| 71 | } | ||
| 41 | 72 | ||
| 42 | static inline void anon_vma_lock(struct vm_area_struct *vma) | 73 | static inline void anon_vma_lock(struct vm_area_struct *vma) |
| 43 | { | 74 | { |
| @@ -62,6 +93,7 @@ void __anon_vma_merge(struct vm_area_struct *, struct vm_area_struct *); | |||
| 62 | void anon_vma_unlink(struct vm_area_struct *); | 93 | void anon_vma_unlink(struct vm_area_struct *); |
| 63 | void anon_vma_link(struct vm_area_struct *); | 94 | void anon_vma_link(struct vm_area_struct *); |
| 64 | void __anon_vma_link(struct vm_area_struct *); | 95 | void __anon_vma_link(struct vm_area_struct *); |
| 96 | void anon_vma_free(struct anon_vma *); | ||
| 65 | 97 | ||
| 66 | /* | 98 | /* |
| 67 | * rmap interfaces called when adding or removing pte of page | 99 | * rmap interfaces called when adding or removing pte of page |
| @@ -81,6 +113,9 @@ static inline void page_dup_rmap(struct page *page) | |||
| 81 | */ | 113 | */ |
| 82 | int page_referenced(struct page *, int is_locked, | 114 | int page_referenced(struct page *, int is_locked, |
| 83 | struct mem_cgroup *cnt, unsigned long *vm_flags); | 115 | struct mem_cgroup *cnt, unsigned long *vm_flags); |
| 116 | int page_referenced_one(struct page *, struct vm_area_struct *, | ||
| 117 | unsigned long address, unsigned int *mapcount, unsigned long *vm_flags); | ||
| 118 | |||
| 84 | enum ttu_flags { | 119 | enum ttu_flags { |
| 85 | TTU_UNMAP = 0, /* unmap mode */ | 120 | TTU_UNMAP = 0, /* unmap mode */ |
| 86 | TTU_MIGRATION = 1, /* migration mode */ | 121 | TTU_MIGRATION = 1, /* migration mode */ |
| @@ -94,6 +129,8 @@ enum ttu_flags { | |||
| 94 | #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) | 129 | #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) |
| 95 | 130 | ||
| 96 | int try_to_unmap(struct page *, enum ttu_flags flags); | 131 | int try_to_unmap(struct page *, enum ttu_flags flags); |
| 132 | int try_to_unmap_one(struct page *, struct vm_area_struct *, | ||
| 133 | unsigned long address, enum ttu_flags flags); | ||
| 97 | 134 | ||
| 98 | /* | 135 | /* |
| 99 | * Called from mm/filemap_xip.c to unmap empty zero page | 136 | * Called from mm/filemap_xip.c to unmap empty zero page |
| @@ -127,6 +164,12 @@ struct anon_vma *page_lock_anon_vma(struct page *page); | |||
| 127 | void page_unlock_anon_vma(struct anon_vma *anon_vma); | 164 | void page_unlock_anon_vma(struct anon_vma *anon_vma); |
| 128 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); | 165 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); |
| 129 | 166 | ||
| 167 | /* | ||
| 168 | * Called by migrate.c to remove migration ptes, but might be used more later. | ||
| 169 | */ | ||
| 170 | int rmap_walk(struct page *page, int (*rmap_one)(struct page *, | ||
| 171 | struct vm_area_struct *, unsigned long, void *), void *arg); | ||
| 172 | |||
| 130 | #else /* !CONFIG_MMU */ | 173 | #else /* !CONFIG_MMU */ |
| 131 | 174 | ||
| 132 | #define anon_vma_init() do {} while (0) | 175 | #define anon_vma_init() do {} while (0) |
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h index f19b00b7d530..281d8fd775e8 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | * @owner: the mutex owner | 24 | * @owner: the mutex owner |
| 25 | */ | 25 | */ |
| 26 | struct rt_mutex { | 26 | struct rt_mutex { |
| 27 | spinlock_t wait_lock; | 27 | raw_spinlock_t wait_lock; |
| 28 | struct plist_head wait_list; | 28 | struct plist_head wait_list; |
| 29 | struct task_struct *owner; | 29 | struct task_struct *owner; |
| 30 | #ifdef CONFIG_DEBUG_RT_MUTEXES | 30 | #ifdef CONFIG_DEBUG_RT_MUTEXES |
| @@ -63,8 +63,8 @@ struct hrtimer_sleeper; | |||
| 63 | #endif | 63 | #endif |
| 64 | 64 | ||
| 65 | #define __RT_MUTEX_INITIALIZER(mutexname) \ | 65 | #define __RT_MUTEX_INITIALIZER(mutexname) \ |
| 66 | { .wait_lock = __SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ | 66 | { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ |
| 67 | , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list, mutexname.wait_lock) \ | 67 | , .wait_list = PLIST_HEAD_INIT_RAW(mutexname.wait_list, mutexname.wait_lock) \ |
| 68 | , .owner = NULL \ | 68 | , .owner = NULL \ |
| 69 | __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} | 69 | __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} |
| 70 | 70 | ||
diff --git a/include/linux/rwlock.h b/include/linux/rwlock.h new file mode 100644 index 000000000000..71e0b00b6f2c --- /dev/null +++ b/include/linux/rwlock.h | |||
| @@ -0,0 +1,125 @@ | |||
| 1 | #ifndef __LINUX_RWLOCK_H | ||
| 2 | #define __LINUX_RWLOCK_H | ||
| 3 | |||
| 4 | #ifndef __LINUX_SPINLOCK_H | ||
| 5 | # error "please don't include this file directly" | ||
| 6 | #endif | ||
| 7 | |||
| 8 | /* | ||
| 9 | * rwlock related methods | ||
| 10 | * | ||
| 11 | * split out from spinlock.h | ||
| 12 | * | ||
| 13 | * portions Copyright 2005, Red Hat, Inc., Ingo Molnar | ||
| 14 | * Released under the General Public License (GPL). | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifdef CONFIG_DEBUG_SPINLOCK | ||
| 18 | extern void __rwlock_init(rwlock_t *lock, const char *name, | ||
| 19 | struct lock_class_key *key); | ||
| 20 | # define rwlock_init(lock) \ | ||
| 21 | do { \ | ||
| 22 | static struct lock_class_key __key; \ | ||
| 23 | \ | ||
| 24 | __rwlock_init((lock), #lock, &__key); \ | ||
| 25 | } while (0) | ||
| 26 | #else | ||
| 27 | # define rwlock_init(lock) \ | ||
| 28 | do { *(lock) = __RW_LOCK_UNLOCKED(lock); } while (0) | ||
| 29 | #endif | ||
| 30 | |||
| 31 | #ifdef CONFIG_DEBUG_SPINLOCK | ||
| 32 | extern void do_raw_read_lock(rwlock_t *lock); | ||
| 33 | #define do_raw_read_lock_flags(lock, flags) do_raw_read_lock(lock) | ||
| 34 | extern int do_raw_read_trylock(rwlock_t *lock); | ||
| 35 | extern void do_raw_read_unlock(rwlock_t *lock); | ||
| 36 | extern void do_raw_write_lock(rwlock_t *lock); | ||
| 37 | #define do_raw_write_lock_flags(lock, flags) do_raw_write_lock(lock) | ||
| 38 | extern int do_raw_write_trylock(rwlock_t *lock); | ||
| 39 | extern void do_raw_write_unlock(rwlock_t *lock); | ||
| 40 | #else | ||
| 41 | # define do_raw_read_lock(rwlock) arch_read_lock(&(rwlock)->raw_lock) | ||
| 42 | # define do_raw_read_lock_flags(lock, flags) \ | ||
| 43 | arch_read_lock_flags(&(lock)->raw_lock, *(flags)) | ||
| 44 | # define do_raw_read_trylock(rwlock) arch_read_trylock(&(rwlock)->raw_lock) | ||
| 45 | # define do_raw_read_unlock(rwlock) arch_read_unlock(&(rwlock)->raw_lock) | ||
| 46 | # define do_raw_write_lock(rwlock) arch_write_lock(&(rwlock)->raw_lock) | ||
| 47 | # define do_raw_write_lock_flags(lock, flags) \ | ||
| 48 | arch_write_lock_flags(&(lock)->raw_lock, *(flags)) | ||
| 49 | # define do_raw_write_trylock(rwlock) arch_write_trylock(&(rwlock)->raw_lock) | ||
| 50 | # define do_raw_write_unlock(rwlock) arch_write_unlock(&(rwlock)->raw_lock) | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #define read_can_lock(rwlock) arch_read_can_lock(&(rwlock)->raw_lock) | ||
| 54 | #define write_can_lock(rwlock) arch_write_can_lock(&(rwlock)->raw_lock) | ||
| 55 | |||
| 56 | /* | ||
| 57 | * Define the various rw_lock methods. Note we define these | ||
| 58 | * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The various | ||
| 59 | * methods are defined as nops in the case they are not required. | ||
| 60 | */ | ||
| 61 | #define read_trylock(lock) __cond_lock(lock, _raw_read_trylock(lock)) | ||
| 62 | #define write_trylock(lock) __cond_lock(lock, _raw_write_trylock(lock)) | ||
| 63 | |||
| 64 | #define write_lock(lock) _raw_write_lock(lock) | ||
| 65 | #define read_lock(lock) _raw_read_lock(lock) | ||
| 66 | |||
| 67 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) | ||
| 68 | |||
| 69 | #define read_lock_irqsave(lock, flags) \ | ||
| 70 | do { \ | ||
| 71 | typecheck(unsigned long, flags); \ | ||
| 72 | flags = _raw_read_lock_irqsave(lock); \ | ||
| 73 | } while (0) | ||
| 74 | #define write_lock_irqsave(lock, flags) \ | ||
| 75 | do { \ | ||
| 76 | typecheck(unsigned long, flags); \ | ||
| 77 | flags = _raw_write_lock_irqsave(lock); \ | ||
| 78 | } while (0) | ||
| 79 | |||
| 80 | #else | ||
| 81 | |||
| 82 | #define read_lock_irqsave(lock, flags) \ | ||
| 83 | do { \ | ||
| 84 | typecheck(unsigned long, flags); \ | ||
| 85 | _raw_read_lock_irqsave(lock, flags); \ | ||
| 86 | } while (0) | ||
| 87 | #define write_lock_irqsave(lock, flags) \ | ||
| 88 | do { \ | ||
| 89 | typecheck(unsigned long, flags); \ | ||
| 90 | _raw_write_lock_irqsave(lock, flags); \ | ||
| 91 | } while (0) | ||
| 92 | |||
| 93 | #endif | ||
| 94 | |||
| 95 | #define read_lock_irq(lock) _raw_read_lock_irq(lock) | ||
| 96 | #define read_lock_bh(lock) _raw_read_lock_bh(lock) | ||
| 97 | #define write_lock_irq(lock) _raw_write_lock_irq(lock) | ||
| 98 | #define write_lock_bh(lock) _raw_write_lock_bh(lock) | ||
| 99 | #define read_unlock(lock) _raw_read_unlock(lock) | ||
| 100 | #define write_unlock(lock) _raw_write_unlock(lock) | ||
| 101 | #define read_unlock_irq(lock) _raw_read_unlock_irq(lock) | ||
| 102 | #define write_unlock_irq(lock) _raw_write_unlock_irq(lock) | ||
| 103 | |||
| 104 | #define read_unlock_irqrestore(lock, flags) \ | ||
| 105 | do { \ | ||
| 106 | typecheck(unsigned long, flags); \ | ||
| 107 | _raw_read_unlock_irqrestore(lock, flags); \ | ||
| 108 | } while (0) | ||
| 109 | #define read_unlock_bh(lock) _raw_read_unlock_bh(lock) | ||
| 110 | |||
| 111 | #define write_unlock_irqrestore(lock, flags) \ | ||
| 112 | do { \ | ||
| 113 | typecheck(unsigned long, flags); \ | ||
| 114 | _raw_write_unlock_irqrestore(lock, flags); \ | ||
| 115 | } while (0) | ||
| 116 | #define write_unlock_bh(lock) _raw_write_unlock_bh(lock) | ||
| 117 | |||
| 118 | #define write_trylock_irqsave(lock, flags) \ | ||
| 119 | ({ \ | ||
| 120 | local_irq_save(flags); \ | ||
| 121 | write_trylock(lock) ? \ | ||
| 122 | 1 : ({ local_irq_restore(flags); 0; }); \ | ||
| 123 | }) | ||
| 124 | |||
| 125 | #endif /* __LINUX_RWLOCK_H */ | ||
diff --git a/include/linux/rwlock_api_smp.h b/include/linux/rwlock_api_smp.h new file mode 100644 index 000000000000..9c9f0495d37c --- /dev/null +++ b/include/linux/rwlock_api_smp.h | |||
| @@ -0,0 +1,282 @@ | |||
| 1 | #ifndef __LINUX_RWLOCK_API_SMP_H | ||
| 2 | #define __LINUX_RWLOCK_API_SMP_H | ||
| 3 | |||
| 4 | #ifndef __LINUX_SPINLOCK_API_SMP_H | ||
| 5 | # error "please don't include this file directly" | ||
| 6 | #endif | ||
| 7 | |||
| 8 | /* | ||
| 9 | * include/linux/rwlock_api_smp.h | ||
| 10 | * | ||
| 11 | * spinlock API declarations on SMP (and debug) | ||
| 12 | * (implemented in kernel/spinlock.c) | ||
| 13 | * | ||
| 14 | * portions Copyright 2005, Red Hat, Inc., Ingo Molnar | ||
| 15 | * Released under the General Public License (GPL). | ||
| 16 | */ | ||
| 17 | |||
| 18 | void __lockfunc _raw_read_lock(rwlock_t *lock) __acquires(lock); | ||
| 19 | void __lockfunc _raw_write_lock(rwlock_t *lock) __acquires(lock); | ||
| 20 | void __lockfunc _raw_read_lock_bh(rwlock_t *lock) __acquires(lock); | ||
| 21 | void __lockfunc _raw_write_lock_bh(rwlock_t *lock) __acquires(lock); | ||
| 22 | void __lockfunc _raw_read_lock_irq(rwlock_t *lock) __acquires(lock); | ||
| 23 | void __lockfunc _raw_write_lock_irq(rwlock_t *lock) __acquires(lock); | ||
| 24 | unsigned long __lockfunc _raw_read_lock_irqsave(rwlock_t *lock) | ||
| 25 | __acquires(lock); | ||
| 26 | unsigned long __lockfunc _raw_write_lock_irqsave(rwlock_t *lock) | ||
| 27 | __acquires(lock); | ||
| 28 | int __lockfunc _raw_read_trylock(rwlock_t *lock); | ||
| 29 | int __lockfunc _raw_write_trylock(rwlock_t *lock); | ||
| 30 | void __lockfunc _raw_read_unlock(rwlock_t *lock) __releases(lock); | ||
| 31 | void __lockfunc _raw_write_unlock(rwlock_t *lock) __releases(lock); | ||
| 32 | void __lockfunc _raw_read_unlock_bh(rwlock_t *lock) __releases(lock); | ||
| 33 | void __lockfunc _raw_write_unlock_bh(rwlock_t *lock) __releases(lock); | ||
| 34 | void __lockfunc _raw_read_unlock_irq(rwlock_t *lock) __releases(lock); | ||
| 35 | void __lockfunc _raw_write_unlock_irq(rwlock_t *lock) __releases(lock); | ||
| 36 | void __lockfunc | ||
| 37 | _raw_read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | ||
| 38 | __releases(lock); | ||
| 39 | void __lockfunc | ||
| 40 | _raw_write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | ||
| 41 | __releases(lock); | ||
| 42 | |||
| 43 | #ifdef CONFIG_INLINE_READ_LOCK | ||
| 44 | #define _raw_read_lock(lock) __raw_read_lock(lock) | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #ifdef CONFIG_INLINE_WRITE_LOCK | ||
| 48 | #define _raw_write_lock(lock) __raw_write_lock(lock) | ||
| 49 | #endif | ||
| 50 | |||
| 51 | #ifdef CONFIG_INLINE_READ_LOCK_BH | ||
| 52 | #define _raw_read_lock_bh(lock) __raw_read_lock_bh(lock) | ||
| 53 | #endif | ||
| 54 | |||
| 55 | #ifdef CONFIG_INLINE_WRITE_LOCK_BH | ||
| 56 | #define _raw_write_lock_bh(lock) __raw_write_lock_bh(lock) | ||
| 57 | #endif | ||
| 58 | |||
| 59 | #ifdef CONFIG_INLINE_READ_LOCK_IRQ | ||
| 60 | #define _raw_read_lock_irq(lock) __raw_read_lock_irq(lock) | ||
| 61 | #endif | ||
| 62 | |||
| 63 | #ifdef CONFIG_INLINE_WRITE_LOCK_IRQ | ||
| 64 | #define _raw_write_lock_irq(lock) __raw_write_lock_irq(lock) | ||
| 65 | #endif | ||
| 66 | |||
| 67 | #ifdef CONFIG_INLINE_READ_LOCK_IRQSAVE | ||
| 68 | #define _raw_read_lock_irqsave(lock) __raw_read_lock_irqsave(lock) | ||
| 69 | #endif | ||
| 70 | |||
| 71 | #ifdef CONFIG_INLINE_WRITE_LOCK_IRQSAVE | ||
| 72 | #define _raw_write_lock_irqsave(lock) __raw_write_lock_irqsave(lock) | ||
| 73 | #endif | ||
| 74 | |||
| 75 | #ifdef CONFIG_INLINE_READ_TRYLOCK | ||
| 76 | #define _raw_read_trylock(lock) __raw_read_trylock(lock) | ||
| 77 | #endif | ||
| 78 | |||
| 79 | #ifdef CONFIG_INLINE_WRITE_TRYLOCK | ||
| 80 | #define _raw_write_trylock(lock) __raw_write_trylock(lock) | ||
| 81 | #endif | ||
| 82 | |||
| 83 | #ifdef CONFIG_INLINE_READ_UNLOCK | ||
| 84 | #define _raw_read_unlock(lock) __raw_read_unlock(lock) | ||
| 85 | #endif | ||
| 86 | |||
| 87 | #ifdef CONFIG_INLINE_WRITE_UNLOCK | ||
| 88 | #define _raw_write_unlock(lock) __raw_write_unlock(lock) | ||
| 89 | #endif | ||
| 90 | |||
| 91 | #ifdef CONFIG_INLINE_READ_UNLOCK_BH | ||
| 92 | #define _raw_read_unlock_bh(lock) __raw_read_unlock_bh(lock) | ||
| 93 | #endif | ||
| 94 | |||
| 95 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_BH | ||
| 96 | #define _raw_write_unlock_bh(lock) __raw_write_unlock_bh(lock) | ||
| 97 | #endif | ||
| 98 | |||
| 99 | #ifdef CONFIG_INLINE_READ_UNLOCK_IRQ | ||
| 100 | #define _raw_read_unlock_irq(lock) __raw_read_unlock_irq(lock) | ||
| 101 | #endif | ||
| 102 | |||
| 103 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQ | ||
| 104 | #define _raw_write_unlock_irq(lock) __raw_write_unlock_irq(lock) | ||
| 105 | #endif | ||
| 106 | |||
| 107 | #ifdef CONFIG_INLINE_READ_UNLOCK_IRQRESTORE | ||
| 108 | #define _raw_read_unlock_irqrestore(lock, flags) \ | ||
| 109 | __raw_read_unlock_irqrestore(lock, flags) | ||
| 110 | #endif | ||
| 111 | |||
| 112 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE | ||
| 113 | #define _raw_write_unlock_irqrestore(lock, flags) \ | ||
| 114 | __raw_write_unlock_irqrestore(lock, flags) | ||
| 115 | #endif | ||
| 116 | |||
| 117 | static inline int __raw_read_trylock(rwlock_t *lock) | ||
| 118 | { | ||
| 119 | preempt_disable(); | ||
| 120 | if (do_raw_read_trylock(lock)) { | ||
| 121 | rwlock_acquire_read(&lock->dep_map, 0, 1, _RET_IP_); | ||
| 122 | return 1; | ||
| 123 | } | ||
| 124 | preempt_enable(); | ||
| 125 | return 0; | ||
| 126 | } | ||
| 127 | |||
| 128 | static inline int __raw_write_trylock(rwlock_t *lock) | ||
| 129 | { | ||
| 130 | preempt_disable(); | ||
| 131 | if (do_raw_write_trylock(lock)) { | ||
| 132 | rwlock_acquire(&lock->dep_map, 0, 1, _RET_IP_); | ||
| 133 | return 1; | ||
| 134 | } | ||
| 135 | preempt_enable(); | ||
| 136 | return 0; | ||
| 137 | } | ||
| 138 | |||
| 139 | /* | ||
| 140 | * If lockdep is enabled then we use the non-preemption spin-ops | ||
| 141 | * even on CONFIG_PREEMPT, because lockdep assumes that interrupts are | ||
| 142 | * not re-enabled during lock-acquire (which the preempt-spin-ops do): | ||
| 143 | */ | ||
| 144 | #if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC) | ||
| 145 | |||
| 146 | static inline void __raw_read_lock(rwlock_t *lock) | ||
| 147 | { | ||
| 148 | preempt_disable(); | ||
| 149 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 150 | LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); | ||
| 151 | } | ||
| 152 | |||
| 153 | static inline unsigned long __raw_read_lock_irqsave(rwlock_t *lock) | ||
| 154 | { | ||
| 155 | unsigned long flags; | ||
| 156 | |||
| 157 | local_irq_save(flags); | ||
| 158 | preempt_disable(); | ||
| 159 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 160 | LOCK_CONTENDED_FLAGS(lock, do_raw_read_trylock, do_raw_read_lock, | ||
| 161 | do_raw_read_lock_flags, &flags); | ||
| 162 | return flags; | ||
| 163 | } | ||
| 164 | |||
| 165 | static inline void __raw_read_lock_irq(rwlock_t *lock) | ||
| 166 | { | ||
| 167 | local_irq_disable(); | ||
| 168 | preempt_disable(); | ||
| 169 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 170 | LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); | ||
| 171 | } | ||
| 172 | |||
| 173 | static inline void __raw_read_lock_bh(rwlock_t *lock) | ||
| 174 | { | ||
| 175 | local_bh_disable(); | ||
| 176 | preempt_disable(); | ||
| 177 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 178 | LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); | ||
| 179 | } | ||
| 180 | |||
| 181 | static inline unsigned long __raw_write_lock_irqsave(rwlock_t *lock) | ||
| 182 | { | ||
| 183 | unsigned long flags; | ||
| 184 | |||
| 185 | local_irq_save(flags); | ||
| 186 | preempt_disable(); | ||
| 187 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 188 | LOCK_CONTENDED_FLAGS(lock, do_raw_write_trylock, do_raw_write_lock, | ||
| 189 | do_raw_write_lock_flags, &flags); | ||
| 190 | return flags; | ||
| 191 | } | ||
| 192 | |||
| 193 | static inline void __raw_write_lock_irq(rwlock_t *lock) | ||
| 194 | { | ||
| 195 | local_irq_disable(); | ||
| 196 | preempt_disable(); | ||
| 197 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 198 | LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock); | ||
| 199 | } | ||
| 200 | |||
| 201 | static inline void __raw_write_lock_bh(rwlock_t *lock) | ||
| 202 | { | ||
| 203 | local_bh_disable(); | ||
| 204 | preempt_disable(); | ||
| 205 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 206 | LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock); | ||
| 207 | } | ||
| 208 | |||
| 209 | static inline void __raw_write_lock(rwlock_t *lock) | ||
| 210 | { | ||
| 211 | preempt_disable(); | ||
| 212 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 213 | LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock); | ||
| 214 | } | ||
| 215 | |||
| 216 | #endif /* CONFIG_PREEMPT */ | ||
| 217 | |||
| 218 | static inline void __raw_write_unlock(rwlock_t *lock) | ||
| 219 | { | ||
| 220 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 221 | do_raw_write_unlock(lock); | ||
| 222 | preempt_enable(); | ||
| 223 | } | ||
| 224 | |||
| 225 | static inline void __raw_read_unlock(rwlock_t *lock) | ||
| 226 | { | ||
| 227 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 228 | do_raw_read_unlock(lock); | ||
| 229 | preempt_enable(); | ||
| 230 | } | ||
| 231 | |||
| 232 | static inline void | ||
| 233 | __raw_read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | ||
| 234 | { | ||
| 235 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 236 | do_raw_read_unlock(lock); | ||
| 237 | local_irq_restore(flags); | ||
| 238 | preempt_enable(); | ||
| 239 | } | ||
| 240 | |||
| 241 | static inline void __raw_read_unlock_irq(rwlock_t *lock) | ||
| 242 | { | ||
| 243 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 244 | do_raw_read_unlock(lock); | ||
| 245 | local_irq_enable(); | ||
| 246 | preempt_enable(); | ||
| 247 | } | ||
| 248 | |||
| 249 | static inline void __raw_read_unlock_bh(rwlock_t *lock) | ||
| 250 | { | ||
| 251 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 252 | do_raw_read_unlock(lock); | ||
| 253 | preempt_enable_no_resched(); | ||
| 254 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 255 | } | ||
| 256 | |||
| 257 | static inline void __raw_write_unlock_irqrestore(rwlock_t *lock, | ||
| 258 | unsigned long flags) | ||
| 259 | { | ||
| 260 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 261 | do_raw_write_unlock(lock); | ||
| 262 | local_irq_restore(flags); | ||
| 263 | preempt_enable(); | ||
| 264 | } | ||
| 265 | |||
| 266 | static inline void __raw_write_unlock_irq(rwlock_t *lock) | ||
| 267 | { | ||
| 268 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 269 | do_raw_write_unlock(lock); | ||
| 270 | local_irq_enable(); | ||
| 271 | preempt_enable(); | ||
| 272 | } | ||
| 273 | |||
| 274 | static inline void __raw_write_unlock_bh(rwlock_t *lock) | ||
| 275 | { | ||
| 276 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 277 | do_raw_write_unlock(lock); | ||
| 278 | preempt_enable_no_resched(); | ||
| 279 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 280 | } | ||
| 281 | |||
| 282 | #endif /* __LINUX_RWLOCK_API_SMP_H */ | ||
diff --git a/include/linux/rwlock_types.h b/include/linux/rwlock_types.h new file mode 100644 index 000000000000..bd31808c7d8e --- /dev/null +++ b/include/linux/rwlock_types.h | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | #ifndef __LINUX_RWLOCK_TYPES_H | ||
| 2 | #define __LINUX_RWLOCK_TYPES_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * include/linux/rwlock_types.h - generic rwlock type definitions | ||
| 6 | * and initializers | ||
| 7 | * | ||
| 8 | * portions Copyright 2005, Red Hat, Inc., Ingo Molnar | ||
| 9 | * Released under the General Public License (GPL). | ||
| 10 | */ | ||
| 11 | typedef struct { | ||
| 12 | arch_rwlock_t raw_lock; | ||
| 13 | #ifdef CONFIG_GENERIC_LOCKBREAK | ||
| 14 | unsigned int break_lock; | ||
| 15 | #endif | ||
| 16 | #ifdef CONFIG_DEBUG_SPINLOCK | ||
| 17 | unsigned int magic, owner_cpu; | ||
| 18 | void *owner; | ||
| 19 | #endif | ||
| 20 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 21 | struct lockdep_map dep_map; | ||
| 22 | #endif | ||
| 23 | } rwlock_t; | ||
| 24 | |||
| 25 | #define RWLOCK_MAGIC 0xdeaf1eed | ||
| 26 | |||
| 27 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 28 | # define RW_DEP_MAP_INIT(lockname) .dep_map = { .name = #lockname } | ||
| 29 | #else | ||
| 30 | # define RW_DEP_MAP_INIT(lockname) | ||
| 31 | #endif | ||
| 32 | |||
| 33 | #ifdef CONFIG_DEBUG_SPINLOCK | ||
| 34 | #define __RW_LOCK_UNLOCKED(lockname) \ | ||
| 35 | (rwlock_t) { .raw_lock = __ARCH_RW_LOCK_UNLOCKED, \ | ||
| 36 | .magic = RWLOCK_MAGIC, \ | ||
| 37 | .owner = SPINLOCK_OWNER_INIT, \ | ||
| 38 | .owner_cpu = -1, \ | ||
| 39 | RW_DEP_MAP_INIT(lockname) } | ||
| 40 | #else | ||
| 41 | #define __RW_LOCK_UNLOCKED(lockname) \ | ||
| 42 | (rwlock_t) { .raw_lock = __ARCH_RW_LOCK_UNLOCKED, \ | ||
| 43 | RW_DEP_MAP_INIT(lockname) } | ||
| 44 | #endif | ||
| 45 | |||
| 46 | /* | ||
| 47 | * RW_LOCK_UNLOCKED defeat lockdep state tracking and is hence | ||
| 48 | * deprecated. | ||
| 49 | * | ||
| 50 | * Please use DEFINE_RWLOCK() or __RW_LOCK_UNLOCKED() as appropriate. | ||
| 51 | */ | ||
| 52 | #define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init) | ||
| 53 | |||
| 54 | #define DEFINE_RWLOCK(x) rwlock_t x = __RW_LOCK_UNLOCKED(x) | ||
| 55 | |||
| 56 | #endif /* __LINUX_RWLOCK_TYPES_H */ | ||
diff --git a/include/linux/rwsem-spinlock.h b/include/linux/rwsem-spinlock.h index 6c3c0f6c261f..bdfcc2527970 100644 --- a/include/linux/rwsem-spinlock.h +++ b/include/linux/rwsem-spinlock.h | |||
| @@ -68,11 +68,7 @@ extern int __down_write_trylock(struct rw_semaphore *sem); | |||
| 68 | extern void __up_read(struct rw_semaphore *sem); | 68 | extern void __up_read(struct rw_semaphore *sem); |
| 69 | extern void __up_write(struct rw_semaphore *sem); | 69 | extern void __up_write(struct rw_semaphore *sem); |
| 70 | extern void __downgrade_write(struct rw_semaphore *sem); | 70 | extern void __downgrade_write(struct rw_semaphore *sem); |
| 71 | 71 | extern int rwsem_is_locked(struct rw_semaphore *sem); | |
| 72 | static inline int rwsem_is_locked(struct rw_semaphore *sem) | ||
| 73 | { | ||
| 74 | return (sem->activity != 0); | ||
| 75 | } | ||
| 76 | 72 | ||
| 77 | #endif /* __KERNEL__ */ | 73 | #endif /* __KERNEL__ */ |
| 78 | #endif /* _LINUX_RWSEM_SPINLOCK_H */ | 74 | #endif /* _LINUX_RWSEM_SPINLOCK_H */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 89115ec7d43f..5c858f38e81a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1102,7 +1102,7 @@ struct sched_class { | |||
| 1102 | 1102 | ||
| 1103 | void (*set_curr_task) (struct rq *rq); | 1103 | void (*set_curr_task) (struct rq *rq); |
| 1104 | void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); | 1104 | void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); |
| 1105 | void (*task_new) (struct rq *rq, struct task_struct *p); | 1105 | void (*task_fork) (struct task_struct *p); |
| 1106 | 1106 | ||
| 1107 | void (*switched_from) (struct rq *this_rq, struct task_struct *task, | 1107 | void (*switched_from) (struct rq *this_rq, struct task_struct *task, |
| 1108 | int running); | 1108 | int running); |
| @@ -1111,7 +1111,8 @@ struct sched_class { | |||
| 1111 | void (*prio_changed) (struct rq *this_rq, struct task_struct *task, | 1111 | void (*prio_changed) (struct rq *this_rq, struct task_struct *task, |
| 1112 | int oldprio, int running); | 1112 | int oldprio, int running); |
| 1113 | 1113 | ||
| 1114 | unsigned int (*get_rr_interval) (struct task_struct *task); | 1114 | unsigned int (*get_rr_interval) (struct rq *rq, |
| 1115 | struct task_struct *task); | ||
| 1115 | 1116 | ||
| 1116 | #ifdef CONFIG_FAIR_GROUP_SCHED | 1117 | #ifdef CONFIG_FAIR_GROUP_SCHED |
| 1117 | void (*moved_group) (struct task_struct *p); | 1118 | void (*moved_group) (struct task_struct *p); |
| @@ -1151,8 +1152,6 @@ struct sched_entity { | |||
| 1151 | u64 start_runtime; | 1152 | u64 start_runtime; |
| 1152 | u64 avg_wakeup; | 1153 | u64 avg_wakeup; |
| 1153 | 1154 | ||
| 1154 | u64 avg_running; | ||
| 1155 | |||
| 1156 | #ifdef CONFIG_SCHEDSTATS | 1155 | #ifdef CONFIG_SCHEDSTATS |
| 1157 | u64 wait_start; | 1156 | u64 wait_start; |
| 1158 | u64 wait_max; | 1157 | u64 wait_max; |
| @@ -1175,7 +1174,6 @@ struct sched_entity { | |||
| 1175 | u64 nr_failed_migrations_running; | 1174 | u64 nr_failed_migrations_running; |
| 1176 | u64 nr_failed_migrations_hot; | 1175 | u64 nr_failed_migrations_hot; |
| 1177 | u64 nr_forced_migrations; | 1176 | u64 nr_forced_migrations; |
| 1178 | u64 nr_forced2_migrations; | ||
| 1179 | 1177 | ||
| 1180 | u64 nr_wakeups; | 1178 | u64 nr_wakeups; |
| 1181 | u64 nr_wakeups_sync; | 1179 | u64 nr_wakeups_sync; |
| @@ -1411,7 +1409,7 @@ struct task_struct { | |||
| 1411 | #endif | 1409 | #endif |
| 1412 | 1410 | ||
| 1413 | /* Protection of the PI data structures: */ | 1411 | /* Protection of the PI data structures: */ |
| 1414 | spinlock_t pi_lock; | 1412 | raw_spinlock_t pi_lock; |
| 1415 | 1413 | ||
| 1416 | #ifdef CONFIG_RT_MUTEXES | 1414 | #ifdef CONFIG_RT_MUTEXES |
| 1417 | /* PI waiters blocked on a rt_mutex held by this task */ | 1415 | /* PI waiters blocked on a rt_mutex held by this task */ |
| @@ -1448,8 +1446,10 @@ struct task_struct { | |||
| 1448 | gfp_t lockdep_reclaim_gfp; | 1446 | gfp_t lockdep_reclaim_gfp; |
| 1449 | #endif | 1447 | #endif |
| 1450 | 1448 | ||
| 1449 | #ifdef CONFIG_FS_JOURNAL_INFO | ||
| 1451 | /* journalling filesystem info */ | 1450 | /* journalling filesystem info */ |
| 1452 | void *journal_info; | 1451 | void *journal_info; |
| 1452 | #endif | ||
| 1453 | 1453 | ||
| 1454 | /* stacked block device info */ | 1454 | /* stacked block device info */ |
| 1455 | struct bio *bio_list, **bio_tail; | 1455 | struct bio *bio_list, **bio_tail; |
| @@ -1840,7 +1840,8 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) | |||
| 1840 | extern int sched_clock_stable; | 1840 | extern int sched_clock_stable; |
| 1841 | #endif | 1841 | #endif |
| 1842 | 1842 | ||
| 1843 | extern unsigned long long sched_clock(void); | 1843 | /* ftrace calls sched_clock() directly */ |
| 1844 | extern unsigned long long notrace sched_clock(void); | ||
| 1844 | 1845 | ||
| 1845 | extern void sched_clock_init(void); | 1846 | extern void sched_clock_init(void); |
| 1846 | extern u64 sched_clock_cpu(int cpu); | 1847 | extern u64 sched_clock_cpu(int cpu); |
| @@ -1903,14 +1904,22 @@ extern unsigned int sysctl_sched_wakeup_granularity; | |||
| 1903 | extern unsigned int sysctl_sched_shares_ratelimit; | 1904 | extern unsigned int sysctl_sched_shares_ratelimit; |
| 1904 | extern unsigned int sysctl_sched_shares_thresh; | 1905 | extern unsigned int sysctl_sched_shares_thresh; |
| 1905 | extern unsigned int sysctl_sched_child_runs_first; | 1906 | extern unsigned int sysctl_sched_child_runs_first; |
| 1907 | |||
| 1908 | enum sched_tunable_scaling { | ||
| 1909 | SCHED_TUNABLESCALING_NONE, | ||
| 1910 | SCHED_TUNABLESCALING_LOG, | ||
| 1911 | SCHED_TUNABLESCALING_LINEAR, | ||
| 1912 | SCHED_TUNABLESCALING_END, | ||
| 1913 | }; | ||
| 1914 | extern enum sched_tunable_scaling sysctl_sched_tunable_scaling; | ||
| 1915 | |||
| 1906 | #ifdef CONFIG_SCHED_DEBUG | 1916 | #ifdef CONFIG_SCHED_DEBUG |
| 1907 | extern unsigned int sysctl_sched_features; | ||
| 1908 | extern unsigned int sysctl_sched_migration_cost; | 1917 | extern unsigned int sysctl_sched_migration_cost; |
| 1909 | extern unsigned int sysctl_sched_nr_migrate; | 1918 | extern unsigned int sysctl_sched_nr_migrate; |
| 1910 | extern unsigned int sysctl_sched_time_avg; | 1919 | extern unsigned int sysctl_sched_time_avg; |
| 1911 | extern unsigned int sysctl_timer_migration; | 1920 | extern unsigned int sysctl_timer_migration; |
| 1912 | 1921 | ||
| 1913 | int sched_nr_latency_handler(struct ctl_table *table, int write, | 1922 | int sched_proc_update_handler(struct ctl_table *table, int write, |
| 1914 | void __user *buffer, size_t *length, | 1923 | void __user *buffer, size_t *length, |
| 1915 | loff_t *ppos); | 1924 | loff_t *ppos); |
| 1916 | #endif | 1925 | #endif |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 850d057500de..ca6b2b317991 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
| @@ -110,7 +110,7 @@ extern struct cache_sizes malloc_sizes[]; | |||
| 110 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | 110 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); |
| 111 | void *__kmalloc(size_t size, gfp_t flags); | 111 | void *__kmalloc(size_t size, gfp_t flags); |
| 112 | 112 | ||
| 113 | #ifdef CONFIG_KMEMTRACE | 113 | #ifdef CONFIG_TRACING |
| 114 | extern void *kmem_cache_alloc_notrace(struct kmem_cache *cachep, gfp_t flags); | 114 | extern void *kmem_cache_alloc_notrace(struct kmem_cache *cachep, gfp_t flags); |
| 115 | extern size_t slab_buffer_size(struct kmem_cache *cachep); | 115 | extern size_t slab_buffer_size(struct kmem_cache *cachep); |
| 116 | #else | 116 | #else |
| @@ -166,7 +166,7 @@ found: | |||
| 166 | extern void *__kmalloc_node(size_t size, gfp_t flags, int node); | 166 | extern void *__kmalloc_node(size_t size, gfp_t flags, int node); |
| 167 | extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | 167 | extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); |
| 168 | 168 | ||
| 169 | #ifdef CONFIG_KMEMTRACE | 169 | #ifdef CONFIG_TRACING |
| 170 | extern void *kmem_cache_alloc_node_notrace(struct kmem_cache *cachep, | 170 | extern void *kmem_cache_alloc_node_notrace(struct kmem_cache *cachep, |
| 171 | gfp_t flags, | 171 | gfp_t flags, |
| 172 | int nodeid); | 172 | int nodeid); |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 5ad70a60fd74..1e14beb23f9b 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
| @@ -217,7 +217,7 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size) | |||
| 217 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | 217 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); |
| 218 | void *__kmalloc(size_t size, gfp_t flags); | 218 | void *__kmalloc(size_t size, gfp_t flags); |
| 219 | 219 | ||
| 220 | #ifdef CONFIG_KMEMTRACE | 220 | #ifdef CONFIG_TRACING |
| 221 | extern void *kmem_cache_alloc_notrace(struct kmem_cache *s, gfp_t gfpflags); | 221 | extern void *kmem_cache_alloc_notrace(struct kmem_cache *s, gfp_t gfpflags); |
| 222 | #else | 222 | #else |
| 223 | static __always_inline void * | 223 | static __always_inline void * |
| @@ -266,7 +266,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags) | |||
| 266 | void *__kmalloc_node(size_t size, gfp_t flags, int node); | 266 | void *__kmalloc_node(size_t size, gfp_t flags, int node); |
| 267 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | 267 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); |
| 268 | 268 | ||
| 269 | #ifdef CONFIG_KMEMTRACE | 269 | #ifdef CONFIG_TRACING |
| 270 | extern void *kmem_cache_alloc_node_notrace(struct kmem_cache *s, | 270 | extern void *kmem_cache_alloc_node_notrace(struct kmem_cache *s, |
| 271 | gfp_t gfpflags, | 271 | gfp_t gfpflags, |
| 272 | int node); | 272 | int node); |
diff --git a/include/linux/spi/sh_msiof.h b/include/linux/spi/sh_msiof.h new file mode 100644 index 000000000000..2e8db3d2d2e5 --- /dev/null +++ b/include/linux/spi/sh_msiof.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef __SPI_SH_MSIOF_H__ | ||
| 2 | #define __SPI_SH_MSIOF_H__ | ||
| 3 | |||
| 4 | struct sh_msiof_spi_info { | ||
| 5 | int tx_fifo_override; | ||
| 6 | int rx_fifo_override; | ||
| 7 | u16 num_chipselect; | ||
| 8 | }; | ||
| 9 | |||
| 10 | #endif /* __SPI_SH_MSIOF_H__ */ | ||
diff --git a/include/linux/spi/xilinx_spi.h b/include/linux/spi/xilinx_spi.h new file mode 100644 index 000000000000..6f17278810b0 --- /dev/null +++ b/include/linux/spi/xilinx_spi.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | #ifndef __LINUX_SPI_XILINX_SPI_H | ||
| 2 | #define __LINUX_SPI_XILINX_SPI_H | ||
| 3 | |||
| 4 | /** | ||
| 5 | * struct xspi_platform_data - Platform data of the Xilinx SPI driver | ||
| 6 | * @num_chipselect: Number of chip select by the IP. | ||
| 7 | * @little_endian: If registers should be accessed little endian or not. | ||
| 8 | * @bits_per_word: Number of bits per word. | ||
| 9 | * @devices: Devices to add when the driver is probed. | ||
| 10 | * @num_devices: Number of devices in the devices array. | ||
| 11 | */ | ||
| 12 | struct xspi_platform_data { | ||
| 13 | u16 num_chipselect; | ||
| 14 | bool little_endian; | ||
| 15 | u8 bits_per_word; | ||
| 16 | struct spi_board_info *devices; | ||
| 17 | u8 num_devices; | ||
| 18 | }; | ||
| 19 | |||
| 20 | #endif /* __LINUX_SPI_XILINX_SPI_H */ | ||
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 71dccfeb0d88..86088213334a 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
| @@ -8,13 +8,13 @@ | |||
| 8 | * | 8 | * |
| 9 | * on SMP builds: | 9 | * on SMP builds: |
| 10 | * | 10 | * |
| 11 | * asm/spinlock_types.h: contains the raw_spinlock_t/raw_rwlock_t and the | 11 | * asm/spinlock_types.h: contains the arch_spinlock_t/arch_rwlock_t and the |
| 12 | * initializers | 12 | * initializers |
| 13 | * | 13 | * |
| 14 | * linux/spinlock_types.h: | 14 | * linux/spinlock_types.h: |
| 15 | * defines the generic type and initializers | 15 | * defines the generic type and initializers |
| 16 | * | 16 | * |
| 17 | * asm/spinlock.h: contains the __raw_spin_*()/etc. lowlevel | 17 | * asm/spinlock.h: contains the arch_spin_*()/etc. lowlevel |
| 18 | * implementations, mostly inline assembly code | 18 | * implementations, mostly inline assembly code |
| 19 | * | 19 | * |
| 20 | * (also included on UP-debug builds:) | 20 | * (also included on UP-debug builds:) |
| @@ -34,7 +34,7 @@ | |||
| 34 | * defines the generic type and initializers | 34 | * defines the generic type and initializers |
| 35 | * | 35 | * |
| 36 | * linux/spinlock_up.h: | 36 | * linux/spinlock_up.h: |
| 37 | * contains the __raw_spin_*()/etc. version of UP | 37 | * contains the arch_spin_*()/etc. version of UP |
| 38 | * builds. (which are NOPs on non-debug, non-preempt | 38 | * builds. (which are NOPs on non-debug, non-preempt |
| 39 | * builds) | 39 | * builds) |
| 40 | * | 40 | * |
| @@ -75,12 +75,12 @@ | |||
| 75 | #define __lockfunc __attribute__((section(".spinlock.text"))) | 75 | #define __lockfunc __attribute__((section(".spinlock.text"))) |
| 76 | 76 | ||
| 77 | /* | 77 | /* |
| 78 | * Pull the raw_spinlock_t and raw_rwlock_t definitions: | 78 | * Pull the arch_spinlock_t and arch_rwlock_t definitions: |
| 79 | */ | 79 | */ |
| 80 | #include <linux/spinlock_types.h> | 80 | #include <linux/spinlock_types.h> |
| 81 | 81 | ||
| 82 | /* | 82 | /* |
| 83 | * Pull the __raw*() functions/declarations (UP-nondebug doesnt need them): | 83 | * Pull the arch_spin*() functions/declarations (UP-nondebug doesnt need them): |
| 84 | */ | 84 | */ |
| 85 | #ifdef CONFIG_SMP | 85 | #ifdef CONFIG_SMP |
| 86 | # include <asm/spinlock.h> | 86 | # include <asm/spinlock.h> |
| @@ -89,45 +89,31 @@ | |||
| 89 | #endif | 89 | #endif |
| 90 | 90 | ||
| 91 | #ifdef CONFIG_DEBUG_SPINLOCK | 91 | #ifdef CONFIG_DEBUG_SPINLOCK |
| 92 | extern void __spin_lock_init(spinlock_t *lock, const char *name, | 92 | extern void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name, |
| 93 | struct lock_class_key *key); | 93 | struct lock_class_key *key); |
| 94 | # define spin_lock_init(lock) \ | 94 | # define raw_spin_lock_init(lock) \ |
| 95 | do { \ | 95 | do { \ |
| 96 | static struct lock_class_key __key; \ | 96 | static struct lock_class_key __key; \ |
| 97 | \ | 97 | \ |
| 98 | __spin_lock_init((lock), #lock, &__key); \ | 98 | __raw_spin_lock_init((lock), #lock, &__key); \ |
| 99 | } while (0) | 99 | } while (0) |
| 100 | 100 | ||
| 101 | #else | 101 | #else |
| 102 | # define spin_lock_init(lock) \ | 102 | # define raw_spin_lock_init(lock) \ |
| 103 | do { *(lock) = __SPIN_LOCK_UNLOCKED(lock); } while (0) | 103 | do { *(lock) = __RAW_SPIN_LOCK_UNLOCKED(lock); } while (0) |
| 104 | #endif | 104 | #endif |
| 105 | 105 | ||
| 106 | #ifdef CONFIG_DEBUG_SPINLOCK | 106 | #define raw_spin_is_locked(lock) arch_spin_is_locked(&(lock)->raw_lock) |
| 107 | extern void __rwlock_init(rwlock_t *lock, const char *name, | ||
| 108 | struct lock_class_key *key); | ||
| 109 | # define rwlock_init(lock) \ | ||
| 110 | do { \ | ||
| 111 | static struct lock_class_key __key; \ | ||
| 112 | \ | ||
| 113 | __rwlock_init((lock), #lock, &__key); \ | ||
| 114 | } while (0) | ||
| 115 | #else | ||
| 116 | # define rwlock_init(lock) \ | ||
| 117 | do { *(lock) = __RW_LOCK_UNLOCKED(lock); } while (0) | ||
| 118 | #endif | ||
| 119 | |||
| 120 | #define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock) | ||
| 121 | 107 | ||
| 122 | #ifdef CONFIG_GENERIC_LOCKBREAK | 108 | #ifdef CONFIG_GENERIC_LOCKBREAK |
| 123 | #define spin_is_contended(lock) ((lock)->break_lock) | 109 | #define raw_spin_is_contended(lock) ((lock)->break_lock) |
| 124 | #else | 110 | #else |
| 125 | 111 | ||
| 126 | #ifdef __raw_spin_is_contended | 112 | #ifdef arch_spin_is_contended |
| 127 | #define spin_is_contended(lock) __raw_spin_is_contended(&(lock)->raw_lock) | 113 | #define raw_spin_is_contended(lock) arch_spin_is_contended(&(lock)->raw_lock) |
| 128 | #else | 114 | #else |
| 129 | #define spin_is_contended(lock) (((void)(lock), 0)) | 115 | #define raw_spin_is_contended(lock) (((void)(lock), 0)) |
| 130 | #endif /*__raw_spin_is_contended*/ | 116 | #endif /*arch_spin_is_contended*/ |
| 131 | #endif | 117 | #endif |
| 132 | 118 | ||
| 133 | /* The lock does not imply full memory barrier. */ | 119 | /* The lock does not imply full memory barrier. */ |
| @@ -136,182 +122,260 @@ static inline void smp_mb__after_lock(void) { smp_mb(); } | |||
| 136 | #endif | 122 | #endif |
| 137 | 123 | ||
| 138 | /** | 124 | /** |
| 139 | * spin_unlock_wait - wait until the spinlock gets unlocked | 125 | * raw_spin_unlock_wait - wait until the spinlock gets unlocked |
| 140 | * @lock: the spinlock in question. | 126 | * @lock: the spinlock in question. |
| 141 | */ | 127 | */ |
| 142 | #define spin_unlock_wait(lock) __raw_spin_unlock_wait(&(lock)->raw_lock) | 128 | #define raw_spin_unlock_wait(lock) arch_spin_unlock_wait(&(lock)->raw_lock) |
| 143 | 129 | ||
| 144 | #ifdef CONFIG_DEBUG_SPINLOCK | 130 | #ifdef CONFIG_DEBUG_SPINLOCK |
| 145 | extern void _raw_spin_lock(spinlock_t *lock); | 131 | extern void do_raw_spin_lock(raw_spinlock_t *lock); |
| 146 | #define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock) | 132 | #define do_raw_spin_lock_flags(lock, flags) do_raw_spin_lock(lock) |
| 147 | extern int _raw_spin_trylock(spinlock_t *lock); | 133 | extern int do_raw_spin_trylock(raw_spinlock_t *lock); |
| 148 | extern void _raw_spin_unlock(spinlock_t *lock); | 134 | extern void do_raw_spin_unlock(raw_spinlock_t *lock); |
| 149 | extern void _raw_read_lock(rwlock_t *lock); | ||
| 150 | #define _raw_read_lock_flags(lock, flags) _raw_read_lock(lock) | ||
| 151 | extern int _raw_read_trylock(rwlock_t *lock); | ||
| 152 | extern void _raw_read_unlock(rwlock_t *lock); | ||
| 153 | extern void _raw_write_lock(rwlock_t *lock); | ||
| 154 | #define _raw_write_lock_flags(lock, flags) _raw_write_lock(lock) | ||
| 155 | extern int _raw_write_trylock(rwlock_t *lock); | ||
| 156 | extern void _raw_write_unlock(rwlock_t *lock); | ||
| 157 | #else | 135 | #else |
| 158 | # define _raw_spin_lock(lock) __raw_spin_lock(&(lock)->raw_lock) | 136 | static inline void do_raw_spin_lock(raw_spinlock_t *lock) |
| 159 | # define _raw_spin_lock_flags(lock, flags) \ | 137 | { |
| 160 | __raw_spin_lock_flags(&(lock)->raw_lock, *(flags)) | 138 | arch_spin_lock(&lock->raw_lock); |
| 161 | # define _raw_spin_trylock(lock) __raw_spin_trylock(&(lock)->raw_lock) | 139 | } |
| 162 | # define _raw_spin_unlock(lock) __raw_spin_unlock(&(lock)->raw_lock) | 140 | |
| 163 | # define _raw_read_lock(rwlock) __raw_read_lock(&(rwlock)->raw_lock) | 141 | static inline void |
| 164 | # define _raw_read_lock_flags(lock, flags) \ | 142 | do_raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long *flags) |
| 165 | __raw_read_lock_flags(&(lock)->raw_lock, *(flags)) | 143 | { |
| 166 | # define _raw_read_trylock(rwlock) __raw_read_trylock(&(rwlock)->raw_lock) | 144 | arch_spin_lock_flags(&lock->raw_lock, *flags); |
| 167 | # define _raw_read_unlock(rwlock) __raw_read_unlock(&(rwlock)->raw_lock) | 145 | } |
| 168 | # define _raw_write_lock(rwlock) __raw_write_lock(&(rwlock)->raw_lock) | 146 | |
| 169 | # define _raw_write_lock_flags(lock, flags) \ | 147 | static inline int do_raw_spin_trylock(raw_spinlock_t *lock) |
| 170 | __raw_write_lock_flags(&(lock)->raw_lock, *(flags)) | 148 | { |
| 171 | # define _raw_write_trylock(rwlock) __raw_write_trylock(&(rwlock)->raw_lock) | 149 | return arch_spin_trylock(&(lock)->raw_lock); |
| 172 | # define _raw_write_unlock(rwlock) __raw_write_unlock(&(rwlock)->raw_lock) | 150 | } |
| 151 | |||
| 152 | static inline void do_raw_spin_unlock(raw_spinlock_t *lock) | ||
| 153 | { | ||
| 154 | arch_spin_unlock(&lock->raw_lock); | ||
| 155 | } | ||
| 173 | #endif | 156 | #endif |
| 174 | 157 | ||
| 175 | #define read_can_lock(rwlock) __raw_read_can_lock(&(rwlock)->raw_lock) | ||
| 176 | #define write_can_lock(rwlock) __raw_write_can_lock(&(rwlock)->raw_lock) | ||
| 177 | |||
| 178 | /* | 158 | /* |
| 179 | * Define the various spin_lock and rw_lock methods. Note we define these | 159 | * Define the various spin_lock methods. Note we define these |
| 180 | * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The various | 160 | * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The |
| 181 | * methods are defined as nops in the case they are not required. | 161 | * various methods are defined as nops in the case they are not |
| 162 | * required. | ||
| 182 | */ | 163 | */ |
| 183 | #define spin_trylock(lock) __cond_lock(lock, _spin_trylock(lock)) | 164 | #define raw_spin_trylock(lock) __cond_lock(lock, _raw_spin_trylock(lock)) |
| 184 | #define read_trylock(lock) __cond_lock(lock, _read_trylock(lock)) | ||
| 185 | #define write_trylock(lock) __cond_lock(lock, _write_trylock(lock)) | ||
| 186 | 165 | ||
| 187 | #define spin_lock(lock) _spin_lock(lock) | 166 | #define raw_spin_lock(lock) _raw_spin_lock(lock) |
| 188 | 167 | ||
| 189 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 168 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 190 | # define spin_lock_nested(lock, subclass) _spin_lock_nested(lock, subclass) | 169 | # define raw_spin_lock_nested(lock, subclass) \ |
| 191 | # define spin_lock_nest_lock(lock, nest_lock) \ | 170 | _raw_spin_lock_nested(lock, subclass) |
| 171 | |||
| 172 | # define raw_spin_lock_nest_lock(lock, nest_lock) \ | ||
| 192 | do { \ | 173 | do { \ |
| 193 | typecheck(struct lockdep_map *, &(nest_lock)->dep_map);\ | 174 | typecheck(struct lockdep_map *, &(nest_lock)->dep_map);\ |
| 194 | _spin_lock_nest_lock(lock, &(nest_lock)->dep_map); \ | 175 | _raw_spin_lock_nest_lock(lock, &(nest_lock)->dep_map); \ |
| 195 | } while (0) | 176 | } while (0) |
| 196 | #else | 177 | #else |
| 197 | # define spin_lock_nested(lock, subclass) _spin_lock(lock) | 178 | # define raw_spin_lock_nested(lock, subclass) _raw_spin_lock(lock) |
| 198 | # define spin_lock_nest_lock(lock, nest_lock) _spin_lock(lock) | 179 | # define raw_spin_lock_nest_lock(lock, nest_lock) _raw_spin_lock(lock) |
| 199 | #endif | 180 | #endif |
| 200 | 181 | ||
| 201 | #define write_lock(lock) _write_lock(lock) | ||
| 202 | #define read_lock(lock) _read_lock(lock) | ||
| 203 | |||
| 204 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) | 182 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) |
| 205 | 183 | ||
| 206 | #define spin_lock_irqsave(lock, flags) \ | 184 | #define raw_spin_lock_irqsave(lock, flags) \ |
| 207 | do { \ | 185 | do { \ |
| 208 | typecheck(unsigned long, flags); \ | 186 | typecheck(unsigned long, flags); \ |
| 209 | flags = _spin_lock_irqsave(lock); \ | 187 | flags = _raw_spin_lock_irqsave(lock); \ |
| 210 | } while (0) | ||
| 211 | #define read_lock_irqsave(lock, flags) \ | ||
| 212 | do { \ | ||
| 213 | typecheck(unsigned long, flags); \ | ||
| 214 | flags = _read_lock_irqsave(lock); \ | ||
| 215 | } while (0) | ||
| 216 | #define write_lock_irqsave(lock, flags) \ | ||
| 217 | do { \ | ||
| 218 | typecheck(unsigned long, flags); \ | ||
| 219 | flags = _write_lock_irqsave(lock); \ | ||
| 220 | } while (0) | 188 | } while (0) |
| 221 | 189 | ||
| 222 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 190 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 223 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ | 191 | #define raw_spin_lock_irqsave_nested(lock, flags, subclass) \ |
| 224 | do { \ | 192 | do { \ |
| 225 | typecheck(unsigned long, flags); \ | 193 | typecheck(unsigned long, flags); \ |
| 226 | flags = _spin_lock_irqsave_nested(lock, subclass); \ | 194 | flags = _raw_spin_lock_irqsave_nested(lock, subclass); \ |
| 227 | } while (0) | 195 | } while (0) |
| 228 | #else | 196 | #else |
| 229 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ | 197 | #define raw_spin_lock_irqsave_nested(lock, flags, subclass) \ |
| 230 | do { \ | 198 | do { \ |
| 231 | typecheck(unsigned long, flags); \ | 199 | typecheck(unsigned long, flags); \ |
| 232 | flags = _spin_lock_irqsave(lock); \ | 200 | flags = _raw_spin_lock_irqsave(lock); \ |
| 233 | } while (0) | 201 | } while (0) |
| 234 | #endif | 202 | #endif |
| 235 | 203 | ||
| 236 | #else | 204 | #else |
| 237 | 205 | ||
| 238 | #define spin_lock_irqsave(lock, flags) \ | 206 | #define raw_spin_lock_irqsave(lock, flags) \ |
| 239 | do { \ | ||
| 240 | typecheck(unsigned long, flags); \ | ||
| 241 | _spin_lock_irqsave(lock, flags); \ | ||
| 242 | } while (0) | ||
| 243 | #define read_lock_irqsave(lock, flags) \ | ||
| 244 | do { \ | ||
| 245 | typecheck(unsigned long, flags); \ | ||
| 246 | _read_lock_irqsave(lock, flags); \ | ||
| 247 | } while (0) | ||
| 248 | #define write_lock_irqsave(lock, flags) \ | ||
| 249 | do { \ | 207 | do { \ |
| 250 | typecheck(unsigned long, flags); \ | 208 | typecheck(unsigned long, flags); \ |
| 251 | _write_lock_irqsave(lock, flags); \ | 209 | _raw_spin_lock_irqsave(lock, flags); \ |
| 252 | } while (0) | 210 | } while (0) |
| 253 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ | ||
| 254 | spin_lock_irqsave(lock, flags) | ||
| 255 | 211 | ||
| 256 | #endif | 212 | #define raw_spin_lock_irqsave_nested(lock, flags, subclass) \ |
| 213 | raw_spin_lock_irqsave(lock, flags) | ||
| 257 | 214 | ||
| 258 | #define spin_lock_irq(lock) _spin_lock_irq(lock) | 215 | #endif |
| 259 | #define spin_lock_bh(lock) _spin_lock_bh(lock) | ||
| 260 | #define read_lock_irq(lock) _read_lock_irq(lock) | ||
| 261 | #define read_lock_bh(lock) _read_lock_bh(lock) | ||
| 262 | #define write_lock_irq(lock) _write_lock_irq(lock) | ||
| 263 | #define write_lock_bh(lock) _write_lock_bh(lock) | ||
| 264 | #define spin_unlock(lock) _spin_unlock(lock) | ||
| 265 | #define read_unlock(lock) _read_unlock(lock) | ||
| 266 | #define write_unlock(lock) _write_unlock(lock) | ||
| 267 | #define spin_unlock_irq(lock) _spin_unlock_irq(lock) | ||
| 268 | #define read_unlock_irq(lock) _read_unlock_irq(lock) | ||
| 269 | #define write_unlock_irq(lock) _write_unlock_irq(lock) | ||
| 270 | |||
| 271 | #define spin_unlock_irqrestore(lock, flags) \ | ||
| 272 | do { \ | ||
| 273 | typecheck(unsigned long, flags); \ | ||
| 274 | _spin_unlock_irqrestore(lock, flags); \ | ||
| 275 | } while (0) | ||
| 276 | #define spin_unlock_bh(lock) _spin_unlock_bh(lock) | ||
| 277 | 216 | ||
| 278 | #define read_unlock_irqrestore(lock, flags) \ | 217 | #define raw_spin_lock_irq(lock) _raw_spin_lock_irq(lock) |
| 279 | do { \ | 218 | #define raw_spin_lock_bh(lock) _raw_spin_lock_bh(lock) |
| 280 | typecheck(unsigned long, flags); \ | 219 | #define raw_spin_unlock(lock) _raw_spin_unlock(lock) |
| 281 | _read_unlock_irqrestore(lock, flags); \ | 220 | #define raw_spin_unlock_irq(lock) _raw_spin_unlock_irq(lock) |
| 282 | } while (0) | ||
| 283 | #define read_unlock_bh(lock) _read_unlock_bh(lock) | ||
| 284 | 221 | ||
| 285 | #define write_unlock_irqrestore(lock, flags) \ | 222 | #define raw_spin_unlock_irqrestore(lock, flags) \ |
| 286 | do { \ | 223 | do { \ |
| 287 | typecheck(unsigned long, flags); \ | 224 | typecheck(unsigned long, flags); \ |
| 288 | _write_unlock_irqrestore(lock, flags); \ | 225 | _raw_spin_unlock_irqrestore(lock, flags); \ |
| 289 | } while (0) | 226 | } while (0) |
| 290 | #define write_unlock_bh(lock) _write_unlock_bh(lock) | 227 | #define raw_spin_unlock_bh(lock) _raw_spin_unlock_bh(lock) |
| 291 | 228 | ||
| 292 | #define spin_trylock_bh(lock) __cond_lock(lock, _spin_trylock_bh(lock)) | 229 | #define raw_spin_trylock_bh(lock) \ |
| 230 | __cond_lock(lock, _raw_spin_trylock_bh(lock)) | ||
| 293 | 231 | ||
| 294 | #define spin_trylock_irq(lock) \ | 232 | #define raw_spin_trylock_irq(lock) \ |
| 295 | ({ \ | 233 | ({ \ |
| 296 | local_irq_disable(); \ | 234 | local_irq_disable(); \ |
| 297 | spin_trylock(lock) ? \ | 235 | raw_spin_trylock(lock) ? \ |
| 298 | 1 : ({ local_irq_enable(); 0; }); \ | 236 | 1 : ({ local_irq_enable(); 0; }); \ |
| 299 | }) | 237 | }) |
| 300 | 238 | ||
| 301 | #define spin_trylock_irqsave(lock, flags) \ | 239 | #define raw_spin_trylock_irqsave(lock, flags) \ |
| 302 | ({ \ | 240 | ({ \ |
| 303 | local_irq_save(flags); \ | 241 | local_irq_save(flags); \ |
| 304 | spin_trylock(lock) ? \ | 242 | raw_spin_trylock(lock) ? \ |
| 305 | 1 : ({ local_irq_restore(flags); 0; }); \ | 243 | 1 : ({ local_irq_restore(flags); 0; }); \ |
| 306 | }) | 244 | }) |
| 307 | 245 | ||
| 308 | #define write_trylock_irqsave(lock, flags) \ | 246 | /** |
| 309 | ({ \ | 247 | * raw_spin_can_lock - would raw_spin_trylock() succeed? |
| 310 | local_irq_save(flags); \ | 248 | * @lock: the spinlock in question. |
| 311 | write_trylock(lock) ? \ | 249 | */ |
| 312 | 1 : ({ local_irq_restore(flags); 0; }); \ | 250 | #define raw_spin_can_lock(lock) (!raw_spin_is_locked(lock)) |
| 251 | |||
| 252 | /* Include rwlock functions */ | ||
| 253 | #include <linux/rwlock.h> | ||
| 254 | |||
| 255 | /* | ||
| 256 | * Pull the _spin_*()/_read_*()/_write_*() functions/declarations: | ||
| 257 | */ | ||
| 258 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) | ||
| 259 | # include <linux/spinlock_api_smp.h> | ||
| 260 | #else | ||
| 261 | # include <linux/spinlock_api_up.h> | ||
| 262 | #endif | ||
| 263 | |||
| 264 | /* | ||
| 265 | * Map the spin_lock functions to the raw variants for PREEMPT_RT=n | ||
| 266 | */ | ||
| 267 | |||
| 268 | static inline raw_spinlock_t *spinlock_check(spinlock_t *lock) | ||
| 269 | { | ||
| 270 | return &lock->rlock; | ||
| 271 | } | ||
| 272 | |||
| 273 | #define spin_lock_init(_lock) \ | ||
| 274 | do { \ | ||
| 275 | spinlock_check(_lock); \ | ||
| 276 | raw_spin_lock_init(&(_lock)->rlock); \ | ||
| 277 | } while (0) | ||
| 278 | |||
| 279 | static inline void spin_lock(spinlock_t *lock) | ||
| 280 | { | ||
| 281 | raw_spin_lock(&lock->rlock); | ||
| 282 | } | ||
| 283 | |||
| 284 | static inline void spin_lock_bh(spinlock_t *lock) | ||
| 285 | { | ||
| 286 | raw_spin_lock_bh(&lock->rlock); | ||
| 287 | } | ||
| 288 | |||
| 289 | static inline int spin_trylock(spinlock_t *lock) | ||
| 290 | { | ||
| 291 | return raw_spin_trylock(&lock->rlock); | ||
| 292 | } | ||
| 293 | |||
| 294 | #define spin_lock_nested(lock, subclass) \ | ||
| 295 | do { \ | ||
| 296 | raw_spin_lock_nested(spinlock_check(lock), subclass); \ | ||
| 297 | } while (0) | ||
| 298 | |||
| 299 | #define spin_lock_nest_lock(lock, nest_lock) \ | ||
| 300 | do { \ | ||
| 301 | raw_spin_lock_nest_lock(spinlock_check(lock), nest_lock); \ | ||
| 302 | } while (0) | ||
| 303 | |||
| 304 | static inline void spin_lock_irq(spinlock_t *lock) | ||
| 305 | { | ||
| 306 | raw_spin_lock_irq(&lock->rlock); | ||
| 307 | } | ||
| 308 | |||
| 309 | #define spin_lock_irqsave(lock, flags) \ | ||
| 310 | do { \ | ||
| 311 | raw_spin_lock_irqsave(spinlock_check(lock), flags); \ | ||
| 312 | } while (0) | ||
| 313 | |||
| 314 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ | ||
| 315 | do { \ | ||
| 316 | raw_spin_lock_irqsave_nested(spinlock_check(lock), flags, subclass); \ | ||
| 317 | } while (0) | ||
| 318 | |||
| 319 | static inline void spin_unlock(spinlock_t *lock) | ||
| 320 | { | ||
| 321 | raw_spin_unlock(&lock->rlock); | ||
| 322 | } | ||
| 323 | |||
| 324 | static inline void spin_unlock_bh(spinlock_t *lock) | ||
| 325 | { | ||
| 326 | raw_spin_unlock_bh(&lock->rlock); | ||
| 327 | } | ||
| 328 | |||
| 329 | static inline void spin_unlock_irq(spinlock_t *lock) | ||
| 330 | { | ||
| 331 | raw_spin_unlock_irq(&lock->rlock); | ||
| 332 | } | ||
| 333 | |||
| 334 | static inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) | ||
| 335 | { | ||
| 336 | raw_spin_unlock_irqrestore(&lock->rlock, flags); | ||
| 337 | } | ||
| 338 | |||
| 339 | static inline int spin_trylock_bh(spinlock_t *lock) | ||
| 340 | { | ||
| 341 | return raw_spin_trylock_bh(&lock->rlock); | ||
| 342 | } | ||
| 343 | |||
| 344 | static inline int spin_trylock_irq(spinlock_t *lock) | ||
| 345 | { | ||
| 346 | return raw_spin_trylock_irq(&lock->rlock); | ||
| 347 | } | ||
| 348 | |||
| 349 | #define spin_trylock_irqsave(lock, flags) \ | ||
| 350 | ({ \ | ||
| 351 | raw_spin_trylock_irqsave(spinlock_check(lock), flags); \ | ||
| 313 | }) | 352 | }) |
| 314 | 353 | ||
| 354 | static inline void spin_unlock_wait(spinlock_t *lock) | ||
| 355 | { | ||
| 356 | raw_spin_unlock_wait(&lock->rlock); | ||
| 357 | } | ||
| 358 | |||
| 359 | static inline int spin_is_locked(spinlock_t *lock) | ||
| 360 | { | ||
| 361 | return raw_spin_is_locked(&lock->rlock); | ||
| 362 | } | ||
| 363 | |||
| 364 | static inline int spin_is_contended(spinlock_t *lock) | ||
| 365 | { | ||
| 366 | return raw_spin_is_contended(&lock->rlock); | ||
| 367 | } | ||
| 368 | |||
| 369 | static inline int spin_can_lock(spinlock_t *lock) | ||
| 370 | { | ||
| 371 | return raw_spin_can_lock(&lock->rlock); | ||
| 372 | } | ||
| 373 | |||
| 374 | static inline void assert_spin_locked(spinlock_t *lock) | ||
| 375 | { | ||
| 376 | assert_raw_spin_locked(&lock->rlock); | ||
| 377 | } | ||
| 378 | |||
| 315 | /* | 379 | /* |
| 316 | * Pull the atomic_t declaration: | 380 | * Pull the atomic_t declaration: |
| 317 | * (asm-mips/atomic.h needs above definitions) | 381 | * (asm-mips/atomic.h needs above definitions) |
| @@ -329,19 +393,4 @@ extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); | |||
| 329 | #define atomic_dec_and_lock(atomic, lock) \ | 393 | #define atomic_dec_and_lock(atomic, lock) \ |
| 330 | __cond_lock(lock, _atomic_dec_and_lock(atomic, lock)) | 394 | __cond_lock(lock, _atomic_dec_and_lock(atomic, lock)) |
| 331 | 395 | ||
| 332 | /** | ||
| 333 | * spin_can_lock - would spin_trylock() succeed? | ||
| 334 | * @lock: the spinlock in question. | ||
| 335 | */ | ||
| 336 | #define spin_can_lock(lock) (!spin_is_locked(lock)) | ||
| 337 | |||
| 338 | /* | ||
| 339 | * Pull the _spin_*()/_read_*()/_write_*() functions/declarations: | ||
| 340 | */ | ||
| 341 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) | ||
| 342 | # include <linux/spinlock_api_smp.h> | ||
| 343 | #else | ||
| 344 | # include <linux/spinlock_api_up.h> | ||
| 345 | #endif | ||
| 346 | |||
| 347 | #endif /* __LINUX_SPINLOCK_H */ | 396 | #endif /* __LINUX_SPINLOCK_H */ |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index 8264a7f459bc..e253ccd7a604 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
| @@ -17,165 +17,76 @@ | |||
| 17 | 17 | ||
| 18 | int in_lock_functions(unsigned long addr); | 18 | int in_lock_functions(unsigned long addr); |
| 19 | 19 | ||
| 20 | #define assert_spin_locked(x) BUG_ON(!spin_is_locked(x)) | 20 | #define assert_raw_spin_locked(x) BUG_ON(!raw_spin_is_locked(x)) |
| 21 | 21 | ||
| 22 | void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock); | 22 | void __lockfunc _raw_spin_lock(raw_spinlock_t *lock) __acquires(lock); |
| 23 | void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) | 23 | void __lockfunc _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass) |
| 24 | __acquires(lock); | 24 | __acquires(lock); |
| 25 | void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *map) | 25 | void __lockfunc |
| 26 | __acquires(lock); | 26 | _raw_spin_lock_nest_lock(raw_spinlock_t *lock, struct lockdep_map *map) |
| 27 | void __lockfunc _read_lock(rwlock_t *lock) __acquires(lock); | 27 | __acquires(lock); |
| 28 | void __lockfunc _write_lock(rwlock_t *lock) __acquires(lock); | 28 | void __lockfunc _raw_spin_lock_bh(raw_spinlock_t *lock) __acquires(lock); |
| 29 | void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(lock); | 29 | void __lockfunc _raw_spin_lock_irq(raw_spinlock_t *lock) |
| 30 | void __lockfunc _read_lock_bh(rwlock_t *lock) __acquires(lock); | 30 | __acquires(lock); |
| 31 | void __lockfunc _write_lock_bh(rwlock_t *lock) __acquires(lock); | 31 | |
| 32 | void __lockfunc _spin_lock_irq(spinlock_t *lock) __acquires(lock); | 32 | unsigned long __lockfunc _raw_spin_lock_irqsave(raw_spinlock_t *lock) |
| 33 | void __lockfunc _read_lock_irq(rwlock_t *lock) __acquires(lock); | 33 | __acquires(lock); |
| 34 | void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(lock); | 34 | unsigned long __lockfunc |
| 35 | unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) | 35 | _raw_spin_lock_irqsave_nested(raw_spinlock_t *lock, int subclass) |
| 36 | __acquires(lock); | 36 | __acquires(lock); |
| 37 | unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass) | 37 | int __lockfunc _raw_spin_trylock(raw_spinlock_t *lock); |
| 38 | __acquires(lock); | 38 | int __lockfunc _raw_spin_trylock_bh(raw_spinlock_t *lock); |
| 39 | unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) | 39 | void __lockfunc _raw_spin_unlock(raw_spinlock_t *lock) __releases(lock); |
| 40 | __acquires(lock); | 40 | void __lockfunc _raw_spin_unlock_bh(raw_spinlock_t *lock) __releases(lock); |
| 41 | unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) | 41 | void __lockfunc _raw_spin_unlock_irq(raw_spinlock_t *lock) __releases(lock); |
| 42 | __acquires(lock); | 42 | void __lockfunc |
| 43 | int __lockfunc _spin_trylock(spinlock_t *lock); | 43 | _raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags) |
| 44 | int __lockfunc _read_trylock(rwlock_t *lock); | 44 | __releases(lock); |
| 45 | int __lockfunc _write_trylock(rwlock_t *lock); | ||
| 46 | int __lockfunc _spin_trylock_bh(spinlock_t *lock); | ||
| 47 | void __lockfunc _spin_unlock(spinlock_t *lock) __releases(lock); | ||
| 48 | void __lockfunc _read_unlock(rwlock_t *lock) __releases(lock); | ||
| 49 | void __lockfunc _write_unlock(rwlock_t *lock) __releases(lock); | ||
| 50 | void __lockfunc _spin_unlock_bh(spinlock_t *lock) __releases(lock); | ||
| 51 | void __lockfunc _read_unlock_bh(rwlock_t *lock) __releases(lock); | ||
| 52 | void __lockfunc _write_unlock_bh(rwlock_t *lock) __releases(lock); | ||
| 53 | void __lockfunc _spin_unlock_irq(spinlock_t *lock) __releases(lock); | ||
| 54 | void __lockfunc _read_unlock_irq(rwlock_t *lock) __releases(lock); | ||
| 55 | void __lockfunc _write_unlock_irq(rwlock_t *lock) __releases(lock); | ||
| 56 | void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) | ||
| 57 | __releases(lock); | ||
| 58 | void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | ||
| 59 | __releases(lock); | ||
| 60 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | ||
| 61 | __releases(lock); | ||
| 62 | 45 | ||
| 63 | #ifdef CONFIG_INLINE_SPIN_LOCK | 46 | #ifdef CONFIG_INLINE_SPIN_LOCK |
| 64 | #define _spin_lock(lock) __spin_lock(lock) | 47 | #define _raw_spin_lock(lock) __raw_spin_lock(lock) |
| 65 | #endif | ||
| 66 | |||
| 67 | #ifdef CONFIG_INLINE_READ_LOCK | ||
| 68 | #define _read_lock(lock) __read_lock(lock) | ||
| 69 | #endif | ||
| 70 | |||
| 71 | #ifdef CONFIG_INLINE_WRITE_LOCK | ||
| 72 | #define _write_lock(lock) __write_lock(lock) | ||
| 73 | #endif | 48 | #endif |
| 74 | 49 | ||
| 75 | #ifdef CONFIG_INLINE_SPIN_LOCK_BH | 50 | #ifdef CONFIG_INLINE_SPIN_LOCK_BH |
| 76 | #define _spin_lock_bh(lock) __spin_lock_bh(lock) | 51 | #define _raw_spin_lock_bh(lock) __raw_spin_lock_bh(lock) |
| 77 | #endif | ||
| 78 | |||
| 79 | #ifdef CONFIG_INLINE_READ_LOCK_BH | ||
| 80 | #define _read_lock_bh(lock) __read_lock_bh(lock) | ||
| 81 | #endif | ||
| 82 | |||
| 83 | #ifdef CONFIG_INLINE_WRITE_LOCK_BH | ||
| 84 | #define _write_lock_bh(lock) __write_lock_bh(lock) | ||
| 85 | #endif | 52 | #endif |
| 86 | 53 | ||
| 87 | #ifdef CONFIG_INLINE_SPIN_LOCK_IRQ | 54 | #ifdef CONFIG_INLINE_SPIN_LOCK_IRQ |
| 88 | #define _spin_lock_irq(lock) __spin_lock_irq(lock) | 55 | #define _raw_spin_lock_irq(lock) __raw_spin_lock_irq(lock) |
| 89 | #endif | ||
| 90 | |||
| 91 | #ifdef CONFIG_INLINE_READ_LOCK_IRQ | ||
| 92 | #define _read_lock_irq(lock) __read_lock_irq(lock) | ||
| 93 | #endif | ||
| 94 | |||
| 95 | #ifdef CONFIG_INLINE_WRITE_LOCK_IRQ | ||
| 96 | #define _write_lock_irq(lock) __write_lock_irq(lock) | ||
| 97 | #endif | 56 | #endif |
| 98 | 57 | ||
| 99 | #ifdef CONFIG_INLINE_SPIN_LOCK_IRQSAVE | 58 | #ifdef CONFIG_INLINE_SPIN_LOCK_IRQSAVE |
| 100 | #define _spin_lock_irqsave(lock) __spin_lock_irqsave(lock) | 59 | #define _raw_spin_lock_irqsave(lock) __raw_spin_lock_irqsave(lock) |
| 101 | #endif | ||
| 102 | |||
| 103 | #ifdef CONFIG_INLINE_READ_LOCK_IRQSAVE | ||
| 104 | #define _read_lock_irqsave(lock) __read_lock_irqsave(lock) | ||
| 105 | #endif | ||
| 106 | |||
| 107 | #ifdef CONFIG_INLINE_WRITE_LOCK_IRQSAVE | ||
| 108 | #define _write_lock_irqsave(lock) __write_lock_irqsave(lock) | ||
| 109 | #endif | 60 | #endif |
| 110 | 61 | ||
| 111 | #ifdef CONFIG_INLINE_SPIN_TRYLOCK | 62 | #ifdef CONFIG_INLINE_SPIN_TRYLOCK |
| 112 | #define _spin_trylock(lock) __spin_trylock(lock) | 63 | #define _raw_spin_trylock(lock) __raw_spin_trylock(lock) |
| 113 | #endif | ||
| 114 | |||
| 115 | #ifdef CONFIG_INLINE_READ_TRYLOCK | ||
| 116 | #define _read_trylock(lock) __read_trylock(lock) | ||
| 117 | #endif | ||
| 118 | |||
| 119 | #ifdef CONFIG_INLINE_WRITE_TRYLOCK | ||
| 120 | #define _write_trylock(lock) __write_trylock(lock) | ||
| 121 | #endif | 64 | #endif |
| 122 | 65 | ||
| 123 | #ifdef CONFIG_INLINE_SPIN_TRYLOCK_BH | 66 | #ifdef CONFIG_INLINE_SPIN_TRYLOCK_BH |
| 124 | #define _spin_trylock_bh(lock) __spin_trylock_bh(lock) | 67 | #define _raw_spin_trylock_bh(lock) __raw_spin_trylock_bh(lock) |
| 125 | #endif | 68 | #endif |
| 126 | 69 | ||
| 127 | #ifdef CONFIG_INLINE_SPIN_UNLOCK | 70 | #ifdef CONFIG_INLINE_SPIN_UNLOCK |
| 128 | #define _spin_unlock(lock) __spin_unlock(lock) | 71 | #define _raw_spin_unlock(lock) __raw_spin_unlock(lock) |
| 129 | #endif | ||
| 130 | |||
| 131 | #ifdef CONFIG_INLINE_READ_UNLOCK | ||
| 132 | #define _read_unlock(lock) __read_unlock(lock) | ||
| 133 | #endif | ||
| 134 | |||
| 135 | #ifdef CONFIG_INLINE_WRITE_UNLOCK | ||
| 136 | #define _write_unlock(lock) __write_unlock(lock) | ||
| 137 | #endif | 72 | #endif |
| 138 | 73 | ||
| 139 | #ifdef CONFIG_INLINE_SPIN_UNLOCK_BH | 74 | #ifdef CONFIG_INLINE_SPIN_UNLOCK_BH |
| 140 | #define _spin_unlock_bh(lock) __spin_unlock_bh(lock) | 75 | #define _raw_spin_unlock_bh(lock) __raw_spin_unlock_bh(lock) |
| 141 | #endif | ||
| 142 | |||
| 143 | #ifdef CONFIG_INLINE_READ_UNLOCK_BH | ||
| 144 | #define _read_unlock_bh(lock) __read_unlock_bh(lock) | ||
| 145 | #endif | ||
| 146 | |||
| 147 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_BH | ||
| 148 | #define _write_unlock_bh(lock) __write_unlock_bh(lock) | ||
| 149 | #endif | 76 | #endif |
| 150 | 77 | ||
| 151 | #ifdef CONFIG_INLINE_SPIN_UNLOCK_IRQ | 78 | #ifdef CONFIG_INLINE_SPIN_UNLOCK_IRQ |
| 152 | #define _spin_unlock_irq(lock) __spin_unlock_irq(lock) | 79 | #define _raw_spin_unlock_irq(lock) __raw_spin_unlock_irq(lock) |
| 153 | #endif | ||
| 154 | |||
| 155 | #ifdef CONFIG_INLINE_READ_UNLOCK_IRQ | ||
| 156 | #define _read_unlock_irq(lock) __read_unlock_irq(lock) | ||
| 157 | #endif | ||
| 158 | |||
| 159 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQ | ||
| 160 | #define _write_unlock_irq(lock) __write_unlock_irq(lock) | ||
| 161 | #endif | 80 | #endif |
| 162 | 81 | ||
| 163 | #ifdef CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE | 82 | #ifdef CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE |
| 164 | #define _spin_unlock_irqrestore(lock, flags) __spin_unlock_irqrestore(lock, flags) | 83 | #define _raw_spin_unlock_irqrestore(lock, flags) __raw_spin_unlock_irqrestore(lock, flags) |
| 165 | #endif | ||
| 166 | |||
| 167 | #ifdef CONFIG_INLINE_READ_UNLOCK_IRQRESTORE | ||
| 168 | #define _read_unlock_irqrestore(lock, flags) __read_unlock_irqrestore(lock, flags) | ||
| 169 | #endif | ||
| 170 | |||
| 171 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE | ||
| 172 | #define _write_unlock_irqrestore(lock, flags) __write_unlock_irqrestore(lock, flags) | ||
| 173 | #endif | 84 | #endif |
| 174 | 85 | ||
| 175 | static inline int __spin_trylock(spinlock_t *lock) | 86 | static inline int __raw_spin_trylock(raw_spinlock_t *lock) |
| 176 | { | 87 | { |
| 177 | preempt_disable(); | 88 | preempt_disable(); |
| 178 | if (_raw_spin_trylock(lock)) { | 89 | if (do_raw_spin_trylock(lock)) { |
| 179 | spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); | 90 | spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); |
| 180 | return 1; | 91 | return 1; |
| 181 | } | 92 | } |
| @@ -183,28 +94,6 @@ static inline int __spin_trylock(spinlock_t *lock) | |||
| 183 | return 0; | 94 | return 0; |
| 184 | } | 95 | } |
| 185 | 96 | ||
| 186 | static inline int __read_trylock(rwlock_t *lock) | ||
| 187 | { | ||
| 188 | preempt_disable(); | ||
| 189 | if (_raw_read_trylock(lock)) { | ||
| 190 | rwlock_acquire_read(&lock->dep_map, 0, 1, _RET_IP_); | ||
| 191 | return 1; | ||
| 192 | } | ||
| 193 | preempt_enable(); | ||
| 194 | return 0; | ||
| 195 | } | ||
| 196 | |||
| 197 | static inline int __write_trylock(rwlock_t *lock) | ||
| 198 | { | ||
| 199 | preempt_disable(); | ||
| 200 | if (_raw_write_trylock(lock)) { | ||
| 201 | rwlock_acquire(&lock->dep_map, 0, 1, _RET_IP_); | ||
| 202 | return 1; | ||
| 203 | } | ||
| 204 | preempt_enable(); | ||
| 205 | return 0; | ||
| 206 | } | ||
| 207 | |||
| 208 | /* | 97 | /* |
| 209 | * If lockdep is enabled then we use the non-preemption spin-ops | 98 | * If lockdep is enabled then we use the non-preemption spin-ops |
| 210 | * even on CONFIG_PREEMPT, because lockdep assumes that interrupts are | 99 | * even on CONFIG_PREEMPT, because lockdep assumes that interrupts are |
| @@ -212,14 +101,7 @@ static inline int __write_trylock(rwlock_t *lock) | |||
| 212 | */ | 101 | */ |
| 213 | #if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC) | 102 | #if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC) |
| 214 | 103 | ||
| 215 | static inline void __read_lock(rwlock_t *lock) | 104 | static inline unsigned long __raw_spin_lock_irqsave(raw_spinlock_t *lock) |
| 216 | { | ||
| 217 | preempt_disable(); | ||
| 218 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 219 | LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); | ||
| 220 | } | ||
| 221 | |||
| 222 | static inline unsigned long __spin_lock_irqsave(spinlock_t *lock) | ||
| 223 | { | 105 | { |
| 224 | unsigned long flags; | 106 | unsigned long flags; |
| 225 | 107 | ||
| @@ -228,205 +110,79 @@ static inline unsigned long __spin_lock_irqsave(spinlock_t *lock) | |||
| 228 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 110 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
| 229 | /* | 111 | /* |
| 230 | * On lockdep we dont want the hand-coded irq-enable of | 112 | * On lockdep we dont want the hand-coded irq-enable of |
| 231 | * _raw_spin_lock_flags() code, because lockdep assumes | 113 | * do_raw_spin_lock_flags() code, because lockdep assumes |
| 232 | * that interrupts are not re-enabled during lock-acquire: | 114 | * that interrupts are not re-enabled during lock-acquire: |
| 233 | */ | 115 | */ |
| 234 | #ifdef CONFIG_LOCKDEP | 116 | #ifdef CONFIG_LOCKDEP |
| 235 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); | 117 | LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); |
| 236 | #else | 118 | #else |
| 237 | _raw_spin_lock_flags(lock, &flags); | 119 | do_raw_spin_lock_flags(lock, &flags); |
| 238 | #endif | 120 | #endif |
| 239 | return flags; | 121 | return flags; |
| 240 | } | 122 | } |
| 241 | 123 | ||
| 242 | static inline void __spin_lock_irq(spinlock_t *lock) | 124 | static inline void __raw_spin_lock_irq(raw_spinlock_t *lock) |
| 243 | { | 125 | { |
| 244 | local_irq_disable(); | 126 | local_irq_disable(); |
| 245 | preempt_disable(); | 127 | preempt_disable(); |
| 246 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 128 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
| 247 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); | 129 | LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); |
| 248 | } | 130 | } |
| 249 | 131 | ||
| 250 | static inline void __spin_lock_bh(spinlock_t *lock) | 132 | static inline void __raw_spin_lock_bh(raw_spinlock_t *lock) |
| 251 | { | 133 | { |
| 252 | local_bh_disable(); | 134 | local_bh_disable(); |
| 253 | preempt_disable(); | 135 | preempt_disable(); |
| 254 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 136 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
| 255 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); | 137 | LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); |
| 256 | } | ||
| 257 | |||
| 258 | static inline unsigned long __read_lock_irqsave(rwlock_t *lock) | ||
| 259 | { | ||
| 260 | unsigned long flags; | ||
| 261 | |||
| 262 | local_irq_save(flags); | ||
| 263 | preempt_disable(); | ||
| 264 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 265 | LOCK_CONTENDED_FLAGS(lock, _raw_read_trylock, _raw_read_lock, | ||
| 266 | _raw_read_lock_flags, &flags); | ||
| 267 | return flags; | ||
| 268 | } | ||
| 269 | |||
| 270 | static inline void __read_lock_irq(rwlock_t *lock) | ||
| 271 | { | ||
| 272 | local_irq_disable(); | ||
| 273 | preempt_disable(); | ||
| 274 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 275 | LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); | ||
| 276 | } | ||
| 277 | |||
| 278 | static inline void __read_lock_bh(rwlock_t *lock) | ||
| 279 | { | ||
| 280 | local_bh_disable(); | ||
| 281 | preempt_disable(); | ||
| 282 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 283 | LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); | ||
| 284 | } | ||
| 285 | |||
| 286 | static inline unsigned long __write_lock_irqsave(rwlock_t *lock) | ||
| 287 | { | ||
| 288 | unsigned long flags; | ||
| 289 | |||
| 290 | local_irq_save(flags); | ||
| 291 | preempt_disable(); | ||
| 292 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 293 | LOCK_CONTENDED_FLAGS(lock, _raw_write_trylock, _raw_write_lock, | ||
| 294 | _raw_write_lock_flags, &flags); | ||
| 295 | return flags; | ||
| 296 | } | ||
| 297 | |||
| 298 | static inline void __write_lock_irq(rwlock_t *lock) | ||
| 299 | { | ||
| 300 | local_irq_disable(); | ||
| 301 | preempt_disable(); | ||
| 302 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 303 | LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); | ||
| 304 | } | 138 | } |
| 305 | 139 | ||
| 306 | static inline void __write_lock_bh(rwlock_t *lock) | 140 | static inline void __raw_spin_lock(raw_spinlock_t *lock) |
| 307 | { | ||
| 308 | local_bh_disable(); | ||
| 309 | preempt_disable(); | ||
| 310 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 311 | LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); | ||
| 312 | } | ||
| 313 | |||
| 314 | static inline void __spin_lock(spinlock_t *lock) | ||
| 315 | { | 141 | { |
| 316 | preempt_disable(); | 142 | preempt_disable(); |
| 317 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 143 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
| 318 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); | 144 | LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); |
| 319 | } | ||
| 320 | |||
| 321 | static inline void __write_lock(rwlock_t *lock) | ||
| 322 | { | ||
| 323 | preempt_disable(); | ||
| 324 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 325 | LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); | ||
| 326 | } | 145 | } |
| 327 | 146 | ||
| 328 | #endif /* CONFIG_PREEMPT */ | 147 | #endif /* CONFIG_PREEMPT */ |
| 329 | 148 | ||
| 330 | static inline void __spin_unlock(spinlock_t *lock) | 149 | static inline void __raw_spin_unlock(raw_spinlock_t *lock) |
| 331 | { | 150 | { |
| 332 | spin_release(&lock->dep_map, 1, _RET_IP_); | 151 | spin_release(&lock->dep_map, 1, _RET_IP_); |
| 333 | _raw_spin_unlock(lock); | 152 | do_raw_spin_unlock(lock); |
| 334 | preempt_enable(); | ||
| 335 | } | ||
| 336 | |||
| 337 | static inline void __write_unlock(rwlock_t *lock) | ||
| 338 | { | ||
| 339 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 340 | _raw_write_unlock(lock); | ||
| 341 | preempt_enable(); | ||
| 342 | } | ||
| 343 | |||
| 344 | static inline void __read_unlock(rwlock_t *lock) | ||
| 345 | { | ||
| 346 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 347 | _raw_read_unlock(lock); | ||
| 348 | preempt_enable(); | 153 | preempt_enable(); |
| 349 | } | 154 | } |
| 350 | 155 | ||
| 351 | static inline void __spin_unlock_irqrestore(spinlock_t *lock, | 156 | static inline void __raw_spin_unlock_irqrestore(raw_spinlock_t *lock, |
| 352 | unsigned long flags) | 157 | unsigned long flags) |
| 353 | { | 158 | { |
| 354 | spin_release(&lock->dep_map, 1, _RET_IP_); | 159 | spin_release(&lock->dep_map, 1, _RET_IP_); |
| 355 | _raw_spin_unlock(lock); | 160 | do_raw_spin_unlock(lock); |
| 356 | local_irq_restore(flags); | 161 | local_irq_restore(flags); |
| 357 | preempt_enable(); | 162 | preempt_enable(); |
| 358 | } | 163 | } |
| 359 | 164 | ||
| 360 | static inline void __spin_unlock_irq(spinlock_t *lock) | 165 | static inline void __raw_spin_unlock_irq(raw_spinlock_t *lock) |
| 361 | { | 166 | { |
| 362 | spin_release(&lock->dep_map, 1, _RET_IP_); | 167 | spin_release(&lock->dep_map, 1, _RET_IP_); |
| 363 | _raw_spin_unlock(lock); | 168 | do_raw_spin_unlock(lock); |
| 364 | local_irq_enable(); | 169 | local_irq_enable(); |
| 365 | preempt_enable(); | 170 | preempt_enable(); |
| 366 | } | 171 | } |
| 367 | 172 | ||
| 368 | static inline void __spin_unlock_bh(spinlock_t *lock) | 173 | static inline void __raw_spin_unlock_bh(raw_spinlock_t *lock) |
| 369 | { | 174 | { |
| 370 | spin_release(&lock->dep_map, 1, _RET_IP_); | 175 | spin_release(&lock->dep_map, 1, _RET_IP_); |
| 371 | _raw_spin_unlock(lock); | 176 | do_raw_spin_unlock(lock); |
| 372 | preempt_enable_no_resched(); | ||
| 373 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 374 | } | ||
| 375 | |||
| 376 | static inline void __read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | ||
| 377 | { | ||
| 378 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 379 | _raw_read_unlock(lock); | ||
| 380 | local_irq_restore(flags); | ||
| 381 | preempt_enable(); | ||
| 382 | } | ||
| 383 | |||
| 384 | static inline void __read_unlock_irq(rwlock_t *lock) | ||
| 385 | { | ||
| 386 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 387 | _raw_read_unlock(lock); | ||
| 388 | local_irq_enable(); | ||
| 389 | preempt_enable(); | ||
| 390 | } | ||
| 391 | |||
| 392 | static inline void __read_unlock_bh(rwlock_t *lock) | ||
| 393 | { | ||
| 394 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 395 | _raw_read_unlock(lock); | ||
| 396 | preempt_enable_no_resched(); | 177 | preempt_enable_no_resched(); |
| 397 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | 178 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); |
| 398 | } | 179 | } |
| 399 | 180 | ||
| 400 | static inline void __write_unlock_irqrestore(rwlock_t *lock, | 181 | static inline int __raw_spin_trylock_bh(raw_spinlock_t *lock) |
| 401 | unsigned long flags) | ||
| 402 | { | ||
| 403 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 404 | _raw_write_unlock(lock); | ||
| 405 | local_irq_restore(flags); | ||
| 406 | preempt_enable(); | ||
| 407 | } | ||
| 408 | |||
| 409 | static inline void __write_unlock_irq(rwlock_t *lock) | ||
| 410 | { | ||
| 411 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 412 | _raw_write_unlock(lock); | ||
| 413 | local_irq_enable(); | ||
| 414 | preempt_enable(); | ||
| 415 | } | ||
| 416 | |||
| 417 | static inline void __write_unlock_bh(rwlock_t *lock) | ||
| 418 | { | ||
| 419 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 420 | _raw_write_unlock(lock); | ||
| 421 | preempt_enable_no_resched(); | ||
| 422 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 423 | } | ||
| 424 | |||
| 425 | static inline int __spin_trylock_bh(spinlock_t *lock) | ||
| 426 | { | 182 | { |
| 427 | local_bh_disable(); | 183 | local_bh_disable(); |
| 428 | preempt_disable(); | 184 | preempt_disable(); |
| 429 | if (_raw_spin_trylock(lock)) { | 185 | if (do_raw_spin_trylock(lock)) { |
| 430 | spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); | 186 | spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); |
| 431 | return 1; | 187 | return 1; |
| 432 | } | 188 | } |
| @@ -435,4 +191,6 @@ static inline int __spin_trylock_bh(spinlock_t *lock) | |||
| 435 | return 0; | 191 | return 0; |
| 436 | } | 192 | } |
| 437 | 193 | ||
| 194 | #include <linux/rwlock_api_smp.h> | ||
| 195 | |||
| 438 | #endif /* __LINUX_SPINLOCK_API_SMP_H */ | 196 | #endif /* __LINUX_SPINLOCK_API_SMP_H */ |
diff --git a/include/linux/spinlock_api_up.h b/include/linux/spinlock_api_up.h index 04e1d3164576..af1f47229e70 100644 --- a/include/linux/spinlock_api_up.h +++ b/include/linux/spinlock_api_up.h | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | #define in_lock_functions(ADDR) 0 | 17 | #define in_lock_functions(ADDR) 0 |
| 18 | 18 | ||
| 19 | #define assert_spin_locked(lock) do { (void)(lock); } while (0) | 19 | #define assert_raw_spin_locked(lock) do { (void)(lock); } while (0) |
| 20 | 20 | ||
| 21 | /* | 21 | /* |
| 22 | * In the UP-nondebug case there's no real locking going on, so the | 22 | * In the UP-nondebug case there's no real locking going on, so the |
| @@ -40,7 +40,8 @@ | |||
| 40 | do { preempt_enable(); __release(lock); (void)(lock); } while (0) | 40 | do { preempt_enable(); __release(lock); (void)(lock); } while (0) |
| 41 | 41 | ||
| 42 | #define __UNLOCK_BH(lock) \ | 42 | #define __UNLOCK_BH(lock) \ |
| 43 | do { preempt_enable_no_resched(); local_bh_enable(); __release(lock); (void)(lock); } while (0) | 43 | do { preempt_enable_no_resched(); local_bh_enable(); \ |
| 44 | __release(lock); (void)(lock); } while (0) | ||
| 44 | 45 | ||
| 45 | #define __UNLOCK_IRQ(lock) \ | 46 | #define __UNLOCK_IRQ(lock) \ |
| 46 | do { local_irq_enable(); __UNLOCK(lock); } while (0) | 47 | do { local_irq_enable(); __UNLOCK(lock); } while (0) |
| @@ -48,34 +49,37 @@ | |||
| 48 | #define __UNLOCK_IRQRESTORE(lock, flags) \ | 49 | #define __UNLOCK_IRQRESTORE(lock, flags) \ |
| 49 | do { local_irq_restore(flags); __UNLOCK(lock); } while (0) | 50 | do { local_irq_restore(flags); __UNLOCK(lock); } while (0) |
| 50 | 51 | ||
| 51 | #define _spin_lock(lock) __LOCK(lock) | 52 | #define _raw_spin_lock(lock) __LOCK(lock) |
| 52 | #define _spin_lock_nested(lock, subclass) __LOCK(lock) | 53 | #define _raw_spin_lock_nested(lock, subclass) __LOCK(lock) |
| 53 | #define _read_lock(lock) __LOCK(lock) | 54 | #define _raw_read_lock(lock) __LOCK(lock) |
| 54 | #define _write_lock(lock) __LOCK(lock) | 55 | #define _raw_write_lock(lock) __LOCK(lock) |
| 55 | #define _spin_lock_bh(lock) __LOCK_BH(lock) | 56 | #define _raw_spin_lock_bh(lock) __LOCK_BH(lock) |
| 56 | #define _read_lock_bh(lock) __LOCK_BH(lock) | 57 | #define _raw_read_lock_bh(lock) __LOCK_BH(lock) |
| 57 | #define _write_lock_bh(lock) __LOCK_BH(lock) | 58 | #define _raw_write_lock_bh(lock) __LOCK_BH(lock) |
| 58 | #define _spin_lock_irq(lock) __LOCK_IRQ(lock) | 59 | #define _raw_spin_lock_irq(lock) __LOCK_IRQ(lock) |
| 59 | #define _read_lock_irq(lock) __LOCK_IRQ(lock) | 60 | #define _raw_read_lock_irq(lock) __LOCK_IRQ(lock) |
| 60 | #define _write_lock_irq(lock) __LOCK_IRQ(lock) | 61 | #define _raw_write_lock_irq(lock) __LOCK_IRQ(lock) |
| 61 | #define _spin_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags) | 62 | #define _raw_spin_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags) |
| 62 | #define _read_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags) | 63 | #define _raw_read_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags) |
| 63 | #define _write_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags) | 64 | #define _raw_write_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags) |
| 64 | #define _spin_trylock(lock) ({ __LOCK(lock); 1; }) | 65 | #define _raw_spin_trylock(lock) ({ __LOCK(lock); 1; }) |
| 65 | #define _read_trylock(lock) ({ __LOCK(lock); 1; }) | 66 | #define _raw_read_trylock(lock) ({ __LOCK(lock); 1; }) |
| 66 | #define _write_trylock(lock) ({ __LOCK(lock); 1; }) | 67 | #define _raw_write_trylock(lock) ({ __LOCK(lock); 1; }) |
| 67 | #define _spin_trylock_bh(lock) ({ __LOCK_BH(lock); 1; }) | 68 | #define _raw_spin_trylock_bh(lock) ({ __LOCK_BH(lock); 1; }) |
| 68 | #define _spin_unlock(lock) __UNLOCK(lock) | 69 | #define _raw_spin_unlock(lock) __UNLOCK(lock) |
| 69 | #define _read_unlock(lock) __UNLOCK(lock) | 70 | #define _raw_read_unlock(lock) __UNLOCK(lock) |
| 70 | #define _write_unlock(lock) __UNLOCK(lock) | 71 | #define _raw_write_unlock(lock) __UNLOCK(lock) |
| 71 | #define _spin_unlock_bh(lock) __UNLOCK_BH(lock) | 72 | #define _raw_spin_unlock_bh(lock) __UNLOCK_BH(lock) |
| 72 | #define _write_unlock_bh(lock) __UNLOCK_BH(lock) | 73 | #define _raw_write_unlock_bh(lock) __UNLOCK_BH(lock) |
| 73 | #define _read_unlock_bh(lock) __UNLOCK_BH(lock) | 74 | #define _raw_read_unlock_bh(lock) __UNLOCK_BH(lock) |
| 74 | #define _spin_unlock_irq(lock) __UNLOCK_IRQ(lock) | 75 | #define _raw_spin_unlock_irq(lock) __UNLOCK_IRQ(lock) |
| 75 | #define _read_unlock_irq(lock) __UNLOCK_IRQ(lock) | 76 | #define _raw_read_unlock_irq(lock) __UNLOCK_IRQ(lock) |
| 76 | #define _write_unlock_irq(lock) __UNLOCK_IRQ(lock) | 77 | #define _raw_write_unlock_irq(lock) __UNLOCK_IRQ(lock) |
| 77 | #define _spin_unlock_irqrestore(lock, flags) __UNLOCK_IRQRESTORE(lock, flags) | 78 | #define _raw_spin_unlock_irqrestore(lock, flags) \ |
| 78 | #define _read_unlock_irqrestore(lock, flags) __UNLOCK_IRQRESTORE(lock, flags) | 79 | __UNLOCK_IRQRESTORE(lock, flags) |
| 79 | #define _write_unlock_irqrestore(lock, flags) __UNLOCK_IRQRESTORE(lock, flags) | 80 | #define _raw_read_unlock_irqrestore(lock, flags) \ |
| 81 | __UNLOCK_IRQRESTORE(lock, flags) | ||
| 82 | #define _raw_write_unlock_irqrestore(lock, flags) \ | ||
| 83 | __UNLOCK_IRQRESTORE(lock, flags) | ||
| 80 | 84 | ||
| 81 | #endif /* __LINUX_SPINLOCK_API_UP_H */ | 85 | #endif /* __LINUX_SPINLOCK_API_UP_H */ |
diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h index 68d88f71f1a2..851b7783720d 100644 --- a/include/linux/spinlock_types.h +++ b/include/linux/spinlock_types.h | |||
| @@ -17,8 +17,8 @@ | |||
| 17 | 17 | ||
| 18 | #include <linux/lockdep.h> | 18 | #include <linux/lockdep.h> |
| 19 | 19 | ||
| 20 | typedef struct { | 20 | typedef struct raw_spinlock { |
| 21 | raw_spinlock_t raw_lock; | 21 | arch_spinlock_t raw_lock; |
| 22 | #ifdef CONFIG_GENERIC_LOCKBREAK | 22 | #ifdef CONFIG_GENERIC_LOCKBREAK |
| 23 | unsigned int break_lock; | 23 | unsigned int break_lock; |
| 24 | #endif | 24 | #endif |
| @@ -29,26 +29,10 @@ typedef struct { | |||
| 29 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 29 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 30 | struct lockdep_map dep_map; | 30 | struct lockdep_map dep_map; |
| 31 | #endif | 31 | #endif |
| 32 | } spinlock_t; | 32 | } raw_spinlock_t; |
| 33 | 33 | ||
| 34 | #define SPINLOCK_MAGIC 0xdead4ead | 34 | #define SPINLOCK_MAGIC 0xdead4ead |
| 35 | 35 | ||
| 36 | typedef struct { | ||
| 37 | raw_rwlock_t raw_lock; | ||
| 38 | #ifdef CONFIG_GENERIC_LOCKBREAK | ||
| 39 | unsigned int break_lock; | ||
| 40 | #endif | ||
| 41 | #ifdef CONFIG_DEBUG_SPINLOCK | ||
| 42 | unsigned int magic, owner_cpu; | ||
| 43 | void *owner; | ||
| 44 | #endif | ||
| 45 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 46 | struct lockdep_map dep_map; | ||
| 47 | #endif | ||
| 48 | } rwlock_t; | ||
| 49 | |||
| 50 | #define RWLOCK_MAGIC 0xdeaf1eed | ||
| 51 | |||
| 52 | #define SPINLOCK_OWNER_INIT ((void *)-1L) | 36 | #define SPINLOCK_OWNER_INIT ((void *)-1L) |
| 53 | 37 | ||
| 54 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 38 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| @@ -57,44 +41,56 @@ typedef struct { | |||
| 57 | # define SPIN_DEP_MAP_INIT(lockname) | 41 | # define SPIN_DEP_MAP_INIT(lockname) |
| 58 | #endif | 42 | #endif |
| 59 | 43 | ||
| 60 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 44 | #ifdef CONFIG_DEBUG_SPINLOCK |
| 61 | # define RW_DEP_MAP_INIT(lockname) .dep_map = { .name = #lockname } | 45 | # define SPIN_DEBUG_INIT(lockname) \ |
| 46 | .magic = SPINLOCK_MAGIC, \ | ||
| 47 | .owner_cpu = -1, \ | ||
| 48 | .owner = SPINLOCK_OWNER_INIT, | ||
| 62 | #else | 49 | #else |
| 63 | # define RW_DEP_MAP_INIT(lockname) | 50 | # define SPIN_DEBUG_INIT(lockname) |
| 64 | #endif | 51 | #endif |
| 65 | 52 | ||
| 66 | #ifdef CONFIG_DEBUG_SPINLOCK | 53 | #define __RAW_SPIN_LOCK_INITIALIZER(lockname) \ |
| 67 | # define __SPIN_LOCK_UNLOCKED(lockname) \ | 54 | { \ |
| 68 | (spinlock_t) { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED, \ | 55 | .raw_lock = __ARCH_SPIN_LOCK_UNLOCKED, \ |
| 69 | .magic = SPINLOCK_MAGIC, \ | 56 | SPIN_DEBUG_INIT(lockname) \ |
| 70 | .owner = SPINLOCK_OWNER_INIT, \ | 57 | SPIN_DEP_MAP_INIT(lockname) } |
| 71 | .owner_cpu = -1, \ | 58 | |
| 72 | SPIN_DEP_MAP_INIT(lockname) } | 59 | #define __RAW_SPIN_LOCK_UNLOCKED(lockname) \ |
| 73 | #define __RW_LOCK_UNLOCKED(lockname) \ | 60 | (raw_spinlock_t) __RAW_SPIN_LOCK_INITIALIZER(lockname) |
| 74 | (rwlock_t) { .raw_lock = __RAW_RW_LOCK_UNLOCKED, \ | 61 | |
| 75 | .magic = RWLOCK_MAGIC, \ | 62 | #define DEFINE_RAW_SPINLOCK(x) raw_spinlock_t x = __RAW_SPIN_LOCK_UNLOCKED(x) |
| 76 | .owner = SPINLOCK_OWNER_INIT, \ | 63 | |
| 77 | .owner_cpu = -1, \ | 64 | typedef struct spinlock { |
| 78 | RW_DEP_MAP_INIT(lockname) } | 65 | union { |
| 79 | #else | 66 | struct raw_spinlock rlock; |
| 80 | # define __SPIN_LOCK_UNLOCKED(lockname) \ | 67 | |
| 81 | (spinlock_t) { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED, \ | 68 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 82 | SPIN_DEP_MAP_INIT(lockname) } | 69 | # define LOCK_PADSIZE (offsetof(struct raw_spinlock, dep_map)) |
| 83 | #define __RW_LOCK_UNLOCKED(lockname) \ | 70 | struct { |
| 84 | (rwlock_t) { .raw_lock = __RAW_RW_LOCK_UNLOCKED, \ | 71 | u8 __padding[LOCK_PADSIZE]; |
| 85 | RW_DEP_MAP_INIT(lockname) } | 72 | struct lockdep_map dep_map; |
| 73 | }; | ||
| 86 | #endif | 74 | #endif |
| 75 | }; | ||
| 76 | } spinlock_t; | ||
| 77 | |||
| 78 | #define __SPIN_LOCK_INITIALIZER(lockname) \ | ||
| 79 | { { .rlock = __RAW_SPIN_LOCK_INITIALIZER(lockname) } } | ||
| 80 | |||
| 81 | #define __SPIN_LOCK_UNLOCKED(lockname) \ | ||
| 82 | (spinlock_t ) __SPIN_LOCK_INITIALIZER(lockname) | ||
| 87 | 83 | ||
| 88 | /* | 84 | /* |
| 89 | * SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED defeat lockdep state tracking and | 85 | * SPIN_LOCK_UNLOCKED defeats lockdep state tracking and is hence |
| 90 | * are hence deprecated. | 86 | * deprecated. |
| 91 | * Please use DEFINE_SPINLOCK()/DEFINE_RWLOCK() or | 87 | * Please use DEFINE_SPINLOCK() or __SPIN_LOCK_UNLOCKED() as |
| 92 | * __SPIN_LOCK_UNLOCKED()/__RW_LOCK_UNLOCKED() as appropriate. | 88 | * appropriate. |
| 93 | */ | 89 | */ |
| 94 | #define SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(old_style_spin_init) | 90 | #define SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(old_style_spin_init) |
| 95 | #define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init) | ||
| 96 | 91 | ||
| 97 | #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) | 92 | #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) |
| 98 | #define DEFINE_RWLOCK(x) rwlock_t x = __RW_LOCK_UNLOCKED(x) | 93 | |
| 94 | #include <linux/rwlock_types.h> | ||
| 99 | 95 | ||
| 100 | #endif /* __LINUX_SPINLOCK_TYPES_H */ | 96 | #endif /* __LINUX_SPINLOCK_TYPES_H */ |
diff --git a/include/linux/spinlock_types_up.h b/include/linux/spinlock_types_up.h index 04135b0e198e..c09b6407ae1b 100644 --- a/include/linux/spinlock_types_up.h +++ b/include/linux/spinlock_types_up.h | |||
| @@ -16,22 +16,22 @@ | |||
| 16 | 16 | ||
| 17 | typedef struct { | 17 | typedef struct { |
| 18 | volatile unsigned int slock; | 18 | volatile unsigned int slock; |
| 19 | } raw_spinlock_t; | 19 | } arch_spinlock_t; |
| 20 | 20 | ||
| 21 | #define __RAW_SPIN_LOCK_UNLOCKED { 1 } | 21 | #define __ARCH_SPIN_LOCK_UNLOCKED { 1 } |
| 22 | 22 | ||
| 23 | #else | 23 | #else |
| 24 | 24 | ||
| 25 | typedef struct { } raw_spinlock_t; | 25 | typedef struct { } arch_spinlock_t; |
| 26 | 26 | ||
| 27 | #define __RAW_SPIN_LOCK_UNLOCKED { } | 27 | #define __ARCH_SPIN_LOCK_UNLOCKED { } |
| 28 | 28 | ||
| 29 | #endif | 29 | #endif |
| 30 | 30 | ||
| 31 | typedef struct { | 31 | typedef struct { |
| 32 | /* no debug version on UP */ | 32 | /* no debug version on UP */ |
| 33 | } raw_rwlock_t; | 33 | } arch_rwlock_t; |
| 34 | 34 | ||
| 35 | #define __RAW_RW_LOCK_UNLOCKED { } | 35 | #define __ARCH_RW_LOCK_UNLOCKED { } |
| 36 | 36 | ||
| 37 | #endif /* __LINUX_SPINLOCK_TYPES_UP_H */ | 37 | #endif /* __LINUX_SPINLOCK_TYPES_UP_H */ |
diff --git a/include/linux/spinlock_up.h b/include/linux/spinlock_up.h index d4841ed8215b..b14f6a91e19f 100644 --- a/include/linux/spinlock_up.h +++ b/include/linux/spinlock_up.h | |||
| @@ -18,21 +18,21 @@ | |||
| 18 | */ | 18 | */ |
| 19 | 19 | ||
| 20 | #ifdef CONFIG_DEBUG_SPINLOCK | 20 | #ifdef CONFIG_DEBUG_SPINLOCK |
| 21 | #define __raw_spin_is_locked(x) ((x)->slock == 0) | 21 | #define arch_spin_is_locked(x) ((x)->slock == 0) |
| 22 | 22 | ||
| 23 | static inline void __raw_spin_lock(raw_spinlock_t *lock) | 23 | static inline void arch_spin_lock(arch_spinlock_t *lock) |
| 24 | { | 24 | { |
| 25 | lock->slock = 0; | 25 | lock->slock = 0; |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | static inline void | 28 | static inline void |
| 29 | __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags) | 29 | arch_spin_lock_flags(arch_spinlock_t *lock, unsigned long flags) |
| 30 | { | 30 | { |
| 31 | local_irq_save(flags); | 31 | local_irq_save(flags); |
| 32 | lock->slock = 0; | 32 | lock->slock = 0; |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | static inline int __raw_spin_trylock(raw_spinlock_t *lock) | 35 | static inline int arch_spin_trylock(arch_spinlock_t *lock) |
| 36 | { | 36 | { |
| 37 | char oldval = lock->slock; | 37 | char oldval = lock->slock; |
| 38 | 38 | ||
| @@ -41,7 +41,7 @@ static inline int __raw_spin_trylock(raw_spinlock_t *lock) | |||
| 41 | return oldval > 0; | 41 | return oldval > 0; |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | static inline void __raw_spin_unlock(raw_spinlock_t *lock) | 44 | static inline void arch_spin_unlock(arch_spinlock_t *lock) |
| 45 | { | 45 | { |
| 46 | lock->slock = 1; | 46 | lock->slock = 1; |
| 47 | } | 47 | } |
| @@ -49,28 +49,28 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock) | |||
| 49 | /* | 49 | /* |
| 50 | * Read-write spinlocks. No debug version. | 50 | * Read-write spinlocks. No debug version. |
| 51 | */ | 51 | */ |
| 52 | #define __raw_read_lock(lock) do { (void)(lock); } while (0) | 52 | #define arch_read_lock(lock) do { (void)(lock); } while (0) |
| 53 | #define __raw_write_lock(lock) do { (void)(lock); } while (0) | 53 | #define arch_write_lock(lock) do { (void)(lock); } while (0) |
| 54 | #define __raw_read_trylock(lock) ({ (void)(lock); 1; }) | 54 | #define arch_read_trylock(lock) ({ (void)(lock); 1; }) |
| 55 | #define __raw_write_trylock(lock) ({ (void)(lock); 1; }) | 55 | #define arch_write_trylock(lock) ({ (void)(lock); 1; }) |
| 56 | #define __raw_read_unlock(lock) do { (void)(lock); } while (0) | 56 | #define arch_read_unlock(lock) do { (void)(lock); } while (0) |
| 57 | #define __raw_write_unlock(lock) do { (void)(lock); } while (0) | 57 | #define arch_write_unlock(lock) do { (void)(lock); } while (0) |
| 58 | 58 | ||
| 59 | #else /* DEBUG_SPINLOCK */ | 59 | #else /* DEBUG_SPINLOCK */ |
| 60 | #define __raw_spin_is_locked(lock) ((void)(lock), 0) | 60 | #define arch_spin_is_locked(lock) ((void)(lock), 0) |
| 61 | /* for sched.c and kernel_lock.c: */ | 61 | /* for sched.c and kernel_lock.c: */ |
| 62 | # define __raw_spin_lock(lock) do { (void)(lock); } while (0) | 62 | # define arch_spin_lock(lock) do { (void)(lock); } while (0) |
| 63 | # define __raw_spin_lock_flags(lock, flags) do { (void)(lock); } while (0) | 63 | # define arch_spin_lock_flags(lock, flags) do { (void)(lock); } while (0) |
| 64 | # define __raw_spin_unlock(lock) do { (void)(lock); } while (0) | 64 | # define arch_spin_unlock(lock) do { (void)(lock); } while (0) |
| 65 | # define __raw_spin_trylock(lock) ({ (void)(lock); 1; }) | 65 | # define arch_spin_trylock(lock) ({ (void)(lock); 1; }) |
| 66 | #endif /* DEBUG_SPINLOCK */ | 66 | #endif /* DEBUG_SPINLOCK */ |
| 67 | 67 | ||
| 68 | #define __raw_spin_is_contended(lock) (((void)(lock), 0)) | 68 | #define arch_spin_is_contended(lock) (((void)(lock), 0)) |
| 69 | 69 | ||
| 70 | #define __raw_read_can_lock(lock) (((void)(lock), 1)) | 70 | #define arch_read_can_lock(lock) (((void)(lock), 1)) |
| 71 | #define __raw_write_can_lock(lock) (((void)(lock), 1)) | 71 | #define arch_write_can_lock(lock) (((void)(lock), 1)) |
| 72 | 72 | ||
| 73 | #define __raw_spin_unlock_wait(lock) \ | 73 | #define arch_spin_unlock_wait(lock) \ |
| 74 | do { cpu_relax(); } while (__raw_spin_is_locked(lock)) | 74 | do { cpu_relax(); } while (arch_spin_is_locked(lock)) |
| 75 | 75 | ||
| 76 | #endif /* __LINUX_SPINLOCK_UP_H */ | 76 | #endif /* __LINUX_SPINLOCK_UP_H */ |
diff --git a/include/linux/string.h b/include/linux/string.h index b8508868d5ad..651839a2a755 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
| @@ -62,7 +62,15 @@ extern char * strnchr(const char *, size_t, int); | |||
| 62 | #ifndef __HAVE_ARCH_STRRCHR | 62 | #ifndef __HAVE_ARCH_STRRCHR |
| 63 | extern char * strrchr(const char *,int); | 63 | extern char * strrchr(const char *,int); |
| 64 | #endif | 64 | #endif |
| 65 | extern char * __must_check strstrip(char *); | 65 | extern char * __must_check skip_spaces(const char *); |
| 66 | |||
| 67 | extern char *strim(char *); | ||
| 68 | |||
| 69 | static inline __must_check char *strstrip(char *str) | ||
| 70 | { | ||
| 71 | return strim(str); | ||
| 72 | } | ||
| 73 | |||
| 66 | #ifndef __HAVE_ARCH_STRSTR | 74 | #ifndef __HAVE_ARCH_STRSTR |
| 67 | extern char * strstr(const char *,const char *); | 75 | extern char * strstr(const char *,const char *); |
| 68 | #endif | 76 | #endif |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 401097781fc0..1906782ec86b 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
| @@ -130,12 +130,14 @@ struct rpc_task_setup { | |||
| 130 | #define RPC_TASK_DYNAMIC 0x0080 /* task was kmalloc'ed */ | 130 | #define RPC_TASK_DYNAMIC 0x0080 /* task was kmalloc'ed */ |
| 131 | #define RPC_TASK_KILLED 0x0100 /* task was killed */ | 131 | #define RPC_TASK_KILLED 0x0100 /* task was killed */ |
| 132 | #define RPC_TASK_SOFT 0x0200 /* Use soft timeouts */ | 132 | #define RPC_TASK_SOFT 0x0200 /* Use soft timeouts */ |
| 133 | #define RPC_TASK_SOFTCONN 0x0400 /* Fail if can't connect */ | ||
| 133 | 134 | ||
| 134 | #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) | 135 | #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) |
| 135 | #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) | 136 | #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) |
| 136 | #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) | 137 | #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) |
| 137 | #define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) | 138 | #define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) |
| 138 | #define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT) | 139 | #define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT) |
| 140 | #define RPC_IS_SOFTCONN(t) ((t)->tk_flags & RPC_TASK_SOFTCONN) | ||
| 139 | 141 | ||
| 140 | #define RPC_TASK_RUNNING 0 | 142 | #define RPC_TASK_RUNNING 0 |
| 141 | #define RPC_TASK_QUEUED 1 | 143 | #define RPC_TASK_QUEUED 1 |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 4ec90019c1a4..a2602a8207a6 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -145,38 +145,43 @@ enum { | |||
| 145 | SWP_DISCARDABLE = (1 << 2), /* blkdev supports discard */ | 145 | SWP_DISCARDABLE = (1 << 2), /* blkdev supports discard */ |
| 146 | SWP_DISCARDING = (1 << 3), /* now discarding a free cluster */ | 146 | SWP_DISCARDING = (1 << 3), /* now discarding a free cluster */ |
| 147 | SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */ | 147 | SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */ |
| 148 | SWP_CONTINUED = (1 << 5), /* swap_map has count continuation */ | ||
| 148 | /* add others here before... */ | 149 | /* add others here before... */ |
| 149 | SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ | 150 | SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ |
| 150 | }; | 151 | }; |
| 151 | 152 | ||
| 152 | #define SWAP_CLUSTER_MAX 32 | 153 | #define SWAP_CLUSTER_MAX 32 |
| 153 | 154 | ||
| 154 | #define SWAP_MAP_MAX 0x7ffe | 155 | #define SWAP_MAP_MAX 0x3e /* Max duplication count, in first swap_map */ |
| 155 | #define SWAP_MAP_BAD 0x7fff | 156 | #define SWAP_MAP_BAD 0x3f /* Note pageblock is bad, in first swap_map */ |
| 156 | #define SWAP_HAS_CACHE 0x8000 /* There is a swap cache of entry. */ | 157 | #define SWAP_HAS_CACHE 0x40 /* Flag page is cached, in first swap_map */ |
| 157 | #define SWAP_COUNT_MASK (~SWAP_HAS_CACHE) | 158 | #define SWAP_CONT_MAX 0x7f /* Max count, in each swap_map continuation */ |
| 159 | #define COUNT_CONTINUED 0x80 /* See swap_map continuation for full count */ | ||
| 160 | #define SWAP_MAP_SHMEM 0xbf /* Owned by shmem/tmpfs, in first swap_map */ | ||
| 161 | |||
| 158 | /* | 162 | /* |
| 159 | * The in-memory structure used to track swap areas. | 163 | * The in-memory structure used to track swap areas. |
| 160 | */ | 164 | */ |
| 161 | struct swap_info_struct { | 165 | struct swap_info_struct { |
| 162 | unsigned long flags; | 166 | unsigned long flags; /* SWP_USED etc: see above */ |
| 163 | int prio; /* swap priority */ | 167 | signed short prio; /* swap priority of this type */ |
| 164 | int next; /* next entry on swap list */ | 168 | signed char type; /* strange name for an index */ |
| 165 | struct file *swap_file; | 169 | signed char next; /* next type on the swap list */ |
| 166 | struct block_device *bdev; | 170 | unsigned int max; /* extent of the swap_map */ |
| 167 | struct list_head extent_list; | 171 | unsigned char *swap_map; /* vmalloc'ed array of usage counts */ |
| 168 | struct swap_extent *curr_swap_extent; | 172 | unsigned int lowest_bit; /* index of first free in swap_map */ |
| 169 | unsigned short *swap_map; | 173 | unsigned int highest_bit; /* index of last free in swap_map */ |
| 170 | unsigned int lowest_bit; | 174 | unsigned int pages; /* total of usable pages of swap */ |
| 171 | unsigned int highest_bit; | 175 | unsigned int inuse_pages; /* number of those currently in use */ |
| 176 | unsigned int cluster_next; /* likely index for next allocation */ | ||
| 177 | unsigned int cluster_nr; /* countdown to next cluster search */ | ||
| 172 | unsigned int lowest_alloc; /* while preparing discard cluster */ | 178 | unsigned int lowest_alloc; /* while preparing discard cluster */ |
| 173 | unsigned int highest_alloc; /* while preparing discard cluster */ | 179 | unsigned int highest_alloc; /* while preparing discard cluster */ |
| 174 | unsigned int cluster_next; | 180 | struct swap_extent *curr_swap_extent; |
| 175 | unsigned int cluster_nr; | 181 | struct swap_extent first_swap_extent; |
| 176 | unsigned int pages; | 182 | struct block_device *bdev; /* swap device or bdev of swap file */ |
| 177 | unsigned int max; | 183 | struct file *swap_file; /* seldom referenced */ |
| 178 | unsigned int inuse_pages; | 184 | unsigned int old_block_size; /* seldom referenced */ |
| 179 | unsigned int old_block_size; | ||
| 180 | }; | 185 | }; |
| 181 | 186 | ||
| 182 | struct swap_list_t { | 187 | struct swap_list_t { |
| @@ -273,6 +278,7 @@ extern int scan_unevictable_register_node(struct node *node); | |||
| 273 | extern void scan_unevictable_unregister_node(struct node *node); | 278 | extern void scan_unevictable_unregister_node(struct node *node); |
| 274 | 279 | ||
| 275 | extern int kswapd_run(int nid); | 280 | extern int kswapd_run(int nid); |
| 281 | extern void kswapd_stop(int nid); | ||
| 276 | 282 | ||
| 277 | #ifdef CONFIG_MMU | 283 | #ifdef CONFIG_MMU |
| 278 | /* linux/mm/shmem.c */ | 284 | /* linux/mm/shmem.c */ |
| @@ -309,17 +315,18 @@ extern long total_swap_pages; | |||
| 309 | extern void si_swapinfo(struct sysinfo *); | 315 | extern void si_swapinfo(struct sysinfo *); |
| 310 | extern swp_entry_t get_swap_page(void); | 316 | extern swp_entry_t get_swap_page(void); |
| 311 | extern swp_entry_t get_swap_page_of_type(int); | 317 | extern swp_entry_t get_swap_page_of_type(int); |
| 312 | extern void swap_duplicate(swp_entry_t); | ||
| 313 | extern int swapcache_prepare(swp_entry_t); | ||
| 314 | extern int valid_swaphandles(swp_entry_t, unsigned long *); | 318 | extern int valid_swaphandles(swp_entry_t, unsigned long *); |
| 319 | extern int add_swap_count_continuation(swp_entry_t, gfp_t); | ||
| 320 | extern void swap_shmem_alloc(swp_entry_t); | ||
| 321 | extern int swap_duplicate(swp_entry_t); | ||
| 322 | extern int swapcache_prepare(swp_entry_t); | ||
| 315 | extern void swap_free(swp_entry_t); | 323 | extern void swap_free(swp_entry_t); |
| 316 | extern void swapcache_free(swp_entry_t, struct page *page); | 324 | extern void swapcache_free(swp_entry_t, struct page *page); |
| 317 | extern int free_swap_and_cache(swp_entry_t); | 325 | extern int free_swap_and_cache(swp_entry_t); |
| 318 | extern int swap_type_of(dev_t, sector_t, struct block_device **); | 326 | extern int swap_type_of(dev_t, sector_t, struct block_device **); |
| 319 | extern unsigned int count_swap_pages(int, int); | 327 | extern unsigned int count_swap_pages(int, int); |
| 320 | extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t); | 328 | extern sector_t map_swap_page(struct page *, struct block_device **); |
| 321 | extern sector_t swapdev_block(int, pgoff_t); | 329 | extern sector_t swapdev_block(int, pgoff_t); |
| 322 | extern struct swap_info_struct *get_swap_info_struct(unsigned); | ||
| 323 | extern int reuse_swap_page(struct page *); | 330 | extern int reuse_swap_page(struct page *); |
| 324 | extern int try_to_free_swap(struct page *); | 331 | extern int try_to_free_swap(struct page *); |
| 325 | struct backing_dev_info; | 332 | struct backing_dev_info; |
| @@ -384,8 +391,18 @@ static inline void show_swap_cache_info(void) | |||
| 384 | #define free_swap_and_cache(swp) is_migration_entry(swp) | 391 | #define free_swap_and_cache(swp) is_migration_entry(swp) |
| 385 | #define swapcache_prepare(swp) is_migration_entry(swp) | 392 | #define swapcache_prepare(swp) is_migration_entry(swp) |
| 386 | 393 | ||
| 387 | static inline void swap_duplicate(swp_entry_t swp) | 394 | static inline int add_swap_count_continuation(swp_entry_t swp, gfp_t gfp_mask) |
| 388 | { | 395 | { |
| 396 | return 0; | ||
| 397 | } | ||
| 398 | |||
| 399 | static inline void swap_shmem_alloc(swp_entry_t swp) | ||
| 400 | { | ||
| 401 | } | ||
| 402 | |||
| 403 | static inline int swap_duplicate(swp_entry_t swp) | ||
| 404 | { | ||
| 405 | return 0; | ||
| 389 | } | 406 | } |
| 390 | 407 | ||
| 391 | static inline void swap_free(swp_entry_t swp) | 408 | static inline void swap_free(swp_entry_t swp) |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index bc70c5810fec..939a61507ac5 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -834,4 +834,8 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | |||
| 834 | asmlinkage long sys_perf_event_open( | 834 | asmlinkage long sys_perf_event_open( |
| 835 | struct perf_event_attr __user *attr_uptr, | 835 | struct perf_event_attr __user *attr_uptr, |
| 836 | pid_t pid, int cpu, int group_fd, unsigned long flags); | 836 | pid_t pid, int cpu, int group_fd, unsigned long flags); |
| 837 | |||
| 838 | asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len, | ||
| 839 | unsigned long prot, unsigned long flags, | ||
| 840 | unsigned long fd, unsigned long pgoff); | ||
| 837 | #endif | 841 | #endif |
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h index 09077f6ed128..5cf397ceb726 100644 --- a/include/linux/trace_seq.h +++ b/include/linux/trace_seq.h | |||
| @@ -14,6 +14,7 @@ struct trace_seq { | |||
| 14 | unsigned char buffer[PAGE_SIZE]; | 14 | unsigned char buffer[PAGE_SIZE]; |
| 15 | unsigned int len; | 15 | unsigned int len; |
| 16 | unsigned int readpos; | 16 | unsigned int readpos; |
| 17 | int full; | ||
| 17 | }; | 18 | }; |
| 18 | 19 | ||
| 19 | static inline void | 20 | static inline void |
| @@ -21,6 +22,7 @@ trace_seq_init(struct trace_seq *s) | |||
| 21 | { | 22 | { |
| 22 | s->len = 0; | 23 | s->len = 0; |
| 23 | s->readpos = 0; | 24 | s->readpos = 0; |
| 25 | s->full = 0; | ||
| 24 | } | 26 | } |
| 25 | 27 | ||
| 26 | /* | 28 | /* |
| @@ -33,7 +35,7 @@ extern int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args) | |||
| 33 | __attribute__ ((format (printf, 2, 0))); | 35 | __attribute__ ((format (printf, 2, 0))); |
| 34 | extern int | 36 | extern int |
| 35 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); | 37 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); |
| 36 | extern void trace_print_seq(struct seq_file *m, struct trace_seq *s); | 38 | extern int trace_print_seq(struct seq_file *m, struct trace_seq *s); |
| 37 | extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, | 39 | extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, |
| 38 | size_t cnt); | 40 | size_t cnt); |
| 39 | extern int trace_seq_puts(struct trace_seq *s, const char *str); | 41 | extern int trace_seq_puts(struct trace_seq *s, const char *str); |
| @@ -55,8 +57,9 @@ trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary) | |||
| 55 | return 0; | 57 | return 0; |
| 56 | } | 58 | } |
| 57 | 59 | ||
| 58 | static inline void trace_print_seq(struct seq_file *m, struct trace_seq *s) | 60 | static inline int trace_print_seq(struct seq_file *m, struct trace_seq *s) |
| 59 | { | 61 | { |
| 62 | return 0; | ||
| 60 | } | 63 | } |
| 61 | static inline ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, | 64 | static inline ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, |
| 62 | size_t cnt) | 65 | size_t cnt) |
diff --git a/include/linux/tty.h b/include/linux/tty.h index f0f43d08d8b8..ef3a2947b102 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -190,9 +190,17 @@ struct tty_port_operations { | |||
| 190 | /* Control the DTR line */ | 190 | /* Control the DTR line */ |
| 191 | void (*dtr_rts)(struct tty_port *port, int raise); | 191 | void (*dtr_rts)(struct tty_port *port, int raise); |
| 192 | /* Called when the last close completes or a hangup finishes | 192 | /* Called when the last close completes or a hangup finishes |
| 193 | IFF the port was initialized. Do not use to free resources */ | 193 | IFF the port was initialized. Do not use to free resources. Called |
| 194 | under the port mutex to serialize against activate/shutdowns */ | ||
| 194 | void (*shutdown)(struct tty_port *port); | 195 | void (*shutdown)(struct tty_port *port); |
| 195 | void (*drop)(struct tty_port *port); | 196 | void (*drop)(struct tty_port *port); |
| 197 | /* Called under the port mutex from tty_port_open, serialized using | ||
| 198 | the port mutex */ | ||
| 199 | /* FIXME: long term getting the tty argument *out* of this would be | ||
| 200 | good for consoles */ | ||
| 201 | int (*activate)(struct tty_port *port, struct tty_struct *tty); | ||
| 202 | /* Called on the final put of a port */ | ||
| 203 | void (*destruct)(struct tty_port *port); | ||
| 196 | }; | 204 | }; |
| 197 | 205 | ||
| 198 | struct tty_port { | 206 | struct tty_port { |
| @@ -206,12 +214,14 @@ struct tty_port { | |||
| 206 | wait_queue_head_t delta_msr_wait; /* Modem status change */ | 214 | wait_queue_head_t delta_msr_wait; /* Modem status change */ |
| 207 | unsigned long flags; /* TTY flags ASY_*/ | 215 | unsigned long flags; /* TTY flags ASY_*/ |
| 208 | struct mutex mutex; /* Locking */ | 216 | struct mutex mutex; /* Locking */ |
| 217 | struct mutex buf_mutex; /* Buffer alloc lock */ | ||
| 209 | unsigned char *xmit_buf; /* Optional buffer */ | 218 | unsigned char *xmit_buf; /* Optional buffer */ |
| 210 | unsigned int close_delay; /* Close port delay */ | 219 | unsigned int close_delay; /* Close port delay */ |
| 211 | unsigned int closing_wait; /* Delay for output */ | 220 | unsigned int closing_wait; /* Delay for output */ |
| 212 | int drain_delay; /* Set to zero if no pure time | 221 | int drain_delay; /* Set to zero if no pure time |
| 213 | based drain is needed else | 222 | based drain is needed else |
| 214 | set to size of fifo */ | 223 | set to size of fifo */ |
| 224 | struct kref kref; /* Ref counter */ | ||
| 215 | }; | 225 | }; |
| 216 | 226 | ||
| 217 | /* | 227 | /* |
| @@ -340,8 +350,6 @@ extern void tty_write_flush(struct tty_struct *); | |||
| 340 | 350 | ||
| 341 | extern struct ktermios tty_std_termios; | 351 | extern struct ktermios tty_std_termios; |
| 342 | 352 | ||
| 343 | extern int kmsg_redirect; | ||
| 344 | |||
| 345 | extern void console_init(void); | 353 | extern void console_init(void); |
| 346 | extern int vcs_init(void); | 354 | extern int vcs_init(void); |
| 347 | 355 | ||
| @@ -439,7 +447,7 @@ extern void initialize_tty_struct(struct tty_struct *tty, | |||
| 439 | struct tty_driver *driver, int idx); | 447 | struct tty_driver *driver, int idx); |
| 440 | extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx, | 448 | extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx, |
| 441 | int first_ok); | 449 | int first_ok); |
| 442 | extern void tty_release_dev(struct file *filp); | 450 | extern int tty_release(struct inode *inode, struct file *filp); |
| 443 | extern int tty_init_termios(struct tty_struct *tty); | 451 | extern int tty_init_termios(struct tty_struct *tty); |
| 444 | 452 | ||
| 445 | extern struct tty_struct *tty_pair_get_tty(struct tty_struct *tty); | 453 | extern struct tty_struct *tty_pair_get_tty(struct tty_struct *tty); |
| @@ -454,6 +462,15 @@ extern int tty_write_lock(struct tty_struct *tty, int ndelay); | |||
| 454 | extern void tty_port_init(struct tty_port *port); | 462 | extern void tty_port_init(struct tty_port *port); |
| 455 | extern int tty_port_alloc_xmit_buf(struct tty_port *port); | 463 | extern int tty_port_alloc_xmit_buf(struct tty_port *port); |
| 456 | extern void tty_port_free_xmit_buf(struct tty_port *port); | 464 | extern void tty_port_free_xmit_buf(struct tty_port *port); |
| 465 | extern void tty_port_put(struct tty_port *port); | ||
| 466 | |||
| 467 | extern inline struct tty_port *tty_port_get(struct tty_port *port) | ||
| 468 | { | ||
| 469 | if (port) | ||
| 470 | kref_get(&port->kref); | ||
| 471 | return port; | ||
| 472 | } | ||
| 473 | |||
| 457 | extern struct tty_struct *tty_port_tty_get(struct tty_port *port); | 474 | extern struct tty_struct *tty_port_tty_get(struct tty_port *port); |
| 458 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); | 475 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); |
| 459 | extern int tty_port_carrier_raised(struct tty_port *port); | 476 | extern int tty_port_carrier_raised(struct tty_port *port); |
| @@ -467,6 +484,8 @@ extern int tty_port_close_start(struct tty_port *port, | |||
| 467 | extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); | 484 | extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); |
| 468 | extern void tty_port_close(struct tty_port *port, | 485 | extern void tty_port_close(struct tty_port *port, |
| 469 | struct tty_struct *tty, struct file *filp); | 486 | struct tty_struct *tty, struct file *filp); |
| 487 | extern int tty_port_open(struct tty_port *port, | ||
| 488 | struct tty_struct *tty, struct file *filp); | ||
| 470 | extern inline int tty_port_users(struct tty_port *port) | 489 | extern inline int tty_port_users(struct tty_port *port) |
| 471 | { | 490 | { |
| 472 | return port->count + port->blocked_open; | 491 | return port->count + port->blocked_open; |
diff --git a/include/linux/usb.h b/include/linux/usb.h index a34fa89f1474..e101a2d04d75 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -331,6 +331,7 @@ struct usb_bus { | |||
| 331 | u8 otg_port; /* 0, or number of OTG/HNP port */ | 331 | u8 otg_port; /* 0, or number of OTG/HNP port */ |
| 332 | unsigned is_b_host:1; /* true during some HNP roleswitches */ | 332 | unsigned is_b_host:1; /* true during some HNP roleswitches */ |
| 333 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ | 333 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ |
| 334 | unsigned sg_tablesize; /* 0 or largest number of sg list entries */ | ||
| 334 | 335 | ||
| 335 | int devnum_next; /* Next open device number in | 336 | int devnum_next; /* Next open device number in |
| 336 | * round-robin allocation */ | 337 | * round-robin allocation */ |
| @@ -428,11 +429,9 @@ struct usb_tt; | |||
| 428 | * @last_busy: time of last use | 429 | * @last_busy: time of last use |
| 429 | * @autosuspend_delay: in jiffies | 430 | * @autosuspend_delay: in jiffies |
| 430 | * @connect_time: time device was first connected | 431 | * @connect_time: time device was first connected |
| 431 | * @auto_pm: autosuspend/resume in progress | ||
| 432 | * @do_remote_wakeup: remote wakeup should be enabled | 432 | * @do_remote_wakeup: remote wakeup should be enabled |
| 433 | * @reset_resume: needs reset instead of resume | 433 | * @reset_resume: needs reset instead of resume |
| 434 | * @autosuspend_disabled: autosuspend disabled by the user | 434 | * @autosuspend_disabled: autosuspend disabled by the user |
| 435 | * @autoresume_disabled: autoresume disabled by the user | ||
| 436 | * @skip_sys_resume: skip the next system resume | 435 | * @skip_sys_resume: skip the next system resume |
| 437 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB | 436 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB |
| 438 | * specific data for the device. | 437 | * specific data for the device. |
| @@ -513,11 +512,9 @@ struct usb_device { | |||
| 513 | int autosuspend_delay; | 512 | int autosuspend_delay; |
| 514 | unsigned long connect_time; | 513 | unsigned long connect_time; |
| 515 | 514 | ||
| 516 | unsigned auto_pm:1; | ||
| 517 | unsigned do_remote_wakeup:1; | 515 | unsigned do_remote_wakeup:1; |
| 518 | unsigned reset_resume:1; | 516 | unsigned reset_resume:1; |
| 519 | unsigned autosuspend_disabled:1; | 517 | unsigned autosuspend_disabled:1; |
| 520 | unsigned autoresume_disabled:1; | ||
| 521 | unsigned skip_sys_resume:1; | 518 | unsigned skip_sys_resume:1; |
| 522 | #endif | 519 | #endif |
| 523 | struct wusb_dev *wusb_dev; | 520 | struct wusb_dev *wusb_dev; |
| @@ -543,22 +540,20 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | |||
| 543 | 540 | ||
| 544 | /* USB autosuspend and autoresume */ | 541 | /* USB autosuspend and autoresume */ |
| 545 | #ifdef CONFIG_USB_SUSPEND | 542 | #ifdef CONFIG_USB_SUSPEND |
| 546 | extern int usb_autopm_set_interface(struct usb_interface *intf); | ||
| 547 | extern int usb_autopm_get_interface(struct usb_interface *intf); | 543 | extern int usb_autopm_get_interface(struct usb_interface *intf); |
| 548 | extern void usb_autopm_put_interface(struct usb_interface *intf); | 544 | extern void usb_autopm_put_interface(struct usb_interface *intf); |
| 549 | extern int usb_autopm_get_interface_async(struct usb_interface *intf); | 545 | extern int usb_autopm_get_interface_async(struct usb_interface *intf); |
| 550 | extern void usb_autopm_put_interface_async(struct usb_interface *intf); | 546 | extern void usb_autopm_put_interface_async(struct usb_interface *intf); |
| 551 | 547 | ||
| 552 | static inline void usb_autopm_enable(struct usb_interface *intf) | 548 | static inline void usb_autopm_get_interface_no_resume( |
| 549 | struct usb_interface *intf) | ||
| 553 | { | 550 | { |
| 554 | atomic_set(&intf->pm_usage_cnt, 0); | 551 | atomic_inc(&intf->pm_usage_cnt); |
| 555 | usb_autopm_set_interface(intf); | ||
| 556 | } | 552 | } |
| 557 | 553 | static inline void usb_autopm_put_interface_no_suspend( | |
| 558 | static inline void usb_autopm_disable(struct usb_interface *intf) | 554 | struct usb_interface *intf) |
| 559 | { | 555 | { |
| 560 | atomic_set(&intf->pm_usage_cnt, 1); | 556 | atomic_dec(&intf->pm_usage_cnt); |
| 561 | usb_autopm_set_interface(intf); | ||
| 562 | } | 557 | } |
| 563 | 558 | ||
| 564 | static inline void usb_mark_last_busy(struct usb_device *udev) | 559 | static inline void usb_mark_last_busy(struct usb_device *udev) |
| @@ -568,12 +563,8 @@ static inline void usb_mark_last_busy(struct usb_device *udev) | |||
| 568 | 563 | ||
| 569 | #else | 564 | #else |
| 570 | 565 | ||
| 571 | static inline int usb_autopm_set_interface(struct usb_interface *intf) | ||
| 572 | { return 0; } | ||
| 573 | |||
| 574 | static inline int usb_autopm_get_interface(struct usb_interface *intf) | 566 | static inline int usb_autopm_get_interface(struct usb_interface *intf) |
| 575 | { return 0; } | 567 | { return 0; } |
| 576 | |||
| 577 | static inline int usb_autopm_get_interface_async(struct usb_interface *intf) | 568 | static inline int usb_autopm_get_interface_async(struct usb_interface *intf) |
| 578 | { return 0; } | 569 | { return 0; } |
| 579 | 570 | ||
| @@ -581,9 +572,11 @@ static inline void usb_autopm_put_interface(struct usb_interface *intf) | |||
| 581 | { } | 572 | { } |
| 582 | static inline void usb_autopm_put_interface_async(struct usb_interface *intf) | 573 | static inline void usb_autopm_put_interface_async(struct usb_interface *intf) |
| 583 | { } | 574 | { } |
| 584 | static inline void usb_autopm_enable(struct usb_interface *intf) | 575 | static inline void usb_autopm_get_interface_no_resume( |
| 576 | struct usb_interface *intf) | ||
| 585 | { } | 577 | { } |
| 586 | static inline void usb_autopm_disable(struct usb_interface *intf) | 578 | static inline void usb_autopm_put_interface_no_suspend( |
| 579 | struct usb_interface *intf) | ||
| 587 | { } | 580 | { } |
| 588 | static inline void usb_mark_last_busy(struct usb_device *udev) | 581 | static inline void usb_mark_last_busy(struct usb_device *udev) |
| 589 | { } | 582 | { } |
| @@ -626,6 +619,10 @@ extern struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev, | |||
| 626 | unsigned ifnum); | 619 | unsigned ifnum); |
| 627 | extern struct usb_host_interface *usb_altnum_to_altsetting( | 620 | extern struct usb_host_interface *usb_altnum_to_altsetting( |
| 628 | const struct usb_interface *intf, unsigned int altnum); | 621 | const struct usb_interface *intf, unsigned int altnum); |
| 622 | extern struct usb_host_interface *usb_find_alt_setting( | ||
| 623 | struct usb_host_config *config, | ||
| 624 | unsigned int iface_num, | ||
| 625 | unsigned int alt_num); | ||
| 629 | 626 | ||
| 630 | 627 | ||
| 631 | /** | 628 | /** |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 4f6bb3d2160e..738ea1a691cb 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
| @@ -127,6 +127,7 @@ struct usb_function { | |||
| 127 | /* private: */ | 127 | /* private: */ |
| 128 | /* internals */ | 128 | /* internals */ |
| 129 | struct list_head list; | 129 | struct list_head list; |
| 130 | DECLARE_BITMAP(endpoints, 32); | ||
| 130 | }; | 131 | }; |
| 131 | 132 | ||
| 132 | int usb_add_function(struct usb_configuration *, struct usb_function *); | 133 | int usb_add_function(struct usb_configuration *, struct usb_function *); |
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 2443c0e7a80c..52bb917641f0 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
| @@ -33,6 +33,23 @@ enum usb_otg_state { | |||
| 33 | OTG_STATE_A_VBUS_ERR, | 33 | OTG_STATE_A_VBUS_ERR, |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | #define USB_OTG_PULLUP_ID (1 << 0) | ||
| 37 | #define USB_OTG_PULLDOWN_DP (1 << 1) | ||
| 38 | #define USB_OTG_PULLDOWN_DM (1 << 2) | ||
| 39 | #define USB_OTG_EXT_VBUS_INDICATOR (1 << 3) | ||
| 40 | #define USB_OTG_DRV_VBUS (1 << 4) | ||
| 41 | #define USB_OTG_DRV_VBUS_EXT (1 << 5) | ||
| 42 | |||
| 43 | struct otg_transceiver; | ||
| 44 | |||
| 45 | /* for transceivers connected thru an ULPI interface, the user must | ||
| 46 | * provide access ops | ||
| 47 | */ | ||
| 48 | struct otg_io_access_ops { | ||
| 49 | int (*read)(struct otg_transceiver *otg, u32 reg); | ||
| 50 | int (*write)(struct otg_transceiver *otg, u32 val, u32 reg); | ||
| 51 | }; | ||
| 52 | |||
| 36 | /* | 53 | /* |
| 37 | * the otg driver needs to interact with both device side and host side | 54 | * the otg driver needs to interact with both device side and host side |
| 38 | * usb controllers. it decides which controller is active at a given | 55 | * usb controllers. it decides which controller is active at a given |
| @@ -42,6 +59,7 @@ enum usb_otg_state { | |||
| 42 | struct otg_transceiver { | 59 | struct otg_transceiver { |
| 43 | struct device *dev; | 60 | struct device *dev; |
| 44 | const char *label; | 61 | const char *label; |
| 62 | unsigned int flags; | ||
| 45 | 63 | ||
| 46 | u8 default_a; | 64 | u8 default_a; |
| 47 | enum usb_otg_state state; | 65 | enum usb_otg_state state; |
| @@ -49,10 +67,17 @@ struct otg_transceiver { | |||
| 49 | struct usb_bus *host; | 67 | struct usb_bus *host; |
| 50 | struct usb_gadget *gadget; | 68 | struct usb_gadget *gadget; |
| 51 | 69 | ||
| 70 | struct otg_io_access_ops *io_ops; | ||
| 71 | void __iomem *io_priv; | ||
| 72 | |||
| 52 | /* to pass extra port status to the root hub */ | 73 | /* to pass extra port status to the root hub */ |
| 53 | u16 port_status; | 74 | u16 port_status; |
| 54 | u16 port_change; | 75 | u16 port_change; |
| 55 | 76 | ||
| 77 | /* initialize/shutdown the OTG controller */ | ||
| 78 | int (*init)(struct otg_transceiver *otg); | ||
| 79 | void (*shutdown)(struct otg_transceiver *otg); | ||
| 80 | |||
| 56 | /* bind/unbind the host controller */ | 81 | /* bind/unbind the host controller */ |
| 57 | int (*set_host)(struct otg_transceiver *otg, | 82 | int (*set_host)(struct otg_transceiver *otg, |
| 58 | struct usb_bus *host); | 83 | struct usb_bus *host); |
| @@ -65,6 +90,10 @@ struct otg_transceiver { | |||
| 65 | int (*set_power)(struct otg_transceiver *otg, | 90 | int (*set_power)(struct otg_transceiver *otg, |
| 66 | unsigned mA); | 91 | unsigned mA); |
| 67 | 92 | ||
| 93 | /* effective for A-peripheral, ignored for B devices */ | ||
| 94 | int (*set_vbus)(struct otg_transceiver *otg, | ||
| 95 | bool enabled); | ||
| 96 | |||
| 68 | /* for non-OTG B devices: set transceiver into suspend mode */ | 97 | /* for non-OTG B devices: set transceiver into suspend mode */ |
| 69 | int (*set_suspend)(struct otg_transceiver *otg, | 98 | int (*set_suspend)(struct otg_transceiver *otg, |
| 70 | int suspend); | 99 | int suspend); |
| @@ -85,6 +114,38 @@ extern int otg_set_transceiver(struct otg_transceiver *); | |||
| 85 | extern void usb_nop_xceiv_register(void); | 114 | extern void usb_nop_xceiv_register(void); |
| 86 | extern void usb_nop_xceiv_unregister(void); | 115 | extern void usb_nop_xceiv_unregister(void); |
| 87 | 116 | ||
| 117 | /* helpers for direct access thru low-level io interface */ | ||
| 118 | static inline int otg_io_read(struct otg_transceiver *otg, u32 reg) | ||
| 119 | { | ||
| 120 | if (otg->io_ops && otg->io_ops->read) | ||
| 121 | return otg->io_ops->read(otg, reg); | ||
| 122 | |||
| 123 | return -EINVAL; | ||
| 124 | } | ||
| 125 | |||
| 126 | static inline int otg_io_write(struct otg_transceiver *otg, u32 reg, u32 val) | ||
| 127 | { | ||
| 128 | if (otg->io_ops && otg->io_ops->write) | ||
| 129 | return otg->io_ops->write(otg, reg, val); | ||
| 130 | |||
| 131 | return -EINVAL; | ||
| 132 | } | ||
| 133 | |||
| 134 | static inline int | ||
| 135 | otg_init(struct otg_transceiver *otg) | ||
| 136 | { | ||
| 137 | if (otg->init) | ||
| 138 | return otg->init(otg); | ||
| 139 | |||
| 140 | return 0; | ||
| 141 | } | ||
| 142 | |||
| 143 | static inline void | ||
| 144 | otg_shutdown(struct otg_transceiver *otg) | ||
| 145 | { | ||
| 146 | if (otg->shutdown) | ||
| 147 | otg->shutdown(otg); | ||
| 148 | } | ||
| 88 | 149 | ||
| 89 | /* for usb host and peripheral controller drivers */ | 150 | /* for usb host and peripheral controller drivers */ |
| 90 | extern struct otg_transceiver *otg_get_transceiver(void); | 151 | extern struct otg_transceiver *otg_get_transceiver(void); |
| @@ -97,6 +158,12 @@ otg_start_hnp(struct otg_transceiver *otg) | |||
| 97 | return otg->start_hnp(otg); | 158 | return otg->start_hnp(otg); |
| 98 | } | 159 | } |
| 99 | 160 | ||
| 161 | /* Context: can sleep */ | ||
| 162 | static inline int | ||
| 163 | otg_set_vbus(struct otg_transceiver *otg, bool enabled) | ||
| 164 | { | ||
| 165 | return otg->set_vbus(otg, enabled); | ||
| 166 | } | ||
| 100 | 167 | ||
| 101 | /* for HCDs */ | 168 | /* for HCDs */ |
| 102 | static inline int | 169 | static inline int |
| @@ -105,7 +172,6 @@ otg_set_host(struct otg_transceiver *otg, struct usb_bus *host) | |||
| 105 | return otg->set_host(otg, host); | 172 | return otg->set_host(otg, host); |
| 106 | } | 173 | } |
| 107 | 174 | ||
| 108 | |||
| 109 | /* for usb peripheral controller drivers */ | 175 | /* for usb peripheral controller drivers */ |
| 110 | 176 | ||
| 111 | /* Context: can sleep */ | 177 | /* Context: can sleep */ |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index ce911ebf91e8..acf6e457c04b 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
| @@ -39,8 +39,6 @@ enum port_dev_state { | |||
| 39 | * @serial: pointer back to the struct usb_serial owner of this port. | 39 | * @serial: pointer back to the struct usb_serial owner of this port. |
| 40 | * @port: pointer to the corresponding tty_port for this port. | 40 | * @port: pointer to the corresponding tty_port for this port. |
| 41 | * @lock: spinlock to grab when updating portions of this structure. | 41 | * @lock: spinlock to grab when updating portions of this structure. |
| 42 | * @mutex: mutex used to synchronize serial_open() and serial_close() | ||
| 43 | * access for this port. | ||
| 44 | * @number: the number of the port (the minor number). | 42 | * @number: the number of the port (the minor number). |
| 45 | * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. | 43 | * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. |
| 46 | * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. | 44 | * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. |
| @@ -77,7 +75,6 @@ struct usb_serial_port { | |||
| 77 | struct usb_serial *serial; | 75 | struct usb_serial *serial; |
| 78 | struct tty_port port; | 76 | struct tty_port port; |
| 79 | spinlock_t lock; | 77 | spinlock_t lock; |
| 80 | struct mutex mutex; | ||
| 81 | unsigned char number; | 78 | unsigned char number; |
| 82 | 79 | ||
| 83 | unsigned char *interrupt_in_buffer; | 80 | unsigned char *interrupt_in_buffer; |
diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h new file mode 100644 index 000000000000..20675c6ebc4d --- /dev/null +++ b/include/linux/usb/ulpi.h | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #ifndef __LINUX_USB_ULPI_H | ||
| 2 | #define __LINUX_USB_ULPI_H | ||
| 3 | |||
| 4 | struct otg_transceiver *otg_ulpi_create(struct otg_io_access_ops *ops, | ||
| 5 | unsigned int flags); | ||
| 6 | |||
| 7 | #endif /* __LINUX_USB_ULPI_H */ | ||
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index 3d15fb9bc116..a4b947e470a5 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
| @@ -56,7 +56,9 @@ | |||
| 56 | US_FLAG(SANE_SENSE, 0x00008000) \ | 56 | US_FLAG(SANE_SENSE, 0x00008000) \ |
| 57 | /* Sane Sense (> 18 bytes) */ \ | 57 | /* Sane Sense (> 18 bytes) */ \ |
| 58 | US_FLAG(CAPACITY_OK, 0x00010000) \ | 58 | US_FLAG(CAPACITY_OK, 0x00010000) \ |
| 59 | /* READ CAPACITY response is correct */ | 59 | /* READ CAPACITY response is correct */ \ |
| 60 | US_FLAG(BAD_SENSE, 0x00020000) \ | ||
| 61 | /* Bad Sense (never more than 18 bytes) */ | ||
| 60 | 62 | ||
| 61 | #define US_FLAG(name, value) US_FL_##name = value , | 63 | #define US_FLAG(name, value) US_FL_##name = value , |
| 62 | enum { US_DO_ALL_FLAGS }; | 64 | enum { US_DO_ALL_FLAGS }; |
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index b2a7d8ba6ee3..15591d2ea400 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h | |||
| @@ -128,6 +128,29 @@ struct usbdevfs_hub_portinfo { | |||
| 128 | #ifdef __KERNEL__ | 128 | #ifdef __KERNEL__ |
| 129 | #ifdef CONFIG_COMPAT | 129 | #ifdef CONFIG_COMPAT |
| 130 | #include <linux/compat.h> | 130 | #include <linux/compat.h> |
| 131 | |||
| 132 | struct usbdevfs_ctrltransfer32 { | ||
| 133 | u8 bRequestType; | ||
| 134 | u8 bRequest; | ||
| 135 | u16 wValue; | ||
| 136 | u16 wIndex; | ||
| 137 | u16 wLength; | ||
| 138 | u32 timeout; /* in milliseconds */ | ||
| 139 | compat_caddr_t data; | ||
| 140 | }; | ||
| 141 | |||
| 142 | struct usbdevfs_bulktransfer32 { | ||
| 143 | compat_uint_t ep; | ||
| 144 | compat_uint_t len; | ||
| 145 | compat_uint_t timeout; /* in milliseconds */ | ||
| 146 | compat_caddr_t data; | ||
| 147 | }; | ||
| 148 | |||
| 149 | struct usbdevfs_disconnectsignal32 { | ||
| 150 | compat_int_t signr; | ||
| 151 | compat_caddr_t context; | ||
| 152 | }; | ||
| 153 | |||
| 131 | struct usbdevfs_urb32 { | 154 | struct usbdevfs_urb32 { |
| 132 | unsigned char type; | 155 | unsigned char type; |
| 133 | unsigned char endpoint; | 156 | unsigned char endpoint; |
| @@ -153,7 +176,9 @@ struct usbdevfs_ioctl32 { | |||
| 153 | #endif /* __KERNEL__ */ | 176 | #endif /* __KERNEL__ */ |
| 154 | 177 | ||
| 155 | #define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) | 178 | #define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) |
| 179 | #define USBDEVFS_CONTROL32 _IOWR('U', 0, struct usbdevfs_ctrltransfer32) | ||
| 156 | #define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer) | 180 | #define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer) |
| 181 | #define USBDEVFS_BULK32 _IOWR('U', 2, struct usbdevfs_bulktransfer32) | ||
| 157 | #define USBDEVFS_RESETEP _IOR('U', 3, unsigned int) | 182 | #define USBDEVFS_RESETEP _IOR('U', 3, unsigned int) |
| 158 | #define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface) | 183 | #define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface) |
| 159 | #define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int) | 184 | #define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int) |
| @@ -166,6 +191,7 @@ struct usbdevfs_ioctl32 { | |||
| 166 | #define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *) | 191 | #define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *) |
| 167 | #define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32) | 192 | #define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32) |
| 168 | #define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal) | 193 | #define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal) |
| 194 | #define USBDEVFS_DISCSIGNAL32 _IOR('U', 14, struct usbdevfs_disconnectsignal32) | ||
| 169 | #define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int) | 195 | #define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int) |
| 170 | #define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) | 196 | #define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) |
| 171 | #define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo) | 197 | #define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo) |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 2d0f222388a8..ee03bba9c5df 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
| @@ -40,6 +40,8 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
| 40 | PGSCAN_ZONE_RECLAIM_FAILED, | 40 | PGSCAN_ZONE_RECLAIM_FAILED, |
| 41 | #endif | 41 | #endif |
| 42 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL, | 42 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL, |
| 43 | KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, | ||
| 44 | KSWAPD_SKIP_CONGESTION_WAIT, | ||
| 43 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, | 45 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, |
| 44 | #ifdef CONFIG_HUGETLB_PAGE | 46 | #ifdef CONFIG_HUGETLB_PAGE |
| 45 | HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL, | 47 | HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL, |
| @@ -76,24 +78,22 @@ DECLARE_PER_CPU(struct vm_event_state, vm_event_states); | |||
| 76 | 78 | ||
| 77 | static inline void __count_vm_event(enum vm_event_item item) | 79 | static inline void __count_vm_event(enum vm_event_item item) |
| 78 | { | 80 | { |
| 79 | __get_cpu_var(vm_event_states).event[item]++; | 81 | __this_cpu_inc(per_cpu_var(vm_event_states).event[item]); |
| 80 | } | 82 | } |
| 81 | 83 | ||
| 82 | static inline void count_vm_event(enum vm_event_item item) | 84 | static inline void count_vm_event(enum vm_event_item item) |
| 83 | { | 85 | { |
| 84 | get_cpu_var(vm_event_states).event[item]++; | 86 | this_cpu_inc(per_cpu_var(vm_event_states).event[item]); |
| 85 | put_cpu(); | ||
| 86 | } | 87 | } |
| 87 | 88 | ||
| 88 | static inline void __count_vm_events(enum vm_event_item item, long delta) | 89 | static inline void __count_vm_events(enum vm_event_item item, long delta) |
| 89 | { | 90 | { |
| 90 | __get_cpu_var(vm_event_states).event[item] += delta; | 91 | __this_cpu_add(per_cpu_var(vm_event_states).event[item], delta); |
| 91 | } | 92 | } |
| 92 | 93 | ||
| 93 | static inline void count_vm_events(enum vm_event_item item, long delta) | 94 | static inline void count_vm_events(enum vm_event_item item, long delta) |
| 94 | { | 95 | { |
| 95 | get_cpu_var(vm_event_states).event[item] += delta; | 96 | this_cpu_add(per_cpu_var(vm_event_states).event[item], delta); |
| 96 | put_cpu(); | ||
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | extern void all_vm_events(unsigned long *); | 99 | extern void all_vm_events(unsigned long *); |
diff --git a/include/linux/vt.h b/include/linux/vt.h index 7ffa11f06232..3fb9944e50a6 100644 --- a/include/linux/vt.h +++ b/include/linux/vt.h | |||
| @@ -84,4 +84,19 @@ struct vt_setactivate { | |||
| 84 | 84 | ||
| 85 | #define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */ | 85 | #define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */ |
| 86 | 86 | ||
| 87 | #ifdef CONFIG_VT_CONSOLE | ||
| 88 | |||
| 89 | extern int vt_kmsg_redirect(int new); | ||
| 90 | |||
| 91 | #else | ||
| 92 | |||
| 93 | static inline int vt_kmsg_redirect(int new) | ||
| 94 | { | ||
| 95 | return 0; | ||
| 96 | } | ||
| 97 | |||
| 98 | #endif | ||
| 99 | |||
| 100 | #define vt_get_kmsg_redirect() vt_kmsg_redirect(-1) | ||
| 101 | |||
| 87 | #endif /* _LINUX_VT_H */ | 102 | #endif /* _LINUX_VT_H */ |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index cf24c20de9e4..9466e860d8c2 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -25,6 +25,7 @@ typedef void (*work_func_t)(struct work_struct *work); | |||
| 25 | struct work_struct { | 25 | struct work_struct { |
| 26 | atomic_long_t data; | 26 | atomic_long_t data; |
| 27 | #define WORK_STRUCT_PENDING 0 /* T if work item pending execution */ | 27 | #define WORK_STRUCT_PENDING 0 /* T if work item pending execution */ |
| 28 | #define WORK_STRUCT_STATIC 1 /* static initializer (debugobjects) */ | ||
| 28 | #define WORK_STRUCT_FLAG_MASK (3UL) | 29 | #define WORK_STRUCT_FLAG_MASK (3UL) |
| 29 | #define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK) | 30 | #define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK) |
| 30 | struct list_head entry; | 31 | struct list_head entry; |
| @@ -35,6 +36,7 @@ struct work_struct { | |||
| 35 | }; | 36 | }; |
| 36 | 37 | ||
| 37 | #define WORK_DATA_INIT() ATOMIC_LONG_INIT(0) | 38 | #define WORK_DATA_INIT() ATOMIC_LONG_INIT(0) |
| 39 | #define WORK_DATA_STATIC_INIT() ATOMIC_LONG_INIT(2) | ||
| 38 | 40 | ||
| 39 | struct delayed_work { | 41 | struct delayed_work { |
| 40 | struct work_struct work; | 42 | struct work_struct work; |
| @@ -63,7 +65,7 @@ struct execute_work { | |||
| 63 | #endif | 65 | #endif |
| 64 | 66 | ||
| 65 | #define __WORK_INITIALIZER(n, f) { \ | 67 | #define __WORK_INITIALIZER(n, f) { \ |
| 66 | .data = WORK_DATA_INIT(), \ | 68 | .data = WORK_DATA_STATIC_INIT(), \ |
| 67 | .entry = { &(n).entry, &(n).entry }, \ | 69 | .entry = { &(n).entry, &(n).entry }, \ |
| 68 | .func = (f), \ | 70 | .func = (f), \ |
| 69 | __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \ | 71 | __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \ |
| @@ -91,6 +93,14 @@ struct execute_work { | |||
| 91 | #define PREPARE_DELAYED_WORK(_work, _func) \ | 93 | #define PREPARE_DELAYED_WORK(_work, _func) \ |
| 92 | PREPARE_WORK(&(_work)->work, (_func)) | 94 | PREPARE_WORK(&(_work)->work, (_func)) |
| 93 | 95 | ||
| 96 | #ifdef CONFIG_DEBUG_OBJECTS_WORK | ||
| 97 | extern void __init_work(struct work_struct *work, int onstack); | ||
| 98 | extern void destroy_work_on_stack(struct work_struct *work); | ||
| 99 | #else | ||
| 100 | static inline void __init_work(struct work_struct *work, int onstack) { } | ||
| 101 | static inline void destroy_work_on_stack(struct work_struct *work) { } | ||
| 102 | #endif | ||
| 103 | |||
| 94 | /* | 104 | /* |
| 95 | * initialize all of a work item in one go | 105 | * initialize all of a work item in one go |
| 96 | * | 106 | * |
| @@ -99,24 +109,36 @@ struct execute_work { | |||
| 99 | * to generate better code. | 109 | * to generate better code. |
| 100 | */ | 110 | */ |
| 101 | #ifdef CONFIG_LOCKDEP | 111 | #ifdef CONFIG_LOCKDEP |
| 102 | #define INIT_WORK(_work, _func) \ | 112 | #define __INIT_WORK(_work, _func, _onstack) \ |
| 103 | do { \ | 113 | do { \ |
| 104 | static struct lock_class_key __key; \ | 114 | static struct lock_class_key __key; \ |
| 105 | \ | 115 | \ |
| 116 | __init_work((_work), _onstack); \ | ||
| 106 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ | 117 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ |
| 107 | lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0);\ | 118 | lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0);\ |
| 108 | INIT_LIST_HEAD(&(_work)->entry); \ | 119 | INIT_LIST_HEAD(&(_work)->entry); \ |
| 109 | PREPARE_WORK((_work), (_func)); \ | 120 | PREPARE_WORK((_work), (_func)); \ |
| 110 | } while (0) | 121 | } while (0) |
| 111 | #else | 122 | #else |
| 112 | #define INIT_WORK(_work, _func) \ | 123 | #define __INIT_WORK(_work, _func, _onstack) \ |
| 113 | do { \ | 124 | do { \ |
| 125 | __init_work((_work), _onstack); \ | ||
| 114 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ | 126 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ |
| 115 | INIT_LIST_HEAD(&(_work)->entry); \ | 127 | INIT_LIST_HEAD(&(_work)->entry); \ |
| 116 | PREPARE_WORK((_work), (_func)); \ | 128 | PREPARE_WORK((_work), (_func)); \ |
| 117 | } while (0) | 129 | } while (0) |
| 118 | #endif | 130 | #endif |
| 119 | 131 | ||
| 132 | #define INIT_WORK(_work, _func) \ | ||
| 133 | do { \ | ||
| 134 | __INIT_WORK((_work), (_func), 0); \ | ||
| 135 | } while (0) | ||
| 136 | |||
| 137 | #define INIT_WORK_ON_STACK(_work, _func) \ | ||
| 138 | do { \ | ||
| 139 | __INIT_WORK((_work), (_func), 1); \ | ||
| 140 | } while (0) | ||
| 141 | |||
| 120 | #define INIT_DELAYED_WORK(_work, _func) \ | 142 | #define INIT_DELAYED_WORK(_work, _func) \ |
| 121 | do { \ | 143 | do { \ |
| 122 | INIT_WORK(&(_work)->work, (_func)); \ | 144 | INIT_WORK(&(_work)->work, (_func)); \ |
| @@ -125,22 +147,16 @@ struct execute_work { | |||
| 125 | 147 | ||
| 126 | #define INIT_DELAYED_WORK_ON_STACK(_work, _func) \ | 148 | #define INIT_DELAYED_WORK_ON_STACK(_work, _func) \ |
| 127 | do { \ | 149 | do { \ |
| 128 | INIT_WORK(&(_work)->work, (_func)); \ | 150 | INIT_WORK_ON_STACK(&(_work)->work, (_func)); \ |
| 129 | init_timer_on_stack(&(_work)->timer); \ | 151 | init_timer_on_stack(&(_work)->timer); \ |
| 130 | } while (0) | 152 | } while (0) |
| 131 | 153 | ||
| 132 | #define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \ | 154 | #define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \ |
| 133 | do { \ | 155 | do { \ |
| 134 | INIT_WORK(&(_work)->work, (_func)); \ | 156 | INIT_WORK(&(_work)->work, (_func)); \ |
| 135 | init_timer_deferrable(&(_work)->timer); \ | 157 | init_timer_deferrable(&(_work)->timer); \ |
| 136 | } while (0) | 158 | } while (0) |
| 137 | 159 | ||
| 138 | #define INIT_DELAYED_WORK_ON_STACK(_work, _func) \ | ||
| 139 | do { \ | ||
| 140 | INIT_WORK(&(_work)->work, (_func)); \ | ||
| 141 | init_timer_on_stack(&(_work)->timer); \ | ||
| 142 | } while (0) | ||
| 143 | |||
| 144 | /** | 160 | /** |
| 145 | * work_pending - Find out whether a work item is currently pending | 161 | * work_pending - Find out whether a work item is currently pending |
| 146 | * @work: The work item in question | 162 | * @work: The work item in question |
