diff options
Diffstat (limited to 'include/linux')
206 files changed, 4566 insertions, 2560 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 115c610324d1..1151a1dcfe41 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -42,6 +42,7 @@ | |||
| 42 | #include <acpi/acpi_bus.h> | 42 | #include <acpi/acpi_bus.h> |
| 43 | #include <acpi/acpi_drivers.h> | 43 | #include <acpi/acpi_drivers.h> |
| 44 | #include <acpi/acpi_numa.h> | 44 | #include <acpi/acpi_numa.h> |
| 45 | #include <acpi/acpi_io.h> | ||
| 45 | #include <asm/acpi.h> | 46 | #include <asm/acpi.h> |
| 46 | 47 | ||
| 47 | static inline acpi_handle acpi_device_handle(struct acpi_device *adev) | 48 | static inline acpi_handle acpi_device_handle(struct acpi_device *adev) |
| @@ -415,6 +416,9 @@ static inline bool acpi_driver_match_device(struct device *dev, | |||
| 415 | return !!acpi_match_device(drv->acpi_match_table, dev); | 416 | return !!acpi_match_device(drv->acpi_match_table, dev); |
| 416 | } | 417 | } |
| 417 | 418 | ||
| 419 | int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *); | ||
| 420 | int acpi_device_modalias(struct device *, char *, int); | ||
| 421 | |||
| 418 | #define ACPI_PTR(_ptr) (_ptr) | 422 | #define ACPI_PTR(_ptr) (_ptr) |
| 419 | 423 | ||
| 420 | #else /* !CONFIG_ACPI */ | 424 | #else /* !CONFIG_ACPI */ |
| @@ -466,7 +470,7 @@ struct acpi_table_header; | |||
| 466 | static inline int acpi_table_parse(char *id, | 470 | static inline int acpi_table_parse(char *id, |
| 467 | int (*handler)(struct acpi_table_header *)) | 471 | int (*handler)(struct acpi_table_header *)) |
| 468 | { | 472 | { |
| 469 | return -1; | 473 | return -ENODEV; |
| 470 | } | 474 | } |
| 471 | 475 | ||
| 472 | static inline int acpi_nvs_register(__u64 start, __u64 size) | 476 | static inline int acpi_nvs_register(__u64 start, __u64 size) |
| @@ -494,6 +498,18 @@ static inline bool acpi_driver_match_device(struct device *dev, | |||
| 494 | return false; | 498 | return false; |
| 495 | } | 499 | } |
| 496 | 500 | ||
| 501 | static inline int acpi_device_uevent_modalias(struct device *dev, | ||
| 502 | struct kobj_uevent_env *env) | ||
| 503 | { | ||
| 504 | return -ENODEV; | ||
| 505 | } | ||
| 506 | |||
| 507 | static inline int acpi_device_modalias(struct device *dev, | ||
| 508 | char *buf, int size) | ||
| 509 | { | ||
| 510 | return -ENODEV; | ||
| 511 | } | ||
| 512 | |||
| 497 | #define ACPI_PTR(_ptr) (NULL) | 513 | #define ACPI_PTR(_ptr) (NULL) |
| 498 | 514 | ||
| 499 | #endif /* !CONFIG_ACPI */ | 515 | #endif /* !CONFIG_ACPI */ |
diff --git a/include/linux/acpi_gpio.h b/include/linux/acpi_gpio.h deleted file mode 100644 index d875bc3dba3c..000000000000 --- a/include/linux/acpi_gpio.h +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | #ifndef _LINUX_ACPI_GPIO_H_ | ||
| 2 | #define _LINUX_ACPI_GPIO_H_ | ||
| 3 | |||
| 4 | #include <linux/device.h> | ||
| 5 | #include <linux/err.h> | ||
| 6 | #include <linux/errno.h> | ||
| 7 | #include <linux/gpio.h> | ||
| 8 | #include <linux/gpio/consumer.h> | ||
| 9 | |||
| 10 | /** | ||
| 11 | * struct acpi_gpio_info - ACPI GPIO specific information | ||
| 12 | * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo | ||
| 13 | * @active_low: in case of @gpioint, the pin is active low | ||
| 14 | */ | ||
| 15 | struct acpi_gpio_info { | ||
| 16 | bool gpioint; | ||
| 17 | bool active_low; | ||
| 18 | }; | ||
| 19 | |||
| 20 | #ifdef CONFIG_GPIO_ACPI | ||
| 21 | |||
| 22 | struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index, | ||
| 23 | struct acpi_gpio_info *info); | ||
| 24 | void acpi_gpiochip_request_interrupts(struct gpio_chip *chip); | ||
| 25 | void acpi_gpiochip_free_interrupts(struct gpio_chip *chip); | ||
| 26 | |||
| 27 | #else /* CONFIG_GPIO_ACPI */ | ||
| 28 | |||
| 29 | static inline struct gpio_desc * | ||
| 30 | acpi_get_gpiod_by_index(struct device *dev, int index, | ||
| 31 | struct acpi_gpio_info *info) | ||
| 32 | { | ||
| 33 | return ERR_PTR(-ENOSYS); | ||
| 34 | } | ||
| 35 | |||
| 36 | static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { } | ||
| 37 | static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { } | ||
| 38 | |||
| 39 | #endif /* CONFIG_GPIO_ACPI */ | ||
| 40 | |||
| 41 | static inline int acpi_get_gpio_by_index(struct device *dev, int index, | ||
| 42 | struct acpi_gpio_info *info) | ||
| 43 | { | ||
| 44 | struct gpio_desc *desc = acpi_get_gpiod_by_index(dev, index, info); | ||
| 45 | |||
| 46 | if (IS_ERR(desc)) | ||
| 47 | return PTR_ERR(desc); | ||
| 48 | return desc_to_gpio(desc); | ||
| 49 | } | ||
| 50 | |||
| 51 | #endif /* _LINUX_ACPI_GPIO_H_ */ | ||
diff --git a/include/linux/acpi_io.h b/include/linux/acpi_io.h deleted file mode 100644 index 2a5a1391ce72..000000000000 --- a/include/linux/acpi_io.h +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | #ifndef _ACPI_IO_H_ | ||
| 2 | #define _ACPI_IO_H_ | ||
| 3 | |||
| 4 | #include <linux/io.h> | ||
| 5 | #include <acpi/acpi.h> /* FIXME: inclusion should be removed */ | ||
| 6 | |||
| 7 | static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, | ||
| 8 | acpi_size size) | ||
| 9 | { | ||
| 10 | return ioremap_cache(phys, size); | ||
| 11 | } | ||
| 12 | |||
| 13 | void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size); | ||
| 14 | |||
| 15 | int acpi_os_map_generic_address(struct acpi_generic_address *addr); | ||
| 16 | void acpi_os_unmap_generic_address(struct acpi_generic_address *addr); | ||
| 17 | |||
| 18 | #endif | ||
diff --git a/include/linux/amba/sp810.h b/include/linux/amba/sp810.h index 6636430dd0e6..c7df89f99115 100644 --- a/include/linux/amba/sp810.h +++ b/include/linux/amba/sp810.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * arch/arm/include/asm/hardware/sp810.h | ||
| 3 | * | ||
| 4 | * ARM PrimeXsys System Controller SP810 header file | 2 | * ARM PrimeXsys System Controller SP810 header file |
| 5 | * | 3 | * |
| 6 | * Copyright (C) 2009 ST Microelectronics | 4 | * Copyright (C) 2009 ST Microelectronics |
| @@ -11,8 +9,8 @@ | |||
| 11 | * warranty of any kind, whether express or implied. | 9 | * warranty of any kind, whether express or implied. |
| 12 | */ | 10 | */ |
| 13 | 11 | ||
| 14 | #ifndef __ASM_ARM_SP810_H | 12 | #ifndef __AMBA_SP810_H |
| 15 | #define __ASM_ARM_SP810_H | 13 | #define __AMBA_SP810_H |
| 16 | 14 | ||
| 17 | #include <linux/io.h> | 15 | #include <linux/io.h> |
| 18 | 16 | ||
| @@ -61,4 +59,4 @@ static inline void sysctl_soft_reset(void __iomem *base) | |||
| 61 | writel(0, base + SCSYSSTAT); | 59 | writel(0, base + SCSYSSTAT); |
| 62 | } | 60 | } |
| 63 | 61 | ||
| 64 | #endif /* __ASM_ARM_SP810_H */ | 62 | #endif /* __AMBA_SP810_H */ |
diff --git a/include/linux/assoc_array.h b/include/linux/assoc_array.h index 9a193b84238a..a89df3be1686 100644 --- a/include/linux/assoc_array.h +++ b/include/linux/assoc_array.h | |||
| @@ -41,10 +41,10 @@ struct assoc_array_ops { | |||
| 41 | /* Is this the object we're looking for? */ | 41 | /* Is this the object we're looking for? */ |
| 42 | bool (*compare_object)(const void *object, const void *index_key); | 42 | bool (*compare_object)(const void *object, const void *index_key); |
| 43 | 43 | ||
| 44 | /* How different are two objects, to a bit position in their keys? (or | 44 | /* How different is an object from an index key, to a bit position in |
| 45 | * -1 if they're the same) | 45 | * their keys? (or -1 if they're the same) |
| 46 | */ | 46 | */ |
| 47 | int (*diff_objects)(const void *a, const void *b); | 47 | int (*diff_objects)(const void *object, const void *index_key); |
| 48 | 48 | ||
| 49 | /* Method to free an object. */ | 49 | /* Method to free an object. */ |
| 50 | void (*free_object)(void *object); | 50 | void (*free_object)(void *object); |
diff --git a/include/linux/audit.h b/include/linux/audit.h index a40641954c29..aa865a9a4c4f 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -137,7 +137,7 @@ static inline void audit_syscall_exit(void *pt_regs) | |||
| 137 | { | 137 | { |
| 138 | if (unlikely(current->audit_context)) { | 138 | if (unlikely(current->audit_context)) { |
| 139 | int success = is_syscall_success(pt_regs); | 139 | int success = is_syscall_success(pt_regs); |
| 140 | int return_code = regs_return_value(pt_regs); | 140 | long return_code = regs_return_value(pt_regs); |
| 141 | 141 | ||
| 142 | __audit_syscall_exit(success, return_code); | 142 | __audit_syscall_exit(success, return_code); |
| 143 | } | 143 | } |
| @@ -202,7 +202,7 @@ static inline kuid_t audit_get_loginuid(struct task_struct *tsk) | |||
| 202 | return tsk->loginuid; | 202 | return tsk->loginuid; |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | static inline int audit_get_sessionid(struct task_struct *tsk) | 205 | static inline unsigned int audit_get_sessionid(struct task_struct *tsk) |
| 206 | { | 206 | { |
| 207 | return tsk->sessionid; | 207 | return tsk->sessionid; |
| 208 | } | 208 | } |
| @@ -220,7 +220,7 @@ extern void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat); | |||
| 220 | extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, | 220 | extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, |
| 221 | const struct cred *new, | 221 | const struct cred *new, |
| 222 | const struct cred *old); | 222 | const struct cred *old); |
| 223 | extern void __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old); | 223 | extern void __audit_log_capset(const struct cred *new, const struct cred *old); |
| 224 | extern void __audit_mmap_fd(int fd, int flags); | 224 | extern void __audit_mmap_fd(int fd, int flags); |
| 225 | 225 | ||
| 226 | static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) | 226 | static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) |
| @@ -285,11 +285,11 @@ static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, | |||
| 285 | return 0; | 285 | return 0; |
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | static inline void audit_log_capset(pid_t pid, const struct cred *new, | 288 | static inline void audit_log_capset(const struct cred *new, |
| 289 | const struct cred *old) | 289 | const struct cred *old) |
| 290 | { | 290 | { |
| 291 | if (unlikely(!audit_dummy_context())) | 291 | if (unlikely(!audit_dummy_context())) |
| 292 | __audit_log_capset(pid, new, old); | 292 | __audit_log_capset(new, old); |
| 293 | } | 293 | } |
| 294 | 294 | ||
| 295 | static inline void audit_mmap_fd(int fd, int flags) | 295 | static inline void audit_mmap_fd(int fd, int flags) |
| @@ -359,7 +359,7 @@ static inline kuid_t audit_get_loginuid(struct task_struct *tsk) | |||
| 359 | { | 359 | { |
| 360 | return INVALID_UID; | 360 | return INVALID_UID; |
| 361 | } | 361 | } |
| 362 | static inline int audit_get_sessionid(struct task_struct *tsk) | 362 | static inline unsigned int audit_get_sessionid(struct task_struct *tsk) |
| 363 | { | 363 | { |
| 364 | return -1; | 364 | return -1; |
| 365 | } | 365 | } |
| @@ -397,8 +397,8 @@ static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, | |||
| 397 | { | 397 | { |
| 398 | return 0; | 398 | return 0; |
| 399 | } | 399 | } |
| 400 | static inline void audit_log_capset(pid_t pid, const struct cred *new, | 400 | static inline void audit_log_capset(const struct cred *new, |
| 401 | const struct cred *old) | 401 | const struct cred *old) |
| 402 | { } | 402 | { } |
| 403 | static inline void audit_mmap_fd(int fd, int flags) | 403 | static inline void audit_mmap_fd(int fd, int flags) |
| 404 | { } | 404 | { } |
| @@ -461,9 +461,11 @@ extern int audit_update_lsm_rules(void); | |||
| 461 | /* Private API (for audit.c only) */ | 461 | /* Private API (for audit.c only) */ |
| 462 | extern int audit_filter_user(int type); | 462 | extern int audit_filter_user(int type); |
| 463 | extern int audit_filter_type(int type); | 463 | extern int audit_filter_type(int type); |
| 464 | extern int audit_receive_filter(int type, int pid, int seq, | 464 | extern int audit_rule_change(int type, __u32 portid, int seq, |
| 465 | void *data, size_t datasz); | 465 | void *data, size_t datasz); |
| 466 | extern int audit_enabled; | 466 | extern int audit_list_rules_send(__u32 portid, int seq); |
| 467 | |||
| 468 | extern u32 audit_enabled; | ||
| 467 | #else /* CONFIG_AUDIT */ | 469 | #else /* CONFIG_AUDIT */ |
| 468 | static inline __printf(4, 5) | 470 | static inline __printf(4, 5) |
| 469 | void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type, | 471 | void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type, |
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h index 669fef5c745a..3e0fbe441763 100644 --- a/include/linux/auxvec.h +++ b/include/linux/auxvec.h | |||
| @@ -3,6 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #include <uapi/linux/auxvec.h> | 4 | #include <uapi/linux/auxvec.h> |
| 5 | 5 | ||
| 6 | #define AT_VECTOR_SIZE_BASE 19 /* NEW_AUX_ENT entries in auxiliary table */ | 6 | #define AT_VECTOR_SIZE_BASE 20 /* NEW_AUX_ENT entries in auxiliary table */ |
| 7 | /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */ | 7 | /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */ |
| 8 | #endif /* _LINUX_AUXVEC_H */ | 8 | #endif /* _LINUX_AUXVEC_H */ |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index f1f07d31a3af..2fae55def608 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #define _LINUX_BOOTMEM_H | 5 | #define _LINUX_BOOTMEM_H |
| 6 | 6 | ||
| 7 | #include <linux/mmzone.h> | 7 | #include <linux/mmzone.h> |
| 8 | #include <linux/mm_types.h> | ||
| 8 | #include <asm/dma.h> | 9 | #include <asm/dma.h> |
| 9 | 10 | ||
| 10 | /* | 11 | /* |
| @@ -52,7 +53,6 @@ extern void free_bootmem_node(pg_data_t *pgdat, | |||
| 52 | unsigned long size); | 53 | unsigned long size); |
| 53 | extern void free_bootmem(unsigned long physaddr, unsigned long size); | 54 | extern void free_bootmem(unsigned long physaddr, unsigned long size); |
| 54 | extern void free_bootmem_late(unsigned long physaddr, unsigned long size); | 55 | extern void free_bootmem_late(unsigned long physaddr, unsigned long size); |
| 55 | extern void __free_pages_bootmem(struct page *page, unsigned int order); | ||
| 56 | 56 | ||
| 57 | /* | 57 | /* |
| 58 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | 58 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, |
| @@ -142,6 +142,157 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, | |||
| 142 | #define alloc_bootmem_low_pages_node(pgdat, x) \ | 142 | #define alloc_bootmem_low_pages_node(pgdat, x) \ |
| 143 | __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) | 143 | __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) |
| 144 | 144 | ||
| 145 | |||
| 146 | #if defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM) | ||
| 147 | |||
| 148 | /* FIXME: use MEMBLOCK_ALLOC_* variants here */ | ||
| 149 | #define BOOTMEM_ALLOC_ACCESSIBLE 0 | ||
| 150 | #define BOOTMEM_ALLOC_ANYWHERE (~(phys_addr_t)0) | ||
| 151 | |||
| 152 | /* FIXME: Move to memblock.h at a point where we remove nobootmem.c */ | ||
| 153 | void *memblock_virt_alloc_try_nid_nopanic(phys_addr_t size, | ||
| 154 | phys_addr_t align, phys_addr_t min_addr, | ||
| 155 | phys_addr_t max_addr, int nid); | ||
| 156 | void *memblock_virt_alloc_try_nid(phys_addr_t size, phys_addr_t align, | ||
| 157 | phys_addr_t min_addr, phys_addr_t max_addr, int nid); | ||
| 158 | void __memblock_free_early(phys_addr_t base, phys_addr_t size); | ||
| 159 | void __memblock_free_late(phys_addr_t base, phys_addr_t size); | ||
| 160 | |||
| 161 | static inline void * __init memblock_virt_alloc( | ||
| 162 | phys_addr_t size, phys_addr_t align) | ||
| 163 | { | ||
| 164 | return memblock_virt_alloc_try_nid(size, align, BOOTMEM_LOW_LIMIT, | ||
| 165 | BOOTMEM_ALLOC_ACCESSIBLE, | ||
| 166 | NUMA_NO_NODE); | ||
| 167 | } | ||
| 168 | |||
| 169 | static inline void * __init memblock_virt_alloc_nopanic( | ||
| 170 | phys_addr_t size, phys_addr_t align) | ||
| 171 | { | ||
| 172 | return memblock_virt_alloc_try_nid_nopanic(size, align, | ||
| 173 | BOOTMEM_LOW_LIMIT, | ||
| 174 | BOOTMEM_ALLOC_ACCESSIBLE, | ||
| 175 | NUMA_NO_NODE); | ||
| 176 | } | ||
| 177 | |||
| 178 | static inline void * __init memblock_virt_alloc_from_nopanic( | ||
| 179 | phys_addr_t size, phys_addr_t align, phys_addr_t min_addr) | ||
| 180 | { | ||
| 181 | return memblock_virt_alloc_try_nid_nopanic(size, align, min_addr, | ||
| 182 | BOOTMEM_ALLOC_ACCESSIBLE, | ||
| 183 | NUMA_NO_NODE); | ||
| 184 | } | ||
| 185 | |||
| 186 | static inline void * __init memblock_virt_alloc_node( | ||
| 187 | phys_addr_t size, int nid) | ||
| 188 | { | ||
| 189 | return memblock_virt_alloc_try_nid(size, 0, BOOTMEM_LOW_LIMIT, | ||
| 190 | BOOTMEM_ALLOC_ACCESSIBLE, nid); | ||
| 191 | } | ||
| 192 | |||
| 193 | static inline void * __init memblock_virt_alloc_node_nopanic( | ||
| 194 | phys_addr_t size, int nid) | ||
| 195 | { | ||
| 196 | return memblock_virt_alloc_try_nid_nopanic(size, 0, BOOTMEM_LOW_LIMIT, | ||
| 197 | BOOTMEM_ALLOC_ACCESSIBLE, | ||
| 198 | nid); | ||
| 199 | } | ||
| 200 | |||
| 201 | static inline void __init memblock_free_early( | ||
| 202 | phys_addr_t base, phys_addr_t size) | ||
| 203 | { | ||
| 204 | __memblock_free_early(base, size); | ||
| 205 | } | ||
| 206 | |||
| 207 | static inline void __init memblock_free_early_nid( | ||
| 208 | phys_addr_t base, phys_addr_t size, int nid) | ||
| 209 | { | ||
| 210 | __memblock_free_early(base, size); | ||
| 211 | } | ||
| 212 | |||
| 213 | static inline void __init memblock_free_late( | ||
| 214 | phys_addr_t base, phys_addr_t size) | ||
| 215 | { | ||
| 216 | __memblock_free_late(base, size); | ||
| 217 | } | ||
| 218 | |||
| 219 | #else | ||
| 220 | |||
| 221 | #define BOOTMEM_ALLOC_ACCESSIBLE 0 | ||
| 222 | |||
| 223 | |||
| 224 | /* Fall back to all the existing bootmem APIs */ | ||
| 225 | static inline void * __init memblock_virt_alloc( | ||
| 226 | phys_addr_t size, phys_addr_t align) | ||
| 227 | { | ||
| 228 | if (!align) | ||
| 229 | align = SMP_CACHE_BYTES; | ||
| 230 | return __alloc_bootmem(size, align, BOOTMEM_LOW_LIMIT); | ||
| 231 | } | ||
| 232 | |||
| 233 | static inline void * __init memblock_virt_alloc_nopanic( | ||
| 234 | phys_addr_t size, phys_addr_t align) | ||
| 235 | { | ||
| 236 | if (!align) | ||
| 237 | align = SMP_CACHE_BYTES; | ||
| 238 | return __alloc_bootmem_nopanic(size, align, BOOTMEM_LOW_LIMIT); | ||
| 239 | } | ||
| 240 | |||
| 241 | static inline void * __init memblock_virt_alloc_from_nopanic( | ||
| 242 | phys_addr_t size, phys_addr_t align, phys_addr_t min_addr) | ||
| 243 | { | ||
| 244 | return __alloc_bootmem_nopanic(size, align, min_addr); | ||
| 245 | } | ||
| 246 | |||
| 247 | static inline void * __init memblock_virt_alloc_node( | ||
| 248 | phys_addr_t size, int nid) | ||
| 249 | { | ||
| 250 | return __alloc_bootmem_node(NODE_DATA(nid), size, SMP_CACHE_BYTES, | ||
| 251 | BOOTMEM_LOW_LIMIT); | ||
| 252 | } | ||
| 253 | |||
| 254 | static inline void * __init memblock_virt_alloc_node_nopanic( | ||
| 255 | phys_addr_t size, int nid) | ||
| 256 | { | ||
| 257 | return __alloc_bootmem_node_nopanic(NODE_DATA(nid), size, | ||
| 258 | SMP_CACHE_BYTES, | ||
| 259 | BOOTMEM_LOW_LIMIT); | ||
| 260 | } | ||
| 261 | |||
| 262 | static inline void * __init memblock_virt_alloc_try_nid(phys_addr_t size, | ||
| 263 | phys_addr_t align, phys_addr_t min_addr, phys_addr_t max_addr, int nid) | ||
| 264 | { | ||
| 265 | return __alloc_bootmem_node_high(NODE_DATA(nid), size, align, | ||
| 266 | min_addr); | ||
| 267 | } | ||
| 268 | |||
| 269 | static inline void * __init memblock_virt_alloc_try_nid_nopanic( | ||
| 270 | phys_addr_t size, phys_addr_t align, | ||
| 271 | phys_addr_t min_addr, phys_addr_t max_addr, int nid) | ||
| 272 | { | ||
| 273 | return ___alloc_bootmem_node_nopanic(NODE_DATA(nid), size, align, | ||
| 274 | min_addr, max_addr); | ||
| 275 | } | ||
| 276 | |||
| 277 | static inline void __init memblock_free_early( | ||
| 278 | phys_addr_t base, phys_addr_t size) | ||
| 279 | { | ||
| 280 | free_bootmem(base, size); | ||
| 281 | } | ||
| 282 | |||
| 283 | static inline void __init memblock_free_early_nid( | ||
| 284 | phys_addr_t base, phys_addr_t size, int nid) | ||
| 285 | { | ||
| 286 | free_bootmem_node(NODE_DATA(nid), base, size); | ||
| 287 | } | ||
| 288 | |||
| 289 | static inline void __init memblock_free_late( | ||
| 290 | phys_addr_t base, phys_addr_t size) | ||
| 291 | { | ||
| 292 | free_bootmem_late(base, size); | ||
| 293 | } | ||
| 294 | #endif /* defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM) */ | ||
| 295 | |||
| 145 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP | 296 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP |
| 146 | extern void *alloc_remap(int nid, unsigned long size); | 297 | extern void *alloc_remap(int nid, unsigned long size); |
| 147 | #else | 298 | #else |
diff --git a/include/linux/bottom_half.h b/include/linux/bottom_half.h index 27b1bcffe408..86c12c93e3cf 100644 --- a/include/linux/bottom_half.h +++ b/include/linux/bottom_half.h | |||
| @@ -1,9 +1,35 @@ | |||
| 1 | #ifndef _LINUX_BH_H | 1 | #ifndef _LINUX_BH_H |
| 2 | #define _LINUX_BH_H | 2 | #define _LINUX_BH_H |
| 3 | 3 | ||
| 4 | extern void local_bh_disable(void); | 4 | #include <linux/preempt.h> |
| 5 | #include <linux/preempt_mask.h> | ||
| 6 | |||
| 7 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
| 8 | extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt); | ||
| 9 | #else | ||
| 10 | static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) | ||
| 11 | { | ||
| 12 | preempt_count_add(cnt); | ||
| 13 | barrier(); | ||
| 14 | } | ||
| 15 | #endif | ||
| 16 | |||
| 17 | static inline void local_bh_disable(void) | ||
| 18 | { | ||
| 19 | __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET); | ||
| 20 | } | ||
| 21 | |||
| 5 | extern void _local_bh_enable(void); | 22 | extern void _local_bh_enable(void); |
| 6 | extern void local_bh_enable(void); | 23 | extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt); |
| 7 | extern void local_bh_enable_ip(unsigned long ip); | 24 | |
| 25 | static inline void local_bh_enable_ip(unsigned long ip) | ||
| 26 | { | ||
| 27 | __local_bh_enable_ip(ip, SOFTIRQ_DISABLE_OFFSET); | ||
| 28 | } | ||
| 29 | |||
| 30 | static inline void local_bh_enable(void) | ||
| 31 | { | ||
| 32 | __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET); | ||
| 33 | } | ||
| 8 | 34 | ||
| 9 | #endif /* _LINUX_BH_H */ | 35 | #endif /* _LINUX_BH_H */ |
diff --git a/include/linux/cache.h b/include/linux/cache.h index 4c570653ab84..17e7e82d2aa7 100644 --- a/include/linux/cache.h +++ b/include/linux/cache.h | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | #ifndef __LINUX_CACHE_H | 1 | #ifndef __LINUX_CACHE_H |
| 2 | #define __LINUX_CACHE_H | 2 | #define __LINUX_CACHE_H |
| 3 | 3 | ||
| 4 | #include <linux/kernel.h> | 4 | #include <uapi/linux/kernel.h> |
| 5 | #include <asm/cache.h> | 5 | #include <asm/cache.h> |
| 6 | 6 | ||
| 7 | #ifndef L1_CACHE_ALIGN | 7 | #ifndef L1_CACHE_ALIGN |
| 8 | #define L1_CACHE_ALIGN(x) ALIGN(x, L1_CACHE_BYTES) | 8 | #define L1_CACHE_ALIGN(x) __ALIGN_KERNEL(x, L1_CACHE_BYTES) |
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #ifndef SMP_CACHE_BYTES | 11 | #ifndef SMP_CACHE_BYTES |
diff --git a/include/linux/ccp.h b/include/linux/ccp.h new file mode 100644 index 000000000000..b941ab9f762b --- /dev/null +++ b/include/linux/ccp.h | |||
| @@ -0,0 +1,537 @@ | |||
| 1 | /* | ||
| 2 | * AMD Cryptographic Coprocessor (CCP) driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 Advanced Micro Devices, Inc. | ||
| 5 | * | ||
| 6 | * Author: Tom Lendacky <thomas.lendacky@amd.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __CPP_H__ | ||
| 14 | #define __CPP_H__ | ||
| 15 | |||
| 16 | #include <linux/scatterlist.h> | ||
| 17 | #include <linux/workqueue.h> | ||
| 18 | #include <linux/list.h> | ||
| 19 | #include <crypto/aes.h> | ||
| 20 | #include <crypto/sha.h> | ||
| 21 | |||
| 22 | |||
| 23 | struct ccp_device; | ||
| 24 | struct ccp_cmd; | ||
| 25 | |||
| 26 | #if defined(CONFIG_CRYPTO_DEV_CCP_DD) || \ | ||
| 27 | defined(CONFIG_CRYPTO_DEV_CCP_DD_MODULE) | ||
| 28 | |||
| 29 | /** | ||
| 30 | * ccp_enqueue_cmd - queue an operation for processing by the CCP | ||
| 31 | * | ||
| 32 | * @cmd: ccp_cmd struct to be processed | ||
| 33 | * | ||
| 34 | * Refer to the ccp_cmd struct below for required fields. | ||
| 35 | * | ||
| 36 | * Queue a cmd to be processed by the CCP. If queueing the cmd | ||
| 37 | * would exceed the defined length of the cmd queue the cmd will | ||
| 38 | * only be queued if the CCP_CMD_MAY_BACKLOG flag is set and will | ||
| 39 | * result in a return code of -EBUSY. | ||
| 40 | * | ||
| 41 | * The callback routine specified in the ccp_cmd struct will be | ||
| 42 | * called to notify the caller of completion (if the cmd was not | ||
| 43 | * backlogged) or advancement out of the backlog. If the cmd has | ||
| 44 | * advanced out of the backlog the "err" value of the callback | ||
| 45 | * will be -EINPROGRESS. Any other "err" value during callback is | ||
| 46 | * the result of the operation. | ||
| 47 | * | ||
| 48 | * The cmd has been successfully queued if: | ||
| 49 | * the return code is -EINPROGRESS or | ||
| 50 | * the return code is -EBUSY and CCP_CMD_MAY_BACKLOG flag is set | ||
| 51 | */ | ||
| 52 | int ccp_enqueue_cmd(struct ccp_cmd *cmd); | ||
| 53 | |||
| 54 | #else /* CONFIG_CRYPTO_DEV_CCP_DD is not enabled */ | ||
| 55 | |||
| 56 | static inline int ccp_enqueue_cmd(struct ccp_cmd *cmd) | ||
| 57 | { | ||
| 58 | return -ENODEV; | ||
| 59 | } | ||
| 60 | |||
| 61 | #endif /* CONFIG_CRYPTO_DEV_CCP_DD */ | ||
| 62 | |||
| 63 | |||
| 64 | /***** AES engine *****/ | ||
| 65 | /** | ||
| 66 | * ccp_aes_type - AES key size | ||
| 67 | * | ||
| 68 | * @CCP_AES_TYPE_128: 128-bit key | ||
| 69 | * @CCP_AES_TYPE_192: 192-bit key | ||
| 70 | * @CCP_AES_TYPE_256: 256-bit key | ||
| 71 | */ | ||
| 72 | enum ccp_aes_type { | ||
| 73 | CCP_AES_TYPE_128 = 0, | ||
| 74 | CCP_AES_TYPE_192, | ||
| 75 | CCP_AES_TYPE_256, | ||
| 76 | CCP_AES_TYPE__LAST, | ||
| 77 | }; | ||
| 78 | |||
| 79 | /** | ||
| 80 | * ccp_aes_mode - AES operation mode | ||
| 81 | * | ||
| 82 | * @CCP_AES_MODE_ECB: ECB mode | ||
| 83 | * @CCP_AES_MODE_CBC: CBC mode | ||
| 84 | * @CCP_AES_MODE_OFB: OFB mode | ||
| 85 | * @CCP_AES_MODE_CFB: CFB mode | ||
| 86 | * @CCP_AES_MODE_CTR: CTR mode | ||
| 87 | * @CCP_AES_MODE_CMAC: CMAC mode | ||
| 88 | */ | ||
| 89 | enum ccp_aes_mode { | ||
| 90 | CCP_AES_MODE_ECB = 0, | ||
| 91 | CCP_AES_MODE_CBC, | ||
| 92 | CCP_AES_MODE_OFB, | ||
| 93 | CCP_AES_MODE_CFB, | ||
| 94 | CCP_AES_MODE_CTR, | ||
| 95 | CCP_AES_MODE_CMAC, | ||
| 96 | CCP_AES_MODE__LAST, | ||
| 97 | }; | ||
| 98 | |||
| 99 | /** | ||
| 100 | * ccp_aes_mode - AES operation mode | ||
| 101 | * | ||
| 102 | * @CCP_AES_ACTION_DECRYPT: AES decrypt operation | ||
| 103 | * @CCP_AES_ACTION_ENCRYPT: AES encrypt operation | ||
| 104 | */ | ||
| 105 | enum ccp_aes_action { | ||
| 106 | CCP_AES_ACTION_DECRYPT = 0, | ||
| 107 | CCP_AES_ACTION_ENCRYPT, | ||
| 108 | CCP_AES_ACTION__LAST, | ||
| 109 | }; | ||
| 110 | |||
| 111 | /** | ||
| 112 | * struct ccp_aes_engine - CCP AES operation | ||
| 113 | * @type: AES operation key size | ||
| 114 | * @mode: AES operation mode | ||
| 115 | * @action: AES operation (decrypt/encrypt) | ||
| 116 | * @key: key to be used for this AES operation | ||
| 117 | * @key_len: length in bytes of key | ||
| 118 | * @iv: IV to be used for this AES operation | ||
| 119 | * @iv_len: length in bytes of iv | ||
| 120 | * @src: data to be used for this operation | ||
| 121 | * @dst: data produced by this operation | ||
| 122 | * @src_len: length in bytes of data used for this operation | ||
| 123 | * @cmac_final: indicates final operation when running in CMAC mode | ||
| 124 | * @cmac_key: K1/K2 key used in final CMAC operation | ||
| 125 | * @cmac_key_len: length in bytes of cmac_key | ||
| 126 | * | ||
| 127 | * Variables required to be set when calling ccp_enqueue_cmd(): | ||
| 128 | * - type, mode, action, key, key_len, src, dst, src_len | ||
| 129 | * - iv, iv_len for any mode other than ECB | ||
| 130 | * - cmac_final for CMAC mode | ||
| 131 | * - cmac_key, cmac_key_len for CMAC mode if cmac_final is non-zero | ||
| 132 | * | ||
| 133 | * The iv variable is used as both input and output. On completion of the | ||
| 134 | * AES operation the new IV overwrites the old IV. | ||
| 135 | */ | ||
| 136 | struct ccp_aes_engine { | ||
| 137 | enum ccp_aes_type type; | ||
| 138 | enum ccp_aes_mode mode; | ||
| 139 | enum ccp_aes_action action; | ||
| 140 | |||
| 141 | struct scatterlist *key; | ||
| 142 | u32 key_len; /* In bytes */ | ||
| 143 | |||
| 144 | struct scatterlist *iv; | ||
| 145 | u32 iv_len; /* In bytes */ | ||
| 146 | |||
| 147 | struct scatterlist *src, *dst; | ||
| 148 | u64 src_len; /* In bytes */ | ||
| 149 | |||
| 150 | u32 cmac_final; /* Indicates final cmac cmd */ | ||
| 151 | struct scatterlist *cmac_key; /* K1/K2 cmac key required for | ||
| 152 | * final cmac cmd */ | ||
| 153 | u32 cmac_key_len; /* In bytes */ | ||
| 154 | }; | ||
| 155 | |||
| 156 | /***** XTS-AES engine *****/ | ||
| 157 | /** | ||
| 158 | * ccp_xts_aes_unit_size - XTS unit size | ||
| 159 | * | ||
| 160 | * @CCP_XTS_AES_UNIT_SIZE_16: Unit size of 16 bytes | ||
| 161 | * @CCP_XTS_AES_UNIT_SIZE_512: Unit size of 512 bytes | ||
| 162 | * @CCP_XTS_AES_UNIT_SIZE_1024: Unit size of 1024 bytes | ||
| 163 | * @CCP_XTS_AES_UNIT_SIZE_2048: Unit size of 2048 bytes | ||
| 164 | * @CCP_XTS_AES_UNIT_SIZE_4096: Unit size of 4096 bytes | ||
| 165 | */ | ||
| 166 | enum ccp_xts_aes_unit_size { | ||
| 167 | CCP_XTS_AES_UNIT_SIZE_16 = 0, | ||
| 168 | CCP_XTS_AES_UNIT_SIZE_512, | ||
| 169 | CCP_XTS_AES_UNIT_SIZE_1024, | ||
| 170 | CCP_XTS_AES_UNIT_SIZE_2048, | ||
| 171 | CCP_XTS_AES_UNIT_SIZE_4096, | ||
| 172 | CCP_XTS_AES_UNIT_SIZE__LAST, | ||
| 173 | }; | ||
| 174 | |||
| 175 | /** | ||
| 176 | * struct ccp_xts_aes_engine - CCP XTS AES operation | ||
| 177 | * @action: AES operation (decrypt/encrypt) | ||
| 178 | * @unit_size: unit size of the XTS operation | ||
| 179 | * @key: key to be used for this XTS AES operation | ||
| 180 | * @key_len: length in bytes of key | ||
| 181 | * @iv: IV to be used for this XTS AES operation | ||
| 182 | * @iv_len: length in bytes of iv | ||
| 183 | * @src: data to be used for this operation | ||
| 184 | * @dst: data produced by this operation | ||
| 185 | * @src_len: length in bytes of data used for this operation | ||
| 186 | * @final: indicates final XTS operation | ||
| 187 | * | ||
| 188 | * Variables required to be set when calling ccp_enqueue_cmd(): | ||
| 189 | * - action, unit_size, key, key_len, iv, iv_len, src, dst, src_len, final | ||
| 190 | * | ||
| 191 | * The iv variable is used as both input and output. On completion of the | ||
| 192 | * AES operation the new IV overwrites the old IV. | ||
| 193 | */ | ||
| 194 | struct ccp_xts_aes_engine { | ||
| 195 | enum ccp_aes_action action; | ||
| 196 | enum ccp_xts_aes_unit_size unit_size; | ||
| 197 | |||
| 198 | struct scatterlist *key; | ||
| 199 | u32 key_len; /* In bytes */ | ||
| 200 | |||
| 201 | struct scatterlist *iv; | ||
| 202 | u32 iv_len; /* In bytes */ | ||
| 203 | |||
| 204 | struct scatterlist *src, *dst; | ||
| 205 | u64 src_len; /* In bytes */ | ||
| 206 | |||
| 207 | u32 final; | ||
| 208 | }; | ||
| 209 | |||
| 210 | /***** SHA engine *****/ | ||
| 211 | #define CCP_SHA_BLOCKSIZE SHA256_BLOCK_SIZE | ||
| 212 | #define CCP_SHA_CTXSIZE SHA256_DIGEST_SIZE | ||
| 213 | |||
| 214 | /** | ||
| 215 | * ccp_sha_type - type of SHA operation | ||
| 216 | * | ||
| 217 | * @CCP_SHA_TYPE_1: SHA-1 operation | ||
| 218 | * @CCP_SHA_TYPE_224: SHA-224 operation | ||
| 219 | * @CCP_SHA_TYPE_256: SHA-256 operation | ||
| 220 | */ | ||
| 221 | enum ccp_sha_type { | ||
| 222 | CCP_SHA_TYPE_1 = 1, | ||
| 223 | CCP_SHA_TYPE_224, | ||
| 224 | CCP_SHA_TYPE_256, | ||
| 225 | CCP_SHA_TYPE__LAST, | ||
| 226 | }; | ||
| 227 | |||
| 228 | /** | ||
| 229 | * struct ccp_sha_engine - CCP SHA operation | ||
| 230 | * @type: Type of SHA operation | ||
| 231 | * @ctx: current hash value | ||
| 232 | * @ctx_len: length in bytes of hash value | ||
| 233 | * @src: data to be used for this operation | ||
| 234 | * @src_len: length in bytes of data used for this operation | ||
| 235 | * @final: indicates final SHA operation | ||
| 236 | * @msg_bits: total length of the message in bits used in final SHA operation | ||
| 237 | * | ||
| 238 | * Variables required to be set when calling ccp_enqueue_cmd(): | ||
| 239 | * - type, ctx, ctx_len, src, src_len, final | ||
| 240 | * - msg_bits if final is non-zero | ||
| 241 | * | ||
| 242 | * The ctx variable is used as both input and output. On completion of the | ||
| 243 | * SHA operation the new hash value overwrites the old hash value. | ||
| 244 | */ | ||
| 245 | struct ccp_sha_engine { | ||
| 246 | enum ccp_sha_type type; | ||
| 247 | |||
| 248 | struct scatterlist *ctx; | ||
| 249 | u32 ctx_len; /* In bytes */ | ||
| 250 | |||
| 251 | struct scatterlist *src; | ||
| 252 | u64 src_len; /* In bytes */ | ||
| 253 | |||
| 254 | u32 final; /* Indicates final sha cmd */ | ||
| 255 | u64 msg_bits; /* Message length in bits required for | ||
| 256 | * final sha cmd */ | ||
| 257 | }; | ||
| 258 | |||
| 259 | /***** RSA engine *****/ | ||
| 260 | /** | ||
| 261 | * struct ccp_rsa_engine - CCP RSA operation | ||
| 262 | * @key_size: length in bits of RSA key | ||
| 263 | * @exp: RSA exponent | ||
| 264 | * @exp_len: length in bytes of exponent | ||
| 265 | * @mod: RSA modulus | ||
| 266 | * @mod_len: length in bytes of modulus | ||
| 267 | * @src: data to be used for this operation | ||
| 268 | * @dst: data produced by this operation | ||
| 269 | * @src_len: length in bytes of data used for this operation | ||
| 270 | * | ||
| 271 | * Variables required to be set when calling ccp_enqueue_cmd(): | ||
| 272 | * - key_size, exp, exp_len, mod, mod_len, src, dst, src_len | ||
| 273 | */ | ||
| 274 | struct ccp_rsa_engine { | ||
| 275 | u32 key_size; /* In bits */ | ||
| 276 | |||
| 277 | struct scatterlist *exp; | ||
| 278 | u32 exp_len; /* In bytes */ | ||
| 279 | |||
| 280 | struct scatterlist *mod; | ||
| 281 | u32 mod_len; /* In bytes */ | ||
| 282 | |||
| 283 | struct scatterlist *src, *dst; | ||
| 284 | u32 src_len; /* In bytes */ | ||
| 285 | }; | ||
| 286 | |||
| 287 | /***** Passthru engine *****/ | ||
| 288 | /** | ||
| 289 | * ccp_passthru_bitwise - type of bitwise passthru operation | ||
| 290 | * | ||
| 291 | * @CCP_PASSTHRU_BITWISE_NOOP: no bitwise operation performed | ||
| 292 | * @CCP_PASSTHRU_BITWISE_AND: perform bitwise AND of src with mask | ||
| 293 | * @CCP_PASSTHRU_BITWISE_OR: perform bitwise OR of src with mask | ||
| 294 | * @CCP_PASSTHRU_BITWISE_XOR: perform bitwise XOR of src with mask | ||
| 295 | * @CCP_PASSTHRU_BITWISE_MASK: overwrite with mask | ||
| 296 | */ | ||
| 297 | enum ccp_passthru_bitwise { | ||
| 298 | CCP_PASSTHRU_BITWISE_NOOP = 0, | ||
| 299 | CCP_PASSTHRU_BITWISE_AND, | ||
| 300 | CCP_PASSTHRU_BITWISE_OR, | ||
| 301 | CCP_PASSTHRU_BITWISE_XOR, | ||
| 302 | CCP_PASSTHRU_BITWISE_MASK, | ||
| 303 | CCP_PASSTHRU_BITWISE__LAST, | ||
| 304 | }; | ||
| 305 | |||
| 306 | /** | ||
| 307 | * ccp_passthru_byteswap - type of byteswap passthru operation | ||
| 308 | * | ||
| 309 | * @CCP_PASSTHRU_BYTESWAP_NOOP: no byte swapping performed | ||
| 310 | * @CCP_PASSTHRU_BYTESWAP_32BIT: swap bytes within 32-bit words | ||
| 311 | * @CCP_PASSTHRU_BYTESWAP_256BIT: swap bytes within 256-bit words | ||
| 312 | */ | ||
| 313 | enum ccp_passthru_byteswap { | ||
| 314 | CCP_PASSTHRU_BYTESWAP_NOOP = 0, | ||
| 315 | CCP_PASSTHRU_BYTESWAP_32BIT, | ||
| 316 | CCP_PASSTHRU_BYTESWAP_256BIT, | ||
| 317 | CCP_PASSTHRU_BYTESWAP__LAST, | ||
| 318 | }; | ||
| 319 | |||
| 320 | /** | ||
| 321 | * struct ccp_passthru_engine - CCP pass-through operation | ||
| 322 | * @bit_mod: bitwise operation to perform | ||
| 323 | * @byte_swap: byteswap operation to perform | ||
| 324 | * @mask: mask to be applied to data | ||
| 325 | * @mask_len: length in bytes of mask | ||
| 326 | * @src: data to be used for this operation | ||
| 327 | * @dst: data produced by this operation | ||
| 328 | * @src_len: length in bytes of data used for this operation | ||
| 329 | * @final: indicate final pass-through operation | ||
| 330 | * | ||
| 331 | * Variables required to be set when calling ccp_enqueue_cmd(): | ||
| 332 | * - bit_mod, byte_swap, src, dst, src_len | ||
| 333 | * - mask, mask_len if bit_mod is not CCP_PASSTHRU_BITWISE_NOOP | ||
| 334 | */ | ||
| 335 | struct ccp_passthru_engine { | ||
| 336 | enum ccp_passthru_bitwise bit_mod; | ||
| 337 | enum ccp_passthru_byteswap byte_swap; | ||
| 338 | |||
| 339 | struct scatterlist *mask; | ||
| 340 | u32 mask_len; /* In bytes */ | ||
| 341 | |||
| 342 | struct scatterlist *src, *dst; | ||
| 343 | u64 src_len; /* In bytes */ | ||
| 344 | |||
| 345 | u32 final; | ||
| 346 | }; | ||
| 347 | |||
| 348 | /***** ECC engine *****/ | ||
| 349 | #define CCP_ECC_MODULUS_BYTES 48 /* 384-bits */ | ||
| 350 | #define CCP_ECC_MAX_OPERANDS 6 | ||
| 351 | #define CCP_ECC_MAX_OUTPUTS 3 | ||
| 352 | |||
| 353 | /** | ||
| 354 | * ccp_ecc_function - type of ECC function | ||
| 355 | * | ||
| 356 | * @CCP_ECC_FUNCTION_MMUL_384BIT: 384-bit modular multiplication | ||
| 357 | * @CCP_ECC_FUNCTION_MADD_384BIT: 384-bit modular addition | ||
| 358 | * @CCP_ECC_FUNCTION_MINV_384BIT: 384-bit multiplicative inverse | ||
| 359 | * @CCP_ECC_FUNCTION_PADD_384BIT: 384-bit point addition | ||
| 360 | * @CCP_ECC_FUNCTION_PMUL_384BIT: 384-bit point multiplication | ||
| 361 | * @CCP_ECC_FUNCTION_PDBL_384BIT: 384-bit point doubling | ||
| 362 | */ | ||
| 363 | enum ccp_ecc_function { | ||
| 364 | CCP_ECC_FUNCTION_MMUL_384BIT = 0, | ||
| 365 | CCP_ECC_FUNCTION_MADD_384BIT, | ||
| 366 | CCP_ECC_FUNCTION_MINV_384BIT, | ||
| 367 | CCP_ECC_FUNCTION_PADD_384BIT, | ||
| 368 | CCP_ECC_FUNCTION_PMUL_384BIT, | ||
| 369 | CCP_ECC_FUNCTION_PDBL_384BIT, | ||
| 370 | }; | ||
| 371 | |||
| 372 | /** | ||
| 373 | * struct ccp_ecc_modular_math - CCP ECC modular math parameters | ||
| 374 | * @operand_1: first operand for the modular math operation | ||
| 375 | * @operand_1_len: length of the first operand | ||
| 376 | * @operand_2: second operand for the modular math operation | ||
| 377 | * (not used for CCP_ECC_FUNCTION_MINV_384BIT) | ||
| 378 | * @operand_2_len: length of the second operand | ||
| 379 | * (not used for CCP_ECC_FUNCTION_MINV_384BIT) | ||
| 380 | * @result: result of the modular math operation | ||
| 381 | * @result_len: length of the supplied result buffer | ||
| 382 | */ | ||
| 383 | struct ccp_ecc_modular_math { | ||
| 384 | struct scatterlist *operand_1; | ||
| 385 | unsigned int operand_1_len; /* In bytes */ | ||
| 386 | |||
| 387 | struct scatterlist *operand_2; | ||
| 388 | unsigned int operand_2_len; /* In bytes */ | ||
| 389 | |||
| 390 | struct scatterlist *result; | ||
| 391 | unsigned int result_len; /* In bytes */ | ||
| 392 | }; | ||
| 393 | |||
| 394 | /** | ||
| 395 | * struct ccp_ecc_point - CCP ECC point definition | ||
| 396 | * @x: the x coordinate of the ECC point | ||
| 397 | * @x_len: the length of the x coordinate | ||
| 398 | * @y: the y coordinate of the ECC point | ||
| 399 | * @y_len: the length of the y coordinate | ||
| 400 | */ | ||
| 401 | struct ccp_ecc_point { | ||
| 402 | struct scatterlist *x; | ||
| 403 | unsigned int x_len; /* In bytes */ | ||
| 404 | |||
| 405 | struct scatterlist *y; | ||
| 406 | unsigned int y_len; /* In bytes */ | ||
| 407 | }; | ||
| 408 | |||
| 409 | /** | ||
| 410 | * struct ccp_ecc_point_math - CCP ECC point math parameters | ||
| 411 | * @point_1: the first point of the ECC point math operation | ||
| 412 | * @point_2: the second point of the ECC point math operation | ||
| 413 | * (only used for CCP_ECC_FUNCTION_PADD_384BIT) | ||
| 414 | * @domain_a: the a parameter of the ECC curve | ||
| 415 | * @domain_a_len: the length of the a parameter | ||
| 416 | * @scalar: the scalar parameter for the point match operation | ||
| 417 | * (only used for CCP_ECC_FUNCTION_PMUL_384BIT) | ||
| 418 | * @scalar_len: the length of the scalar parameter | ||
| 419 | * (only used for CCP_ECC_FUNCTION_PMUL_384BIT) | ||
| 420 | * @result: the point resulting from the point math operation | ||
| 421 | */ | ||
| 422 | struct ccp_ecc_point_math { | ||
| 423 | struct ccp_ecc_point point_1; | ||
| 424 | struct ccp_ecc_point point_2; | ||
| 425 | |||
| 426 | struct scatterlist *domain_a; | ||
| 427 | unsigned int domain_a_len; /* In bytes */ | ||
| 428 | |||
| 429 | struct scatterlist *scalar; | ||
| 430 | unsigned int scalar_len; /* In bytes */ | ||
| 431 | |||
| 432 | struct ccp_ecc_point result; | ||
| 433 | }; | ||
| 434 | |||
| 435 | /** | ||
| 436 | * struct ccp_ecc_engine - CCP ECC operation | ||
| 437 | * @function: ECC function to perform | ||
| 438 | * @mod: ECC modulus | ||
| 439 | * @mod_len: length in bytes of modulus | ||
| 440 | * @mm: module math parameters | ||
| 441 | * @pm: point math parameters | ||
| 442 | * @ecc_result: result of the ECC operation | ||
| 443 | * | ||
| 444 | * Variables required to be set when calling ccp_enqueue_cmd(): | ||
| 445 | * - function, mod, mod_len | ||
| 446 | * - operand, operand_len, operand_count, output, output_len, output_count | ||
| 447 | * - ecc_result | ||
| 448 | */ | ||
| 449 | struct ccp_ecc_engine { | ||
| 450 | enum ccp_ecc_function function; | ||
| 451 | |||
| 452 | struct scatterlist *mod; | ||
| 453 | u32 mod_len; /* In bytes */ | ||
| 454 | |||
| 455 | union { | ||
| 456 | struct ccp_ecc_modular_math mm; | ||
| 457 | struct ccp_ecc_point_math pm; | ||
| 458 | } u; | ||
| 459 | |||
| 460 | u16 ecc_result; | ||
| 461 | }; | ||
| 462 | |||
| 463 | |||
| 464 | /** | ||
| 465 | * ccp_engine - CCP operation identifiers | ||
| 466 | * | ||
| 467 | * @CCP_ENGINE_AES: AES operation | ||
| 468 | * @CCP_ENGINE_XTS_AES: 128-bit XTS AES operation | ||
| 469 | * @CCP_ENGINE_RSVD1: unused | ||
| 470 | * @CCP_ENGINE_SHA: SHA operation | ||
| 471 | * @CCP_ENGINE_RSA: RSA operation | ||
| 472 | * @CCP_ENGINE_PASSTHRU: pass-through operation | ||
| 473 | * @CCP_ENGINE_ZLIB_DECOMPRESS: unused | ||
| 474 | * @CCP_ENGINE_ECC: ECC operation | ||
| 475 | */ | ||
| 476 | enum ccp_engine { | ||
| 477 | CCP_ENGINE_AES = 0, | ||
| 478 | CCP_ENGINE_XTS_AES_128, | ||
| 479 | CCP_ENGINE_RSVD1, | ||
| 480 | CCP_ENGINE_SHA, | ||
| 481 | CCP_ENGINE_RSA, | ||
| 482 | CCP_ENGINE_PASSTHRU, | ||
| 483 | CCP_ENGINE_ZLIB_DECOMPRESS, | ||
| 484 | CCP_ENGINE_ECC, | ||
| 485 | CCP_ENGINE__LAST, | ||
| 486 | }; | ||
| 487 | |||
| 488 | /* Flag values for flags member of ccp_cmd */ | ||
| 489 | #define CCP_CMD_MAY_BACKLOG 0x00000001 | ||
| 490 | |||
| 491 | /** | ||
| 492 | * struct ccp_cmd - CPP operation request | ||
| 493 | * @entry: list element (ccp driver use only) | ||
| 494 | * @work: work element used for callbacks (ccp driver use only) | ||
| 495 | * @ccp: CCP device to be run on (ccp driver use only) | ||
| 496 | * @ret: operation return code (ccp driver use only) | ||
| 497 | * @flags: cmd processing flags | ||
| 498 | * @engine: CCP operation to perform | ||
| 499 | * @engine_error: CCP engine return code | ||
| 500 | * @u: engine specific structures, refer to specific engine struct below | ||
| 501 | * @callback: operation completion callback function | ||
| 502 | * @data: parameter value to be supplied to the callback function | ||
| 503 | * | ||
| 504 | * Variables required to be set when calling ccp_enqueue_cmd(): | ||
| 505 | * - engine, callback | ||
| 506 | * - See the operation structures below for what is required for each | ||
| 507 | * operation. | ||
| 508 | */ | ||
| 509 | struct ccp_cmd { | ||
| 510 | /* The list_head, work_struct, ccp and ret variables are for use | ||
| 511 | * by the CCP driver only. | ||
| 512 | */ | ||
| 513 | struct list_head entry; | ||
| 514 | struct work_struct work; | ||
| 515 | struct ccp_device *ccp; | ||
| 516 | int ret; | ||
| 517 | |||
| 518 | u32 flags; | ||
| 519 | |||
| 520 | enum ccp_engine engine; | ||
| 521 | u32 engine_error; | ||
| 522 | |||
| 523 | union { | ||
| 524 | struct ccp_aes_engine aes; | ||
| 525 | struct ccp_xts_aes_engine xts; | ||
| 526 | struct ccp_sha_engine sha; | ||
| 527 | struct ccp_rsa_engine rsa; | ||
| 528 | struct ccp_passthru_engine passthru; | ||
| 529 | struct ccp_ecc_engine ecc; | ||
| 530 | } u; | ||
| 531 | |||
| 532 | /* Completion callback support */ | ||
| 533 | void (*callback)(void *data, int err); | ||
| 534 | void *data; | ||
| 535 | }; | ||
| 536 | |||
| 537 | #endif | ||
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h index 0442c3d800f0..a6ef9cc267ec 100644 --- a/include/linux/ceph/decode.h +++ b/include/linux/ceph/decode.h | |||
| @@ -8,23 +8,6 @@ | |||
| 8 | 8 | ||
| 9 | #include <linux/ceph/types.h> | 9 | #include <linux/ceph/types.h> |
| 10 | 10 | ||
| 11 | /* This seemed to be the easiest place to define these */ | ||
| 12 | |||
| 13 | #define U8_MAX ((u8)(~0U)) | ||
| 14 | #define U16_MAX ((u16)(~0U)) | ||
| 15 | #define U32_MAX ((u32)(~0U)) | ||
| 16 | #define U64_MAX ((u64)(~0ULL)) | ||
| 17 | |||
| 18 | #define S8_MAX ((s8)(U8_MAX >> 1)) | ||
| 19 | #define S16_MAX ((s16)(U16_MAX >> 1)) | ||
| 20 | #define S32_MAX ((s32)(U32_MAX >> 1)) | ||
| 21 | #define S64_MAX ((s64)(U64_MAX >> 1LL)) | ||
| 22 | |||
| 23 | #define S8_MIN ((s8)(-S8_MAX - 1)) | ||
| 24 | #define S16_MIN ((s16)(-S16_MAX - 1)) | ||
| 25 | #define S32_MIN ((s32)(-S32_MAX - 1)) | ||
| 26 | #define S64_MIN ((s64)(-S64_MAX - 1LL)) | ||
| 27 | |||
| 28 | /* | 11 | /* |
| 29 | * in all cases, | 12 | * in all cases, |
| 30 | * void **p pointer to position pointer | 13 | * void **p pointer to position pointer |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 39c1d9469677..5c097596104b 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/xattr.h> | 21 | #include <linux/xattr.h> |
| 22 | #include <linux/fs.h> | 22 | #include <linux/fs.h> |
| 23 | #include <linux/percpu-refcount.h> | 23 | #include <linux/percpu-refcount.h> |
| 24 | #include <linux/seq_file.h> | ||
| 24 | 25 | ||
| 25 | #ifdef CONFIG_CGROUPS | 26 | #ifdef CONFIG_CGROUPS |
| 26 | 27 | ||
| @@ -28,8 +29,6 @@ struct cgroupfs_root; | |||
| 28 | struct cgroup_subsys; | 29 | struct cgroup_subsys; |
| 29 | struct inode; | 30 | struct inode; |
| 30 | struct cgroup; | 31 | struct cgroup; |
| 31 | struct css_id; | ||
| 32 | struct eventfd_ctx; | ||
| 33 | 32 | ||
| 34 | extern int cgroup_init_early(void); | 33 | extern int cgroup_init_early(void); |
| 35 | extern int cgroup_init(void); | 34 | extern int cgroup_init(void); |
| @@ -79,8 +78,6 @@ struct cgroup_subsys_state { | |||
| 79 | struct cgroup_subsys_state *parent; | 78 | struct cgroup_subsys_state *parent; |
| 80 | 79 | ||
| 81 | unsigned long flags; | 80 | unsigned long flags; |
| 82 | /* ID for this css, if possible */ | ||
| 83 | struct css_id __rcu *id; | ||
| 84 | 81 | ||
| 85 | /* percpu_ref killing and RCU release */ | 82 | /* percpu_ref killing and RCU release */ |
| 86 | struct rcu_head rcu_head; | 83 | struct rcu_head rcu_head; |
| @@ -239,10 +236,6 @@ struct cgroup { | |||
| 239 | struct rcu_head rcu_head; | 236 | struct rcu_head rcu_head; |
| 240 | struct work_struct destroy_work; | 237 | struct work_struct destroy_work; |
| 241 | 238 | ||
| 242 | /* List of events which userspace want to receive */ | ||
| 243 | struct list_head event_list; | ||
| 244 | spinlock_t event_list_lock; | ||
| 245 | |||
| 246 | /* directory xattrs */ | 239 | /* directory xattrs */ |
| 247 | struct simple_xattrs xattrs; | 240 | struct simple_xattrs xattrs; |
| 248 | }; | 241 | }; |
| @@ -280,6 +273,9 @@ enum { | |||
| 280 | * - "tasks" is removed. Everything should be at process | 273 | * - "tasks" is removed. Everything should be at process |
| 281 | * granularity. Use "cgroup.procs" instead. | 274 | * granularity. Use "cgroup.procs" instead. |
| 282 | * | 275 | * |
| 276 | * - "cgroup.procs" is not sorted. pids will be unique unless they | ||
| 277 | * got recycled inbetween reads. | ||
| 278 | * | ||
| 283 | * - "release_agent" and "notify_on_release" are removed. | 279 | * - "release_agent" and "notify_on_release" are removed. |
| 284 | * Replacement notification mechanism will be implemented. | 280 | * Replacement notification mechanism will be implemented. |
| 285 | * | 281 | * |
| @@ -320,9 +316,6 @@ struct cgroupfs_root { | |||
| 320 | /* Unique id for this hierarchy. */ | 316 | /* Unique id for this hierarchy. */ |
| 321 | int hierarchy_id; | 317 | int hierarchy_id; |
| 322 | 318 | ||
| 323 | /* A list running through the attached subsystems */ | ||
| 324 | struct list_head subsys_list; | ||
| 325 | |||
| 326 | /* The root cgroup for this hierarchy */ | 319 | /* The root cgroup for this hierarchy */ |
| 327 | struct cgroup top_cgroup; | 320 | struct cgroup top_cgroup; |
| 328 | 321 | ||
| @@ -389,16 +382,6 @@ struct css_set { | |||
| 389 | }; | 382 | }; |
| 390 | 383 | ||
| 391 | /* | 384 | /* |
| 392 | * cgroup_map_cb is an abstract callback API for reporting map-valued | ||
| 393 | * control files | ||
| 394 | */ | ||
| 395 | |||
| 396 | struct cgroup_map_cb { | ||
| 397 | int (*fill)(struct cgroup_map_cb *cb, const char *key, u64 value); | ||
| 398 | void *state; | ||
| 399 | }; | ||
| 400 | |||
| 401 | /* | ||
| 402 | * struct cftype: handler definitions for cgroup control files | 385 | * struct cftype: handler definitions for cgroup control files |
| 403 | * | 386 | * |
| 404 | * When reading/writing to a file: | 387 | * When reading/writing to a file: |
| @@ -445,10 +428,6 @@ struct cftype { | |||
| 445 | */ | 428 | */ |
| 446 | struct cgroup_subsys *ss; | 429 | struct cgroup_subsys *ss; |
| 447 | 430 | ||
| 448 | int (*open)(struct inode *inode, struct file *file); | ||
| 449 | ssize_t (*read)(struct cgroup_subsys_state *css, struct cftype *cft, | ||
| 450 | struct file *file, | ||
| 451 | char __user *buf, size_t nbytes, loff_t *ppos); | ||
| 452 | /* | 431 | /* |
| 453 | * read_u64() is a shortcut for the common case of returning a | 432 | * read_u64() is a shortcut for the common case of returning a |
| 454 | * single integer. Use it in place of read() | 433 | * single integer. Use it in place of read() |
| @@ -458,24 +437,14 @@ struct cftype { | |||
| 458 | * read_s64() is a signed version of read_u64() | 437 | * read_s64() is a signed version of read_u64() |
| 459 | */ | 438 | */ |
| 460 | s64 (*read_s64)(struct cgroup_subsys_state *css, struct cftype *cft); | 439 | s64 (*read_s64)(struct cgroup_subsys_state *css, struct cftype *cft); |
| 461 | /* | ||
| 462 | * read_map() is used for defining a map of key/value | ||
| 463 | * pairs. It should call cb->fill(cb, key, value) for each | ||
| 464 | * entry. The key/value pairs (and their ordering) should not | ||
| 465 | * change between reboots. | ||
| 466 | */ | ||
| 467 | int (*read_map)(struct cgroup_subsys_state *css, struct cftype *cft, | ||
| 468 | struct cgroup_map_cb *cb); | ||
| 469 | /* | ||
| 470 | * read_seq_string() is used for outputting a simple sequence | ||
| 471 | * using seqfile. | ||
| 472 | */ | ||
| 473 | int (*read_seq_string)(struct cgroup_subsys_state *css, | ||
| 474 | struct cftype *cft, struct seq_file *m); | ||
| 475 | 440 | ||
| 476 | ssize_t (*write)(struct cgroup_subsys_state *css, struct cftype *cft, | 441 | /* generic seq_file read interface */ |
| 477 | struct file *file, | 442 | int (*seq_show)(struct seq_file *sf, void *v); |
| 478 | const char __user *buf, size_t nbytes, loff_t *ppos); | 443 | |
| 444 | /* optional ops, implement all or none */ | ||
| 445 | void *(*seq_start)(struct seq_file *sf, loff_t *ppos); | ||
| 446 | void *(*seq_next)(struct seq_file *sf, void *v, loff_t *ppos); | ||
| 447 | void (*seq_stop)(struct seq_file *sf, void *v); | ||
| 479 | 448 | ||
| 480 | /* | 449 | /* |
| 481 | * write_u64() is a shortcut for the common case of accepting | 450 | * write_u64() is a shortcut for the common case of accepting |
| @@ -504,27 +473,6 @@ struct cftype { | |||
| 504 | * kick type for multiplexing. | 473 | * kick type for multiplexing. |
| 505 | */ | 474 | */ |
| 506 | int (*trigger)(struct cgroup_subsys_state *css, unsigned int event); | 475 | int (*trigger)(struct cgroup_subsys_state *css, unsigned int event); |
| 507 | |||
| 508 | int (*release)(struct inode *inode, struct file *file); | ||
| 509 | |||
| 510 | /* | ||
| 511 | * register_event() callback will be used to add new userspace | ||
| 512 | * waiter for changes related to the cftype. Implement it if | ||
| 513 | * you want to provide this functionality. Use eventfd_signal() | ||
| 514 | * on eventfd to send notification to userspace. | ||
| 515 | */ | ||
| 516 | int (*register_event)(struct cgroup_subsys_state *css, | ||
| 517 | struct cftype *cft, struct eventfd_ctx *eventfd, | ||
| 518 | const char *args); | ||
| 519 | /* | ||
| 520 | * unregister_event() callback will be called when userspace | ||
| 521 | * closes the eventfd or on cgroup removing. | ||
| 522 | * This callback must be implemented, if you want provide | ||
| 523 | * notification functionality. | ||
| 524 | */ | ||
| 525 | void (*unregister_event)(struct cgroup_subsys_state *css, | ||
| 526 | struct cftype *cft, | ||
| 527 | struct eventfd_ctx *eventfd); | ||
| 528 | }; | 476 | }; |
| 529 | 477 | ||
| 530 | /* | 478 | /* |
| @@ -538,6 +486,26 @@ struct cftype_set { | |||
| 538 | }; | 486 | }; |
| 539 | 487 | ||
| 540 | /* | 488 | /* |
| 489 | * cgroupfs file entry, pointed to from leaf dentry->d_fsdata. Don't | ||
| 490 | * access directly. | ||
| 491 | */ | ||
| 492 | struct cfent { | ||
| 493 | struct list_head node; | ||
| 494 | struct dentry *dentry; | ||
| 495 | struct cftype *type; | ||
| 496 | struct cgroup_subsys_state *css; | ||
| 497 | |||
| 498 | /* file xattrs */ | ||
| 499 | struct simple_xattrs xattrs; | ||
| 500 | }; | ||
| 501 | |||
| 502 | /* seq_file->private points to the following, only ->priv is public */ | ||
| 503 | struct cgroup_open_file { | ||
| 504 | struct cfent *cfe; | ||
| 505 | void *priv; | ||
| 506 | }; | ||
| 507 | |||
| 508 | /* | ||
| 541 | * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This | 509 | * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This |
| 542 | * function can be called as long as @cgrp is accessible. | 510 | * function can be called as long as @cgrp is accessible. |
| 543 | */ | 511 | */ |
| @@ -552,6 +520,18 @@ static inline const char *cgroup_name(const struct cgroup *cgrp) | |||
| 552 | return rcu_dereference(cgrp->name)->name; | 520 | return rcu_dereference(cgrp->name)->name; |
| 553 | } | 521 | } |
| 554 | 522 | ||
| 523 | static inline struct cgroup_subsys_state *seq_css(struct seq_file *seq) | ||
| 524 | { | ||
| 525 | struct cgroup_open_file *of = seq->private; | ||
| 526 | return of->cfe->css; | ||
| 527 | } | ||
| 528 | |||
| 529 | static inline struct cftype *seq_cft(struct seq_file *seq) | ||
| 530 | { | ||
| 531 | struct cgroup_open_file *of = seq->private; | ||
| 532 | return of->cfe->type; | ||
| 533 | } | ||
| 534 | |||
| 555 | int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); | 535 | int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); |
| 556 | int cgroup_rm_cftypes(struct cftype *cfts); | 536 | int cgroup_rm_cftypes(struct cftype *cfts); |
| 557 | 537 | ||
| @@ -631,12 +611,8 @@ struct cgroup_subsys { | |||
| 631 | #define MAX_CGROUP_TYPE_NAMELEN 32 | 611 | #define MAX_CGROUP_TYPE_NAMELEN 32 |
| 632 | const char *name; | 612 | const char *name; |
| 633 | 613 | ||
| 634 | /* | 614 | /* link to parent, protected by cgroup_lock() */ |
| 635 | * Link to parent, and list entry in parent's children. | ||
| 636 | * Protected by cgroup_lock() | ||
| 637 | */ | ||
| 638 | struct cgroupfs_root *root; | 615 | struct cgroupfs_root *root; |
| 639 | struct list_head sibling; | ||
| 640 | 616 | ||
| 641 | /* list of cftype_sets */ | 617 | /* list of cftype_sets */ |
| 642 | struct list_head cftsets; | 618 | struct list_head cftsets; |
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h index 8138c94409f3..efbf70b9fd84 100644 --- a/include/linux/clk-private.h +++ b/include/linux/clk-private.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #define __LINUX_CLK_PRIVATE_H | 12 | #define __LINUX_CLK_PRIVATE_H |
| 13 | 13 | ||
| 14 | #include <linux/clk-provider.h> | 14 | #include <linux/clk-provider.h> |
| 15 | #include <linux/kref.h> | ||
| 15 | #include <linux/list.h> | 16 | #include <linux/list.h> |
| 16 | 17 | ||
| 17 | /* | 18 | /* |
| @@ -25,10 +26,13 @@ | |||
| 25 | 26 | ||
| 26 | #ifdef CONFIG_COMMON_CLK | 27 | #ifdef CONFIG_COMMON_CLK |
| 27 | 28 | ||
| 29 | struct module; | ||
| 30 | |||
| 28 | struct clk { | 31 | struct clk { |
| 29 | const char *name; | 32 | const char *name; |
| 30 | const struct clk_ops *ops; | 33 | const struct clk_ops *ops; |
| 31 | struct clk_hw *hw; | 34 | struct clk_hw *hw; |
| 35 | struct module *owner; | ||
| 32 | struct clk *parent; | 36 | struct clk *parent; |
| 33 | const char **parent_names; | 37 | const char **parent_names; |
| 34 | struct clk **parents; | 38 | struct clk **parents; |
| @@ -41,12 +45,14 @@ struct clk { | |||
| 41 | unsigned long flags; | 45 | unsigned long flags; |
| 42 | unsigned int enable_count; | 46 | unsigned int enable_count; |
| 43 | unsigned int prepare_count; | 47 | unsigned int prepare_count; |
| 48 | unsigned long accuracy; | ||
| 44 | struct hlist_head children; | 49 | struct hlist_head children; |
| 45 | struct hlist_node child_node; | 50 | struct hlist_node child_node; |
| 46 | unsigned int notifier_count; | 51 | unsigned int notifier_count; |
| 47 | #ifdef CONFIG_COMMON_CLK_DEBUG | 52 | #ifdef CONFIG_DEBUG_FS |
| 48 | struct dentry *dentry; | 53 | struct dentry *dentry; |
| 49 | #endif | 54 | #endif |
| 55 | struct kref ref; | ||
| 50 | }; | 56 | }; |
| 51 | 57 | ||
| 52 | /* | 58 | /* |
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 7e59253b8603..999b28ba38f7 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */ | 29 | #define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */ |
| 30 | #define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */ | 30 | #define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */ |
| 31 | #define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */ | 31 | #define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */ |
| 32 | #define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */ | ||
| 32 | 33 | ||
| 33 | struct clk_hw; | 34 | struct clk_hw; |
| 34 | 35 | ||
| @@ -108,6 +109,25 @@ struct clk_hw; | |||
| 108 | * which is likely helpful for most .set_rate implementation. | 109 | * which is likely helpful for most .set_rate implementation. |
| 109 | * Returns 0 on success, -EERROR otherwise. | 110 | * Returns 0 on success, -EERROR otherwise. |
| 110 | * | 111 | * |
| 112 | * @recalc_accuracy: Recalculate the accuracy of this clock. The clock accuracy | ||
| 113 | * is expressed in ppb (parts per billion). The parent accuracy is | ||
| 114 | * an input parameter. | ||
| 115 | * Returns the calculated accuracy. Optional - if this op is not | ||
| 116 | * set then clock accuracy will be initialized to parent accuracy | ||
| 117 | * or 0 (perfect clock) if clock has no parent. | ||
| 118 | * | ||
| 119 | * @set_rate_and_parent: Change the rate and the parent of this clock. The | ||
| 120 | * requested rate is specified by the second argument, which | ||
| 121 | * should typically be the return of .round_rate call. The | ||
| 122 | * third argument gives the parent rate which is likely helpful | ||
| 123 | * for most .set_rate_and_parent implementation. The fourth | ||
| 124 | * argument gives the parent index. This callback is optional (and | ||
| 125 | * unnecessary) for clocks with 0 or 1 parents as well as | ||
| 126 | * for clocks that can tolerate switching the rate and the parent | ||
| 127 | * separately via calls to .set_parent and .set_rate. | ||
| 128 | * Returns 0 on success, -EERROR otherwise. | ||
| 129 | * | ||
| 130 | * | ||
| 111 | * The clk_enable/clk_disable and clk_prepare/clk_unprepare pairs allow | 131 | * The clk_enable/clk_disable and clk_prepare/clk_unprepare pairs allow |
| 112 | * implementations to split any work between atomic (enable) and sleepable | 132 | * implementations to split any work between atomic (enable) and sleepable |
| 113 | * (prepare) contexts. If enabling a clock requires code that might sleep, | 133 | * (prepare) contexts. If enabling a clock requires code that might sleep, |
| @@ -139,6 +159,11 @@ struct clk_ops { | |||
| 139 | u8 (*get_parent)(struct clk_hw *hw); | 159 | u8 (*get_parent)(struct clk_hw *hw); |
| 140 | int (*set_rate)(struct clk_hw *hw, unsigned long, | 160 | int (*set_rate)(struct clk_hw *hw, unsigned long, |
| 141 | unsigned long); | 161 | unsigned long); |
| 162 | int (*set_rate_and_parent)(struct clk_hw *hw, | ||
| 163 | unsigned long rate, | ||
| 164 | unsigned long parent_rate, u8 index); | ||
| 165 | unsigned long (*recalc_accuracy)(struct clk_hw *hw, | ||
| 166 | unsigned long parent_accuracy); | ||
| 142 | void (*init)(struct clk_hw *hw); | 167 | void (*init)(struct clk_hw *hw); |
| 143 | }; | 168 | }; |
| 144 | 169 | ||
| @@ -194,6 +219,7 @@ struct clk_hw { | |||
| 194 | struct clk_fixed_rate { | 219 | struct clk_fixed_rate { |
| 195 | struct clk_hw hw; | 220 | struct clk_hw hw; |
| 196 | unsigned long fixed_rate; | 221 | unsigned long fixed_rate; |
| 222 | unsigned long fixed_accuracy; | ||
| 197 | u8 flags; | 223 | u8 flags; |
| 198 | }; | 224 | }; |
| 199 | 225 | ||
| @@ -201,6 +227,9 @@ extern const struct clk_ops clk_fixed_rate_ops; | |||
| 201 | struct clk *clk_register_fixed_rate(struct device *dev, const char *name, | 227 | struct clk *clk_register_fixed_rate(struct device *dev, const char *name, |
| 202 | const char *parent_name, unsigned long flags, | 228 | const char *parent_name, unsigned long flags, |
| 203 | unsigned long fixed_rate); | 229 | unsigned long fixed_rate); |
| 230 | struct clk *clk_register_fixed_rate_with_accuracy(struct device *dev, | ||
| 231 | const char *name, const char *parent_name, unsigned long flags, | ||
| 232 | unsigned long fixed_rate, unsigned long fixed_accuracy); | ||
| 204 | 233 | ||
| 205 | void of_fixed_clk_setup(struct device_node *np); | 234 | void of_fixed_clk_setup(struct device_node *np); |
| 206 | 235 | ||
| @@ -433,6 +462,7 @@ struct clk *clk_get_parent_by_index(struct clk *clk, u8 index); | |||
| 433 | unsigned int __clk_get_enable_count(struct clk *clk); | 462 | unsigned int __clk_get_enable_count(struct clk *clk); |
| 434 | unsigned int __clk_get_prepare_count(struct clk *clk); | 463 | unsigned int __clk_get_prepare_count(struct clk *clk); |
| 435 | unsigned long __clk_get_rate(struct clk *clk); | 464 | unsigned long __clk_get_rate(struct clk *clk); |
| 465 | unsigned long __clk_get_accuracy(struct clk *clk); | ||
| 436 | unsigned long __clk_get_flags(struct clk *clk); | 466 | unsigned long __clk_get_flags(struct clk *clk); |
| 437 | bool __clk_is_prepared(struct clk *clk); | 467 | bool __clk_is_prepared(struct clk *clk); |
| 438 | bool __clk_is_enabled(struct clk *clk); | 468 | bool __clk_is_enabled(struct clk *clk); |
diff --git a/include/linux/clk.h b/include/linux/clk.h index 9a6d04524b1a..0dd91148165e 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
| @@ -82,6 +82,23 @@ int clk_notifier_register(struct clk *clk, struct notifier_block *nb); | |||
| 82 | 82 | ||
| 83 | int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb); | 83 | int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb); |
| 84 | 84 | ||
| 85 | /** | ||
| 86 | * clk_get_accuracy - obtain the clock accuracy in ppb (parts per billion) | ||
| 87 | * for a clock source. | ||
| 88 | * @clk: clock source | ||
| 89 | * | ||
| 90 | * This gets the clock source accuracy expressed in ppb. | ||
| 91 | * A perfect clock returns 0. | ||
| 92 | */ | ||
| 93 | long clk_get_accuracy(struct clk *clk); | ||
| 94 | |||
| 95 | #else | ||
| 96 | |||
| 97 | static inline long clk_get_accuracy(struct clk *clk) | ||
| 98 | { | ||
| 99 | return -ENOTSUPP; | ||
| 100 | } | ||
| 101 | |||
| 85 | #endif | 102 | #endif |
| 86 | 103 | ||
| 87 | /** | 104 | /** |
diff --git a/include/linux/clk/at91_pmc.h b/include/linux/clk/at91_pmc.h new file mode 100644 index 000000000000..a6911ebbd02a --- /dev/null +++ b/include/linux/clk/at91_pmc.h | |||
| @@ -0,0 +1,192 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/clk/at91_pmc.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2005 Ivan Kokshaysky | ||
| 5 | * Copyright (C) SAN People | ||
| 6 | * | ||
| 7 | * Power Management Controller (PMC) - System peripherals registers. | ||
| 8 | * Based on AT91RM9200 datasheet revision E. | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License as published by | ||
| 12 | * the Free Software Foundation; either version 2 of the License, or | ||
| 13 | * (at your option) any later version. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef AT91_PMC_H | ||
| 17 | #define AT91_PMC_H | ||
| 18 | |||
| 19 | #ifndef __ASSEMBLY__ | ||
| 20 | extern void __iomem *at91_pmc_base; | ||
| 21 | |||
| 22 | #define at91_pmc_read(field) \ | ||
| 23 | __raw_readl(at91_pmc_base + field) | ||
| 24 | |||
| 25 | #define at91_pmc_write(field, value) \ | ||
| 26 | __raw_writel(value, at91_pmc_base + field) | ||
| 27 | #else | ||
| 28 | .extern at91_pmc_base | ||
| 29 | #endif | ||
| 30 | |||
| 31 | #define AT91_PMC_SCER 0x00 /* System Clock Enable Register */ | ||
| 32 | #define AT91_PMC_SCDR 0x04 /* System Clock Disable Register */ | ||
| 33 | |||
| 34 | #define AT91_PMC_SCSR 0x08 /* System Clock Status Register */ | ||
| 35 | #define AT91_PMC_PCK (1 << 0) /* Processor Clock */ | ||
| 36 | #define AT91RM9200_PMC_UDP (1 << 1) /* USB Devcice Port Clock [AT91RM9200 only] */ | ||
| 37 | #define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */ | ||
| 38 | #define AT91RM9200_PMC_UHP (1 << 4) /* USB Host Port Clock [AT91RM9200 only] */ | ||
| 39 | #define AT91SAM926x_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91SAM926x only] */ | ||
| 40 | #define AT91SAM926x_PMC_UDP (1 << 7) /* USB Devcice Port Clock [AT91SAM926x only] */ | ||
| 41 | #define AT91_PMC_PCK0 (1 << 8) /* Programmable Clock 0 */ | ||
| 42 | #define AT91_PMC_PCK1 (1 << 9) /* Programmable Clock 1 */ | ||
| 43 | #define AT91_PMC_PCK2 (1 << 10) /* Programmable Clock 2 */ | ||
| 44 | #define AT91_PMC_PCK3 (1 << 11) /* Programmable Clock 3 */ | ||
| 45 | #define AT91_PMC_PCK4 (1 << 12) /* Programmable Clock 4 [AT572D940HF only] */ | ||
| 46 | #define AT91_PMC_HCK0 (1 << 16) /* AHB Clock (USB host) [AT91SAM9261 only] */ | ||
| 47 | #define AT91_PMC_HCK1 (1 << 17) /* AHB Clock (LCD) [AT91SAM9261 only] */ | ||
| 48 | |||
| 49 | #define AT91_PMC_PCER 0x10 /* Peripheral Clock Enable Register */ | ||
| 50 | #define AT91_PMC_PCDR 0x14 /* Peripheral Clock Disable Register */ | ||
| 51 | #define AT91_PMC_PCSR 0x18 /* Peripheral Clock Status Register */ | ||
| 52 | |||
| 53 | #define AT91_CKGR_UCKR 0x1C /* UTMI Clock Register [some SAM9] */ | ||
| 54 | #define AT91_PMC_UPLLEN (1 << 16) /* UTMI PLL Enable */ | ||
| 55 | #define AT91_PMC_UPLLCOUNT (0xf << 20) /* UTMI PLL Start-up Time */ | ||
| 56 | #define AT91_PMC_BIASEN (1 << 24) /* UTMI BIAS Enable */ | ||
| 57 | #define AT91_PMC_BIASCOUNT (0xf << 28) /* UTMI BIAS Start-up Time */ | ||
| 58 | |||
| 59 | #define AT91_CKGR_MOR 0x20 /* Main Oscillator Register [not on SAM9RL] */ | ||
| 60 | #define AT91_PMC_MOSCEN (1 << 0) /* Main Oscillator Enable */ | ||
| 61 | #define AT91_PMC_OSCBYPASS (1 << 1) /* Oscillator Bypass */ | ||
| 62 | #define AT91_PMC_MOSCRCEN (1 << 3) /* Main On-Chip RC Oscillator Enable [some SAM9] */ | ||
| 63 | #define AT91_PMC_OSCOUNT (0xff << 8) /* Main Oscillator Start-up Time */ | ||
| 64 | #define AT91_PMC_KEY (0x37 << 16) /* MOR Writing Key */ | ||
| 65 | #define AT91_PMC_MOSCSEL (1 << 24) /* Main Oscillator Selection [some SAM9] */ | ||
| 66 | #define AT91_PMC_CFDEN (1 << 25) /* Clock Failure Detector Enable [some SAM9] */ | ||
| 67 | |||
| 68 | #define AT91_CKGR_MCFR 0x24 /* Main Clock Frequency Register */ | ||
| 69 | #define AT91_PMC_MAINF (0xffff << 0) /* Main Clock Frequency */ | ||
| 70 | #define AT91_PMC_MAINRDY (1 << 16) /* Main Clock Ready */ | ||
| 71 | |||
| 72 | #define AT91_CKGR_PLLAR 0x28 /* PLL A Register */ | ||
| 73 | #define AT91_CKGR_PLLBR 0x2c /* PLL B Register */ | ||
| 74 | #define AT91_PMC_DIV (0xff << 0) /* Divider */ | ||
| 75 | #define AT91_PMC_PLLCOUNT (0x3f << 8) /* PLL Counter */ | ||
| 76 | #define AT91_PMC_OUT (3 << 14) /* PLL Clock Frequency Range */ | ||
| 77 | #define AT91_PMC_MUL (0x7ff << 16) /* PLL Multiplier */ | ||
| 78 | #define AT91_PMC_MUL_GET(n) ((n) >> 16 & 0x7ff) | ||
| 79 | #define AT91_PMC3_MUL (0x7f << 18) /* PLL Multiplier [SAMA5 only] */ | ||
| 80 | #define AT91_PMC3_MUL_GET(n) ((n) >> 18 & 0x7f) | ||
| 81 | #define AT91_PMC_USBDIV (3 << 28) /* USB Divisor (PLLB only) */ | ||
| 82 | #define AT91_PMC_USBDIV_1 (0 << 28) | ||
| 83 | #define AT91_PMC_USBDIV_2 (1 << 28) | ||
| 84 | #define AT91_PMC_USBDIV_4 (2 << 28) | ||
| 85 | #define AT91_PMC_USB96M (1 << 28) /* Divider by 2 Enable (PLLB only) */ | ||
| 86 | |||
| 87 | #define AT91_PMC_MCKR 0x30 /* Master Clock Register */ | ||
| 88 | #define AT91_PMC_CSS (3 << 0) /* Master Clock Selection */ | ||
| 89 | #define AT91_PMC_CSS_SLOW (0 << 0) | ||
| 90 | #define AT91_PMC_CSS_MAIN (1 << 0) | ||
| 91 | #define AT91_PMC_CSS_PLLA (2 << 0) | ||
| 92 | #define AT91_PMC_CSS_PLLB (3 << 0) | ||
| 93 | #define AT91_PMC_CSS_UPLL (3 << 0) /* [some SAM9 only] */ | ||
| 94 | #define PMC_PRES_OFFSET 2 | ||
| 95 | #define AT91_PMC_PRES (7 << PMC_PRES_OFFSET) /* Master Clock Prescaler */ | ||
| 96 | #define AT91_PMC_PRES_1 (0 << PMC_PRES_OFFSET) | ||
| 97 | #define AT91_PMC_PRES_2 (1 << PMC_PRES_OFFSET) | ||
| 98 | #define AT91_PMC_PRES_4 (2 << PMC_PRES_OFFSET) | ||
| 99 | #define AT91_PMC_PRES_8 (3 << PMC_PRES_OFFSET) | ||
| 100 | #define AT91_PMC_PRES_16 (4 << PMC_PRES_OFFSET) | ||
| 101 | #define AT91_PMC_PRES_32 (5 << PMC_PRES_OFFSET) | ||
| 102 | #define AT91_PMC_PRES_64 (6 << PMC_PRES_OFFSET) | ||
| 103 | #define PMC_ALT_PRES_OFFSET 4 | ||
| 104 | #define AT91_PMC_ALT_PRES (7 << PMC_ALT_PRES_OFFSET) /* Master Clock Prescaler [alternate location] */ | ||
| 105 | #define AT91_PMC_ALT_PRES_1 (0 << PMC_ALT_PRES_OFFSET) | ||
| 106 | #define AT91_PMC_ALT_PRES_2 (1 << PMC_ALT_PRES_OFFSET) | ||
| 107 | #define AT91_PMC_ALT_PRES_4 (2 << PMC_ALT_PRES_OFFSET) | ||
| 108 | #define AT91_PMC_ALT_PRES_8 (3 << PMC_ALT_PRES_OFFSET) | ||
| 109 | #define AT91_PMC_ALT_PRES_16 (4 << PMC_ALT_PRES_OFFSET) | ||
| 110 | #define AT91_PMC_ALT_PRES_32 (5 << PMC_ALT_PRES_OFFSET) | ||
| 111 | #define AT91_PMC_ALT_PRES_64 (6 << PMC_ALT_PRES_OFFSET) | ||
| 112 | #define AT91_PMC_MDIV (3 << 8) /* Master Clock Division */ | ||
| 113 | #define AT91RM9200_PMC_MDIV_1 (0 << 8) /* [AT91RM9200 only] */ | ||
| 114 | #define AT91RM9200_PMC_MDIV_2 (1 << 8) | ||
| 115 | #define AT91RM9200_PMC_MDIV_3 (2 << 8) | ||
| 116 | #define AT91RM9200_PMC_MDIV_4 (3 << 8) | ||
| 117 | #define AT91SAM9_PMC_MDIV_1 (0 << 8) /* [SAM9 only] */ | ||
| 118 | #define AT91SAM9_PMC_MDIV_2 (1 << 8) | ||
| 119 | #define AT91SAM9_PMC_MDIV_4 (2 << 8) | ||
| 120 | #define AT91SAM9_PMC_MDIV_6 (3 << 8) /* [some SAM9 only] */ | ||
| 121 | #define AT91SAM9_PMC_MDIV_3 (3 << 8) /* [some SAM9 only] */ | ||
| 122 | #define AT91_PMC_PDIV (1 << 12) /* Processor Clock Division [some SAM9 only] */ | ||
| 123 | #define AT91_PMC_PDIV_1 (0 << 12) | ||
| 124 | #define AT91_PMC_PDIV_2 (1 << 12) | ||
| 125 | #define AT91_PMC_PLLADIV2 (1 << 12) /* PLLA divisor by 2 [some SAM9 only] */ | ||
| 126 | #define AT91_PMC_PLLADIV2_OFF (0 << 12) | ||
| 127 | #define AT91_PMC_PLLADIV2_ON (1 << 12) | ||
| 128 | |||
| 129 | #define AT91_PMC_USB 0x38 /* USB Clock Register [some SAM9 only] */ | ||
| 130 | #define AT91_PMC_USBS (0x1 << 0) /* USB OHCI Input clock selection */ | ||
| 131 | #define AT91_PMC_USBS_PLLA (0 << 0) | ||
| 132 | #define AT91_PMC_USBS_UPLL (1 << 0) | ||
| 133 | #define AT91_PMC_USBS_PLLB (1 << 0) /* [AT91SAMN12 only] */ | ||
| 134 | #define AT91_PMC_OHCIUSBDIV (0xF << 8) /* Divider for USB OHCI Clock */ | ||
| 135 | #define AT91_PMC_OHCIUSBDIV_1 (0x0 << 8) | ||
| 136 | #define AT91_PMC_OHCIUSBDIV_2 (0x1 << 8) | ||
| 137 | |||
| 138 | #define AT91_PMC_SMD 0x3c /* Soft Modem Clock Register [some SAM9 only] */ | ||
| 139 | #define AT91_PMC_SMDS (0x1 << 0) /* SMD input clock selection */ | ||
| 140 | #define AT91_PMC_SMD_DIV (0x1f << 8) /* SMD input clock divider */ | ||
| 141 | #define AT91_PMC_SMDDIV(n) (((n) << 8) & AT91_PMC_SMD_DIV) | ||
| 142 | |||
| 143 | #define AT91_PMC_PCKR(n) (0x40 + ((n) * 4)) /* Programmable Clock 0-N Registers */ | ||
| 144 | #define AT91_PMC_ALT_PCKR_CSS (0x7 << 0) /* Programmable Clock Source Selection [alternate length] */ | ||
| 145 | #define AT91_PMC_CSS_MASTER (4 << 0) /* [some SAM9 only] */ | ||
| 146 | #define AT91_PMC_CSSMCK (0x1 << 8) /* CSS or Master Clock Selection */ | ||
| 147 | #define AT91_PMC_CSSMCK_CSS (0 << 8) | ||
| 148 | #define AT91_PMC_CSSMCK_MCK (1 << 8) | ||
| 149 | |||
| 150 | #define AT91_PMC_IER 0x60 /* Interrupt Enable Register */ | ||
| 151 | #define AT91_PMC_IDR 0x64 /* Interrupt Disable Register */ | ||
| 152 | #define AT91_PMC_SR 0x68 /* Status Register */ | ||
| 153 | #define AT91_PMC_MOSCS (1 << 0) /* MOSCS Flag */ | ||
| 154 | #define AT91_PMC_LOCKA (1 << 1) /* PLLA Lock */ | ||
| 155 | #define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */ | ||
| 156 | #define AT91_PMC_MCKRDY (1 << 3) /* Master Clock */ | ||
| 157 | #define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [some SAM9] */ | ||
| 158 | #define AT91_PMC_PCK0RDY (1 << 8) /* Programmable Clock 0 */ | ||
| 159 | #define AT91_PMC_PCK1RDY (1 << 9) /* Programmable Clock 1 */ | ||
| 160 | #define AT91_PMC_PCK2RDY (1 << 10) /* Programmable Clock 2 */ | ||
| 161 | #define AT91_PMC_PCK3RDY (1 << 11) /* Programmable Clock 3 */ | ||
| 162 | #define AT91_PMC_MOSCSELS (1 << 16) /* Main Oscillator Selection [some SAM9] */ | ||
| 163 | #define AT91_PMC_MOSCRCS (1 << 17) /* Main On-Chip RC [some SAM9] */ | ||
| 164 | #define AT91_PMC_CFDEV (1 << 18) /* Clock Failure Detector Event [some SAM9] */ | ||
| 165 | #define AT91_PMC_IMR 0x6c /* Interrupt Mask Register */ | ||
| 166 | |||
| 167 | #define AT91_PMC_PLLICPR 0x80 /* PLL Charge Pump Current Register */ | ||
| 168 | |||
| 169 | #define AT91_PMC_PROT 0xe4 /* Write Protect Mode Register [some SAM9] */ | ||
| 170 | #define AT91_PMC_WPEN (0x1 << 0) /* Write Protect Enable */ | ||
| 171 | #define AT91_PMC_WPKEY (0xffffff << 8) /* Write Protect Key */ | ||
| 172 | #define AT91_PMC_PROTKEY (0x504d43 << 8) /* Activation Code */ | ||
| 173 | |||
| 174 | #define AT91_PMC_WPSR 0xe8 /* Write Protect Status Register [some SAM9] */ | ||
| 175 | #define AT91_PMC_WPVS (0x1 << 0) /* Write Protect Violation Status */ | ||
| 176 | #define AT91_PMC_WPVSRC (0xffff << 8) /* Write Protect Violation Source */ | ||
| 177 | |||
| 178 | #define AT91_PMC_PCER1 0x100 /* Peripheral Clock Enable Register 1 [SAMA5 only]*/ | ||
| 179 | #define AT91_PMC_PCDR1 0x104 /* Peripheral Clock Enable Register 1 */ | ||
| 180 | #define AT91_PMC_PCSR1 0x108 /* Peripheral Clock Enable Register 1 */ | ||
| 181 | |||
| 182 | #define AT91_PMC_PCR 0x10c /* Peripheral Control Register [some SAM9 and SAMA5] */ | ||
| 183 | #define AT91_PMC_PCR_PID (0x3f << 0) /* Peripheral ID */ | ||
| 184 | #define AT91_PMC_PCR_CMD (0x1 << 12) /* Command (read=0, write=1) */ | ||
| 185 | #define AT91_PMC_PCR_DIV(n) ((n) << 16) /* Divisor Value */ | ||
| 186 | #define AT91_PMC_PCR_DIV0 0x0 /* Peripheral clock is MCK */ | ||
| 187 | #define AT91_PMC_PCR_DIV2 0x1 /* Peripheral clock is MCK/2 */ | ||
| 188 | #define AT91_PMC_PCR_DIV4 0x2 /* Peripheral clock is MCK/4 */ | ||
| 189 | #define AT91_PMC_PCR_DIV8 0x3 /* Peripheral clock is MCK/8 */ | ||
| 190 | #define AT91_PMC_PCR_EN (0x1 << 28) /* Enable */ | ||
| 191 | |||
| 192 | #endif | ||
diff --git a/include/linux/clk/shmobile.h b/include/linux/clk/shmobile.h new file mode 100644 index 000000000000..f9bf080a1123 --- /dev/null +++ b/include/linux/clk/shmobile.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2013 Ideas On Board SPRL | ||
| 3 | * | ||
| 4 | * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.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 as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __LINUX_CLK_SHMOBILE_H_ | ||
| 13 | #define __LINUX_CLK_SHMOBILE_H_ | ||
| 14 | |||
| 15 | #include <linux/types.h> | ||
| 16 | |||
| 17 | void rcar_gen2_clocks_init(u32 mode); | ||
| 18 | |||
| 19 | #endif | ||
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h index 23a0ceee831f..3ca9fca827a2 100644 --- a/include/linux/clk/tegra.h +++ b/include/linux/clk/tegra.h | |||
| @@ -120,13 +120,6 @@ static inline void tegra_cpu_clock_resume(void) | |||
| 120 | } | 120 | } |
| 121 | #endif | 121 | #endif |
| 122 | 122 | ||
| 123 | #ifdef CONFIG_ARCH_TEGRA | ||
| 124 | void tegra_periph_reset_deassert(struct clk *c); | ||
| 125 | void tegra_periph_reset_assert(struct clk *c); | ||
| 126 | #else | ||
| 127 | static inline void tegra_periph_reset_deassert(struct clk *c) {} | ||
| 128 | static inline void tegra_periph_reset_assert(struct clk *c) {} | ||
| 129 | #endif | ||
| 130 | void tegra_clocks_apply_init_table(void); | 123 | void tegra_clocks_apply_init_table(void); |
| 131 | 124 | ||
| 132 | #endif /* __LINUX_CLK_TEGRA_H_ */ | 125 | #endif /* __LINUX_CLK_TEGRA_H_ */ |
diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h index a6a6f603103b..94bad77eeb4a 100644 --- a/include/linux/clkdev.h +++ b/include/linux/clkdev.h | |||
| @@ -43,4 +43,9 @@ int clk_add_alias(const char *, const char *, char *, struct device *); | |||
| 43 | int clk_register_clkdev(struct clk *, const char *, const char *, ...); | 43 | int clk_register_clkdev(struct clk *, const char *, const char *, ...); |
| 44 | int clk_register_clkdevs(struct clk *, struct clk_lookup *, size_t); | 44 | int clk_register_clkdevs(struct clk *, struct clk_lookup *, size_t); |
| 45 | 45 | ||
| 46 | #ifdef CONFIG_COMMON_CLK | ||
| 47 | int __clk_get(struct clk *clk); | ||
| 48 | void __clk_put(struct clk *clk); | ||
| 49 | #endif | ||
| 50 | |||
| 46 | #endif | 51 | #endif |
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index 091d72e70d8a..7e1c76e3cd68 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h | |||
| @@ -62,6 +62,22 @@ static inline bool compaction_deferred(struct zone *zone, int order) | |||
| 62 | return zone->compact_considered < defer_limit; | 62 | return zone->compact_considered < defer_limit; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | /* | ||
| 66 | * Update defer tracking counters after successful compaction of given order, | ||
| 67 | * which means an allocation either succeeded (alloc_success == true) or is | ||
| 68 | * expected to succeed. | ||
| 69 | */ | ||
| 70 | static inline void compaction_defer_reset(struct zone *zone, int order, | ||
| 71 | bool alloc_success) | ||
| 72 | { | ||
| 73 | if (alloc_success) { | ||
| 74 | zone->compact_considered = 0; | ||
| 75 | zone->compact_defer_shift = 0; | ||
| 76 | } | ||
| 77 | if (order >= zone->compact_order_failed) | ||
| 78 | zone->compact_order_failed = order + 1; | ||
| 79 | } | ||
| 80 | |||
| 65 | /* Returns true if restarting compaction after many failures */ | 81 | /* Returns true if restarting compaction after many failures */ |
| 66 | static inline bool compaction_restarting(struct zone *zone, int order) | 82 | static inline bool compaction_restarting(struct zone *zone, int order) |
| 67 | { | 83 | { |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 24545cd90a25..02ae99e8e6d3 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
| @@ -37,6 +37,9 @@ | |||
| 37 | __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ | 37 | __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ |
| 38 | (typeof(ptr)) (__ptr + (off)); }) | 38 | (typeof(ptr)) (__ptr + (off)); }) |
| 39 | 39 | ||
| 40 | /* Make the optimizer believe the variable can be manipulated arbitrarily. */ | ||
| 41 | #define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var)) | ||
| 42 | |||
| 40 | #ifdef __CHECKER__ | 43 | #ifdef __CHECKER__ |
| 41 | #define __must_be_array(arr) 0 | 44 | #define __must_be_array(arr) 0 |
| 42 | #else | 45 | #else |
diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h index 973ce10c40b6..5529c5239421 100644 --- a/include/linux/compiler-intel.h +++ b/include/linux/compiler-intel.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | */ | 15 | */ |
| 16 | #undef barrier | 16 | #undef barrier |
| 17 | #undef RELOC_HIDE | 17 | #undef RELOC_HIDE |
| 18 | #undef OPTIMIZER_HIDE_VAR | ||
| 18 | 19 | ||
| 19 | #define barrier() __memory_barrier() | 20 | #define barrier() __memory_barrier() |
| 20 | 21 | ||
| @@ -23,13 +24,17 @@ | |||
| 23 | __ptr = (unsigned long) (ptr); \ | 24 | __ptr = (unsigned long) (ptr); \ |
| 24 | (typeof(ptr)) (__ptr + (off)); }) | 25 | (typeof(ptr)) (__ptr + (off)); }) |
| 25 | 26 | ||
| 27 | /* This should act as an optimization barrier on var. | ||
| 28 | * Given that this compiler does not have inline assembly, a compiler barrier | ||
| 29 | * is the best we can do. | ||
| 30 | */ | ||
| 31 | #define OPTIMIZER_HIDE_VAR(var) barrier() | ||
| 32 | |||
| 26 | /* Intel ECC compiler doesn't support __builtin_types_compatible_p() */ | 33 | /* Intel ECC compiler doesn't support __builtin_types_compatible_p() */ |
| 27 | #define __must_be_array(a) 0 | 34 | #define __must_be_array(a) 0 |
| 28 | 35 | ||
| 29 | #endif | 36 | #endif |
| 30 | 37 | ||
| 31 | #define uninitialized_var(x) x | ||
| 32 | |||
| 33 | #ifndef __HAVE_BUILTIN_BSWAP16__ | 38 | #ifndef __HAVE_BUILTIN_BSWAP16__ |
| 34 | /* icc has this, but it's called _bswap16 */ | 39 | /* icc has this, but it's called _bswap16 */ |
| 35 | #define __HAVE_BUILTIN_BSWAP16__ | 40 | #define __HAVE_BUILTIN_BSWAP16__ |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 92669cd182a6..2472740d7ab2 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -170,6 +170,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 170 | (typeof(ptr)) (__ptr + (off)); }) | 170 | (typeof(ptr)) (__ptr + (off)); }) |
| 171 | #endif | 171 | #endif |
| 172 | 172 | ||
| 173 | #ifndef OPTIMIZER_HIDE_VAR | ||
| 174 | #define OPTIMIZER_HIDE_VAR(var) barrier() | ||
| 175 | #endif | ||
| 176 | |||
| 173 | /* Not-quite-unique ID. */ | 177 | /* Not-quite-unique ID. */ |
| 174 | #ifndef __UNIQUE_ID | 178 | #ifndef __UNIQUE_ID |
| 175 | # define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__) | 179 | # define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__) |
| @@ -298,6 +302,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 298 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) | 302 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) |
| 299 | #endif | 303 | #endif |
| 300 | 304 | ||
| 305 | /* Is this type a native word size -- useful for atomic operations */ | ||
| 306 | #ifndef __native_word | ||
| 307 | # define __native_word(t) (sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) | ||
| 308 | #endif | ||
| 309 | |||
| 301 | /* Compile time object size, -1 for unknown */ | 310 | /* Compile time object size, -1 for unknown */ |
| 302 | #ifndef __compiletime_object_size | 311 | #ifndef __compiletime_object_size |
| 303 | # define __compiletime_object_size(obj) -1 | 312 | # define __compiletime_object_size(obj) -1 |
| @@ -337,6 +346,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 337 | #define compiletime_assert(condition, msg) \ | 346 | #define compiletime_assert(condition, msg) \ |
| 338 | _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) | 347 | _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) |
| 339 | 348 | ||
| 349 | #define compiletime_assert_atomic_type(t) \ | ||
| 350 | compiletime_assert(__native_word(t), \ | ||
| 351 | "Need native word sized stores/loads for atomicity.") | ||
| 352 | |||
| 340 | /* | 353 | /* |
| 341 | * Prevent the compiler from merging or refetching accesses. The compiler | 354 | * Prevent the compiler from merging or refetching accesses. The compiler |
| 342 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), | 355 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), |
diff --git a/include/linux/component.h b/include/linux/component.h new file mode 100644 index 000000000000..68870182ca1e --- /dev/null +++ b/include/linux/component.h | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | #ifndef COMPONENT_H | ||
| 2 | #define COMPONENT_H | ||
| 3 | |||
| 4 | struct device; | ||
| 5 | |||
| 6 | struct component_ops { | ||
| 7 | int (*bind)(struct device *, struct device *, void *); | ||
| 8 | void (*unbind)(struct device *, struct device *, void *); | ||
| 9 | }; | ||
| 10 | |||
| 11 | int component_add(struct device *, const struct component_ops *); | ||
| 12 | void component_del(struct device *, const struct component_ops *); | ||
| 13 | |||
| 14 | int component_bind_all(struct device *, void *); | ||
| 15 | void component_unbind_all(struct device *, void *); | ||
| 16 | |||
| 17 | struct master; | ||
| 18 | |||
| 19 | struct component_master_ops { | ||
| 20 | int (*add_components)(struct device *, struct master *); | ||
| 21 | int (*bind)(struct device *); | ||
| 22 | void (*unbind)(struct device *); | ||
| 23 | }; | ||
| 24 | |||
| 25 | int component_master_add(struct device *, const struct component_master_ops *); | ||
| 26 | void component_master_del(struct device *, | ||
| 27 | const struct component_master_ops *); | ||
| 28 | |||
| 29 | int component_master_add_child(struct master *master, | ||
| 30 | int (*compare)(struct device *, void *), void *compare_data); | ||
| 31 | |||
| 32 | #endif | ||
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h index 158158704c30..37b81bd51ec0 100644 --- a/include/linux/context_tracking.h +++ b/include/linux/context_tracking.h | |||
| @@ -17,13 +17,13 @@ extern void __context_tracking_task_switch(struct task_struct *prev, | |||
| 17 | 17 | ||
| 18 | static inline void user_enter(void) | 18 | static inline void user_enter(void) |
| 19 | { | 19 | { |
| 20 | if (static_key_false(&context_tracking_enabled)) | 20 | if (context_tracking_is_enabled()) |
| 21 | context_tracking_user_enter(); | 21 | context_tracking_user_enter(); |
| 22 | 22 | ||
| 23 | } | 23 | } |
| 24 | static inline void user_exit(void) | 24 | static inline void user_exit(void) |
| 25 | { | 25 | { |
| 26 | if (static_key_false(&context_tracking_enabled)) | 26 | if (context_tracking_is_enabled()) |
| 27 | context_tracking_user_exit(); | 27 | context_tracking_user_exit(); |
| 28 | } | 28 | } |
| 29 | 29 | ||
| @@ -31,7 +31,7 @@ static inline enum ctx_state exception_enter(void) | |||
| 31 | { | 31 | { |
| 32 | enum ctx_state prev_ctx; | 32 | enum ctx_state prev_ctx; |
| 33 | 33 | ||
| 34 | if (!static_key_false(&context_tracking_enabled)) | 34 | if (!context_tracking_is_enabled()) |
| 35 | return 0; | 35 | return 0; |
| 36 | 36 | ||
| 37 | prev_ctx = this_cpu_read(context_tracking.state); | 37 | prev_ctx = this_cpu_read(context_tracking.state); |
| @@ -42,7 +42,7 @@ static inline enum ctx_state exception_enter(void) | |||
| 42 | 42 | ||
| 43 | static inline void exception_exit(enum ctx_state prev_ctx) | 43 | static inline void exception_exit(enum ctx_state prev_ctx) |
| 44 | { | 44 | { |
| 45 | if (static_key_false(&context_tracking_enabled)) { | 45 | if (context_tracking_is_enabled()) { |
| 46 | if (prev_ctx == IN_USER) | 46 | if (prev_ctx == IN_USER) |
| 47 | context_tracking_user_enter(); | 47 | context_tracking_user_enter(); |
| 48 | } | 48 | } |
| @@ -51,7 +51,7 @@ static inline void exception_exit(enum ctx_state prev_ctx) | |||
| 51 | static inline void context_tracking_task_switch(struct task_struct *prev, | 51 | static inline void context_tracking_task_switch(struct task_struct *prev, |
| 52 | struct task_struct *next) | 52 | struct task_struct *next) |
| 53 | { | 53 | { |
| 54 | if (static_key_false(&context_tracking_enabled)) | 54 | if (context_tracking_is_enabled()) |
| 55 | __context_tracking_task_switch(prev, next); | 55 | __context_tracking_task_switch(prev, next); |
| 56 | } | 56 | } |
| 57 | #else | 57 | #else |
diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h index 0f1979d0674f..97a81225d037 100644 --- a/include/linux/context_tracking_state.h +++ b/include/linux/context_tracking_state.h | |||
| @@ -22,15 +22,20 @@ struct context_tracking { | |||
| 22 | extern struct static_key context_tracking_enabled; | 22 | extern struct static_key context_tracking_enabled; |
| 23 | DECLARE_PER_CPU(struct context_tracking, context_tracking); | 23 | DECLARE_PER_CPU(struct context_tracking, context_tracking); |
| 24 | 24 | ||
| 25 | static inline bool context_tracking_in_user(void) | 25 | static inline bool context_tracking_is_enabled(void) |
| 26 | { | 26 | { |
| 27 | return __this_cpu_read(context_tracking.state) == IN_USER; | 27 | return static_key_false(&context_tracking_enabled); |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | static inline bool context_tracking_active(void) | 30 | static inline bool context_tracking_cpu_is_enabled(void) |
| 31 | { | 31 | { |
| 32 | return __this_cpu_read(context_tracking.active); | 32 | return __this_cpu_read(context_tracking.active); |
| 33 | } | 33 | } |
| 34 | |||
| 35 | static inline bool context_tracking_in_user(void) | ||
| 36 | { | ||
| 37 | return __this_cpu_read(context_tracking.state) == IN_USER; | ||
| 38 | } | ||
| 34 | #else | 39 | #else |
| 35 | static inline bool context_tracking_in_user(void) { return false; } | 40 | static inline bool context_tracking_in_user(void) { return false; } |
| 36 | static inline bool context_tracking_active(void) { return false; } | 41 | static inline bool context_tracking_active(void) { return false; } |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index dc196bbcf227..4d89e0e6f9cc 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #ifndef _LINUX_CPUFREQ_H | 11 | #ifndef _LINUX_CPUFREQ_H |
| 12 | #define _LINUX_CPUFREQ_H | 12 | #define _LINUX_CPUFREQ_H |
| 13 | 13 | ||
| 14 | #include <linux/clk.h> | ||
| 14 | #include <linux/cpumask.h> | 15 | #include <linux/cpumask.h> |
| 15 | #include <linux/completion.h> | 16 | #include <linux/completion.h> |
| 16 | #include <linux/kobject.h> | 17 | #include <linux/kobject.h> |
| @@ -66,6 +67,7 @@ struct cpufreq_policy { | |||
| 66 | unsigned int cpu; /* cpu nr of CPU managing this policy */ | 67 | unsigned int cpu; /* cpu nr of CPU managing this policy */ |
| 67 | unsigned int last_cpu; /* cpu nr of previous CPU that managed | 68 | unsigned int last_cpu; /* cpu nr of previous CPU that managed |
| 68 | * this policy */ | 69 | * this policy */ |
| 70 | struct clk *clk; | ||
| 69 | struct cpufreq_cpuinfo cpuinfo;/* see above */ | 71 | struct cpufreq_cpuinfo cpuinfo;/* see above */ |
| 70 | 72 | ||
| 71 | unsigned int min; /* in kHz */ | 73 | unsigned int min; /* in kHz */ |
| @@ -225,6 +227,11 @@ struct cpufreq_driver { | |||
| 225 | int (*suspend) (struct cpufreq_policy *policy); | 227 | int (*suspend) (struct cpufreq_policy *policy); |
| 226 | int (*resume) (struct cpufreq_policy *policy); | 228 | int (*resume) (struct cpufreq_policy *policy); |
| 227 | struct freq_attr **attr; | 229 | struct freq_attr **attr; |
| 230 | |||
| 231 | /* platform specific boost support code */ | ||
| 232 | bool boost_supported; | ||
| 233 | bool boost_enabled; | ||
| 234 | int (*set_boost) (int state); | ||
| 228 | }; | 235 | }; |
| 229 | 236 | ||
| 230 | /* flags */ | 237 | /* flags */ |
| @@ -252,6 +259,15 @@ struct cpufreq_driver { | |||
| 252 | */ | 259 | */ |
| 253 | #define CPUFREQ_ASYNC_NOTIFICATION (1 << 4) | 260 | #define CPUFREQ_ASYNC_NOTIFICATION (1 << 4) |
| 254 | 261 | ||
| 262 | /* | ||
| 263 | * Set by drivers which want cpufreq core to check if CPU is running at a | ||
| 264 | * frequency present in freq-table exposed by the driver. For these drivers if | ||
| 265 | * CPU is found running at an out of table freq, we will try to set it to a freq | ||
| 266 | * from the table. And if that fails, we will stop further boot process by | ||
| 267 | * issuing a BUG_ON(). | ||
| 268 | */ | ||
| 269 | #define CPUFREQ_NEED_INITIAL_FREQ_CHECK (1 << 5) | ||
| 270 | |||
| 255 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); | 271 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); |
| 256 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); | 272 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); |
| 257 | 273 | ||
| @@ -299,6 +315,8 @@ cpufreq_verify_within_cpu_limits(struct cpufreq_policy *policy) | |||
| 299 | #define CPUFREQ_NOTIFY (2) | 315 | #define CPUFREQ_NOTIFY (2) |
| 300 | #define CPUFREQ_START (3) | 316 | #define CPUFREQ_START (3) |
| 301 | #define CPUFREQ_UPDATE_POLICY_CPU (4) | 317 | #define CPUFREQ_UPDATE_POLICY_CPU (4) |
| 318 | #define CPUFREQ_CREATE_POLICY (5) | ||
| 319 | #define CPUFREQ_REMOVE_POLICY (6) | ||
| 302 | 320 | ||
| 303 | #ifdef CONFIG_CPU_FREQ | 321 | #ifdef CONFIG_CPU_FREQ |
| 304 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); | 322 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); |
| @@ -306,6 +324,8 @@ int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list); | |||
| 306 | 324 | ||
| 307 | void cpufreq_notify_transition(struct cpufreq_policy *policy, | 325 | void cpufreq_notify_transition(struct cpufreq_policy *policy, |
| 308 | struct cpufreq_freqs *freqs, unsigned int state); | 326 | struct cpufreq_freqs *freqs, unsigned int state); |
| 327 | void cpufreq_notify_post_transition(struct cpufreq_policy *policy, | ||
| 328 | struct cpufreq_freqs *freqs, int transition_failed); | ||
| 309 | 329 | ||
| 310 | #else /* CONFIG_CPU_FREQ */ | 330 | #else /* CONFIG_CPU_FREQ */ |
| 311 | static inline int cpufreq_register_notifier(struct notifier_block *nb, | 331 | static inline int cpufreq_register_notifier(struct notifier_block *nb, |
| @@ -420,6 +440,7 @@ extern struct cpufreq_governor cpufreq_gov_conservative; | |||
| 420 | 440 | ||
| 421 | #define CPUFREQ_ENTRY_INVALID ~0 | 441 | #define CPUFREQ_ENTRY_INVALID ~0 |
| 422 | #define CPUFREQ_TABLE_END ~1 | 442 | #define CPUFREQ_TABLE_END ~1 |
| 443 | #define CPUFREQ_BOOST_FREQ ~2 | ||
| 423 | 444 | ||
| 424 | struct cpufreq_frequency_table { | 445 | struct cpufreq_frequency_table { |
| 425 | unsigned int driver_data; /* driver specific data, not used by core */ | 446 | unsigned int driver_data; /* driver specific data, not used by core */ |
| @@ -439,10 +460,30 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, | |||
| 439 | unsigned int target_freq, | 460 | unsigned int target_freq, |
| 440 | unsigned int relation, | 461 | unsigned int relation, |
| 441 | unsigned int *index); | 462 | unsigned int *index); |
| 463 | int cpufreq_frequency_table_get_index(struct cpufreq_policy *policy, | ||
| 464 | unsigned int freq); | ||
| 442 | 465 | ||
| 443 | void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy); | 466 | void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy); |
| 444 | ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf); | 467 | ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf); |
| 445 | 468 | ||
| 469 | #ifdef CONFIG_CPU_FREQ | ||
| 470 | int cpufreq_boost_trigger_state(int state); | ||
| 471 | int cpufreq_boost_supported(void); | ||
| 472 | int cpufreq_boost_enabled(void); | ||
| 473 | #else | ||
| 474 | static inline int cpufreq_boost_trigger_state(int state) | ||
| 475 | { | ||
| 476 | return 0; | ||
| 477 | } | ||
| 478 | static inline int cpufreq_boost_supported(void) | ||
| 479 | { | ||
| 480 | return 0; | ||
| 481 | } | ||
| 482 | static inline int cpufreq_boost_enabled(void) | ||
| 483 | { | ||
| 484 | return 0; | ||
| 485 | } | ||
| 486 | #endif | ||
| 446 | /* the following funtion is for cpufreq core use only */ | 487 | /* the following funtion is for cpufreq core use only */ |
| 447 | struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); | 488 | struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); |
| 448 | 489 | ||
| @@ -455,6 +496,7 @@ void cpufreq_frequency_table_put_attr(unsigned int cpu); | |||
| 455 | int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, | 496 | int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, |
| 456 | struct cpufreq_frequency_table *table); | 497 | struct cpufreq_frequency_table *table); |
| 457 | 498 | ||
| 499 | unsigned int cpufreq_generic_get(unsigned int cpu); | ||
| 458 | int cpufreq_generic_init(struct cpufreq_policy *policy, | 500 | int cpufreq_generic_init(struct cpufreq_policy *policy, |
| 459 | struct cpufreq_frequency_table *table, | 501 | struct cpufreq_frequency_table *table, |
| 460 | unsigned int transition_latency); | 502 | unsigned int transition_latency); |
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index fe68a5a98583..7032518f8542 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | #include <linux/proc_fs.h> | 6 | #include <linux/proc_fs.h> |
| 7 | #include <linux/elf.h> | 7 | #include <linux/elf.h> |
| 8 | 8 | ||
| 9 | #include <asm/pgtable.h> /* for pgprot_t */ | ||
| 10 | |||
| 9 | #define ELFCORE_ADDR_MAX (-1ULL) | 11 | #define ELFCORE_ADDR_MAX (-1ULL) |
| 10 | #define ELFCORE_ADDR_ERR (-2ULL) | 12 | #define ELFCORE_ADDR_ERR (-2ULL) |
| 11 | 13 | ||
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 57e87e749a48..bf72e9ac6de0 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -29,8 +29,10 @@ struct vfsmount; | |||
| 29 | /* The hash is always the low bits of hash_len */ | 29 | /* The hash is always the low bits of hash_len */ |
| 30 | #ifdef __LITTLE_ENDIAN | 30 | #ifdef __LITTLE_ENDIAN |
| 31 | #define HASH_LEN_DECLARE u32 hash; u32 len; | 31 | #define HASH_LEN_DECLARE u32 hash; u32 len; |
| 32 | #define bytemask_from_count(cnt) (~(~0ul << (cnt)*8)) | ||
| 32 | #else | 33 | #else |
| 33 | #define HASH_LEN_DECLARE u32 len; u32 hash; | 34 | #define HASH_LEN_DECLARE u32 len; u32 hash; |
| 35 | #define bytemask_from_count(cnt) (~(~0ul >> (cnt)*8)) | ||
| 34 | #endif | 36 | #endif |
| 35 | 37 | ||
| 36 | /* | 38 | /* |
diff --git a/include/linux/dma-debug.h b/include/linux/dma-debug.h index fc0e34ce038f..fe8cb610deac 100644 --- a/include/linux/dma-debug.h +++ b/include/linux/dma-debug.h | |||
| @@ -85,6 +85,8 @@ extern void debug_dma_sync_sg_for_device(struct device *dev, | |||
| 85 | 85 | ||
| 86 | extern void debug_dma_dump_mappings(struct device *dev); | 86 | extern void debug_dma_dump_mappings(struct device *dev); |
| 87 | 87 | ||
| 88 | extern void debug_dma_assert_idle(struct page *page); | ||
| 89 | |||
| 88 | #else /* CONFIG_DMA_API_DEBUG */ | 90 | #else /* CONFIG_DMA_API_DEBUG */ |
| 89 | 91 | ||
| 90 | static inline void dma_debug_add_bus(struct bus_type *bus) | 92 | static inline void dma_debug_add_bus(struct bus_type *bus) |
| @@ -183,6 +185,10 @@ static inline void debug_dma_dump_mappings(struct device *dev) | |||
| 183 | { | 185 | { |
| 184 | } | 186 | } |
| 185 | 187 | ||
| 188 | static inline void debug_dma_assert_idle(struct page *page) | ||
| 189 | { | ||
| 190 | } | ||
| 191 | |||
| 186 | #endif /* CONFIG_DMA_API_DEBUG */ | 192 | #endif /* CONFIG_DMA_API_DEBUG */ |
| 187 | 193 | ||
| 188 | #endif /* __DMA_DEBUG_H */ | 194 | #endif /* __DMA_DEBUG_H */ |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 41cf0c399288..6fd9390ccf91 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #define LINUX_DMAENGINE_H | 22 | #define LINUX_DMAENGINE_H |
| 23 | 23 | ||
| 24 | #include <linux/device.h> | 24 | #include <linux/device.h> |
| 25 | #include <linux/err.h> | ||
| 25 | #include <linux/uio.h> | 26 | #include <linux/uio.h> |
| 26 | #include <linux/bug.h> | 27 | #include <linux/bug.h> |
| 27 | #include <linux/scatterlist.h> | 28 | #include <linux/scatterlist.h> |
| @@ -363,6 +364,32 @@ struct dma_slave_config { | |||
| 363 | unsigned int slave_id; | 364 | unsigned int slave_id; |
| 364 | }; | 365 | }; |
| 365 | 366 | ||
| 367 | /** | ||
| 368 | * enum dma_residue_granularity - Granularity of the reported transfer residue | ||
| 369 | * @DMA_RESIDUE_GRANULARITY_DESCRIPTOR: Residue reporting is not support. The | ||
| 370 | * DMA channel is only able to tell whether a descriptor has been completed or | ||
| 371 | * not, which means residue reporting is not supported by this channel. The | ||
| 372 | * residue field of the dma_tx_state field will always be 0. | ||
| 373 | * @DMA_RESIDUE_GRANULARITY_SEGMENT: Residue is updated after each successfully | ||
| 374 | * completed segment of the transfer (For cyclic transfers this is after each | ||
| 375 | * period). This is typically implemented by having the hardware generate an | ||
| 376 | * interrupt after each transferred segment and then the drivers updates the | ||
| 377 | * outstanding residue by the size of the segment. Another possibility is if | ||
| 378 | * the hardware supports scatter-gather and the segment descriptor has a field | ||
| 379 | * which gets set after the segment has been completed. The driver then counts | ||
| 380 | * the number of segments without the flag set to compute the residue. | ||
| 381 | * @DMA_RESIDUE_GRANULARITY_BURST: Residue is updated after each transferred | ||
| 382 | * burst. This is typically only supported if the hardware has a progress | ||
| 383 | * register of some sort (E.g. a register with the current read/write address | ||
| 384 | * or a register with the amount of bursts/beats/bytes that have been | ||
| 385 | * transferred or still need to be transferred). | ||
| 386 | */ | ||
| 387 | enum dma_residue_granularity { | ||
| 388 | DMA_RESIDUE_GRANULARITY_DESCRIPTOR = 0, | ||
| 389 | DMA_RESIDUE_GRANULARITY_SEGMENT = 1, | ||
| 390 | DMA_RESIDUE_GRANULARITY_BURST = 2, | ||
| 391 | }; | ||
| 392 | |||
| 366 | /* struct dma_slave_caps - expose capabilities of a slave channel only | 393 | /* struct dma_slave_caps - expose capabilities of a slave channel only |
| 367 | * | 394 | * |
| 368 | * @src_addr_widths: bit mask of src addr widths the channel supports | 395 | * @src_addr_widths: bit mask of src addr widths the channel supports |
| @@ -373,6 +400,7 @@ struct dma_slave_config { | |||
| 373 | * should be checked by controller as well | 400 | * should be checked by controller as well |
| 374 | * @cmd_pause: true, if pause and thereby resume is supported | 401 | * @cmd_pause: true, if pause and thereby resume is supported |
| 375 | * @cmd_terminate: true, if terminate cmd is supported | 402 | * @cmd_terminate: true, if terminate cmd is supported |
| 403 | * @residue_granularity: granularity of the reported transfer residue | ||
| 376 | */ | 404 | */ |
| 377 | struct dma_slave_caps { | 405 | struct dma_slave_caps { |
| 378 | u32 src_addr_widths; | 406 | u32 src_addr_widths; |
| @@ -380,6 +408,7 @@ struct dma_slave_caps { | |||
| 380 | u32 directions; | 408 | u32 directions; |
| 381 | bool cmd_pause; | 409 | bool cmd_pause; |
| 382 | bool cmd_terminate; | 410 | bool cmd_terminate; |
| 411 | enum dma_residue_granularity residue_granularity; | ||
| 383 | }; | 412 | }; |
| 384 | 413 | ||
| 385 | static inline const char *dma_chan_name(struct dma_chan *chan) | 414 | static inline const char *dma_chan_name(struct dma_chan *chan) |
| @@ -1040,6 +1069,8 @@ enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); | |||
| 1040 | void dma_issue_pending_all(void); | 1069 | void dma_issue_pending_all(void); |
| 1041 | struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, | 1070 | struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, |
| 1042 | dma_filter_fn fn, void *fn_param); | 1071 | dma_filter_fn fn, void *fn_param); |
| 1072 | struct dma_chan *dma_request_slave_channel_reason(struct device *dev, | ||
| 1073 | const char *name); | ||
| 1043 | struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name); | 1074 | struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name); |
| 1044 | void dma_release_channel(struct dma_chan *chan); | 1075 | void dma_release_channel(struct dma_chan *chan); |
| 1045 | #else | 1076 | #else |
| @@ -1063,6 +1094,11 @@ static inline struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, | |||
| 1063 | { | 1094 | { |
| 1064 | return NULL; | 1095 | return NULL; |
| 1065 | } | 1096 | } |
| 1097 | static inline struct dma_chan *dma_request_slave_channel_reason( | ||
| 1098 | struct device *dev, const char *name) | ||
| 1099 | { | ||
| 1100 | return ERR_PTR(-ENODEV); | ||
| 1101 | } | ||
| 1066 | static inline struct dma_chan *dma_request_slave_channel(struct device *dev, | 1102 | static inline struct dma_chan *dma_request_slave_channel(struct device *dev, |
| 1067 | const char *name) | 1103 | const char *name) |
| 1068 | { | 1104 | { |
| @@ -1079,6 +1115,7 @@ int dma_async_device_register(struct dma_device *device); | |||
| 1079 | void dma_async_device_unregister(struct dma_device *device); | 1115 | void dma_async_device_unregister(struct dma_device *device); |
| 1080 | void dma_run_dependencies(struct dma_async_tx_descriptor *tx); | 1116 | void dma_run_dependencies(struct dma_async_tx_descriptor *tx); |
| 1081 | struct dma_chan *dma_get_slave_channel(struct dma_chan *chan); | 1117 | struct dma_chan *dma_get_slave_channel(struct dma_chan *chan); |
| 1118 | struct dma_chan *dma_get_any_slave_channel(struct dma_device *device); | ||
| 1082 | struct dma_chan *net_dma_find_channel(void); | 1119 | struct dma_chan *net_dma_find_channel(void); |
| 1083 | #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) | 1120 | #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) |
| 1084 | #define dma_request_slave_channel_compat(mask, x, y, dev, name) \ | 1121 | #define dma_request_slave_channel_compat(mask, x, y, dev, name) \ |
diff --git a/include/linux/edac.h b/include/linux/edac.h index dbdffe8d4469..8e6c20af11a2 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
| @@ -35,6 +35,34 @@ extern void edac_atomic_assert_error(void); | |||
| 35 | extern struct bus_type *edac_get_sysfs_subsys(void); | 35 | extern struct bus_type *edac_get_sysfs_subsys(void); |
| 36 | extern void edac_put_sysfs_subsys(void); | 36 | extern void edac_put_sysfs_subsys(void); |
| 37 | 37 | ||
| 38 | enum { | ||
| 39 | EDAC_REPORTING_ENABLED, | ||
| 40 | EDAC_REPORTING_DISABLED, | ||
| 41 | EDAC_REPORTING_FORCE | ||
| 42 | }; | ||
| 43 | |||
| 44 | extern int edac_report_status; | ||
| 45 | #ifdef CONFIG_EDAC | ||
| 46 | static inline int get_edac_report_status(void) | ||
| 47 | { | ||
| 48 | return edac_report_status; | ||
| 49 | } | ||
| 50 | |||
| 51 | static inline void set_edac_report_status(int new) | ||
| 52 | { | ||
| 53 | edac_report_status = new; | ||
| 54 | } | ||
| 55 | #else | ||
| 56 | static inline int get_edac_report_status(void) | ||
| 57 | { | ||
| 58 | return EDAC_REPORTING_DISABLED; | ||
| 59 | } | ||
| 60 | |||
| 61 | static inline void set_edac_report_status(int new) | ||
| 62 | { | ||
| 63 | } | ||
| 64 | #endif | ||
| 65 | |||
| 38 | static inline void opstate_init(void) | 66 | static inline void opstate_init(void) |
| 39 | { | 67 | { |
| 40 | switch (edac_op_state) { | 68 | switch (edac_op_state) { |
diff --git a/include/linux/efi.h b/include/linux/efi.h index bc5687d0f315..0a819e7a60c9 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
| @@ -556,6 +556,9 @@ extern struct efi { | |||
| 556 | unsigned long hcdp; /* HCDP table */ | 556 | unsigned long hcdp; /* HCDP table */ |
| 557 | unsigned long uga; /* UGA table */ | 557 | unsigned long uga; /* UGA table */ |
| 558 | unsigned long uv_systab; /* UV system table */ | 558 | unsigned long uv_systab; /* UV system table */ |
| 559 | unsigned long fw_vendor; /* fw_vendor */ | ||
| 560 | unsigned long runtime; /* runtime table */ | ||
| 561 | unsigned long config_table; /* config tables */ | ||
| 559 | efi_get_time_t *get_time; | 562 | efi_get_time_t *get_time; |
| 560 | efi_set_time_t *set_time; | 563 | efi_set_time_t *set_time; |
| 561 | efi_get_wakeup_time_t *get_wakeup_time; | 564 | efi_get_wakeup_time_t *get_wakeup_time; |
| @@ -653,6 +656,7 @@ extern int __init efi_setup_pcdp_console(char *); | |||
| 653 | #define EFI_RUNTIME_SERVICES 3 /* Can we use runtime services? */ | 656 | #define EFI_RUNTIME_SERVICES 3 /* Can we use runtime services? */ |
| 654 | #define EFI_MEMMAP 4 /* Can we use EFI memory map? */ | 657 | #define EFI_MEMMAP 4 /* Can we use EFI memory map? */ |
| 655 | #define EFI_64BIT 5 /* Is the firmware 64-bit? */ | 658 | #define EFI_64BIT 5 /* Is the firmware 64-bit? */ |
| 659 | #define EFI_ARCH_1 6 /* First arch-specific bit */ | ||
| 656 | 660 | ||
| 657 | #ifdef CONFIG_EFI | 661 | #ifdef CONFIG_EFI |
| 658 | # ifdef CONFIG_X86 | 662 | # ifdef CONFIG_X86 |
| @@ -801,6 +805,8 @@ struct efivar_entry { | |||
| 801 | struct efi_variable var; | 805 | struct efi_variable var; |
| 802 | struct list_head list; | 806 | struct list_head list; |
| 803 | struct kobject kobj; | 807 | struct kobject kobj; |
| 808 | bool scanning; | ||
| 809 | bool deleting; | ||
| 804 | }; | 810 | }; |
| 805 | 811 | ||
| 806 | 812 | ||
| @@ -866,6 +872,21 @@ void efivar_run_worker(void); | |||
| 866 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) | 872 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) |
| 867 | int efivars_sysfs_init(void); | 873 | int efivars_sysfs_init(void); |
| 868 | 874 | ||
| 875 | #define EFIVARS_DATA_SIZE_MAX 1024 | ||
| 876 | |||
| 869 | #endif /* CONFIG_EFI_VARS */ | 877 | #endif /* CONFIG_EFI_VARS */ |
| 870 | 878 | ||
| 879 | #ifdef CONFIG_EFI_RUNTIME_MAP | ||
| 880 | int efi_runtime_map_init(struct kobject *); | ||
| 881 | void efi_runtime_map_setup(void *, int, u32); | ||
| 882 | #else | ||
| 883 | static inline int efi_runtime_map_init(struct kobject *kobj) | ||
| 884 | { | ||
| 885 | return 0; | ||
| 886 | } | ||
| 887 | |||
| 888 | static inline void | ||
| 889 | efi_runtime_map_setup(void *map, int nr_entries, u32 desc_size) {} | ||
| 890 | #endif | ||
| 891 | |||
| 871 | #endif /* _LINUX_EFI_H */ | 892 | #endif /* _LINUX_EFI_H */ |
diff --git a/include/linux/export.h b/include/linux/export.h index 3f2793d51899..96e45ea463e7 100644 --- a/include/linux/export.h +++ b/include/linux/export.h | |||
| @@ -59,6 +59,7 @@ extern struct module __this_module; | |||
| 59 | static const char __kstrtab_##sym[] \ | 59 | static const char __kstrtab_##sym[] \ |
| 60 | __attribute__((section("__ksymtab_strings"), aligned(1))) \ | 60 | __attribute__((section("__ksymtab_strings"), aligned(1))) \ |
| 61 | = VMLINUX_SYMBOL_STR(sym); \ | 61 | = VMLINUX_SYMBOL_STR(sym); \ |
| 62 | extern const struct kernel_symbol __ksymtab_##sym; \ | ||
| 62 | __visible const struct kernel_symbol __ksymtab_##sym \ | 63 | __visible const struct kernel_symbol __ksymtab_##sym \ |
| 63 | __used \ | 64 | __used \ |
| 64 | __attribute__((section("___ksymtab" sec "+" #sym), unused)) \ | 65 | __attribute__((section("___ksymtab" sec "+" #sym), unused)) \ |
diff --git a/include/linux/extcon/extcon-gpio.h b/include/linux/extcon/extcon-gpio.h index 4195810f87fe..8900fdf511c6 100644 --- a/include/linux/extcon/extcon-gpio.h +++ b/include/linux/extcon/extcon-gpio.h | |||
| @@ -51,6 +51,7 @@ struct gpio_extcon_platform_data { | |||
| 51 | /* if NULL, "0" or "1" will be printed */ | 51 | /* if NULL, "0" or "1" will be printed */ |
| 52 | const char *state_on; | 52 | const char *state_on; |
| 53 | const char *state_off; | 53 | const char *state_off; |
| 54 | bool check_on_resume; | ||
| 54 | }; | 55 | }; |
| 55 | 56 | ||
| 56 | #endif /* __EXTCON_GPIO_H__ */ | 57 | #endif /* __EXTCON_GPIO_H__ */ |
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h index bb942f6d5702..da74d878dc4f 100644 --- a/include/linux/f2fs_fs.h +++ b/include/linux/f2fs_fs.h | |||
| @@ -153,6 +153,13 @@ struct f2fs_extent { | |||
| 153 | #define NODE_DIND_BLOCK (DEF_ADDRS_PER_INODE + 5) | 153 | #define NODE_DIND_BLOCK (DEF_ADDRS_PER_INODE + 5) |
| 154 | 154 | ||
| 155 | #define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */ | 155 | #define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */ |
| 156 | #define F2FS_INLINE_DATA 0x02 /* file inline data flag */ | ||
| 157 | |||
| 158 | #define MAX_INLINE_DATA (sizeof(__le32) * (DEF_ADDRS_PER_INODE - \ | ||
| 159 | F2FS_INLINE_XATTR_ADDRS - 1)) | ||
| 160 | |||
| 161 | #define INLINE_DATA_OFFSET (PAGE_CACHE_SIZE - sizeof(struct node_footer) \ | ||
| 162 | - sizeof(__le32) * (DEF_ADDRS_PER_INODE + 5 - 1)) | ||
| 156 | 163 | ||
| 157 | struct f2fs_inode { | 164 | struct f2fs_inode { |
| 158 | __le16 i_mode; /* file mode */ | 165 | __le16 i_mode; /* file mode */ |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index e154c1005cd1..59529330efd6 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
| @@ -68,4 +68,11 @@ static inline void release_firmware(const struct firmware *fw) | |||
| 68 | 68 | ||
| 69 | #endif | 69 | #endif |
| 70 | 70 | ||
| 71 | #ifdef CONFIG_FW_LOADER_USER_HELPER | ||
| 72 | int request_firmware_direct(const struct firmware **fw, const char *name, | ||
| 73 | struct device *device); | ||
| 74 | #else | ||
| 75 | #define request_firmware_direct request_firmware | ||
| 76 | #endif | ||
| 77 | |||
| 71 | #endif | 78 | #endif |
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 4b2ee8d12f5e..7d8d5e608594 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include <linux/path.h> /* struct path */ | 15 | #include <linux/path.h> /* struct path */ |
| 16 | #include <linux/spinlock.h> | 16 | #include <linux/spinlock.h> |
| 17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 18 | |||
| 19 | #include <linux/atomic.h> | 18 | #include <linux/atomic.h> |
| 20 | 19 | ||
| 21 | /* | 20 | /* |
| @@ -79,6 +78,7 @@ struct fsnotify_group; | |||
| 79 | struct fsnotify_event; | 78 | struct fsnotify_event; |
| 80 | struct fsnotify_mark; | 79 | struct fsnotify_mark; |
| 81 | struct fsnotify_event_private_data; | 80 | struct fsnotify_event_private_data; |
| 81 | struct fsnotify_fname; | ||
| 82 | 82 | ||
| 83 | /* | 83 | /* |
| 84 | * Each group much define these ops. The fsnotify infrastructure will call | 84 | * Each group much define these ops. The fsnotify infrastructure will call |
| @@ -94,17 +94,27 @@ struct fsnotify_event_private_data; | |||
| 94 | * userspace messages that marks have been removed. | 94 | * userspace messages that marks have been removed. |
| 95 | */ | 95 | */ |
| 96 | struct fsnotify_ops { | 96 | struct fsnotify_ops { |
| 97 | bool (*should_send_event)(struct fsnotify_group *group, struct inode *inode, | ||
| 98 | struct fsnotify_mark *inode_mark, | ||
| 99 | struct fsnotify_mark *vfsmount_mark, | ||
| 100 | __u32 mask, void *data, int data_type); | ||
| 101 | int (*handle_event)(struct fsnotify_group *group, | 97 | int (*handle_event)(struct fsnotify_group *group, |
| 98 | struct inode *inode, | ||
| 102 | struct fsnotify_mark *inode_mark, | 99 | struct fsnotify_mark *inode_mark, |
| 103 | struct fsnotify_mark *vfsmount_mark, | 100 | struct fsnotify_mark *vfsmount_mark, |
| 104 | struct fsnotify_event *event); | 101 | u32 mask, void *data, int data_type, |
| 102 | const unsigned char *file_name); | ||
| 105 | void (*free_group_priv)(struct fsnotify_group *group); | 103 | void (*free_group_priv)(struct fsnotify_group *group); |
| 106 | void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group); | 104 | void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group); |
| 107 | void (*free_event_priv)(struct fsnotify_event_private_data *priv); | 105 | void (*free_event)(struct fsnotify_event *event); |
| 106 | }; | ||
| 107 | |||
| 108 | /* | ||
| 109 | * all of the information about the original object we want to now send to | ||
| 110 | * a group. If you want to carry more info from the accessing task to the | ||
| 111 | * listener this structure is where you need to be adding fields. | ||
| 112 | */ | ||
| 113 | struct fsnotify_event { | ||
| 114 | struct list_head list; | ||
| 115 | /* inode may ONLY be dereferenced during handle_event(). */ | ||
| 116 | struct inode *inode; /* either the inode the event happened to or its parent */ | ||
| 117 | u32 mask; /* the type of access, bitwise OR for FS_* event types */ | ||
| 108 | }; | 118 | }; |
| 109 | 119 | ||
| 110 | /* | 120 | /* |
| @@ -148,7 +158,11 @@ struct fsnotify_group { | |||
| 148 | * a group */ | 158 | * a group */ |
| 149 | struct list_head marks_list; /* all inode marks for this group */ | 159 | struct list_head marks_list; /* all inode marks for this group */ |
| 150 | 160 | ||
| 151 | struct fasync_struct *fsn_fa; /* async notification */ | 161 | struct fasync_struct *fsn_fa; /* async notification */ |
| 162 | |||
| 163 | struct fsnotify_event overflow_event; /* Event we queue when the | ||
| 164 | * notification list is too | ||
| 165 | * full */ | ||
| 152 | 166 | ||
| 153 | /* groups can define private fields here or use the void *private */ | 167 | /* groups can define private fields here or use the void *private */ |
| 154 | union { | 168 | union { |
| @@ -177,76 +191,10 @@ struct fsnotify_group { | |||
| 177 | }; | 191 | }; |
| 178 | }; | 192 | }; |
| 179 | 193 | ||
| 180 | /* | ||
| 181 | * A single event can be queued in multiple group->notification_lists. | ||
| 182 | * | ||
| 183 | * each group->notification_list will point to an event_holder which in turns points | ||
| 184 | * to the actual event that needs to be sent to userspace. | ||
| 185 | * | ||
| 186 | * Seemed cheaper to create a refcnt'd event and a small holder for every group | ||
| 187 | * than create a different event for every group | ||
| 188 | * | ||
| 189 | */ | ||
| 190 | struct fsnotify_event_holder { | ||
| 191 | struct fsnotify_event *event; | ||
| 192 | struct list_head event_list; | ||
| 193 | }; | ||
| 194 | |||
| 195 | /* | ||
| 196 | * Inotify needs to tack data onto an event. This struct lets us later find the | ||
| 197 | * correct private data of the correct group. | ||
| 198 | */ | ||
| 199 | struct fsnotify_event_private_data { | ||
| 200 | struct fsnotify_group *group; | ||
| 201 | struct list_head event_list; | ||
| 202 | }; | ||
| 203 | |||
| 204 | /* | ||
| 205 | * all of the information about the original object we want to now send to | ||
| 206 | * a group. If you want to carry more info from the accessing task to the | ||
| 207 | * listener this structure is where you need to be adding fields. | ||
| 208 | */ | ||
| 209 | struct fsnotify_event { | ||
| 210 | /* | ||
| 211 | * If we create an event we are also likely going to need a holder | ||
| 212 | * to link to a group. So embed one holder in the event. Means only | ||
| 213 | * one allocation for the common case where we only have one group | ||
| 214 | */ | ||
| 215 | struct fsnotify_event_holder holder; | ||
| 216 | spinlock_t lock; /* protection for the associated event_holder and private_list */ | ||
| 217 | /* to_tell may ONLY be dereferenced during handle_event(). */ | ||
| 218 | struct inode *to_tell; /* either the inode the event happened to or its parent */ | ||
| 219 | /* | ||
| 220 | * depending on the event type we should have either a path or inode | ||
| 221 | * We hold a reference on path, but NOT on inode. Since we have the ref on | ||
| 222 | * the path, it may be dereferenced at any point during this object's | ||
| 223 | * lifetime. That reference is dropped when this object's refcnt hits | ||
| 224 | * 0. If this event contains an inode instead of a path, the inode may | ||
| 225 | * ONLY be used during handle_event(). | ||
| 226 | */ | ||
| 227 | union { | ||
| 228 | struct path path; | ||
| 229 | struct inode *inode; | ||
| 230 | }; | ||
| 231 | /* when calling fsnotify tell it if the data is a path or inode */ | 194 | /* when calling fsnotify tell it if the data is a path or inode */ |
| 232 | #define FSNOTIFY_EVENT_NONE 0 | 195 | #define FSNOTIFY_EVENT_NONE 0 |
| 233 | #define FSNOTIFY_EVENT_PATH 1 | 196 | #define FSNOTIFY_EVENT_PATH 1 |
| 234 | #define FSNOTIFY_EVENT_INODE 2 | 197 | #define FSNOTIFY_EVENT_INODE 2 |
| 235 | int data_type; /* which of the above union we have */ | ||
| 236 | atomic_t refcnt; /* how many groups still are using/need to send this event */ | ||
| 237 | __u32 mask; /* the type of access, bitwise OR for FS_* event types */ | ||
| 238 | |||
| 239 | u32 sync_cookie; /* used to corrolate events, namely inotify mv events */ | ||
| 240 | const unsigned char *file_name; | ||
| 241 | size_t name_len; | ||
| 242 | struct pid *tgid; | ||
| 243 | |||
| 244 | #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS | ||
| 245 | __u32 response; /* userspace answer to question */ | ||
| 246 | #endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ | ||
| 247 | |||
| 248 | struct list_head private_data_list; /* groups can store private data here */ | ||
| 249 | }; | ||
| 250 | 198 | ||
| 251 | /* | 199 | /* |
| 252 | * Inode specific fields in an fsnotify_mark | 200 | * Inode specific fields in an fsnotify_mark |
| @@ -370,17 +318,12 @@ extern void fsnotify_put_group(struct fsnotify_group *group); | |||
| 370 | extern void fsnotify_destroy_group(struct fsnotify_group *group); | 318 | extern void fsnotify_destroy_group(struct fsnotify_group *group); |
| 371 | /* fasync handler function */ | 319 | /* fasync handler function */ |
| 372 | extern int fsnotify_fasync(int fd, struct file *file, int on); | 320 | extern int fsnotify_fasync(int fd, struct file *file, int on); |
| 373 | /* take a reference to an event */ | 321 | /* Free event from memory */ |
| 374 | extern void fsnotify_get_event(struct fsnotify_event *event); | 322 | extern void fsnotify_destroy_event(struct fsnotify_group *group, |
| 375 | extern void fsnotify_put_event(struct fsnotify_event *event); | 323 | struct fsnotify_event *event); |
| 376 | /* find private data previously attached to an event and unlink it */ | ||
| 377 | extern struct fsnotify_event_private_data *fsnotify_remove_priv_from_event(struct fsnotify_group *group, | ||
| 378 | struct fsnotify_event *event); | ||
| 379 | |||
| 380 | /* attach the event to the group notification queue */ | 324 | /* attach the event to the group notification queue */ |
| 381 | extern struct fsnotify_event *fsnotify_add_notify_event(struct fsnotify_group *group, | 325 | extern struct fsnotify_event *fsnotify_add_notify_event(struct fsnotify_group *group, |
| 382 | struct fsnotify_event *event, | 326 | struct fsnotify_event *event, |
| 383 | struct fsnotify_event_private_data *priv, | ||
| 384 | struct fsnotify_event *(*merge)(struct list_head *, | 327 | struct fsnotify_event *(*merge)(struct list_head *, |
| 385 | struct fsnotify_event *)); | 328 | struct fsnotify_event *)); |
| 386 | /* true if the group notification queue is empty */ | 329 | /* true if the group notification queue is empty */ |
| @@ -430,15 +373,8 @@ extern void fsnotify_put_mark(struct fsnotify_mark *mark); | |||
| 430 | extern void fsnotify_unmount_inodes(struct list_head *list); | 373 | extern void fsnotify_unmount_inodes(struct list_head *list); |
| 431 | 374 | ||
| 432 | /* put here because inotify does some weird stuff when destroying watches */ | 375 | /* put here because inotify does some weird stuff when destroying watches */ |
| 433 | extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, | 376 | extern void fsnotify_init_event(struct fsnotify_event *event, |
| 434 | void *data, int data_is, | 377 | struct inode *to_tell, u32 mask); |
| 435 | const unsigned char *name, | ||
| 436 | u32 cookie, gfp_t gfp); | ||
| 437 | |||
| 438 | /* fanotify likes to change events after they are on lists... */ | ||
| 439 | extern struct fsnotify_event *fsnotify_clone_event(struct fsnotify_event *old_event); | ||
| 440 | extern int fsnotify_replace_event(struct fsnotify_event_holder *old_holder, | ||
| 441 | struct fsnotify_event *new_event); | ||
| 442 | 378 | ||
| 443 | #else | 379 | #else |
| 444 | 380 | ||
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 31ea4b428360..f4233b195dab 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
| @@ -570,8 +570,6 @@ static inline int | |||
| 570 | ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } | 570 | ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } |
| 571 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 571 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
| 572 | 572 | ||
| 573 | loff_t ftrace_filter_lseek(struct file *file, loff_t offset, int whence); | ||
| 574 | |||
| 575 | /* totally disable ftrace - can not re-enable after this */ | 573 | /* totally disable ftrace - can not re-enable after this */ |
| 576 | void ftrace_kill(void); | 574 | void ftrace_kill(void); |
| 577 | 575 | ||
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 9abbe630c456..4e4cc28623ad 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | |||
| 1 | #ifndef _LINUX_FTRACE_EVENT_H | 2 | #ifndef _LINUX_FTRACE_EVENT_H |
| 2 | #define _LINUX_FTRACE_EVENT_H | 3 | #define _LINUX_FTRACE_EVENT_H |
| 3 | 4 | ||
| @@ -248,6 +249,9 @@ struct ftrace_event_call { | |||
| 248 | #ifdef CONFIG_PERF_EVENTS | 249 | #ifdef CONFIG_PERF_EVENTS |
| 249 | int perf_refcount; | 250 | int perf_refcount; |
| 250 | struct hlist_head __percpu *perf_events; | 251 | struct hlist_head __percpu *perf_events; |
| 252 | |||
| 253 | int (*perf_perm)(struct ftrace_event_call *, | ||
| 254 | struct perf_event *); | ||
| 251 | #endif | 255 | #endif |
| 252 | }; | 256 | }; |
| 253 | 257 | ||
| @@ -261,6 +265,8 @@ enum { | |||
| 261 | FTRACE_EVENT_FL_NO_SET_FILTER_BIT, | 265 | FTRACE_EVENT_FL_NO_SET_FILTER_BIT, |
| 262 | FTRACE_EVENT_FL_SOFT_MODE_BIT, | 266 | FTRACE_EVENT_FL_SOFT_MODE_BIT, |
| 263 | FTRACE_EVENT_FL_SOFT_DISABLED_BIT, | 267 | FTRACE_EVENT_FL_SOFT_DISABLED_BIT, |
| 268 | FTRACE_EVENT_FL_TRIGGER_MODE_BIT, | ||
| 269 | FTRACE_EVENT_FL_TRIGGER_COND_BIT, | ||
| 264 | }; | 270 | }; |
| 265 | 271 | ||
| 266 | /* | 272 | /* |
| @@ -272,6 +278,8 @@ enum { | |||
| 272 | * SOFT_MODE - The event is enabled/disabled by SOFT_DISABLED | 278 | * SOFT_MODE - The event is enabled/disabled by SOFT_DISABLED |
| 273 | * SOFT_DISABLED - When set, do not trace the event (even though its | 279 | * SOFT_DISABLED - When set, do not trace the event (even though its |
| 274 | * tracepoint may be enabled) | 280 | * tracepoint may be enabled) |
| 281 | * TRIGGER_MODE - When set, invoke the triggers associated with the event | ||
| 282 | * TRIGGER_COND - When set, one or more triggers has an associated filter | ||
| 275 | */ | 283 | */ |
| 276 | enum { | 284 | enum { |
| 277 | FTRACE_EVENT_FL_ENABLED = (1 << FTRACE_EVENT_FL_ENABLED_BIT), | 285 | FTRACE_EVENT_FL_ENABLED = (1 << FTRACE_EVENT_FL_ENABLED_BIT), |
| @@ -280,6 +288,8 @@ enum { | |||
| 280 | FTRACE_EVENT_FL_NO_SET_FILTER = (1 << FTRACE_EVENT_FL_NO_SET_FILTER_BIT), | 288 | FTRACE_EVENT_FL_NO_SET_FILTER = (1 << FTRACE_EVENT_FL_NO_SET_FILTER_BIT), |
| 281 | FTRACE_EVENT_FL_SOFT_MODE = (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT), | 289 | FTRACE_EVENT_FL_SOFT_MODE = (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT), |
| 282 | FTRACE_EVENT_FL_SOFT_DISABLED = (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT), | 290 | FTRACE_EVENT_FL_SOFT_DISABLED = (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT), |
| 291 | FTRACE_EVENT_FL_TRIGGER_MODE = (1 << FTRACE_EVENT_FL_TRIGGER_MODE_BIT), | ||
| 292 | FTRACE_EVENT_FL_TRIGGER_COND = (1 << FTRACE_EVENT_FL_TRIGGER_COND_BIT), | ||
| 283 | }; | 293 | }; |
| 284 | 294 | ||
| 285 | struct ftrace_event_file { | 295 | struct ftrace_event_file { |
| @@ -289,6 +299,7 @@ struct ftrace_event_file { | |||
| 289 | struct dentry *dir; | 299 | struct dentry *dir; |
| 290 | struct trace_array *tr; | 300 | struct trace_array *tr; |
| 291 | struct ftrace_subsystem_dir *system; | 301 | struct ftrace_subsystem_dir *system; |
| 302 | struct list_head triggers; | ||
| 292 | 303 | ||
| 293 | /* | 304 | /* |
| 294 | * 32 bit flags: | 305 | * 32 bit flags: |
| @@ -296,6 +307,7 @@ struct ftrace_event_file { | |||
| 296 | * bit 1: enabled cmd record | 307 | * bit 1: enabled cmd record |
| 297 | * bit 2: enable/disable with the soft disable bit | 308 | * bit 2: enable/disable with the soft disable bit |
| 298 | * bit 3: soft disabled | 309 | * bit 3: soft disabled |
| 310 | * bit 4: trigger enabled | ||
| 299 | * | 311 | * |
| 300 | * Note: The bits must be set atomically to prevent races | 312 | * Note: The bits must be set atomically to prevent races |
| 301 | * from other writers. Reads of flags do not need to be in | 313 | * from other writers. Reads of flags do not need to be in |
| @@ -307,6 +319,7 @@ struct ftrace_event_file { | |||
| 307 | */ | 319 | */ |
| 308 | unsigned long flags; | 320 | unsigned long flags; |
| 309 | atomic_t sm_ref; /* soft-mode reference counter */ | 321 | atomic_t sm_ref; /* soft-mode reference counter */ |
| 322 | atomic_t tm_ref; /* trigger-mode reference counter */ | ||
| 310 | }; | 323 | }; |
| 311 | 324 | ||
| 312 | #define __TRACE_EVENT_FLAGS(name, value) \ | 325 | #define __TRACE_EVENT_FLAGS(name, value) \ |
| @@ -317,10 +330,31 @@ struct ftrace_event_file { | |||
| 317 | } \ | 330 | } \ |
| 318 | early_initcall(trace_init_flags_##name); | 331 | early_initcall(trace_init_flags_##name); |
| 319 | 332 | ||
| 333 | #define __TRACE_EVENT_PERF_PERM(name, expr...) \ | ||
| 334 | static int perf_perm_##name(struct ftrace_event_call *tp_event, \ | ||
| 335 | struct perf_event *p_event) \ | ||
| 336 | { \ | ||
| 337 | return ({ expr; }); \ | ||
| 338 | } \ | ||
| 339 | static int __init trace_init_perf_perm_##name(void) \ | ||
| 340 | { \ | ||
| 341 | event_##name.perf_perm = &perf_perm_##name; \ | ||
| 342 | return 0; \ | ||
| 343 | } \ | ||
| 344 | early_initcall(trace_init_perf_perm_##name); | ||
| 345 | |||
| 320 | #define PERF_MAX_TRACE_SIZE 2048 | 346 | #define PERF_MAX_TRACE_SIZE 2048 |
| 321 | 347 | ||
| 322 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ | 348 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ |
| 323 | 349 | ||
| 350 | enum event_trigger_type { | ||
| 351 | ETT_NONE = (0), | ||
| 352 | ETT_TRACE_ONOFF = (1 << 0), | ||
| 353 | ETT_SNAPSHOT = (1 << 1), | ||
| 354 | ETT_STACKTRACE = (1 << 2), | ||
| 355 | ETT_EVENT_ENABLE = (1 << 3), | ||
| 356 | }; | ||
| 357 | |||
| 324 | extern void destroy_preds(struct ftrace_event_file *file); | 358 | extern void destroy_preds(struct ftrace_event_file *file); |
| 325 | extern void destroy_call_preds(struct ftrace_event_call *call); | 359 | extern void destroy_call_preds(struct ftrace_event_call *call); |
| 326 | extern int filter_match_preds(struct event_filter *filter, void *rec); | 360 | extern int filter_match_preds(struct event_filter *filter, void *rec); |
| @@ -331,6 +365,127 @@ extern int filter_check_discard(struct ftrace_event_file *file, void *rec, | |||
| 331 | extern int call_filter_check_discard(struct ftrace_event_call *call, void *rec, | 365 | extern int call_filter_check_discard(struct ftrace_event_call *call, void *rec, |
| 332 | struct ring_buffer *buffer, | 366 | struct ring_buffer *buffer, |
| 333 | struct ring_buffer_event *event); | 367 | struct ring_buffer_event *event); |
| 368 | extern enum event_trigger_type event_triggers_call(struct ftrace_event_file *file, | ||
| 369 | void *rec); | ||
| 370 | extern void event_triggers_post_call(struct ftrace_event_file *file, | ||
| 371 | enum event_trigger_type tt); | ||
| 372 | |||
| 373 | /** | ||
| 374 | * ftrace_trigger_soft_disabled - do triggers and test if soft disabled | ||
| 375 | * @file: The file pointer of the event to test | ||
| 376 | * | ||
| 377 | * If any triggers without filters are attached to this event, they | ||
| 378 | * will be called here. If the event is soft disabled and has no | ||
| 379 | * triggers that require testing the fields, it will return true, | ||
| 380 | * otherwise false. | ||
| 381 | */ | ||
| 382 | static inline bool | ||
| 383 | ftrace_trigger_soft_disabled(struct ftrace_event_file *file) | ||
| 384 | { | ||
| 385 | unsigned long eflags = file->flags; | ||
| 386 | |||
| 387 | if (!(eflags & FTRACE_EVENT_FL_TRIGGER_COND)) { | ||
| 388 | if (eflags & FTRACE_EVENT_FL_TRIGGER_MODE) | ||
| 389 | event_triggers_call(file, NULL); | ||
| 390 | if (eflags & FTRACE_EVENT_FL_SOFT_DISABLED) | ||
| 391 | return true; | ||
| 392 | } | ||
| 393 | return false; | ||
| 394 | } | ||
| 395 | |||
| 396 | /* | ||
| 397 | * Helper function for event_trigger_unlock_commit{_regs}(). | ||
| 398 | * If there are event triggers attached to this event that requires | ||
| 399 | * filtering against its fields, then they wil be called as the | ||
| 400 | * entry already holds the field information of the current event. | ||
| 401 | * | ||
| 402 | * It also checks if the event should be discarded or not. | ||
| 403 | * It is to be discarded if the event is soft disabled and the | ||
| 404 | * event was only recorded to process triggers, or if the event | ||
| 405 | * filter is active and this event did not match the filters. | ||
| 406 | * | ||
| 407 | * Returns true if the event is discarded, false otherwise. | ||
| 408 | */ | ||
| 409 | static inline bool | ||
| 410 | __event_trigger_test_discard(struct ftrace_event_file *file, | ||
| 411 | struct ring_buffer *buffer, | ||
| 412 | struct ring_buffer_event *event, | ||
| 413 | void *entry, | ||
| 414 | enum event_trigger_type *tt) | ||
| 415 | { | ||
| 416 | unsigned long eflags = file->flags; | ||
| 417 | |||
| 418 | if (eflags & FTRACE_EVENT_FL_TRIGGER_COND) | ||
| 419 | *tt = event_triggers_call(file, entry); | ||
| 420 | |||
| 421 | if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT, &file->flags)) | ||
| 422 | ring_buffer_discard_commit(buffer, event); | ||
| 423 | else if (!filter_check_discard(file, entry, buffer, event)) | ||
| 424 | return false; | ||
| 425 | |||
| 426 | return true; | ||
| 427 | } | ||
| 428 | |||
| 429 | /** | ||
| 430 | * event_trigger_unlock_commit - handle triggers and finish event commit | ||
| 431 | * @file: The file pointer assoctiated to the event | ||
| 432 | * @buffer: The ring buffer that the event is being written to | ||
| 433 | * @event: The event meta data in the ring buffer | ||
| 434 | * @entry: The event itself | ||
| 435 | * @irq_flags: The state of the interrupts at the start of the event | ||
| 436 | * @pc: The state of the preempt count at the start of the event. | ||
| 437 | * | ||
| 438 | * This is a helper function to handle triggers that require data | ||
| 439 | * from the event itself. It also tests the event against filters and | ||
| 440 | * if the event is soft disabled and should be discarded. | ||
| 441 | */ | ||
| 442 | static inline void | ||
| 443 | event_trigger_unlock_commit(struct ftrace_event_file *file, | ||
| 444 | struct ring_buffer *buffer, | ||
| 445 | struct ring_buffer_event *event, | ||
| 446 | void *entry, unsigned long irq_flags, int pc) | ||
| 447 | { | ||
| 448 | enum event_trigger_type tt = ETT_NONE; | ||
| 449 | |||
| 450 | if (!__event_trigger_test_discard(file, buffer, event, entry, &tt)) | ||
| 451 | trace_buffer_unlock_commit(buffer, event, irq_flags, pc); | ||
| 452 | |||
| 453 | if (tt) | ||
| 454 | event_triggers_post_call(file, tt); | ||
| 455 | } | ||
| 456 | |||
| 457 | /** | ||
| 458 | * event_trigger_unlock_commit_regs - handle triggers and finish event commit | ||
| 459 | * @file: The file pointer assoctiated to the event | ||
| 460 | * @buffer: The ring buffer that the event is being written to | ||
| 461 | * @event: The event meta data in the ring buffer | ||
| 462 | * @entry: The event itself | ||
| 463 | * @irq_flags: The state of the interrupts at the start of the event | ||
| 464 | * @pc: The state of the preempt count at the start of the event. | ||
| 465 | * | ||
| 466 | * This is a helper function to handle triggers that require data | ||
| 467 | * from the event itself. It also tests the event against filters and | ||
| 468 | * if the event is soft disabled and should be discarded. | ||
| 469 | * | ||
| 470 | * Same as event_trigger_unlock_commit() but calls | ||
| 471 | * trace_buffer_unlock_commit_regs() instead of trace_buffer_unlock_commit(). | ||
| 472 | */ | ||
| 473 | static inline void | ||
| 474 | event_trigger_unlock_commit_regs(struct ftrace_event_file *file, | ||
| 475 | struct ring_buffer *buffer, | ||
| 476 | struct ring_buffer_event *event, | ||
| 477 | void *entry, unsigned long irq_flags, int pc, | ||
| 478 | struct pt_regs *regs) | ||
| 479 | { | ||
| 480 | enum event_trigger_type tt = ETT_NONE; | ||
| 481 | |||
| 482 | if (!__event_trigger_test_discard(file, buffer, event, entry, &tt)) | ||
| 483 | trace_buffer_unlock_commit_regs(buffer, event, | ||
| 484 | irq_flags, pc, regs); | ||
| 485 | |||
| 486 | if (tt) | ||
| 487 | event_triggers_post_call(file, tt); | ||
| 488 | } | ||
| 334 | 489 | ||
| 335 | enum { | 490 | enum { |
| 336 | FILTER_OTHER = 0, | 491 | FILTER_OTHER = 0, |
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index 1eda33d7cb10..1c2fdaa2ffc3 100644 --- a/include/linux/genalloc.h +++ b/include/linux/genalloc.h | |||
| @@ -30,6 +30,8 @@ | |||
| 30 | #ifndef __GENALLOC_H__ | 30 | #ifndef __GENALLOC_H__ |
| 31 | #define __GENALLOC_H__ | 31 | #define __GENALLOC_H__ |
| 32 | 32 | ||
| 33 | #include <linux/spinlock_types.h> | ||
| 34 | |||
| 33 | struct device; | 35 | struct device; |
| 34 | struct device_node; | 36 | struct device_node; |
| 35 | 37 | ||
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 9b4dd491f7e8..0437439bc047 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef __LINUX_GFP_H | 1 | #ifndef __LINUX_GFP_H |
| 2 | #define __LINUX_GFP_H | 2 | #define __LINUX_GFP_H |
| 3 | 3 | ||
| 4 | #include <linux/mmdebug.h> | ||
| 4 | #include <linux/mmzone.h> | 5 | #include <linux/mmzone.h> |
| 5 | #include <linux/stddef.h> | 6 | #include <linux/stddef.h> |
| 6 | #include <linux/linkage.h> | 7 | #include <linux/linkage.h> |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 13dfd24d01ab..b581b13d29d9 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
| @@ -90,7 +90,6 @@ void devm_gpio_free(struct device *dev, unsigned int gpio); | |||
| 90 | 90 | ||
| 91 | #include <linux/kernel.h> | 91 | #include <linux/kernel.h> |
| 92 | #include <linux/types.h> | 92 | #include <linux/types.h> |
| 93 | #include <linux/errno.h> | ||
| 94 | #include <linux/bug.h> | 93 | #include <linux/bug.h> |
| 95 | #include <linux/pinctrl/pinctrl.h> | 94 | #include <linux/pinctrl/pinctrl.h> |
| 96 | 95 | ||
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 656a27efb2c8..a3e181e09636 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h | |||
| @@ -2,9 +2,12 @@ | |||
| 2 | #define __LINUX_GPIO_DRIVER_H | 2 | #define __LINUX_GPIO_DRIVER_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/module.h> | ||
| 5 | 6 | ||
| 6 | struct device; | 7 | struct device; |
| 7 | struct gpio_desc; | 8 | struct gpio_desc; |
| 9 | struct of_phandle_args; | ||
| 10 | struct device_node; | ||
| 8 | struct seq_file; | 11 | struct seq_file; |
| 9 | 12 | ||
| 10 | /** | 13 | /** |
| @@ -36,14 +39,15 @@ struct seq_file; | |||
| 36 | * @ngpio: the number of GPIOs handled by this controller; the last GPIO | 39 | * @ngpio: the number of GPIOs handled by this controller; the last GPIO |
| 37 | * handled is (base + ngpio - 1). | 40 | * handled is (base + ngpio - 1). |
| 38 | * @desc: array of ngpio descriptors. Private. | 41 | * @desc: array of ngpio descriptors. Private. |
| 39 | * @can_sleep: flag must be set iff get()/set() methods sleep, as they | ||
| 40 | * must while accessing GPIO expander chips over I2C or SPI | ||
| 41 | * @names: if set, must be an array of strings to use as alternative | 42 | * @names: if set, must be an array of strings to use as alternative |
| 42 | * names for the GPIOs in this chip. Any entry in the array | 43 | * names for the GPIOs in this chip. Any entry in the array |
| 43 | * may be NULL if there is no alias for the GPIO, however the | 44 | * may be NULL if there is no alias for the GPIO, however the |
| 44 | * array must be @ngpio entries long. A name can include a single printk | 45 | * array must be @ngpio entries long. A name can include a single printk |
| 45 | * format specifier for an unsigned int. It is substituted by the actual | 46 | * format specifier for an unsigned int. It is substituted by the actual |
| 46 | * number of the gpio. | 47 | * number of the gpio. |
| 48 | * @can_sleep: flag must be set iff get()/set() methods sleep, as they | ||
| 49 | * must while accessing GPIO expander chips over I2C or SPI | ||
| 50 | * @exported: flags if the gpiochip is exported for use from sysfs. Private. | ||
| 47 | * | 51 | * |
| 48 | * A gpio_chip can help platforms abstract various sources of GPIOs so | 52 | * A gpio_chip can help platforms abstract various sources of GPIOs so |
| 49 | * they can all be accessed through a common programing interface. | 53 | * they can all be accessed through a common programing interface. |
| @@ -88,8 +92,8 @@ struct gpio_chip { | |||
| 88 | u16 ngpio; | 92 | u16 ngpio; |
| 89 | struct gpio_desc *desc; | 93 | struct gpio_desc *desc; |
| 90 | const char *const *names; | 94 | const char *const *names; |
| 91 | unsigned can_sleep:1; | 95 | bool can_sleep; |
| 92 | unsigned exported:1; | 96 | bool exported; |
| 93 | 97 | ||
| 94 | #if defined(CONFIG_OF_GPIO) | 98 | #if defined(CONFIG_OF_GPIO) |
| 95 | /* | 99 | /* |
| @@ -125,60 +129,58 @@ extern struct gpio_chip *gpiochip_find(void *data, | |||
| 125 | int gpiod_lock_as_irq(struct gpio_desc *desc); | 129 | int gpiod_lock_as_irq(struct gpio_desc *desc); |
| 126 | void gpiod_unlock_as_irq(struct gpio_desc *desc); | 130 | void gpiod_unlock_as_irq(struct gpio_desc *desc); |
| 127 | 131 | ||
| 132 | enum gpio_lookup_flags { | ||
| 133 | GPIO_ACTIVE_HIGH = (0 << 0), | ||
| 134 | GPIO_ACTIVE_LOW = (1 << 0), | ||
| 135 | GPIO_OPEN_DRAIN = (1 << 1), | ||
| 136 | GPIO_OPEN_SOURCE = (1 << 2), | ||
| 137 | }; | ||
| 138 | |||
| 128 | /** | 139 | /** |
| 129 | * Lookup table for associating GPIOs to specific devices and functions using | 140 | * struct gpiod_lookup - lookup table |
| 130 | * platform data. | 141 | * @chip_label: name of the chip the GPIO belongs to |
| 142 | * @chip_hwnum: hardware number (i.e. relative to the chip) of the GPIO | ||
| 143 | * @con_id: name of the GPIO from the device's point of view | ||
| 144 | * @idx: index of the GPIO in case several GPIOs share the same name | ||
| 145 | * @flags: mask of GPIO_* values | ||
| 146 | * | ||
| 147 | * gpiod_lookup is a lookup table for associating GPIOs to specific devices and | ||
| 148 | * functions using platform data. | ||
| 131 | */ | 149 | */ |
| 132 | struct gpiod_lookup { | 150 | struct gpiod_lookup { |
| 133 | struct list_head list; | ||
| 134 | /* | ||
| 135 | * name of the chip the GPIO belongs to | ||
| 136 | */ | ||
| 137 | const char *chip_label; | 151 | const char *chip_label; |
| 138 | /* | ||
| 139 | * hardware number (i.e. relative to the chip) of the GPIO | ||
| 140 | */ | ||
| 141 | u16 chip_hwnum; | 152 | u16 chip_hwnum; |
| 142 | /* | ||
| 143 | * name of device that can claim this GPIO | ||
| 144 | */ | ||
| 145 | const char *dev_id; | ||
| 146 | /* | ||
| 147 | * name of the GPIO from the device's point of view | ||
| 148 | */ | ||
| 149 | const char *con_id; | 153 | const char *con_id; |
| 150 | /* | ||
| 151 | * index of the GPIO in case several GPIOs share the same name | ||
| 152 | */ | ||
| 153 | unsigned int idx; | 154 | unsigned int idx; |
| 154 | /* | 155 | enum gpio_lookup_flags flags; |
| 155 | * mask of GPIOF_* values | 156 | }; |
| 156 | */ | 157 | |
| 157 | unsigned long flags; | 158 | struct gpiod_lookup_table { |
| 159 | struct list_head list; | ||
| 160 | const char *dev_id; | ||
| 161 | struct gpiod_lookup table[]; | ||
| 158 | }; | 162 | }; |
| 159 | 163 | ||
| 160 | /* | 164 | /* |
| 161 | * Simple definition of a single GPIO under a con_id | 165 | * Simple definition of a single GPIO under a con_id |
| 162 | */ | 166 | */ |
| 163 | #define GPIO_LOOKUP(_chip_label, _chip_hwnum, _dev_id, _con_id, _flags) \ | 167 | #define GPIO_LOOKUP(_chip_label, _chip_hwnum, _con_id, _flags) \ |
| 164 | GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _dev_id, _con_id, 0, _flags) | 168 | GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _con_id, 0, _flags) |
| 165 | 169 | ||
| 166 | /* | 170 | /* |
| 167 | * Use this macro if you need to have several GPIOs under the same con_id. | 171 | * Use this macro if you need to have several GPIOs under the same con_id. |
| 168 | * Each GPIO needs to use a different index and can be accessed using | 172 | * Each GPIO needs to use a different index and can be accessed using |
| 169 | * gpiod_get_index() | 173 | * gpiod_get_index() |
| 170 | */ | 174 | */ |
| 171 | #define GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _dev_id, _con_id, _idx, \ | 175 | #define GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _con_id, _idx, _flags) \ |
| 172 | _flags) \ | ||
| 173 | { \ | 176 | { \ |
| 174 | .chip_label = _chip_label, \ | 177 | .chip_label = _chip_label, \ |
| 175 | .chip_hwnum = _chip_hwnum, \ | 178 | .chip_hwnum = _chip_hwnum, \ |
| 176 | .dev_id = _dev_id, \ | ||
| 177 | .con_id = _con_id, \ | 179 | .con_id = _con_id, \ |
| 178 | .idx = _idx, \ | 180 | .idx = _idx, \ |
| 179 | .flags = _flags, \ | 181 | .flags = _flags, \ |
| 180 | } | 182 | } |
| 181 | 183 | ||
| 182 | void gpiod_add_table(struct gpiod_lookup *table, size_t size); | 184 | void gpiod_add_lookup_table(struct gpiod_lookup_table *table); |
| 183 | 185 | ||
| 184 | #endif | 186 | #endif |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index d9cf963ac832..12d5f972f23f 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <linux/lockdep.h> | 5 | #include <linux/lockdep.h> |
| 6 | #include <linux/ftrace_irq.h> | 6 | #include <linux/ftrace_irq.h> |
| 7 | #include <linux/vtime.h> | 7 | #include <linux/vtime.h> |
| 8 | #include <asm/hardirq.h> | ||
| 8 | 9 | ||
| 9 | 10 | ||
| 10 | extern void synchronize_irq(unsigned int irq); | 11 | extern void synchronize_irq(unsigned int irq); |
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h index a265af294ea4..b914ca3f57ba 100644 --- a/include/linux/hid-sensor-hub.h +++ b/include/linux/hid-sensor-hub.h | |||
| @@ -21,6 +21,8 @@ | |||
| 21 | 21 | ||
| 22 | #include <linux/hid.h> | 22 | #include <linux/hid.h> |
| 23 | #include <linux/hid-sensor-ids.h> | 23 | #include <linux/hid-sensor-ids.h> |
| 24 | #include <linux/iio/iio.h> | ||
| 25 | #include <linux/iio/trigger.h> | ||
| 24 | 26 | ||
| 25 | /** | 27 | /** |
| 26 | * struct hid_sensor_hub_attribute_info - Attribute info | 28 | * struct hid_sensor_hub_attribute_info - Attribute info |
| @@ -40,6 +42,8 @@ struct hid_sensor_hub_attribute_info { | |||
| 40 | s32 units; | 42 | s32 units; |
| 41 | s32 unit_expo; | 43 | s32 unit_expo; |
| 42 | s32 size; | 44 | s32 size; |
| 45 | s32 logical_minimum; | ||
| 46 | s32 logical_maximum; | ||
| 43 | }; | 47 | }; |
| 44 | 48 | ||
| 45 | /** | 49 | /** |
| @@ -184,6 +188,7 @@ struct hid_sensor_common { | |||
| 184 | struct platform_device *pdev; | 188 | struct platform_device *pdev; |
| 185 | unsigned usage_id; | 189 | unsigned usage_id; |
| 186 | bool data_ready; | 190 | bool data_ready; |
| 191 | struct iio_trigger *trigger; | ||
| 187 | struct hid_sensor_hub_attribute_info poll; | 192 | struct hid_sensor_hub_attribute_info poll; |
| 188 | struct hid_sensor_hub_attribute_info report_state; | 193 | struct hid_sensor_hub_attribute_info report_state; |
| 189 | struct hid_sensor_hub_attribute_info power_state; | 194 | struct hid_sensor_hub_attribute_info power_state; |
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h index 4f945d3ed49f..beaf965621c1 100644 --- a/include/linux/hid-sensor-ids.h +++ b/include/linux/hid-sensor-ids.h | |||
| @@ -23,22 +23,26 @@ | |||
| 23 | 23 | ||
| 24 | /* Accel 3D (200073) */ | 24 | /* Accel 3D (200073) */ |
| 25 | #define HID_USAGE_SENSOR_ACCEL_3D 0x200073 | 25 | #define HID_USAGE_SENSOR_ACCEL_3D 0x200073 |
| 26 | #define HID_USAGE_SENSOR_DATA_ACCELERATION 0x200452 | ||
| 26 | #define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453 | 27 | #define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453 |
| 27 | #define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454 | 28 | #define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454 |
| 28 | #define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455 | 29 | #define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455 |
| 29 | 30 | ||
| 30 | /* ALS (200041) */ | 31 | /* ALS (200041) */ |
| 31 | #define HID_USAGE_SENSOR_ALS 0x200041 | 32 | #define HID_USAGE_SENSOR_ALS 0x200041 |
| 33 | #define HID_USAGE_SENSOR_DATA_LIGHT 0x2004d0 | ||
| 32 | #define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1 | 34 | #define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1 |
| 33 | 35 | ||
| 34 | /* Gyro 3D: (200076) */ | 36 | /* Gyro 3D: (200076) */ |
| 35 | #define HID_USAGE_SENSOR_GYRO_3D 0x200076 | 37 | #define HID_USAGE_SENSOR_GYRO_3D 0x200076 |
| 38 | #define HID_USAGE_SENSOR_DATA_ANGL_VELOCITY 0x200456 | ||
| 36 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457 | 39 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457 |
| 37 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458 | 40 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458 |
| 38 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459 | 41 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459 |
| 39 | 42 | ||
| 40 | /* ORIENTATION: Compass 3D: (200083) */ | 43 | /* ORIENTATION: Compass 3D: (200083) */ |
| 41 | #define HID_USAGE_SENSOR_COMPASS_3D 0x200083 | 44 | #define HID_USAGE_SENSOR_COMPASS_3D 0x200083 |
| 45 | #define HID_USAGE_SENSOR_DATA_ORIENTATION 0x200470 | ||
| 42 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471 | 46 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471 |
| 43 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472 | 47 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472 |
| 44 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473 | 48 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473 |
| @@ -54,10 +58,14 @@ | |||
| 54 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Y 0x20047B | 58 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Y 0x20047B |
| 55 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Z 0x20047C | 59 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Z 0x20047C |
| 56 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_OUT_OF_RANGE 0x20047D | 60 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_OUT_OF_RANGE 0x20047D |
| 61 | |||
| 62 | /* ORIENTATION: Inclinometer 3D: (200086) */ | ||
| 63 | #define HID_USAGE_SENSOR_INCLINOMETER_3D 0x200086 | ||
| 57 | #define HID_USAGE_SENSOR_ORIENT_TILT 0x20047E | 64 | #define HID_USAGE_SENSOR_ORIENT_TILT 0x20047E |
| 58 | #define HID_USAGE_SENSOR_ORIENT_TILT_X 0x20047F | 65 | #define HID_USAGE_SENSOR_ORIENT_TILT_X 0x20047F |
| 59 | #define HID_USAGE_SENSOR_ORIENT_TILT_Y 0x200480 | 66 | #define HID_USAGE_SENSOR_ORIENT_TILT_Y 0x200480 |
| 60 | #define HID_USAGE_SENSOR_ORIENT_TILT_Z 0x200481 | 67 | #define HID_USAGE_SENSOR_ORIENT_TILT_Z 0x200481 |
| 68 | |||
| 61 | #define HID_USAGE_SENSOR_ORIENT_ROTATION_MATRIX 0x200482 | 69 | #define HID_USAGE_SENSOR_ORIENT_ROTATION_MATRIX 0x200482 |
| 62 | #define HID_USAGE_SENSOR_ORIENT_QUATERNION 0x200483 | 70 | #define HID_USAGE_SENSOR_ORIENT_QUATERNION 0x200483 |
| 63 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX 0x200484 | 71 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX 0x200484 |
| @@ -117,4 +125,20 @@ | |||
| 117 | #define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 | 125 | #define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 |
| 118 | #define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 | 126 | #define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 |
| 119 | 127 | ||
| 128 | /* Per data field properties */ | ||
| 129 | #define HID_USAGE_SENSOR_DATA_MOD_NONE 0x00 | ||
| 130 | #define HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS 0x1000 | ||
| 131 | |||
| 132 | /* Power state enumerations */ | ||
| 133 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_UNDEFINED_ENUM 0x00 | ||
| 134 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM 0x01 | ||
| 135 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D1_LOW_POWER_ENUM 0x02 | ||
| 136 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D2_STANDBY_WITH_WAKE_ENUM 0x03 | ||
| 137 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D3_SLEEP_WITH_WAKE_ENUM 0x04 | ||
| 138 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM 0x05 | ||
| 139 | |||
| 140 | /* Report State enumerations */ | ||
| 141 | #define HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM 0x00 | ||
| 142 | #define HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM 0x01 | ||
| 143 | |||
| 120 | #endif | 144 | #endif |
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 91672e2deec3..db512014e061 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
| @@ -157,6 +157,26 @@ static inline int hpage_nr_pages(struct page *page) | |||
| 157 | return HPAGE_PMD_NR; | 157 | return HPAGE_PMD_NR; |
| 158 | return 1; | 158 | return 1; |
| 159 | } | 159 | } |
| 160 | /* | ||
| 161 | * compound_trans_head() should be used instead of compound_head(), | ||
| 162 | * whenever the "page" passed as parameter could be the tail of a | ||
| 163 | * transparent hugepage that could be undergoing a | ||
| 164 | * __split_huge_page_refcount(). The page structure layout often | ||
| 165 | * changes across releases and it makes extensive use of unions. So if | ||
| 166 | * the page structure layout will change in a way that | ||
| 167 | * page->first_page gets clobbered by __split_huge_page_refcount, the | ||
| 168 | * implementation making use of smp_rmb() will be required. | ||
| 169 | * | ||
| 170 | * Currently we define compound_trans_head as compound_head, because | ||
| 171 | * page->private is in the same union with page->first_page, and | ||
| 172 | * page->private isn't clobbered. However this also means we're | ||
| 173 | * currently leaving dirt into the page->private field of anonymous | ||
| 174 | * pages resulting from a THP split, instead of setting page->private | ||
| 175 | * to zero like for every other page that has PG_private not set. But | ||
| 176 | * anonymous pages don't use page->private so this is not a problem. | ||
| 177 | */ | ||
| 178 | #if 0 | ||
| 179 | /* This will be needed if page->private will be clobbered in split_huge_page */ | ||
| 160 | static inline struct page *compound_trans_head(struct page *page) | 180 | static inline struct page *compound_trans_head(struct page *page) |
| 161 | { | 181 | { |
| 162 | if (PageTail(page)) { | 182 | if (PageTail(page)) { |
| @@ -174,6 +194,9 @@ static inline struct page *compound_trans_head(struct page *page) | |||
| 174 | } | 194 | } |
| 175 | return page; | 195 | return page; |
| 176 | } | 196 | } |
| 197 | #else | ||
| 198 | #define compound_trans_head(page) compound_head(page) | ||
| 199 | #endif | ||
| 177 | 200 | ||
| 178 | extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | 201 | extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, |
| 179 | unsigned long addr, pmd_t pmd, pmd_t *pmdp); | 202 | unsigned long addr, pmd_t pmd, pmd_t *pmdp); |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 9649ff0c63f8..8c43cc469d78 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _LINUX_HUGETLB_H | 2 | #define _LINUX_HUGETLB_H |
| 3 | 3 | ||
| 4 | #include <linux/mm_types.h> | 4 | #include <linux/mm_types.h> |
| 5 | #include <linux/mmdebug.h> | ||
| 5 | #include <linux/fs.h> | 6 | #include <linux/fs.h> |
| 6 | #include <linux/hugetlb_inline.h> | 7 | #include <linux/hugetlb_inline.h> |
| 7 | #include <linux/cgroup.h> | 8 | #include <linux/cgroup.h> |
| @@ -31,7 +32,6 @@ struct hugepage_subpool *hugepage_new_subpool(long nr_blocks); | |||
| 31 | void hugepage_put_subpool(struct hugepage_subpool *spool); | 32 | void hugepage_put_subpool(struct hugepage_subpool *spool); |
| 32 | 33 | ||
| 33 | int PageHuge(struct page *page); | 34 | int PageHuge(struct page *page); |
| 34 | int PageHeadHuge(struct page *page_head); | ||
| 35 | 35 | ||
| 36 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); | 36 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); |
| 37 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); | 37 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
| @@ -104,11 +104,6 @@ static inline int PageHuge(struct page *page) | |||
| 104 | return 0; | 104 | return 0; |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | static inline int PageHeadHuge(struct page *page_head) | ||
| 108 | { | ||
| 109 | return 0; | ||
| 110 | } | ||
| 111 | |||
| 112 | static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) | 107 | static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) |
| 113 | { | 108 | { |
| 114 | } | 109 | } |
| @@ -142,7 +137,10 @@ static inline int dequeue_hwpoisoned_huge_page(struct page *page) | |||
| 142 | return 0; | 137 | return 0; |
| 143 | } | 138 | } |
| 144 | 139 | ||
| 145 | #define isolate_huge_page(p, l) false | 140 | static inline bool isolate_huge_page(struct page *page, struct list_head *list) |
| 141 | { | ||
| 142 | return false; | ||
| 143 | } | ||
| 146 | #define putback_active_hugepage(p) do {} while (0) | 144 | #define putback_active_hugepage(p) do {} while (0) |
| 147 | #define is_hugepage_active(x) false | 145 | #define is_hugepage_active(x) false |
| 148 | 146 | ||
| @@ -357,6 +355,7 @@ static inline pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma, | |||
| 357 | 355 | ||
| 358 | static inline struct hstate *page_hstate(struct page *page) | 356 | static inline struct hstate *page_hstate(struct page *page) |
| 359 | { | 357 | { |
| 358 | VM_BUG_ON_PAGE(!PageHuge(page), page); | ||
| 360 | return size_to_hstate(PAGE_SIZE << compound_order(page)); | 359 | return size_to_hstate(PAGE_SIZE << compound_order(page)); |
| 361 | } | 360 | } |
| 362 | 361 | ||
diff --git a/include/linux/hugetlb_cgroup.h b/include/linux/hugetlb_cgroup.h index ce8217f7b5c2..787bba3bf552 100644 --- a/include/linux/hugetlb_cgroup.h +++ b/include/linux/hugetlb_cgroup.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #ifndef _LINUX_HUGETLB_CGROUP_H | 15 | #ifndef _LINUX_HUGETLB_CGROUP_H |
| 16 | #define _LINUX_HUGETLB_CGROUP_H | 16 | #define _LINUX_HUGETLB_CGROUP_H |
| 17 | 17 | ||
| 18 | #include <linux/mmdebug.h> | ||
| 18 | #include <linux/res_counter.h> | 19 | #include <linux/res_counter.h> |
| 19 | 20 | ||
| 20 | struct hugetlb_cgroup; | 21 | struct hugetlb_cgroup; |
| @@ -28,7 +29,7 @@ struct hugetlb_cgroup; | |||
| 28 | 29 | ||
| 29 | static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page) | 30 | static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page) |
| 30 | { | 31 | { |
| 31 | VM_BUG_ON(!PageHuge(page)); | 32 | VM_BUG_ON_PAGE(!PageHuge(page), page); |
| 32 | 33 | ||
| 33 | if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER) | 34 | if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER) |
| 34 | return NULL; | 35 | return NULL; |
| @@ -38,7 +39,7 @@ static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page) | |||
| 38 | static inline | 39 | static inline |
| 39 | int set_hugetlb_cgroup(struct page *page, struct hugetlb_cgroup *h_cg) | 40 | int set_hugetlb_cgroup(struct page *page, struct hugetlb_cgroup *h_cg) |
| 40 | { | 41 | { |
| 41 | VM_BUG_ON(!PageHuge(page)); | 42 | VM_BUG_ON_PAGE(!PageHuge(page), page); |
| 42 | 43 | ||
| 43 | if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER) | 44 | if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER) |
| 44 | return -1; | 45 | return -1; |
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h index 49ed17fdf055..5388326fbbff 100644 --- a/include/linux/i2c-pnx.h +++ b/include/linux/i2c-pnx.h | |||
| @@ -31,7 +31,6 @@ struct i2c_pnx_algo_data { | |||
| 31 | int last; | 31 | int last; |
| 32 | struct clk *clk; | 32 | struct clk *clk; |
| 33 | struct i2c_adapter adapter; | 33 | struct i2c_adapter adapter; |
| 34 | phys_addr_t base; | ||
| 35 | int irq; | 34 | int irq; |
| 36 | u32 timeout; | 35 | u32 timeout; |
| 37 | }; | 36 | }; |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index eff50e062be8..d9c8dbd3373f 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -445,7 +445,7 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data) | |||
| 445 | static inline struct i2c_adapter * | 445 | static inline struct i2c_adapter * |
| 446 | i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) | 446 | i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) |
| 447 | { | 447 | { |
| 448 | #if IS_ENABLED(I2C_MUX) | 448 | #if IS_ENABLED(CONFIG_I2C_MUX) |
| 449 | struct device *parent = adapter->dev.parent; | 449 | struct device *parent = adapter->dev.parent; |
| 450 | 450 | ||
| 451 | if (parent != NULL && parent->type == &i2c_adapter_type) | 451 | if (parent != NULL && parent->type == &i2c_adapter_type) |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 673a3ce67f31..ade1c06d4ceb 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
| @@ -175,6 +175,9 @@ static inline int twl_class_is_ ##class(void) \ | |||
| 175 | TWL_CLASS_IS(4030, TWL4030_CLASS_ID) | 175 | TWL_CLASS_IS(4030, TWL4030_CLASS_ID) |
| 176 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) | 176 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) |
| 177 | 177 | ||
| 178 | /* Set the regcache bypass for the regmap associated with the nodule */ | ||
| 179 | int twl_set_regcache_bypass(u8 mod_no, bool enable); | ||
| 180 | |||
| 178 | /* | 181 | /* |
| 179 | * Read and write several 8-bit registers at once. | 182 | * Read and write several 8-bit registers at once. |
| 180 | */ | 183 | */ |
| @@ -667,8 +670,6 @@ struct twl4030_codec_data { | |||
| 667 | unsigned int digimic_delay; /* in ms */ | 670 | unsigned int digimic_delay; /* in ms */ |
| 668 | unsigned int ramp_delay_value; | 671 | unsigned int ramp_delay_value; |
| 669 | unsigned int offset_cncl_path; | 672 | unsigned int offset_cncl_path; |
| 670 | unsigned int check_defaults:1; | ||
| 671 | unsigned int reset_registers:1; | ||
| 672 | unsigned int hs_extmute:1; | 673 | unsigned int hs_extmute:1; |
| 673 | int hs_extmute_gpio; | 674 | int hs_extmute_gpio; |
| 674 | }; | 675 | }; |
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h index 15607b45221a..519392763393 100644 --- a/include/linux/iio/buffer.h +++ b/include/linux/iio/buffer.h | |||
| @@ -21,6 +21,8 @@ struct iio_buffer; | |||
| 21 | * struct iio_buffer_access_funcs - access functions for buffers. | 21 | * struct iio_buffer_access_funcs - access functions for buffers. |
| 22 | * @store_to: actually store stuff to the buffer | 22 | * @store_to: actually store stuff to the buffer |
| 23 | * @read_first_n: try to get a specified number of bytes (must exist) | 23 | * @read_first_n: try to get a specified number of bytes (must exist) |
| 24 | * @data_available: indicates whether data for reading from the buffer is | ||
| 25 | * available. | ||
| 24 | * @request_update: if a parameter change has been marked, update underlying | 26 | * @request_update: if a parameter change has been marked, update underlying |
| 25 | * storage. | 27 | * storage. |
| 26 | * @get_bytes_per_datum:get current bytes per datum | 28 | * @get_bytes_per_datum:get current bytes per datum |
| @@ -43,6 +45,7 @@ struct iio_buffer_access_funcs { | |||
| 43 | int (*read_first_n)(struct iio_buffer *buffer, | 45 | int (*read_first_n)(struct iio_buffer *buffer, |
| 44 | size_t n, | 46 | size_t n, |
| 45 | char __user *buf); | 47 | char __user *buf); |
| 48 | bool (*data_available)(struct iio_buffer *buffer); | ||
| 46 | 49 | ||
| 47 | int (*request_update)(struct iio_buffer *buffer); | 50 | int (*request_update)(struct iio_buffer *buffer); |
| 48 | 51 | ||
diff --git a/include/linux/iio/events.h b/include/linux/iio/events.h index 5dab2c41031f..8bbd7bc1043d 100644 --- a/include/linux/iio/events.h +++ b/include/linux/iio/events.h | |||
| @@ -46,10 +46,6 @@ struct iio_event_data { | |||
| 46 | ((u16)chan)) | 46 | ((u16)chan)) |
| 47 | 47 | ||
| 48 | 48 | ||
| 49 | #define IIO_EV_DIR_MAX 4 | ||
| 50 | #define IIO_EV_BIT(type, direction) \ | ||
| 51 | (1 << (type*IIO_EV_DIR_MAX + direction)) | ||
| 52 | |||
| 53 | /** | 49 | /** |
| 54 | * IIO_MOD_EVENT_CODE() - create event identifier for modified channels | 50 | * IIO_MOD_EVENT_CODE() - create event identifier for modified channels |
| 55 | * @chan_type: Type of the channel. Should be one of enum iio_chan_type. | 51 | * @chan_type: Type of the channel. Should be one of enum iio_chan_type. |
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 256a90a1bea6..75a8a20c8179 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
| @@ -185,7 +185,6 @@ struct iio_event_spec { | |||
| 185 | * by all channels of the same direction. | 185 | * by all channels of the same direction. |
| 186 | * @info_mask_shared_by_all: What information is to be exported that is shared | 186 | * @info_mask_shared_by_all: What information is to be exported that is shared |
| 187 | * by all channels. | 187 | * by all channels. |
| 188 | * @event_mask: What events can this channel produce. | ||
| 189 | * @event_spec: Array of events which should be registered for this | 188 | * @event_spec: Array of events which should be registered for this |
| 190 | * channel. | 189 | * channel. |
| 191 | * @num_event_specs: Size of the event_spec array. | 190 | * @num_event_specs: Size of the event_spec array. |
| @@ -226,7 +225,6 @@ struct iio_chan_spec { | |||
| 226 | long info_mask_shared_by_type; | 225 | long info_mask_shared_by_type; |
| 227 | long info_mask_shared_by_dir; | 226 | long info_mask_shared_by_dir; |
| 228 | long info_mask_shared_by_all; | 227 | long info_mask_shared_by_all; |
| 229 | long event_mask; | ||
| 230 | const struct iio_event_spec *event_spec; | 228 | const struct iio_event_spec *event_spec; |
| 231 | unsigned int num_event_specs; | 229 | unsigned int num_event_specs; |
| 232 | const struct iio_chan_spec_ext_info *ext_info; | 230 | const struct iio_chan_spec_ext_info *ext_info; |
| @@ -307,16 +305,8 @@ struct iio_dev; | |||
| 307 | * returns IIO_VAL_INT_PLUS_MICRO. | 305 | * returns IIO_VAL_INT_PLUS_MICRO. |
| 308 | * @read_event_config: find out if the event is enabled. | 306 | * @read_event_config: find out if the event is enabled. |
| 309 | * @write_event_config: set if the event is enabled. | 307 | * @write_event_config: set if the event is enabled. |
| 310 | * @read_event_value: read a value associated with the event. Meaning | 308 | * @read_event_value: read a configuration value associated with the event. |
| 311 | * is event dependant. event_code specifies which event. | 309 | * @write_event_value: write a configuration value for the event. |
| 312 | * @write_event_value: write the value associated with the event. | ||
| 313 | * Meaning is event dependent. | ||
| 314 | * @read_event_config_new: find out if the event is enabled. New style interface. | ||
| 315 | * @write_event_config_new: set if the event is enabled. New style interface. | ||
| 316 | * @read_event_value_new: read a configuration value associated with the event. | ||
| 317 | * New style interface. | ||
| 318 | * @write_event_value_new: write a configuration value for the event. New style | ||
| 319 | * interface. | ||
| 320 | * @validate_trigger: function to validate the trigger when the | 310 | * @validate_trigger: function to validate the trigger when the |
| 321 | * current trigger gets changed. | 311 | * current trigger gets changed. |
| 322 | * @update_scan_mode: function to configure device and scan buffer when | 312 | * @update_scan_mode: function to configure device and scan buffer when |
| @@ -345,37 +335,23 @@ struct iio_info { | |||
| 345 | long mask); | 335 | long mask); |
| 346 | 336 | ||
| 347 | int (*read_event_config)(struct iio_dev *indio_dev, | 337 | int (*read_event_config)(struct iio_dev *indio_dev, |
| 348 | u64 event_code); | ||
| 349 | |||
| 350 | int (*write_event_config)(struct iio_dev *indio_dev, | ||
| 351 | u64 event_code, | ||
| 352 | int state); | ||
| 353 | |||
| 354 | int (*read_event_value)(struct iio_dev *indio_dev, | ||
| 355 | u64 event_code, | ||
| 356 | int *val); | ||
| 357 | int (*write_event_value)(struct iio_dev *indio_dev, | ||
| 358 | u64 event_code, | ||
| 359 | int val); | ||
| 360 | |||
| 361 | int (*read_event_config_new)(struct iio_dev *indio_dev, | ||
| 362 | const struct iio_chan_spec *chan, | 338 | const struct iio_chan_spec *chan, |
| 363 | enum iio_event_type type, | 339 | enum iio_event_type type, |
| 364 | enum iio_event_direction dir); | 340 | enum iio_event_direction dir); |
| 365 | 341 | ||
| 366 | int (*write_event_config_new)(struct iio_dev *indio_dev, | 342 | int (*write_event_config)(struct iio_dev *indio_dev, |
| 367 | const struct iio_chan_spec *chan, | 343 | const struct iio_chan_spec *chan, |
| 368 | enum iio_event_type type, | 344 | enum iio_event_type type, |
| 369 | enum iio_event_direction dir, | 345 | enum iio_event_direction dir, |
| 370 | int state); | 346 | int state); |
| 371 | 347 | ||
| 372 | int (*read_event_value_new)(struct iio_dev *indio_dev, | 348 | int (*read_event_value)(struct iio_dev *indio_dev, |
| 373 | const struct iio_chan_spec *chan, | 349 | const struct iio_chan_spec *chan, |
| 374 | enum iio_event_type type, | 350 | enum iio_event_type type, |
| 375 | enum iio_event_direction dir, | 351 | enum iio_event_direction dir, |
| 376 | enum iio_event_info info, int *val, int *val2); | 352 | enum iio_event_info info, int *val, int *val2); |
| 377 | 353 | ||
| 378 | int (*write_event_value_new)(struct iio_dev *indio_dev, | 354 | int (*write_event_value)(struct iio_dev *indio_dev, |
| 379 | const struct iio_chan_spec *chan, | 355 | const struct iio_chan_spec *chan, |
| 380 | enum iio_event_type type, | 356 | enum iio_event_type type, |
| 381 | enum iio_event_direction dir, | 357 | enum iio_event_direction dir, |
| @@ -490,32 +466,12 @@ struct iio_dev { | |||
| 490 | #endif | 466 | #endif |
| 491 | }; | 467 | }; |
| 492 | 468 | ||
| 493 | /** | ||
| 494 | * iio_find_channel_from_si() - get channel from its scan index | ||
| 495 | * @indio_dev: device | ||
| 496 | * @si: scan index to match | ||
| 497 | */ | ||
| 498 | const struct iio_chan_spec | 469 | const struct iio_chan_spec |
| 499 | *iio_find_channel_from_si(struct iio_dev *indio_dev, int si); | 470 | *iio_find_channel_from_si(struct iio_dev *indio_dev, int si); |
| 500 | |||
| 501 | /** | ||
| 502 | * iio_device_register() - register a device with the IIO subsystem | ||
| 503 | * @indio_dev: Device structure filled by the device driver | ||
| 504 | **/ | ||
| 505 | int iio_device_register(struct iio_dev *indio_dev); | 471 | int iio_device_register(struct iio_dev *indio_dev); |
| 506 | |||
| 507 | /** | ||
| 508 | * iio_device_unregister() - unregister a device from the IIO subsystem | ||
| 509 | * @indio_dev: Device structure representing the device. | ||
| 510 | **/ | ||
| 511 | void iio_device_unregister(struct iio_dev *indio_dev); | 472 | void iio_device_unregister(struct iio_dev *indio_dev); |
| 512 | 473 | int devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev); | |
| 513 | /** | 474 | void devm_iio_device_unregister(struct device *dev, struct iio_dev *indio_dev); |
| 514 | * iio_push_event() - try to add event to the list for userspace reading | ||
| 515 | * @indio_dev: IIO device structure | ||
| 516 | * @ev_code: What event | ||
| 517 | * @timestamp: When the event occurred | ||
| 518 | **/ | ||
| 519 | int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp); | 475 | int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp); |
| 520 | 476 | ||
| 521 | extern struct bus_type iio_bus_type; | 477 | extern struct bus_type iio_bus_type; |
| @@ -579,10 +535,6 @@ static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev) | |||
| 579 | 535 | ||
| 580 | /* Can we make this smaller? */ | 536 | /* Can we make this smaller? */ |
| 581 | #define IIO_ALIGN L1_CACHE_BYTES | 537 | #define IIO_ALIGN L1_CACHE_BYTES |
| 582 | /** | ||
| 583 | * iio_device_alloc() - allocate an iio_dev from a driver | ||
| 584 | * @sizeof_priv: Space to allocate for private structure. | ||
| 585 | **/ | ||
| 586 | struct iio_dev *iio_device_alloc(int sizeof_priv); | 538 | struct iio_dev *iio_device_alloc(int sizeof_priv); |
| 587 | 539 | ||
| 588 | static inline void *iio_priv(const struct iio_dev *indio_dev) | 540 | static inline void *iio_priv(const struct iio_dev *indio_dev) |
| @@ -596,64 +548,11 @@ static inline struct iio_dev *iio_priv_to_dev(void *priv) | |||
| 596 | ALIGN(sizeof(struct iio_dev), IIO_ALIGN)); | 548 | ALIGN(sizeof(struct iio_dev), IIO_ALIGN)); |
| 597 | } | 549 | } |
| 598 | 550 | ||
| 599 | /** | ||
| 600 | * iio_device_free() - free an iio_dev from a driver | ||
| 601 | * @indio_dev: the iio_dev associated with the device | ||
| 602 | **/ | ||
| 603 | void iio_device_free(struct iio_dev *indio_dev); | 551 | void iio_device_free(struct iio_dev *indio_dev); |
| 604 | |||
| 605 | /** | ||
| 606 | * devm_iio_device_alloc - Resource-managed iio_device_alloc() | ||
| 607 | * @dev: Device to allocate iio_dev for | ||
| 608 | * @sizeof_priv: Space to allocate for private structure. | ||
| 609 | * | ||
| 610 | * Managed iio_device_alloc. iio_dev allocated with this function is | ||
| 611 | * automatically freed on driver detach. | ||
| 612 | * | ||
| 613 | * If an iio_dev allocated with this function needs to be freed separately, | ||
| 614 | * devm_iio_device_free() must be used. | ||
| 615 | * | ||
| 616 | * RETURNS: | ||
| 617 | * Pointer to allocated iio_dev on success, NULL on failure. | ||
| 618 | */ | ||
| 619 | struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv); | 552 | struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv); |
| 620 | |||
| 621 | /** | ||
| 622 | * devm_iio_device_free - Resource-managed iio_device_free() | ||
| 623 | * @dev: Device this iio_dev belongs to | ||
| 624 | * @indio_dev: the iio_dev associated with the device | ||
| 625 | * | ||
| 626 | * Free iio_dev allocated with devm_iio_device_alloc(). | ||
| 627 | */ | ||
| 628 | void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev); | 553 | void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev); |
| 629 | |||
| 630 | /** | ||
| 631 | * devm_iio_trigger_alloc - Resource-managed iio_trigger_alloc() | ||
| 632 | * @dev: Device to allocate iio_trigger for | ||
| 633 | * @fmt: trigger name format. If it includes format | ||
| 634 | * specifiers, the additional arguments following | ||
| 635 | * format are formatted and inserted in the resulting | ||
| 636 | * string replacing their respective specifiers. | ||
| 637 | * | ||
| 638 | * Managed iio_trigger_alloc. iio_trigger allocated with this function is | ||
| 639 | * automatically freed on driver detach. | ||
| 640 | * | ||
| 641 | * If an iio_trigger allocated with this function needs to be freed separately, | ||
| 642 | * devm_iio_trigger_free() must be used. | ||
| 643 | * | ||
| 644 | * RETURNS: | ||
| 645 | * Pointer to allocated iio_trigger on success, NULL on failure. | ||
| 646 | */ | ||
| 647 | struct iio_trigger *devm_iio_trigger_alloc(struct device *dev, | 554 | struct iio_trigger *devm_iio_trigger_alloc(struct device *dev, |
| 648 | const char *fmt, ...); | 555 | const char *fmt, ...); |
| 649 | |||
| 650 | /** | ||
| 651 | * devm_iio_trigger_free - Resource-managed iio_trigger_free() | ||
| 652 | * @dev: Device this iio_dev belongs to | ||
| 653 | * @iio_trig: the iio_trigger associated with the device | ||
| 654 | * | ||
| 655 | * Free iio_trigger allocated with devm_iio_trigger_alloc(). | ||
| 656 | */ | ||
| 657 | void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig); | 556 | void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig); |
| 658 | 557 | ||
| 659 | /** | 558 | /** |
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 4ac928ee31c5..084d882fe01b 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h | |||
| @@ -29,6 +29,7 @@ enum iio_chan_type { | |||
| 29 | IIO_ALTVOLTAGE, | 29 | IIO_ALTVOLTAGE, |
| 30 | IIO_CCT, | 30 | IIO_CCT, |
| 31 | IIO_PRESSURE, | 31 | IIO_PRESSURE, |
| 32 | IIO_HUMIDITYRELATIVE, | ||
| 32 | }; | 33 | }; |
| 33 | 34 | ||
| 34 | enum iio_modifier { | 35 | enum iio_modifier { |
diff --git a/include/linux/init.h b/include/linux/init.h index 8e68a64bfe00..e1688802964f 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
| @@ -286,9 +286,11 @@ void __init parse_early_options(char *cmdline); | |||
| 286 | #define arch_initcall(fn) module_init(fn) | 286 | #define arch_initcall(fn) module_init(fn) |
| 287 | #define subsys_initcall(fn) module_init(fn) | 287 | #define subsys_initcall(fn) module_init(fn) |
| 288 | #define fs_initcall(fn) module_init(fn) | 288 | #define fs_initcall(fn) module_init(fn) |
| 289 | #define rootfs_initcall(fn) module_init(fn) | ||
| 289 | #define device_initcall(fn) module_init(fn) | 290 | #define device_initcall(fn) module_init(fn) |
| 290 | #define late_initcall(fn) module_init(fn) | 291 | #define late_initcall(fn) module_init(fn) |
| 291 | 292 | ||
| 293 | #define console_initcall(fn) module_init(fn) | ||
| 292 | #define security_initcall(fn) module_init(fn) | 294 | #define security_initcall(fn) module_init(fn) |
| 293 | 295 | ||
| 294 | /* Each module must use one module_init(). */ | 296 | /* Each module must use one module_init(). */ |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index b0ed422e4e4a..6df7f9fe0d01 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/user_namespace.h> | 11 | #include <linux/user_namespace.h> |
| 12 | #include <linux/securebits.h> | 12 | #include <linux/securebits.h> |
| 13 | #include <linux/seqlock.h> | 13 | #include <linux/seqlock.h> |
| 14 | #include <linux/rbtree.h> | ||
| 14 | #include <net/net_namespace.h> | 15 | #include <net/net_namespace.h> |
| 15 | #include <linux/sched/rt.h> | 16 | #include <linux/sched/rt.h> |
| 16 | 17 | ||
| @@ -40,6 +41,7 @@ extern struct fs_struct init_fs; | |||
| 40 | 41 | ||
| 41 | #define INIT_SIGNALS(sig) { \ | 42 | #define INIT_SIGNALS(sig) { \ |
| 42 | .nr_threads = 1, \ | 43 | .nr_threads = 1, \ |
| 44 | .thread_head = LIST_HEAD_INIT(init_task.thread_node), \ | ||
| 43 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ | 45 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ |
| 44 | .shared_pending = { \ | 46 | .shared_pending = { \ |
| 45 | .list = LIST_HEAD_INIT(sig.shared_pending.list), \ | 47 | .list = LIST_HEAD_INIT(sig.shared_pending.list), \ |
| @@ -95,7 +97,7 @@ extern struct group_info init_groups; | |||
| 95 | #ifdef CONFIG_AUDITSYSCALL | 97 | #ifdef CONFIG_AUDITSYSCALL |
| 96 | #define INIT_IDS \ | 98 | #define INIT_IDS \ |
| 97 | .loginuid = INVALID_UID, \ | 99 | .loginuid = INVALID_UID, \ |
| 98 | .sessionid = -1, | 100 | .sessionid = (unsigned int)-1, |
| 99 | #else | 101 | #else |
| 100 | #define INIT_IDS | 102 | #define INIT_IDS |
| 101 | #endif | 103 | #endif |
| @@ -154,6 +156,14 @@ extern struct task_group root_task_group; | |||
| 154 | 156 | ||
| 155 | #define INIT_TASK_COMM "swapper" | 157 | #define INIT_TASK_COMM "swapper" |
| 156 | 158 | ||
| 159 | #ifdef CONFIG_RT_MUTEXES | ||
| 160 | # define INIT_RT_MUTEXES(tsk) \ | ||
| 161 | .pi_waiters = RB_ROOT, \ | ||
| 162 | .pi_waiters_leftmost = NULL, | ||
| 163 | #else | ||
| 164 | # define INIT_RT_MUTEXES(tsk) | ||
| 165 | #endif | ||
| 166 | |||
| 157 | /* | 167 | /* |
| 158 | * INIT_TASK is used to set up the first task table, touch at | 168 | * INIT_TASK is used to set up the first task table, touch at |
| 159 | * your own risk!. Base=0, limit=0x1fffff (=2MB) | 169 | * your own risk!. Base=0, limit=0x1fffff (=2MB) |
| @@ -213,6 +223,7 @@ extern struct task_group root_task_group; | |||
| 213 | [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ | 223 | [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ |
| 214 | }, \ | 224 | }, \ |
| 215 | .thread_group = LIST_HEAD_INIT(tsk.thread_group), \ | 225 | .thread_group = LIST_HEAD_INIT(tsk.thread_group), \ |
| 226 | .thread_node = LIST_HEAD_INIT(init_signals.thread_head), \ | ||
| 216 | INIT_IDS \ | 227 | INIT_IDS \ |
| 217 | INIT_PERF_EVENTS(tsk) \ | 228 | INIT_PERF_EVENTS(tsk) \ |
| 218 | INIT_TRACE_IRQFLAGS \ | 229 | INIT_TRACE_IRQFLAGS \ |
| @@ -221,6 +232,7 @@ extern struct task_group root_task_group; | |||
| 221 | INIT_TRACE_RECURSION \ | 232 | INIT_TRACE_RECURSION \ |
| 222 | INIT_TASK_RCU_PREEMPT(tsk) \ | 233 | INIT_TASK_RCU_PREEMPT(tsk) \ |
| 223 | INIT_CPUSET_SEQ(tsk) \ | 234 | INIT_CPUSET_SEQ(tsk) \ |
| 235 | INIT_RT_MUTEXES(tsk) \ | ||
| 224 | INIT_VTIME(tsk) \ | 236 | INIT_VTIME(tsk) \ |
| 225 | } | 237 | } |
| 226 | 238 | ||
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 5d89d1b808a6..c56c350324e4 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <uapi/linux/ipv6.h> | 4 | #include <uapi/linux/ipv6.h> |
| 5 | 5 | ||
| 6 | #define ipv6_optlen(p) (((p)->hdrlen+1) << 3) | 6 | #define ipv6_optlen(p) (((p)->hdrlen+1) << 3) |
| 7 | #define ipv6_authlen(p) (((p)->hdrlen+2) << 2) | ||
| 7 | /* | 8 | /* |
| 8 | * This structure contains configuration options per IPv6 link. | 9 | * This structure contains configuration options per IPv6 link. |
| 9 | */ | 10 | */ |
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h index cac496b1e279..0ceb389dba6c 100644 --- a/include/linux/irqchip/arm-gic.h +++ b/include/linux/irqchip/arm-gic.h | |||
| @@ -17,6 +17,9 @@ | |||
| 17 | #define GIC_CPU_EOI 0x10 | 17 | #define GIC_CPU_EOI 0x10 |
| 18 | #define GIC_CPU_RUNNINGPRI 0x14 | 18 | #define GIC_CPU_RUNNINGPRI 0x14 |
| 19 | #define GIC_CPU_HIGHPRI 0x18 | 19 | #define GIC_CPU_HIGHPRI 0x18 |
| 20 | #define GIC_CPU_ALIAS_BINPOINT 0x1c | ||
| 21 | #define GIC_CPU_ACTIVEPRIO 0xd0 | ||
| 22 | #define GIC_CPU_IDENT 0xfc | ||
| 20 | 23 | ||
| 21 | #define GIC_DIST_CTRL 0x000 | 24 | #define GIC_DIST_CTRL 0x000 |
| 22 | #define GIC_DIST_CTR 0x004 | 25 | #define GIC_DIST_CTR 0x004 |
| @@ -56,6 +59,15 @@ | |||
| 56 | #define GICH_LR_ACTIVE_BIT (1 << 29) | 59 | #define GICH_LR_ACTIVE_BIT (1 << 29) |
| 57 | #define GICH_LR_EOI (1 << 19) | 60 | #define GICH_LR_EOI (1 << 19) |
| 58 | 61 | ||
| 62 | #define GICH_VMCR_CTRL_SHIFT 0 | ||
| 63 | #define GICH_VMCR_CTRL_MASK (0x21f << GICH_VMCR_CTRL_SHIFT) | ||
| 64 | #define GICH_VMCR_PRIMASK_SHIFT 27 | ||
| 65 | #define GICH_VMCR_PRIMASK_MASK (0x1f << GICH_VMCR_PRIMASK_SHIFT) | ||
| 66 | #define GICH_VMCR_BINPOINT_SHIFT 21 | ||
| 67 | #define GICH_VMCR_BINPOINT_MASK (0x7 << GICH_VMCR_BINPOINT_SHIFT) | ||
| 68 | #define GICH_VMCR_ALIAS_BINPOINT_SHIFT 18 | ||
| 69 | #define GICH_VMCR_ALIAS_BINPOINT_MASK (0x7 << GICH_VMCR_ALIAS_BINPOINT_SHIFT) | ||
| 70 | |||
| 59 | #define GICH_MISR_EOI (1 << 0) | 71 | #define GICH_MISR_EOI (1 << 0) |
| 60 | #define GICH_MISR_U (1 << 1) | 72 | #define GICH_MISR_U (1 << 1) |
| 61 | 73 | ||
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index 56fb646909dc..26e2661d3935 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h | |||
| @@ -152,6 +152,14 @@ static inline int irq_balancing_disabled(unsigned int irq) | |||
| 152 | return desc->status_use_accessors & IRQ_NO_BALANCING_MASK; | 152 | return desc->status_use_accessors & IRQ_NO_BALANCING_MASK; |
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | static inline int irq_is_percpu(unsigned int irq) | ||
| 156 | { | ||
| 157 | struct irq_desc *desc; | ||
| 158 | |||
| 159 | desc = irq_to_desc(irq); | ||
| 160 | return desc->status_use_accessors & IRQ_PER_CPU; | ||
| 161 | } | ||
| 162 | |||
| 155 | static inline void | 163 | static inline void |
| 156 | irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class) | 164 | irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class) |
| 157 | { | 165 | { |
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h index 714ba08dc092..e374e369fb2f 100644 --- a/include/linux/irqreturn.h +++ b/include/linux/irqreturn.h | |||
| @@ -14,6 +14,6 @@ enum irqreturn { | |||
| 14 | }; | 14 | }; |
| 15 | 15 | ||
| 16 | typedef enum irqreturn irqreturn_t; | 16 | typedef enum irqreturn irqreturn_t; |
| 17 | #define IRQ_RETVAL(x) ((x) != IRQ_NONE) | 17 | #define IRQ_RETVAL(x) ((x) ? IRQ_HANDLED : IRQ_NONE) |
| 18 | 18 | ||
| 19 | #endif | 19 | #endif |
diff --git a/include/linux/iscsi_ibft.h b/include/linux/iscsi_ibft.h index 82f9673c2527..605cc5c333d9 100644 --- a/include/linux/iscsi_ibft.h +++ b/include/linux/iscsi_ibft.h | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | #ifndef ISCSI_IBFT_H | 21 | #ifndef ISCSI_IBFT_H |
| 22 | #define ISCSI_IBFT_H | 22 | #define ISCSI_IBFT_H |
| 23 | 23 | ||
| 24 | #include <acpi/acpi.h> /* FIXME: inclusion should be removed */ | 24 | #include <linux/acpi.h> |
| 25 | 25 | ||
| 26 | /* | 26 | /* |
| 27 | * Logical location of iSCSI Boot Format Table. | 27 | * Logical location of iSCSI Boot Format Table. |
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index 39999775b922..5c1dfb2a9e73 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h | |||
| @@ -81,18 +81,21 @@ struct module; | |||
| 81 | #include <linux/atomic.h> | 81 | #include <linux/atomic.h> |
| 82 | #ifdef HAVE_JUMP_LABEL | 82 | #ifdef HAVE_JUMP_LABEL |
| 83 | 83 | ||
| 84 | #define JUMP_LABEL_TRUE_BRANCH 1UL | 84 | #define JUMP_LABEL_TYPE_FALSE_BRANCH 0UL |
| 85 | #define JUMP_LABEL_TYPE_TRUE_BRANCH 1UL | ||
| 86 | #define JUMP_LABEL_TYPE_MASK 1UL | ||
| 85 | 87 | ||
| 86 | static | 88 | static |
| 87 | inline struct jump_entry *jump_label_get_entries(struct static_key *key) | 89 | inline struct jump_entry *jump_label_get_entries(struct static_key *key) |
| 88 | { | 90 | { |
| 89 | return (struct jump_entry *)((unsigned long)key->entries | 91 | return (struct jump_entry *)((unsigned long)key->entries |
| 90 | & ~JUMP_LABEL_TRUE_BRANCH); | 92 | & ~JUMP_LABEL_TYPE_MASK); |
| 91 | } | 93 | } |
| 92 | 94 | ||
| 93 | static inline bool jump_label_get_branch_default(struct static_key *key) | 95 | static inline bool jump_label_get_branch_default(struct static_key *key) |
| 94 | { | 96 | { |
| 95 | if ((unsigned long)key->entries & JUMP_LABEL_TRUE_BRANCH) | 97 | if (((unsigned long)key->entries & JUMP_LABEL_TYPE_MASK) == |
| 98 | JUMP_LABEL_TYPE_TRUE_BRANCH) | ||
| 96 | return true; | 99 | return true; |
| 97 | return false; | 100 | return false; |
| 98 | } | 101 | } |
| @@ -122,10 +125,12 @@ extern void static_key_slow_inc(struct static_key *key); | |||
| 122 | extern void static_key_slow_dec(struct static_key *key); | 125 | extern void static_key_slow_dec(struct static_key *key); |
| 123 | extern void jump_label_apply_nops(struct module *mod); | 126 | extern void jump_label_apply_nops(struct module *mod); |
| 124 | 127 | ||
| 125 | #define STATIC_KEY_INIT_TRUE ((struct static_key) \ | 128 | #define STATIC_KEY_INIT_TRUE ((struct static_key) \ |
| 126 | { .enabled = ATOMIC_INIT(1), .entries = (void *)1 }) | 129 | { .enabled = ATOMIC_INIT(1), \ |
| 127 | #define STATIC_KEY_INIT_FALSE ((struct static_key) \ | 130 | .entries = (void *)JUMP_LABEL_TYPE_TRUE_BRANCH }) |
| 128 | { .enabled = ATOMIC_INIT(0), .entries = (void *)0 }) | 131 | #define STATIC_KEY_INIT_FALSE ((struct static_key) \ |
| 132 | { .enabled = ATOMIC_INIT(0), \ | ||
| 133 | .entries = (void *)JUMP_LABEL_TYPE_FALSE_BRANCH }) | ||
| 129 | 134 | ||
| 130 | #else /* !HAVE_JUMP_LABEL */ | 135 | #else /* !HAVE_JUMP_LABEL */ |
| 131 | 136 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d4e98d13eff4..f74bb581ab64 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -29,6 +29,19 @@ | |||
| 29 | #define ULLONG_MAX (~0ULL) | 29 | #define ULLONG_MAX (~0ULL) |
| 30 | #define SIZE_MAX (~(size_t)0) | 30 | #define SIZE_MAX (~(size_t)0) |
| 31 | 31 | ||
| 32 | #define U8_MAX ((u8)~0U) | ||
| 33 | #define S8_MAX ((s8)(U8_MAX>>1)) | ||
| 34 | #define S8_MIN ((s8)(-S8_MAX - 1)) | ||
| 35 | #define U16_MAX ((u16)~0U) | ||
| 36 | #define S16_MAX ((s16)(U16_MAX>>1)) | ||
| 37 | #define S16_MIN ((s16)(-S16_MAX - 1)) | ||
| 38 | #define U32_MAX ((u32)~0U) | ||
| 39 | #define S32_MAX ((s32)(U32_MAX>>1)) | ||
| 40 | #define S32_MIN ((s32)(-S32_MAX - 1)) | ||
| 41 | #define U64_MAX ((u64)~0ULL) | ||
| 42 | #define S64_MAX ((s64)(U64_MAX>>1)) | ||
| 43 | #define S64_MIN ((s64)(-S64_MAX - 1)) | ||
| 44 | |||
| 32 | #define STACK_MAGIC 0xdeadbeef | 45 | #define STACK_MAGIC 0xdeadbeef |
| 33 | 46 | ||
| 34 | #define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) | 47 | #define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) |
| @@ -193,7 +206,8 @@ extern int _cond_resched(void); | |||
| 193 | (__x < 0) ? -__x : __x; \ | 206 | (__x < 0) ? -__x : __x; \ |
| 194 | }) | 207 | }) |
| 195 | 208 | ||
| 196 | #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP) | 209 | #if defined(CONFIG_MMU) && \ |
| 210 | (defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)) | ||
| 197 | void might_fault(void); | 211 | void might_fault(void); |
| 198 | #else | 212 | #else |
| 199 | static inline void might_fault(void) { } | 213 | static inline void might_fault(void) { } |
| @@ -393,6 +407,15 @@ extern int panic_on_oops; | |||
| 393 | extern int panic_on_unrecovered_nmi; | 407 | extern int panic_on_unrecovered_nmi; |
| 394 | extern int panic_on_io_nmi; | 408 | extern int panic_on_io_nmi; |
| 395 | extern int sysctl_panic_on_stackoverflow; | 409 | extern int sysctl_panic_on_stackoverflow; |
| 410 | /* | ||
| 411 | * Only to be used by arch init code. If the user over-wrote the default | ||
| 412 | * CONFIG_PANIC_TIMEOUT, honor it. | ||
| 413 | */ | ||
| 414 | static inline void set_arch_panic_timeout(int timeout, int arch_default_timeout) | ||
| 415 | { | ||
| 416 | if (panic_timeout == arch_default_timeout) | ||
| 417 | panic_timeout = timeout; | ||
| 418 | } | ||
| 396 | extern const char *print_tainted(void); | 419 | extern const char *print_tainted(void); |
| 397 | enum lockdep_ok { | 420 | enum lockdep_ok { |
| 398 | LOCKDEP_STILL_OK, | 421 | LOCKDEP_STILL_OK, |
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h new file mode 100644 index 000000000000..5be9f0228a3b --- /dev/null +++ b/include/linux/kernfs.h | |||
| @@ -0,0 +1,376 @@ | |||
| 1 | /* | ||
| 2 | * kernfs.h - pseudo filesystem decoupled from vfs locking | ||
| 3 | * | ||
| 4 | * This file is released under the GPLv2. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __LINUX_KERNFS_H | ||
| 8 | #define __LINUX_KERNFS_H | ||
| 9 | |||
| 10 | #include <linux/kernel.h> | ||
| 11 | #include <linux/err.h> | ||
| 12 | #include <linux/list.h> | ||
| 13 | #include <linux/mutex.h> | ||
| 14 | #include <linux/idr.h> | ||
| 15 | #include <linux/lockdep.h> | ||
| 16 | #include <linux/rbtree.h> | ||
| 17 | #include <linux/atomic.h> | ||
| 18 | #include <linux/completion.h> | ||
| 19 | |||
| 20 | struct file; | ||
| 21 | struct dentry; | ||
| 22 | struct iattr; | ||
| 23 | struct seq_file; | ||
| 24 | struct vm_area_struct; | ||
| 25 | struct super_block; | ||
| 26 | struct file_system_type; | ||
| 27 | |||
| 28 | struct kernfs_open_node; | ||
| 29 | struct kernfs_iattrs; | ||
| 30 | |||
| 31 | enum kernfs_node_type { | ||
| 32 | KERNFS_DIR = 0x0001, | ||
| 33 | KERNFS_FILE = 0x0002, | ||
| 34 | KERNFS_LINK = 0x0004, | ||
| 35 | }; | ||
| 36 | |||
| 37 | #define KERNFS_TYPE_MASK 0x000f | ||
| 38 | #define KERNFS_ACTIVE_REF KERNFS_FILE | ||
| 39 | #define KERNFS_FLAG_MASK ~KERNFS_TYPE_MASK | ||
| 40 | |||
| 41 | enum kernfs_node_flag { | ||
| 42 | KERNFS_REMOVED = 0x0010, | ||
| 43 | KERNFS_NS = 0x0020, | ||
| 44 | KERNFS_HAS_SEQ_SHOW = 0x0040, | ||
| 45 | KERNFS_HAS_MMAP = 0x0080, | ||
| 46 | KERNFS_LOCKDEP = 0x0100, | ||
| 47 | KERNFS_STATIC_NAME = 0x0200, | ||
| 48 | }; | ||
| 49 | |||
| 50 | /* type-specific structures for kernfs_node union members */ | ||
| 51 | struct kernfs_elem_dir { | ||
| 52 | unsigned long subdirs; | ||
| 53 | /* children rbtree starts here and goes through kn->rb */ | ||
| 54 | struct rb_root children; | ||
| 55 | |||
| 56 | /* | ||
| 57 | * The kernfs hierarchy this directory belongs to. This fits | ||
| 58 | * better directly in kernfs_node but is here to save space. | ||
| 59 | */ | ||
| 60 | struct kernfs_root *root; | ||
| 61 | }; | ||
| 62 | |||
| 63 | struct kernfs_elem_symlink { | ||
| 64 | struct kernfs_node *target_kn; | ||
| 65 | }; | ||
| 66 | |||
| 67 | struct kernfs_elem_attr { | ||
| 68 | const struct kernfs_ops *ops; | ||
| 69 | struct kernfs_open_node *open; | ||
| 70 | loff_t size; | ||
| 71 | }; | ||
| 72 | |||
| 73 | /* | ||
| 74 | * kernfs_node - the building block of kernfs hierarchy. Each and every | ||
| 75 | * kernfs node is represented by single kernfs_node. Most fields are | ||
| 76 | * private to kernfs and shouldn't be accessed directly by kernfs users. | ||
| 77 | * | ||
| 78 | * As long as s_count reference is held, the kernfs_node itself is | ||
| 79 | * accessible. Dereferencing elem or any other outer entity requires | ||
| 80 | * active reference. | ||
| 81 | */ | ||
| 82 | struct kernfs_node { | ||
| 83 | atomic_t count; | ||
| 84 | atomic_t active; | ||
| 85 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 86 | struct lockdep_map dep_map; | ||
| 87 | #endif | ||
| 88 | /* the following two fields are published */ | ||
| 89 | struct kernfs_node *parent; | ||
| 90 | const char *name; | ||
| 91 | |||
| 92 | struct rb_node rb; | ||
| 93 | |||
| 94 | union { | ||
| 95 | struct completion *completion; | ||
| 96 | struct kernfs_node *removed_list; | ||
| 97 | } u; | ||
| 98 | |||
| 99 | const void *ns; /* namespace tag */ | ||
| 100 | unsigned int hash; /* ns + name hash */ | ||
| 101 | union { | ||
| 102 | struct kernfs_elem_dir dir; | ||
| 103 | struct kernfs_elem_symlink symlink; | ||
| 104 | struct kernfs_elem_attr attr; | ||
| 105 | }; | ||
| 106 | |||
| 107 | void *priv; | ||
| 108 | |||
| 109 | unsigned short flags; | ||
| 110 | umode_t mode; | ||
| 111 | unsigned int ino; | ||
| 112 | struct kernfs_iattrs *iattr; | ||
| 113 | }; | ||
| 114 | |||
| 115 | /* | ||
| 116 | * kernfs_dir_ops may be specified on kernfs_create_root() to support | ||
| 117 | * directory manipulation syscalls. These optional callbacks are invoked | ||
| 118 | * on the matching syscalls and can perform any kernfs operations which | ||
| 119 | * don't necessarily have to be the exact operation requested. | ||
| 120 | */ | ||
| 121 | struct kernfs_dir_ops { | ||
| 122 | int (*mkdir)(struct kernfs_node *parent, const char *name, | ||
| 123 | umode_t mode); | ||
| 124 | int (*rmdir)(struct kernfs_node *kn); | ||
| 125 | int (*rename)(struct kernfs_node *kn, struct kernfs_node *new_parent, | ||
| 126 | const char *new_name); | ||
| 127 | }; | ||
| 128 | |||
| 129 | struct kernfs_root { | ||
| 130 | /* published fields */ | ||
| 131 | struct kernfs_node *kn; | ||
| 132 | |||
| 133 | /* private fields, do not use outside kernfs proper */ | ||
| 134 | struct ida ino_ida; | ||
| 135 | struct kernfs_dir_ops *dir_ops; | ||
| 136 | }; | ||
| 137 | |||
| 138 | struct kernfs_open_file { | ||
| 139 | /* published fields */ | ||
| 140 | struct kernfs_node *kn; | ||
| 141 | struct file *file; | ||
| 142 | |||
| 143 | /* private fields, do not use outside kernfs proper */ | ||
| 144 | struct mutex mutex; | ||
| 145 | int event; | ||
| 146 | struct list_head list; | ||
| 147 | |||
| 148 | bool mmapped; | ||
| 149 | const struct vm_operations_struct *vm_ops; | ||
| 150 | }; | ||
| 151 | |||
| 152 | struct kernfs_ops { | ||
| 153 | /* | ||
| 154 | * Read is handled by either seq_file or raw_read(). | ||
| 155 | * | ||
| 156 | * If seq_show() is present, seq_file path is active. Other seq | ||
| 157 | * operations are optional and if not implemented, the behavior is | ||
| 158 | * equivalent to single_open(). @sf->private points to the | ||
| 159 | * associated kernfs_open_file. | ||
| 160 | * | ||
| 161 | * read() is bounced through kernel buffer and a read larger than | ||
| 162 | * PAGE_SIZE results in partial operation of PAGE_SIZE. | ||
| 163 | */ | ||
| 164 | int (*seq_show)(struct seq_file *sf, void *v); | ||
| 165 | |||
| 166 | void *(*seq_start)(struct seq_file *sf, loff_t *ppos); | ||
| 167 | void *(*seq_next)(struct seq_file *sf, void *v, loff_t *ppos); | ||
| 168 | void (*seq_stop)(struct seq_file *sf, void *v); | ||
| 169 | |||
| 170 | ssize_t (*read)(struct kernfs_open_file *of, char *buf, size_t bytes, | ||
| 171 | loff_t off); | ||
| 172 | |||
| 173 | /* | ||
| 174 | * write() is bounced through kernel buffer and a write larger than | ||
| 175 | * PAGE_SIZE results in partial operation of PAGE_SIZE. | ||
| 176 | */ | ||
| 177 | ssize_t (*write)(struct kernfs_open_file *of, char *buf, size_t bytes, | ||
| 178 | loff_t off); | ||
| 179 | |||
| 180 | int (*mmap)(struct kernfs_open_file *of, struct vm_area_struct *vma); | ||
| 181 | |||
| 182 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 183 | struct lock_class_key lockdep_key; | ||
| 184 | #endif | ||
| 185 | }; | ||
| 186 | |||
| 187 | #ifdef CONFIG_SYSFS | ||
| 188 | |||
| 189 | static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) | ||
| 190 | { | ||
| 191 | return kn->flags & KERNFS_TYPE_MASK; | ||
| 192 | } | ||
| 193 | |||
| 194 | /** | ||
| 195 | * kernfs_enable_ns - enable namespace under a directory | ||
| 196 | * @kn: directory of interest, should be empty | ||
| 197 | * | ||
| 198 | * This is to be called right after @kn is created to enable namespace | ||
| 199 | * under it. All children of @kn must have non-NULL namespace tags and | ||
| 200 | * only the ones which match the super_block's tag will be visible. | ||
| 201 | */ | ||
| 202 | static inline void kernfs_enable_ns(struct kernfs_node *kn) | ||
| 203 | { | ||
| 204 | WARN_ON_ONCE(kernfs_type(kn) != KERNFS_DIR); | ||
| 205 | WARN_ON_ONCE(!RB_EMPTY_ROOT(&kn->dir.children)); | ||
| 206 | kn->flags |= KERNFS_NS; | ||
| 207 | } | ||
| 208 | |||
| 209 | /** | ||
| 210 | * kernfs_ns_enabled - test whether namespace is enabled | ||
| 211 | * @kn: the node to test | ||
| 212 | * | ||
| 213 | * Test whether namespace filtering is enabled for the children of @ns. | ||
| 214 | */ | ||
| 215 | static inline bool kernfs_ns_enabled(struct kernfs_node *kn) | ||
| 216 | { | ||
| 217 | return kn->flags & KERNFS_NS; | ||
| 218 | } | ||
| 219 | |||
| 220 | struct kernfs_node *kernfs_find_and_get_ns(struct kernfs_node *parent, | ||
| 221 | const char *name, const void *ns); | ||
| 222 | void kernfs_get(struct kernfs_node *kn); | ||
| 223 | void kernfs_put(struct kernfs_node *kn); | ||
| 224 | |||
| 225 | struct kernfs_root *kernfs_create_root(struct kernfs_dir_ops *kdops, | ||
| 226 | void *priv); | ||
| 227 | void kernfs_destroy_root(struct kernfs_root *root); | ||
| 228 | |||
| 229 | struct kernfs_node *kernfs_create_dir_ns(struct kernfs_node *parent, | ||
| 230 | const char *name, umode_t mode, | ||
| 231 | void *priv, const void *ns); | ||
| 232 | struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent, | ||
| 233 | const char *name, | ||
| 234 | umode_t mode, loff_t size, | ||
| 235 | const struct kernfs_ops *ops, | ||
| 236 | void *priv, const void *ns, | ||
| 237 | bool name_is_static, | ||
| 238 | struct lock_class_key *key); | ||
| 239 | struct kernfs_node *kernfs_create_link(struct kernfs_node *parent, | ||
| 240 | const char *name, | ||
| 241 | struct kernfs_node *target); | ||
| 242 | void kernfs_remove(struct kernfs_node *kn); | ||
| 243 | int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name, | ||
| 244 | const void *ns); | ||
| 245 | int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent, | ||
| 246 | const char *new_name, const void *new_ns); | ||
| 247 | int kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr); | ||
| 248 | void kernfs_notify(struct kernfs_node *kn); | ||
| 249 | |||
| 250 | const void *kernfs_super_ns(struct super_block *sb); | ||
| 251 | struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags, | ||
| 252 | struct kernfs_root *root, const void *ns); | ||
| 253 | void kernfs_kill_sb(struct super_block *sb); | ||
| 254 | |||
| 255 | void kernfs_init(void); | ||
| 256 | |||
| 257 | #else /* CONFIG_SYSFS */ | ||
| 258 | |||
| 259 | static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) | ||
| 260 | { return 0; } /* whatever */ | ||
| 261 | |||
| 262 | static inline void kernfs_enable_ns(struct kernfs_node *kn) { } | ||
| 263 | |||
| 264 | static inline bool kernfs_ns_enabled(struct kernfs_node *kn) | ||
| 265 | { return false; } | ||
| 266 | |||
| 267 | static inline struct kernfs_node * | ||
| 268 | kernfs_find_and_get_ns(struct kernfs_node *parent, const char *name, | ||
| 269 | const void *ns) | ||
| 270 | { return NULL; } | ||
| 271 | |||
| 272 | static inline void kernfs_get(struct kernfs_node *kn) { } | ||
| 273 | static inline void kernfs_put(struct kernfs_node *kn) { } | ||
| 274 | |||
| 275 | static inline struct kernfs_root * | ||
| 276 | kernfs_create_root(struct kernfs_dir_ops *kdops, void *priv) | ||
| 277 | { return ERR_PTR(-ENOSYS); } | ||
| 278 | |||
| 279 | static inline void kernfs_destroy_root(struct kernfs_root *root) { } | ||
| 280 | |||
| 281 | static inline struct kernfs_node * | ||
| 282 | kernfs_create_dir_ns(struct kernfs_node *parent, const char *name, | ||
| 283 | umode_t mode, void *priv, const void *ns) | ||
| 284 | { return ERR_PTR(-ENOSYS); } | ||
| 285 | |||
| 286 | static inline struct kernfs_node * | ||
| 287 | __kernfs_create_file(struct kernfs_node *parent, const char *name, | ||
| 288 | umode_t mode, loff_t size, const struct kernfs_ops *ops, | ||
| 289 | void *priv, const void *ns, bool name_is_static, | ||
| 290 | struct lock_class_key *key) | ||
| 291 | { return ERR_PTR(-ENOSYS); } | ||
| 292 | |||
| 293 | static inline struct kernfs_node * | ||
| 294 | kernfs_create_link(struct kernfs_node *parent, const char *name, | ||
| 295 | struct kernfs_node *target) | ||
| 296 | { return ERR_PTR(-ENOSYS); } | ||
| 297 | |||
| 298 | static inline void kernfs_remove(struct kernfs_node *kn) { } | ||
| 299 | |||
| 300 | static inline int kernfs_remove_by_name_ns(struct kernfs_node *kn, | ||
| 301 | const char *name, const void *ns) | ||
| 302 | { return -ENOSYS; } | ||
| 303 | |||
| 304 | static inline int kernfs_rename_ns(struct kernfs_node *kn, | ||
| 305 | struct kernfs_node *new_parent, | ||
| 306 | const char *new_name, const void *new_ns) | ||
| 307 | { return -ENOSYS; } | ||
| 308 | |||
| 309 | static inline int kernfs_setattr(struct kernfs_node *kn, | ||
| 310 | const struct iattr *iattr) | ||
| 311 | { return -ENOSYS; } | ||
| 312 | |||
| 313 | static inline void kernfs_notify(struct kernfs_node *kn) { } | ||
| 314 | |||
| 315 | static inline const void *kernfs_super_ns(struct super_block *sb) | ||
| 316 | { return NULL; } | ||
| 317 | |||
| 318 | static inline struct dentry * | ||
| 319 | kernfs_mount_ns(struct file_system_type *fs_type, int flags, | ||
| 320 | struct kernfs_root *root, const void *ns) | ||
| 321 | { return ERR_PTR(-ENOSYS); } | ||
| 322 | |||
| 323 | static inline void kernfs_kill_sb(struct super_block *sb) { } | ||
| 324 | |||
| 325 | static inline void kernfs_init(void) { } | ||
| 326 | |||
| 327 | #endif /* CONFIG_SYSFS */ | ||
| 328 | |||
| 329 | static inline struct kernfs_node * | ||
| 330 | kernfs_find_and_get(struct kernfs_node *kn, const char *name) | ||
| 331 | { | ||
| 332 | return kernfs_find_and_get_ns(kn, name, NULL); | ||
| 333 | } | ||
| 334 | |||
| 335 | static inline struct kernfs_node * | ||
| 336 | kernfs_create_dir(struct kernfs_node *parent, const char *name, umode_t mode, | ||
| 337 | void *priv) | ||
| 338 | { | ||
| 339 | return kernfs_create_dir_ns(parent, name, mode, priv, NULL); | ||
| 340 | } | ||
| 341 | |||
| 342 | static inline struct kernfs_node * | ||
| 343 | kernfs_create_file_ns(struct kernfs_node *parent, const char *name, | ||
| 344 | umode_t mode, loff_t size, const struct kernfs_ops *ops, | ||
| 345 | void *priv, const void *ns) | ||
| 346 | { | ||
| 347 | struct lock_class_key *key = NULL; | ||
| 348 | |||
| 349 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 350 | key = (struct lock_class_key *)&ops->lockdep_key; | ||
| 351 | #endif | ||
| 352 | return __kernfs_create_file(parent, name, mode, size, ops, priv, ns, | ||
| 353 | false, key); | ||
| 354 | } | ||
| 355 | |||
| 356 | static inline struct kernfs_node * | ||
| 357 | kernfs_create_file(struct kernfs_node *parent, const char *name, umode_t mode, | ||
| 358 | loff_t size, const struct kernfs_ops *ops, void *priv) | ||
| 359 | { | ||
| 360 | return kernfs_create_file_ns(parent, name, mode, size, ops, priv, NULL); | ||
| 361 | } | ||
| 362 | |||
| 363 | static inline int kernfs_remove_by_name(struct kernfs_node *parent, | ||
| 364 | const char *name) | ||
| 365 | { | ||
| 366 | return kernfs_remove_by_name_ns(parent, name, NULL); | ||
| 367 | } | ||
| 368 | |||
| 369 | static inline struct dentry * | ||
| 370 | kernfs_mount(struct file_system_type *fs_type, int flags, | ||
| 371 | struct kernfs_root *root) | ||
| 372 | { | ||
| 373 | return kernfs_mount_ns(fs_type, flags, root, NULL); | ||
| 374 | } | ||
| 375 | |||
| 376 | #endif /* __LINUX_KERNFS_H */ | ||
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d78d28a733b1..6d4066cdb5b5 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
| @@ -170,6 +170,7 @@ unsigned long paddr_vmcoreinfo_note(void); | |||
| 170 | 170 | ||
| 171 | extern struct kimage *kexec_image; | 171 | extern struct kimage *kexec_image; |
| 172 | extern struct kimage *kexec_crash_image; | 172 | extern struct kimage *kexec_crash_image; |
| 173 | extern int kexec_load_disabled; | ||
| 173 | 174 | ||
| 174 | #ifndef kexec_flush_icache_page | 175 | #ifndef kexec_flush_icache_page |
| 175 | #define kexec_flush_icache_page(page) | 176 | #define kexec_flush_icache_page(page) |
| @@ -198,6 +199,9 @@ extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; | |||
| 198 | extern size_t vmcoreinfo_size; | 199 | extern size_t vmcoreinfo_size; |
| 199 | extern size_t vmcoreinfo_max_size; | 200 | extern size_t vmcoreinfo_max_size; |
| 200 | 201 | ||
| 202 | /* flag to track if kexec reboot is in progress */ | ||
| 203 | extern bool kexec_in_progress; | ||
| 204 | |||
| 201 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, | 205 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, |
| 202 | unsigned long long *crash_size, unsigned long long *crash_base); | 206 | unsigned long long *crash_size, unsigned long long *crash_base); |
| 203 | int parse_crashkernel_high(char *cmdline, unsigned long long system_ram, | 207 | int parse_crashkernel_high(char *cmdline, unsigned long long system_ram, |
diff --git a/include/linux/kobj_completion.h b/include/linux/kobj_completion.h deleted file mode 100644 index a428f6436063..000000000000 --- a/include/linux/kobj_completion.h +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | #ifndef _KOBJ_COMPLETION_H_ | ||
| 2 | #define _KOBJ_COMPLETION_H_ | ||
| 3 | |||
| 4 | #include <linux/kobject.h> | ||
| 5 | #include <linux/completion.h> | ||
| 6 | |||
| 7 | struct kobj_completion { | ||
| 8 | struct kobject kc_kobj; | ||
| 9 | struct completion kc_unregister; | ||
| 10 | }; | ||
| 11 | |||
| 12 | #define kobj_to_kobj_completion(kobj) \ | ||
| 13 | container_of(kobj, struct kobj_completion, kc_kobj) | ||
| 14 | |||
| 15 | void kobj_completion_init(struct kobj_completion *kc, struct kobj_type *ktype); | ||
| 16 | void kobj_completion_release(struct kobject *kobj); | ||
| 17 | void kobj_completion_del_and_wait(struct kobj_completion *kc); | ||
| 18 | #endif /* _KOBJ_COMPLETION_H_ */ | ||
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index e7ba650086ce..926afb6f6b5f 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
| @@ -64,7 +64,7 @@ struct kobject { | |||
| 64 | struct kobject *parent; | 64 | struct kobject *parent; |
| 65 | struct kset *kset; | 65 | struct kset *kset; |
| 66 | struct kobj_type *ktype; | 66 | struct kobj_type *ktype; |
| 67 | struct sysfs_dirent *sd; | 67 | struct kernfs_node *sd; |
| 68 | struct kref kref; | 68 | struct kref kref; |
| 69 | #ifdef CONFIG_DEBUG_KOBJECT_RELEASE | 69 | #ifdef CONFIG_DEBUG_KOBJECT_RELEASE |
| 70 | struct delayed_work release; | 70 | struct delayed_work release; |
diff --git a/include/linux/ksm.h b/include/linux/ksm.h index 45c9b6a17bcb..3be6bb18562d 100644 --- a/include/linux/ksm.h +++ b/include/linux/ksm.h | |||
| @@ -73,11 +73,7 @@ static inline void set_page_stable_node(struct page *page, | |||
| 73 | struct page *ksm_might_need_to_copy(struct page *page, | 73 | struct page *ksm_might_need_to_copy(struct page *page, |
| 74 | struct vm_area_struct *vma, unsigned long address); | 74 | struct vm_area_struct *vma, unsigned long address); |
| 75 | 75 | ||
| 76 | int page_referenced_ksm(struct page *page, | 76 | int rmap_walk_ksm(struct page *page, struct rmap_walk_control *rwc); |
| 77 | struct mem_cgroup *memcg, unsigned long *vm_flags); | ||
| 78 | int try_to_unmap_ksm(struct page *page, enum ttu_flags flags); | ||
| 79 | int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page *, | ||
| 80 | struct vm_area_struct *, unsigned long, void *), void *arg); | ||
| 81 | void ksm_migrate_page(struct page *newpage, struct page *oldpage); | 77 | void ksm_migrate_page(struct page *newpage, struct page *oldpage); |
| 82 | 78 | ||
| 83 | #else /* !CONFIG_KSM */ | 79 | #else /* !CONFIG_KSM */ |
| @@ -115,13 +111,8 @@ static inline int page_referenced_ksm(struct page *page, | |||
| 115 | return 0; | 111 | return 0; |
| 116 | } | 112 | } |
| 117 | 113 | ||
| 118 | static inline int try_to_unmap_ksm(struct page *page, enum ttu_flags flags) | 114 | static inline int rmap_walk_ksm(struct page *page, |
| 119 | { | 115 | struct rmap_walk_control *rwc) |
| 120 | return 0; | ||
| 121 | } | ||
| 122 | |||
| 123 | static inline int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page*, | ||
| 124 | struct vm_area_struct *, unsigned long, void *), void *arg) | ||
| 125 | { | 116 | { |
| 126 | return 0; | 117 | return 0; |
| 127 | } | 118 | } |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 9523d2ad7535..b8e9a43e501a 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -172,8 +172,6 @@ int kvm_io_bus_write_cookie(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, | |||
| 172 | int len, const void *val, long cookie); | 172 | int len, const void *val, long cookie); |
| 173 | int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len, | 173 | int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len, |
| 174 | void *val); | 174 | void *val); |
| 175 | int kvm_io_bus_read_cookie(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, | ||
| 176 | int len, void *val, long cookie); | ||
| 177 | int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, | 175 | int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, |
| 178 | int len, struct kvm_io_device *dev); | 176 | int len, struct kvm_io_device *dev); |
| 179 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, | 177 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, |
| @@ -463,8 +461,6 @@ void kvm_exit(void); | |||
| 463 | 461 | ||
| 464 | void kvm_get_kvm(struct kvm *kvm); | 462 | void kvm_get_kvm(struct kvm *kvm); |
| 465 | void kvm_put_kvm(struct kvm *kvm); | 463 | void kvm_put_kvm(struct kvm *kvm); |
| 466 | void update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new, | ||
| 467 | u64 last_generation); | ||
| 468 | 464 | ||
| 469 | static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) | 465 | static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) |
| 470 | { | 466 | { |
| @@ -537,7 +533,6 @@ unsigned long gfn_to_hva_prot(struct kvm *kvm, gfn_t gfn, bool *writable); | |||
| 537 | unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn); | 533 | unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn); |
| 538 | void kvm_release_page_clean(struct page *page); | 534 | void kvm_release_page_clean(struct page *page); |
| 539 | void kvm_release_page_dirty(struct page *page); | 535 | void kvm_release_page_dirty(struct page *page); |
| 540 | void kvm_set_page_dirty(struct page *page); | ||
| 541 | void kvm_set_page_accessed(struct page *page); | 536 | void kvm_set_page_accessed(struct page *page); |
| 542 | 537 | ||
| 543 | pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn); | 538 | pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn); |
| @@ -549,7 +544,6 @@ pfn_t gfn_to_pfn_prot(struct kvm *kvm, gfn_t gfn, bool write_fault, | |||
| 549 | pfn_t gfn_to_pfn_memslot(struct kvm_memory_slot *slot, gfn_t gfn); | 544 | pfn_t gfn_to_pfn_memslot(struct kvm_memory_slot *slot, gfn_t gfn); |
| 550 | pfn_t gfn_to_pfn_memslot_atomic(struct kvm_memory_slot *slot, gfn_t gfn); | 545 | pfn_t gfn_to_pfn_memslot_atomic(struct kvm_memory_slot *slot, gfn_t gfn); |
| 551 | 546 | ||
| 552 | void kvm_release_pfn_dirty(pfn_t pfn); | ||
| 553 | void kvm_release_pfn_clean(pfn_t pfn); | 547 | void kvm_release_pfn_clean(pfn_t pfn); |
| 554 | void kvm_set_pfn_dirty(pfn_t pfn); | 548 | void kvm_set_pfn_dirty(pfn_t pfn); |
| 555 | void kvm_set_pfn_accessed(pfn_t pfn); | 549 | void kvm_set_pfn_accessed(pfn_t pfn); |
| @@ -576,14 +570,11 @@ struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); | |||
| 576 | int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); | 570 | int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); |
| 577 | unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn); | 571 | unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn); |
| 578 | void mark_page_dirty(struct kvm *kvm, gfn_t gfn); | 572 | void mark_page_dirty(struct kvm *kvm, gfn_t gfn); |
| 579 | void mark_page_dirty_in_slot(struct kvm *kvm, struct kvm_memory_slot *memslot, | ||
| 580 | gfn_t gfn); | ||
| 581 | 573 | ||
| 582 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); | 574 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); |
| 583 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); | 575 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); |
| 584 | bool kvm_vcpu_yield_to(struct kvm_vcpu *target); | 576 | bool kvm_vcpu_yield_to(struct kvm_vcpu *target); |
| 585 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); | 577 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); |
| 586 | void kvm_resched(struct kvm_vcpu *vcpu); | ||
| 587 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); | 578 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); |
| 588 | void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); | 579 | void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); |
| 589 | 580 | ||
| @@ -605,8 +596,6 @@ int kvm_get_dirty_log(struct kvm *kvm, | |||
| 605 | int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, | 596 | int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, |
| 606 | struct kvm_dirty_log *log); | 597 | struct kvm_dirty_log *log); |
| 607 | 598 | ||
| 608 | int kvm_vm_ioctl_set_memory_region(struct kvm *kvm, | ||
| 609 | struct kvm_userspace_memory_region *mem); | ||
| 610 | int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level, | 599 | int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level, |
| 611 | bool line_status); | 600 | bool line_status); |
| 612 | long kvm_arch_vm_ioctl(struct file *filp, | 601 | long kvm_arch_vm_ioctl(struct file *filp, |
| @@ -654,8 +643,6 @@ void kvm_arch_check_processor_compat(void *rtn); | |||
| 654 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); | 643 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); |
| 655 | int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu); | 644 | int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu); |
| 656 | 645 | ||
| 657 | void kvm_free_physmem(struct kvm *kvm); | ||
| 658 | |||
| 659 | void *kvm_kvzalloc(unsigned long size); | 646 | void *kvm_kvzalloc(unsigned long size); |
| 660 | void kvm_kvfree(const void *addr); | 647 | void kvm_kvfree(const void *addr); |
| 661 | 648 | ||
| @@ -1076,6 +1063,7 @@ struct kvm_device *kvm_device_from_filp(struct file *filp); | |||
| 1076 | extern struct kvm_device_ops kvm_mpic_ops; | 1063 | extern struct kvm_device_ops kvm_mpic_ops; |
| 1077 | extern struct kvm_device_ops kvm_xics_ops; | 1064 | extern struct kvm_device_ops kvm_xics_ops; |
| 1078 | extern struct kvm_device_ops kvm_vfio_ops; | 1065 | extern struct kvm_device_ops kvm_vfio_ops; |
| 1066 | extern struct kvm_device_ops kvm_arm_vgic_v2_ops; | ||
| 1079 | 1067 | ||
| 1080 | #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT | 1068 | #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT |
| 1081 | 1069 | ||
| @@ -1097,12 +1085,6 @@ static inline void kvm_vcpu_set_in_spin_loop(struct kvm_vcpu *vcpu, bool val) | |||
| 1097 | static inline void kvm_vcpu_set_dy_eligible(struct kvm_vcpu *vcpu, bool val) | 1085 | static inline void kvm_vcpu_set_dy_eligible(struct kvm_vcpu *vcpu, bool val) |
| 1098 | { | 1086 | { |
| 1099 | } | 1087 | } |
| 1100 | |||
| 1101 | static inline bool kvm_vcpu_eligible_for_directed_yield(struct kvm_vcpu *vcpu) | ||
| 1102 | { | ||
| 1103 | return true; | ||
| 1104 | } | ||
| 1105 | |||
| 1106 | #endif /* CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT */ | 1088 | #endif /* CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT */ |
| 1107 | #endif | 1089 | #endif |
| 1108 | 1090 | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index 0e23c26485f4..bec6dbe939a0 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -418,6 +418,9 @@ enum { | |||
| 418 | ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ | 418 | ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ |
| 419 | ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ | 419 | ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ |
| 420 | ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */ | 420 | ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */ |
| 421 | ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */ | ||
| 422 | ATA_HORKAGE_NOLPM = (1 << 20), /* don't use LPM */ | ||
| 423 | ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */ | ||
| 421 | 424 | ||
| 422 | /* DMA mask for user DMA control: User visible values; DO NOT | 425 | /* DMA mask for user DMA control: User visible values; DO NOT |
| 423 | renumber */ | 426 | renumber */ |
diff --git a/include/linux/lockref.h b/include/linux/lockref.h index c8929c3832db..4bfde0e99ed5 100644 --- a/include/linux/lockref.h +++ b/include/linux/lockref.h | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | #define USE_CMPXCHG_LOCKREF \ | 20 | #define USE_CMPXCHG_LOCKREF \ |
| 21 | (IS_ENABLED(CONFIG_ARCH_USE_CMPXCHG_LOCKREF) && \ | 21 | (IS_ENABLED(CONFIG_ARCH_USE_CMPXCHG_LOCKREF) && \ |
| 22 | IS_ENABLED(CONFIG_SMP) && !BLOATED_SPINLOCKS) | 22 | IS_ENABLED(CONFIG_SMP) && SPINLOCK_SIZE <= 4) |
| 23 | 23 | ||
| 24 | struct lockref { | 24 | struct lockref { |
| 25 | union { | 25 | union { |
diff --git a/include/linux/math64.h b/include/linux/math64.h index 69ed5f5e9f6e..c45c089bfdac 100644 --- a/include/linux/math64.h +++ b/include/linux/math64.h | |||
| @@ -133,4 +133,34 @@ __iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder) | |||
| 133 | return ret; | 133 | return ret; |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | #if defined(CONFIG_ARCH_SUPPORTS_INT128) && defined(__SIZEOF_INT128__) | ||
| 137 | |||
| 138 | #ifndef mul_u64_u32_shr | ||
| 139 | static inline u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift) | ||
| 140 | { | ||
| 141 | return (u64)(((unsigned __int128)a * mul) >> shift); | ||
| 142 | } | ||
| 143 | #endif /* mul_u64_u32_shr */ | ||
| 144 | |||
| 145 | #else | ||
| 146 | |||
| 147 | #ifndef mul_u64_u32_shr | ||
| 148 | static inline u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift) | ||
| 149 | { | ||
| 150 | u32 ah, al; | ||
| 151 | u64 ret; | ||
| 152 | |||
| 153 | al = a; | ||
| 154 | ah = a >> 32; | ||
| 155 | |||
| 156 | ret = ((u64)al * mul) >> shift; | ||
| 157 | if (ah) | ||
| 158 | ret += ((u64)ah * mul) << (32 - shift); | ||
| 159 | |||
| 160 | return ret; | ||
| 161 | } | ||
| 162 | #endif /* mul_u64_u32_shr */ | ||
| 163 | |||
| 164 | #endif | ||
| 165 | |||
| 136 | #endif /* _LINUX_MATH64_H */ | 166 | #endif /* _LINUX_MATH64_H */ |
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 77c60e52939d..1ef66360f0b0 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
| @@ -19,9 +19,13 @@ | |||
| 19 | 19 | ||
| 20 | #define INIT_MEMBLOCK_REGIONS 128 | 20 | #define INIT_MEMBLOCK_REGIONS 128 |
| 21 | 21 | ||
| 22 | /* Definition of memblock flags. */ | ||
| 23 | #define MEMBLOCK_HOTPLUG 0x1 /* hotpluggable region */ | ||
| 24 | |||
| 22 | struct memblock_region { | 25 | struct memblock_region { |
| 23 | phys_addr_t base; | 26 | phys_addr_t base; |
| 24 | phys_addr_t size; | 27 | phys_addr_t size; |
| 28 | unsigned long flags; | ||
| 25 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 29 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
| 26 | int nid; | 30 | int nid; |
| 27 | #endif | 31 | #endif |
| @@ -43,15 +47,21 @@ struct memblock { | |||
| 43 | 47 | ||
| 44 | extern struct memblock memblock; | 48 | extern struct memblock memblock; |
| 45 | extern int memblock_debug; | 49 | extern int memblock_debug; |
| 50 | #ifdef CONFIG_MOVABLE_NODE | ||
| 51 | /* If movable_node boot option specified */ | ||
| 52 | extern bool movable_node_enabled; | ||
| 53 | #endif /* CONFIG_MOVABLE_NODE */ | ||
| 46 | 54 | ||
| 47 | #define memblock_dbg(fmt, ...) \ | 55 | #define memblock_dbg(fmt, ...) \ |
| 48 | if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 56 | if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
| 49 | 57 | ||
| 50 | phys_addr_t memblock_find_in_range_node(phys_addr_t start, phys_addr_t end, | 58 | phys_addr_t memblock_find_in_range_node(phys_addr_t size, phys_addr_t align, |
| 51 | phys_addr_t size, phys_addr_t align, int nid); | 59 | phys_addr_t start, phys_addr_t end, |
| 60 | int nid); | ||
| 52 | phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end, | 61 | phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end, |
| 53 | phys_addr_t size, phys_addr_t align); | 62 | phys_addr_t size, phys_addr_t align); |
| 54 | phys_addr_t get_allocated_memblock_reserved_regions_info(phys_addr_t *addr); | 63 | phys_addr_t get_allocated_memblock_reserved_regions_info(phys_addr_t *addr); |
| 64 | phys_addr_t get_allocated_memblock_memory_regions_info(phys_addr_t *addr); | ||
| 55 | void memblock_allow_resize(void); | 65 | void memblock_allow_resize(void); |
| 56 | int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid); | 66 | int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid); |
| 57 | int memblock_add(phys_addr_t base, phys_addr_t size); | 67 | int memblock_add(phys_addr_t base, phys_addr_t size); |
| @@ -59,6 +69,28 @@ int memblock_remove(phys_addr_t base, phys_addr_t size); | |||
| 59 | int memblock_free(phys_addr_t base, phys_addr_t size); | 69 | int memblock_free(phys_addr_t base, phys_addr_t size); |
| 60 | int memblock_reserve(phys_addr_t base, phys_addr_t size); | 70 | int memblock_reserve(phys_addr_t base, phys_addr_t size); |
| 61 | void memblock_trim_memory(phys_addr_t align); | 71 | void memblock_trim_memory(phys_addr_t align); |
| 72 | int memblock_mark_hotplug(phys_addr_t base, phys_addr_t size); | ||
| 73 | int memblock_clear_hotplug(phys_addr_t base, phys_addr_t size); | ||
| 74 | #ifdef CONFIG_MOVABLE_NODE | ||
| 75 | static inline bool memblock_is_hotpluggable(struct memblock_region *m) | ||
| 76 | { | ||
| 77 | return m->flags & MEMBLOCK_HOTPLUG; | ||
| 78 | } | ||
| 79 | |||
| 80 | static inline bool movable_node_is_enabled(void) | ||
| 81 | { | ||
| 82 | return movable_node_enabled; | ||
| 83 | } | ||
| 84 | #else | ||
| 85 | static inline bool memblock_is_hotpluggable(struct memblock_region *m) | ||
| 86 | { | ||
| 87 | return false; | ||
| 88 | } | ||
| 89 | static inline bool movable_node_is_enabled(void) | ||
| 90 | { | ||
| 91 | return false; | ||
| 92 | } | ||
| 93 | #endif | ||
| 62 | 94 | ||
| 63 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 95 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
| 64 | int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn, | 96 | int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn, |
| @@ -87,7 +119,7 @@ void __next_free_mem_range(u64 *idx, int nid, phys_addr_t *out_start, | |||
| 87 | /** | 119 | /** |
| 88 | * for_each_free_mem_range - iterate through free memblock areas | 120 | * for_each_free_mem_range - iterate through free memblock areas |
| 89 | * @i: u64 used as loop variable | 121 | * @i: u64 used as loop variable |
| 90 | * @nid: node selector, %MAX_NUMNODES for all nodes | 122 | * @nid: node selector, %NUMA_NO_NODE for all nodes |
| 91 | * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL | 123 | * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL |
| 92 | * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL | 124 | * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL |
| 93 | * @p_nid: ptr to int for nid of the range, can be %NULL | 125 | * @p_nid: ptr to int for nid of the range, can be %NULL |
| @@ -107,7 +139,7 @@ void __next_free_mem_range_rev(u64 *idx, int nid, phys_addr_t *out_start, | |||
| 107 | /** | 139 | /** |
| 108 | * for_each_free_mem_range_reverse - rev-iterate through free memblock areas | 140 | * for_each_free_mem_range_reverse - rev-iterate through free memblock areas |
| 109 | * @i: u64 used as loop variable | 141 | * @i: u64 used as loop variable |
| 110 | * @nid: node selector, %MAX_NUMNODES for all nodes | 142 | * @nid: node selector, %NUMA_NO_NODE for all nodes |
| 111 | * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL | 143 | * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL |
| 112 | * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL | 144 | * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL |
| 113 | * @p_nid: ptr to int for nid of the range, can be %NULL | 145 | * @p_nid: ptr to int for nid of the range, can be %NULL |
| @@ -121,8 +153,21 @@ void __next_free_mem_range_rev(u64 *idx, int nid, phys_addr_t *out_start, | |||
| 121 | i != (u64)ULLONG_MAX; \ | 153 | i != (u64)ULLONG_MAX; \ |
| 122 | __next_free_mem_range_rev(&i, nid, p_start, p_end, p_nid)) | 154 | __next_free_mem_range_rev(&i, nid, p_start, p_end, p_nid)) |
| 123 | 155 | ||
| 156 | static inline void memblock_set_region_flags(struct memblock_region *r, | ||
| 157 | unsigned long flags) | ||
| 158 | { | ||
| 159 | r->flags |= flags; | ||
| 160 | } | ||
| 161 | |||
| 162 | static inline void memblock_clear_region_flags(struct memblock_region *r, | ||
| 163 | unsigned long flags) | ||
| 164 | { | ||
| 165 | r->flags &= ~flags; | ||
| 166 | } | ||
| 167 | |||
| 124 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 168 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
| 125 | int memblock_set_node(phys_addr_t base, phys_addr_t size, int nid); | 169 | int memblock_set_node(phys_addr_t base, phys_addr_t size, |
| 170 | struct memblock_type *type, int nid); | ||
| 126 | 171 | ||
| 127 | static inline void memblock_set_region_node(struct memblock_region *r, int nid) | 172 | static inline void memblock_set_region_node(struct memblock_region *r, int nid) |
| 128 | { | 173 | { |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index b3e7a667e03c..abd0113b6620 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
| @@ -497,10 +497,11 @@ void __memcg_kmem_commit_charge(struct page *page, | |||
| 497 | void __memcg_kmem_uncharge_pages(struct page *page, int order); | 497 | void __memcg_kmem_uncharge_pages(struct page *page, int order); |
| 498 | 498 | ||
| 499 | int memcg_cache_id(struct mem_cgroup *memcg); | 499 | int memcg_cache_id(struct mem_cgroup *memcg); |
| 500 | int memcg_register_cache(struct mem_cgroup *memcg, struct kmem_cache *s, | 500 | int memcg_alloc_cache_params(struct mem_cgroup *memcg, struct kmem_cache *s, |
| 501 | struct kmem_cache *root_cache); | 501 | struct kmem_cache *root_cache); |
| 502 | void memcg_release_cache(struct kmem_cache *cachep); | 502 | void memcg_free_cache_params(struct kmem_cache *s); |
| 503 | void memcg_cache_list_add(struct mem_cgroup *memcg, struct kmem_cache *cachep); | 503 | void memcg_register_cache(struct kmem_cache *s); |
| 504 | void memcg_unregister_cache(struct kmem_cache *s); | ||
| 504 | 505 | ||
| 505 | int memcg_update_cache_size(struct kmem_cache *s, int num_groups); | 506 | int memcg_update_cache_size(struct kmem_cache *s, int num_groups); |
| 506 | void memcg_update_array_size(int num_groups); | 507 | void memcg_update_array_size(int num_groups); |
| @@ -640,19 +641,21 @@ static inline int memcg_cache_id(struct mem_cgroup *memcg) | |||
| 640 | return -1; | 641 | return -1; |
| 641 | } | 642 | } |
| 642 | 643 | ||
| 643 | static inline int | 644 | static inline int memcg_alloc_cache_params(struct mem_cgroup *memcg, |
| 644 | memcg_register_cache(struct mem_cgroup *memcg, struct kmem_cache *s, | 645 | struct kmem_cache *s, struct kmem_cache *root_cache) |
| 645 | struct kmem_cache *root_cache) | ||
| 646 | { | 646 | { |
| 647 | return 0; | 647 | return 0; |
| 648 | } | 648 | } |
| 649 | 649 | ||
| 650 | static inline void memcg_release_cache(struct kmem_cache *cachep) | 650 | static inline void memcg_free_cache_params(struct kmem_cache *s) |
| 651 | { | ||
| 652 | } | ||
| 653 | |||
| 654 | static inline void memcg_register_cache(struct kmem_cache *s) | ||
| 651 | { | 655 | { |
| 652 | } | 656 | } |
| 653 | 657 | ||
| 654 | static inline void memcg_cache_list_add(struct mem_cgroup *memcg, | 658 | static inline void memcg_unregister_cache(struct kmem_cache *s) |
| 655 | struct kmem_cache *s) | ||
| 656 | { | 659 | { |
| 657 | } | 660 | } |
| 658 | 661 | ||
diff --git a/include/linux/memory.h b/include/linux/memory.h index 9a6bbf76452d..bb7384e3c3d8 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
| @@ -35,6 +35,7 @@ struct memory_block { | |||
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | int arch_get_memory_phys_device(unsigned long start_pfn); | 37 | int arch_get_memory_phys_device(unsigned long start_pfn); |
| 38 | unsigned long __weak memory_block_size_bytes(void); | ||
| 38 | 39 | ||
| 39 | /* These states are exposed to userspace as text strings in sysfs */ | 40 | /* These states are exposed to userspace as text strings in sysfs */ |
| 40 | #define MEM_ONLINE (1<<0) /* exposed to userspace */ | 41 | #define MEM_ONLINE (1<<0) /* exposed to userspace */ |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 9fe426b30a41..5f1ea756aace 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
| @@ -211,20 +211,8 @@ static inline void mpol_get(struct mempolicy *pol) | |||
| 211 | { | 211 | { |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | static inline struct mempolicy *mpol_dup(struct mempolicy *old) | ||
| 215 | { | ||
| 216 | return NULL; | ||
| 217 | } | ||
| 218 | |||
| 219 | struct shared_policy {}; | 214 | struct shared_policy {}; |
| 220 | 215 | ||
| 221 | static inline int mpol_set_shared_policy(struct shared_policy *info, | ||
| 222 | struct vm_area_struct *vma, | ||
| 223 | struct mempolicy *new) | ||
| 224 | { | ||
| 225 | return -EINVAL; | ||
| 226 | } | ||
| 227 | |||
| 228 | static inline void mpol_shared_policy_init(struct shared_policy *sp, | 216 | static inline void mpol_shared_policy_init(struct shared_policy *sp, |
| 229 | struct mempolicy *mpol) | 217 | struct mempolicy *mpol) |
| 230 | { | 218 | { |
| @@ -234,12 +222,6 @@ static inline void mpol_free_shared_policy(struct shared_policy *p) | |||
| 234 | { | 222 | { |
| 235 | } | 223 | } |
| 236 | 224 | ||
| 237 | static inline struct mempolicy * | ||
| 238 | mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx) | ||
| 239 | { | ||
| 240 | return NULL; | ||
| 241 | } | ||
| 242 | |||
| 243 | #define vma_policy(vma) NULL | 225 | #define vma_policy(vma) NULL |
| 244 | 226 | ||
| 245 | static inline int | 227 | static inline int |
| @@ -266,10 +248,6 @@ static inline void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new) | |||
| 266 | { | 248 | { |
| 267 | } | 249 | } |
| 268 | 250 | ||
| 269 | static inline void mpol_fix_fork_child_flag(struct task_struct *p) | ||
| 270 | { | ||
| 271 | } | ||
| 272 | |||
| 273 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, | 251 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, |
| 274 | unsigned long addr, gfp_t gfp_flags, | 252 | unsigned long addr, gfp_t gfp_flags, |
| 275 | struct mempolicy **mpol, nodemask_t **nodemask) | 253 | struct mempolicy **mpol, nodemask_t **nodemask) |
| @@ -284,12 +262,6 @@ static inline bool init_nodemask_of_mempolicy(nodemask_t *m) | |||
| 284 | return false; | 262 | return false; |
| 285 | } | 263 | } |
| 286 | 264 | ||
| 287 | static inline bool mempolicy_nodemask_intersects(struct task_struct *tsk, | ||
| 288 | const nodemask_t *mask) | ||
| 289 | { | ||
| 290 | return false; | ||
| 291 | } | ||
| 292 | |||
| 293 | static inline int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, | 265 | static inline int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, |
| 294 | const nodemask_t *to, int flags) | 266 | const nodemask_t *to, int flags) |
| 295 | { | 267 | { |
| @@ -307,10 +279,6 @@ static inline int mpol_parse_str(char *str, struct mempolicy **mpol) | |||
| 307 | } | 279 | } |
| 308 | #endif | 280 | #endif |
| 309 | 281 | ||
| 310 | static inline void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol) | ||
| 311 | { | ||
| 312 | } | ||
| 313 | |||
| 314 | static inline int mpol_misplaced(struct page *page, struct vm_area_struct *vma, | 282 | static inline int mpol_misplaced(struct page *page, struct vm_area_struct *vma, |
| 315 | unsigned long address) | 283 | unsigned long address) |
| 316 | { | 284 | { |
diff --git a/include/linux/mfd/abx500/ab8500-gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h deleted file mode 100644 index 172b2f201ae0..000000000000 --- a/include/linux/mfd/abx500/ab8500-gpio.h +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright ST-Ericsson 2010. | ||
| 3 | * | ||
| 4 | * Author: Bibek Basu <bibek.basu@stericsson.com> | ||
| 5 | * Licensed under GPLv2. | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef _AB8500_GPIO_H | ||
| 9 | #define _AB8500_GPIO_H | ||
| 10 | |||
| 11 | /* | ||
| 12 | * Platform data to register a block: only the initial gpio/irq number. | ||
| 13 | * Array sizes are large enough to contain all AB8500 and AB9540 GPIO | ||
| 14 | * registers. | ||
| 15 | */ | ||
| 16 | |||
| 17 | struct abx500_gpio_platform_data { | ||
| 18 | int gpio_base; | ||
| 19 | }; | ||
| 20 | |||
| 21 | enum abx500_gpio_pull_updown { | ||
| 22 | ABX500_GPIO_PULL_DOWN = 0x0, | ||
| 23 | ABX500_GPIO_PULL_NONE = 0x1, | ||
| 24 | ABX500_GPIO_PULL_UP = 0x3, | ||
| 25 | }; | ||
| 26 | |||
| 27 | enum abx500_gpio_vinsel { | ||
| 28 | ABX500_GPIO_VINSEL_VBAT = 0x0, | ||
| 29 | ABX500_GPIO_VINSEL_VIN_1V8 = 0x1, | ||
| 30 | ABX500_GPIO_VINSEL_VDD_BIF = 0x2, | ||
| 31 | }; | ||
| 32 | |||
| 33 | #endif /* _AB8500_GPIO_H */ | ||
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index f4acd898dac9..a86ca1406fb8 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h | |||
| @@ -368,7 +368,6 @@ struct ab8500 { | |||
| 368 | }; | 368 | }; |
| 369 | 369 | ||
| 370 | struct ab8500_regulator_platform_data; | 370 | struct ab8500_regulator_platform_data; |
| 371 | struct ab8500_gpio_platform_data; | ||
| 372 | struct ab8500_codec_platform_data; | 371 | struct ab8500_codec_platform_data; |
| 373 | struct ab8500_sysctrl_platform_data; | 372 | struct ab8500_sysctrl_platform_data; |
| 374 | 373 | ||
| @@ -382,7 +381,6 @@ struct ab8500_platform_data { | |||
| 382 | int irq_base; | 381 | int irq_base; |
| 383 | void (*init) (struct ab8500 *); | 382 | void (*init) (struct ab8500 *); |
| 384 | struct ab8500_regulator_platform_data *regulator; | 383 | struct ab8500_regulator_platform_data *regulator; |
| 385 | struct abx500_gpio_platform_data *gpio; | ||
| 386 | struct ab8500_codec_platform_data *codec; | 384 | struct ab8500_codec_platform_data *codec; |
| 387 | struct ab8500_sysctrl_platform_data *sysctrl; | 385 | struct ab8500_sysctrl_platform_data *sysctrl; |
| 388 | }; | 386 | }; |
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h index cb49417f8ba9..fdf3aa376eb2 100644 --- a/include/linux/mfd/arizona/registers.h +++ b/include/linux/mfd/arizona/registers.h | |||
| @@ -139,6 +139,7 @@ | |||
| 139 | #define ARIZONA_INPUT_ENABLES_STATUS 0x301 | 139 | #define ARIZONA_INPUT_ENABLES_STATUS 0x301 |
| 140 | #define ARIZONA_INPUT_RATE 0x308 | 140 | #define ARIZONA_INPUT_RATE 0x308 |
| 141 | #define ARIZONA_INPUT_VOLUME_RAMP 0x309 | 141 | #define ARIZONA_INPUT_VOLUME_RAMP 0x309 |
| 142 | #define ARIZONA_HPF_CONTROL 0x30C | ||
| 142 | #define ARIZONA_IN1L_CONTROL 0x310 | 143 | #define ARIZONA_IN1L_CONTROL 0x310 |
| 143 | #define ARIZONA_ADC_DIGITAL_VOLUME_1L 0x311 | 144 | #define ARIZONA_ADC_DIGITAL_VOLUME_1L 0x311 |
| 144 | #define ARIZONA_DMIC1L_CONTROL 0x312 | 145 | #define ARIZONA_DMIC1L_CONTROL 0x312 |
| @@ -160,6 +161,7 @@ | |||
| 160 | #define ARIZONA_IN4L_CONTROL 0x328 | 161 | #define ARIZONA_IN4L_CONTROL 0x328 |
| 161 | #define ARIZONA_ADC_DIGITAL_VOLUME_4L 0x329 | 162 | #define ARIZONA_ADC_DIGITAL_VOLUME_4L 0x329 |
| 162 | #define ARIZONA_DMIC4L_CONTROL 0x32A | 163 | #define ARIZONA_DMIC4L_CONTROL 0x32A |
| 164 | #define ARIZONA_IN4R_CONTROL 0x32C | ||
| 163 | #define ARIZONA_ADC_DIGITAL_VOLUME_4R 0x32D | 165 | #define ARIZONA_ADC_DIGITAL_VOLUME_4R 0x32D |
| 164 | #define ARIZONA_DMIC4R_CONTROL 0x32E | 166 | #define ARIZONA_DMIC4R_CONTROL 0x32E |
| 165 | #define ARIZONA_OUTPUT_ENABLES_1 0x400 | 167 | #define ARIZONA_OUTPUT_ENABLES_1 0x400 |
| @@ -224,6 +226,9 @@ | |||
| 224 | #define ARIZONA_PDM_SPK1_CTRL_2 0x491 | 226 | #define ARIZONA_PDM_SPK1_CTRL_2 0x491 |
| 225 | #define ARIZONA_PDM_SPK2_CTRL_1 0x492 | 227 | #define ARIZONA_PDM_SPK2_CTRL_1 0x492 |
| 226 | #define ARIZONA_PDM_SPK2_CTRL_2 0x493 | 228 | #define ARIZONA_PDM_SPK2_CTRL_2 0x493 |
| 229 | #define ARIZONA_HP1_SHORT_CIRCUIT_CTRL 0x4A0 | ||
| 230 | #define ARIZONA_HP2_SHORT_CIRCUIT_CTRL 0x4A1 | ||
| 231 | #define ARIZONA_HP3_SHORT_CIRCUIT_CTRL 0x4A2 | ||
| 227 | #define ARIZONA_SPK_CTRL_2 0x4B5 | 232 | #define ARIZONA_SPK_CTRL_2 0x4B5 |
| 228 | #define ARIZONA_SPK_CTRL_3 0x4B6 | 233 | #define ARIZONA_SPK_CTRL_3 0x4B6 |
| 229 | #define ARIZONA_DAC_COMP_1 0x4DC | 234 | #define ARIZONA_DAC_COMP_1 0x4DC |
| @@ -511,6 +516,38 @@ | |||
| 511 | #define ARIZONA_AIF2TX2MIX_INPUT_3_VOLUME 0x74D | 516 | #define ARIZONA_AIF2TX2MIX_INPUT_3_VOLUME 0x74D |
| 512 | #define ARIZONA_AIF2TX2MIX_INPUT_4_SOURCE 0x74E | 517 | #define ARIZONA_AIF2TX2MIX_INPUT_4_SOURCE 0x74E |
| 513 | #define ARIZONA_AIF2TX2MIX_INPUT_4_VOLUME 0x74F | 518 | #define ARIZONA_AIF2TX2MIX_INPUT_4_VOLUME 0x74F |
| 519 | #define ARIZONA_AIF2TX3MIX_INPUT_1_SOURCE 0x750 | ||
| 520 | #define ARIZONA_AIF2TX3MIX_INPUT_1_VOLUME 0x751 | ||
| 521 | #define ARIZONA_AIF2TX3MIX_INPUT_2_SOURCE 0x752 | ||
| 522 | #define ARIZONA_AIF2TX3MIX_INPUT_2_VOLUME 0x753 | ||
| 523 | #define ARIZONA_AIF2TX3MIX_INPUT_3_SOURCE 0x754 | ||
| 524 | #define ARIZONA_AIF2TX3MIX_INPUT_3_VOLUME 0x755 | ||
| 525 | #define ARIZONA_AIF2TX3MIX_INPUT_4_SOURCE 0x756 | ||
| 526 | #define ARIZONA_AIF2TX3MIX_INPUT_4_VOLUME 0x757 | ||
| 527 | #define ARIZONA_AIF2TX4MIX_INPUT_1_SOURCE 0x758 | ||
| 528 | #define ARIZONA_AIF2TX4MIX_INPUT_1_VOLUME 0x759 | ||
| 529 | #define ARIZONA_AIF2TX4MIX_INPUT_2_SOURCE 0x75A | ||
| 530 | #define ARIZONA_AIF2TX4MIX_INPUT_2_VOLUME 0x75B | ||
| 531 | #define ARIZONA_AIF2TX4MIX_INPUT_3_SOURCE 0x75C | ||
| 532 | #define ARIZONA_AIF2TX4MIX_INPUT_3_VOLUME 0x75D | ||
| 533 | #define ARIZONA_AIF2TX4MIX_INPUT_4_SOURCE 0x75E | ||
| 534 | #define ARIZONA_AIF2TX4MIX_INPUT_4_VOLUME 0x75F | ||
| 535 | #define ARIZONA_AIF2TX5MIX_INPUT_1_SOURCE 0x760 | ||
| 536 | #define ARIZONA_AIF2TX5MIX_INPUT_1_VOLUME 0x761 | ||
| 537 | #define ARIZONA_AIF2TX5MIX_INPUT_2_SOURCE 0x762 | ||
| 538 | #define ARIZONA_AIF2TX5MIX_INPUT_2_VOLUME 0x763 | ||
| 539 | #define ARIZONA_AIF2TX5MIX_INPUT_3_SOURCE 0x764 | ||
| 540 | #define ARIZONA_AIF2TX5MIX_INPUT_3_VOLUME 0x765 | ||
| 541 | #define ARIZONA_AIF2TX5MIX_INPUT_4_SOURCE 0x766 | ||
| 542 | #define ARIZONA_AIF2TX5MIX_INPUT_4_VOLUME 0x767 | ||
| 543 | #define ARIZONA_AIF2TX6MIX_INPUT_1_SOURCE 0x768 | ||
| 544 | #define ARIZONA_AIF2TX6MIX_INPUT_1_VOLUME 0x769 | ||
| 545 | #define ARIZONA_AIF2TX6MIX_INPUT_2_SOURCE 0x76A | ||
| 546 | #define ARIZONA_AIF2TX6MIX_INPUT_2_VOLUME 0x76B | ||
| 547 | #define ARIZONA_AIF2TX6MIX_INPUT_3_SOURCE 0x76C | ||
| 548 | #define ARIZONA_AIF2TX6MIX_INPUT_3_VOLUME 0x76D | ||
| 549 | #define ARIZONA_AIF2TX6MIX_INPUT_4_SOURCE 0x76E | ||
| 550 | #define ARIZONA_AIF2TX6MIX_INPUT_4_VOLUME 0x76F | ||
| 514 | #define ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE 0x780 | 551 | #define ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE 0x780 |
| 515 | #define ARIZONA_AIF3TX1MIX_INPUT_1_VOLUME 0x781 | 552 | #define ARIZONA_AIF3TX1MIX_INPUT_1_VOLUME 0x781 |
| 516 | #define ARIZONA_AIF3TX1MIX_INPUT_2_SOURCE 0x782 | 553 | #define ARIZONA_AIF3TX1MIX_INPUT_2_SOURCE 0x782 |
| @@ -2196,6 +2233,15 @@ | |||
| 2196 | /* | 2233 | /* |
| 2197 | * R677 (0x2A5) - Mic Detect 3 | 2234 | * R677 (0x2A5) - Mic Detect 3 |
| 2198 | */ | 2235 | */ |
| 2236 | #define ARIZONA_MICD_LVL_0 0x0004 /* MICD_LVL - [2] */ | ||
| 2237 | #define ARIZONA_MICD_LVL_1 0x0008 /* MICD_LVL - [3] */ | ||
| 2238 | #define ARIZONA_MICD_LVL_2 0x0010 /* MICD_LVL - [4] */ | ||
| 2239 | #define ARIZONA_MICD_LVL_3 0x0020 /* MICD_LVL - [5] */ | ||
| 2240 | #define ARIZONA_MICD_LVL_4 0x0040 /* MICD_LVL - [6] */ | ||
| 2241 | #define ARIZONA_MICD_LVL_5 0x0080 /* MICD_LVL - [7] */ | ||
| 2242 | #define ARIZONA_MICD_LVL_6 0x0100 /* MICD_LVL - [8] */ | ||
| 2243 | #define ARIZONA_MICD_LVL_7 0x0200 /* MICD_LVL - [9] */ | ||
| 2244 | #define ARIZONA_MICD_LVL_8 0x0400 /* MICD_LVL - [10] */ | ||
| 2199 | #define ARIZONA_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */ | 2245 | #define ARIZONA_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */ |
| 2200 | #define ARIZONA_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */ | 2246 | #define ARIZONA_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */ |
| 2201 | #define ARIZONA_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */ | 2247 | #define ARIZONA_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */ |
| @@ -2293,8 +2339,18 @@ | |||
| 2293 | #define ARIZONA_IN_VI_RAMP_WIDTH 3 /* IN_VI_RAMP - [2:0] */ | 2339 | #define ARIZONA_IN_VI_RAMP_WIDTH 3 /* IN_VI_RAMP - [2:0] */ |
| 2294 | 2340 | ||
| 2295 | /* | 2341 | /* |
| 2342 | * R780 (0x30C) - HPF Control | ||
| 2343 | */ | ||
| 2344 | #define ARIZONA_IN_HPF_CUT_MASK 0x0007 /* IN_HPF_CUT [2:0] */ | ||
| 2345 | #define ARIZONA_IN_HPF_CUT_SHIFT 0 /* IN_HPF_CUT [2:0] */ | ||
| 2346 | #define ARIZONA_IN_HPF_CUT_WIDTH 3 /* IN_HPF_CUT [2:0] */ | ||
| 2347 | |||
| 2348 | /* | ||
| 2296 | * R784 (0x310) - IN1L Control | 2349 | * R784 (0x310) - IN1L Control |
| 2297 | */ | 2350 | */ |
| 2351 | #define ARIZONA_IN1L_HPF_MASK 0x8000 /* IN1L_HPF - [15] */ | ||
| 2352 | #define ARIZONA_IN1L_HPF_SHIFT 15 /* IN1L_HPF - [15] */ | ||
| 2353 | #define ARIZONA_IN1L_HPF_WIDTH 1 /* IN1L_HPF - [15] */ | ||
| 2298 | #define ARIZONA_IN1_OSR_MASK 0x6000 /* IN1_OSR - [14:13] */ | 2354 | #define ARIZONA_IN1_OSR_MASK 0x6000 /* IN1_OSR - [14:13] */ |
| 2299 | #define ARIZONA_IN1_OSR_SHIFT 13 /* IN1_OSR - [14:13] */ | 2355 | #define ARIZONA_IN1_OSR_SHIFT 13 /* IN1_OSR - [14:13] */ |
| 2300 | #define ARIZONA_IN1_OSR_WIDTH 2 /* IN1_OSR - [14:13] */ | 2356 | #define ARIZONA_IN1_OSR_WIDTH 2 /* IN1_OSR - [14:13] */ |
| @@ -2333,6 +2389,9 @@ | |||
| 2333 | /* | 2389 | /* |
| 2334 | * R788 (0x314) - IN1R Control | 2390 | * R788 (0x314) - IN1R Control |
| 2335 | */ | 2391 | */ |
| 2392 | #define ARIZONA_IN1R_HPF_MASK 0x8000 /* IN1R_HPF - [15] */ | ||
| 2393 | #define ARIZONA_IN1R_HPF_SHIFT 15 /* IN1R_HPF - [15] */ | ||
| 2394 | #define ARIZONA_IN1R_HPF_WIDTH 1 /* IN1R_HPF - [15] */ | ||
| 2336 | #define ARIZONA_IN1R_PGA_VOL_MASK 0x00FE /* IN1R_PGA_VOL - [7:1] */ | 2395 | #define ARIZONA_IN1R_PGA_VOL_MASK 0x00FE /* IN1R_PGA_VOL - [7:1] */ |
| 2337 | #define ARIZONA_IN1R_PGA_VOL_SHIFT 1 /* IN1R_PGA_VOL - [7:1] */ | 2396 | #define ARIZONA_IN1R_PGA_VOL_SHIFT 1 /* IN1R_PGA_VOL - [7:1] */ |
| 2338 | #define ARIZONA_IN1R_PGA_VOL_WIDTH 7 /* IN1R_PGA_VOL - [7:1] */ | 2397 | #define ARIZONA_IN1R_PGA_VOL_WIDTH 7 /* IN1R_PGA_VOL - [7:1] */ |
| @@ -2362,6 +2421,9 @@ | |||
| 2362 | /* | 2421 | /* |
| 2363 | * R792 (0x318) - IN2L Control | 2422 | * R792 (0x318) - IN2L Control |
| 2364 | */ | 2423 | */ |
| 2424 | #define ARIZONA_IN2L_HPF_MASK 0x8000 /* IN2L_HPF - [15] */ | ||
| 2425 | #define ARIZONA_IN2L_HPF_SHIFT 15 /* IN2L_HPF - [15] */ | ||
| 2426 | #define ARIZONA_IN2L_HPF_WIDTH 1 /* IN2L_HPF - [15] */ | ||
| 2365 | #define ARIZONA_IN2_OSR_MASK 0x6000 /* IN2_OSR - [14:13] */ | 2427 | #define ARIZONA_IN2_OSR_MASK 0x6000 /* IN2_OSR - [14:13] */ |
| 2366 | #define ARIZONA_IN2_OSR_SHIFT 13 /* IN2_OSR - [14:13] */ | 2428 | #define ARIZONA_IN2_OSR_SHIFT 13 /* IN2_OSR - [14:13] */ |
| 2367 | #define ARIZONA_IN2_OSR_WIDTH 2 /* IN2_OSR - [14:13] */ | 2429 | #define ARIZONA_IN2_OSR_WIDTH 2 /* IN2_OSR - [14:13] */ |
| @@ -2400,6 +2462,9 @@ | |||
| 2400 | /* | 2462 | /* |
| 2401 | * R796 (0x31C) - IN2R Control | 2463 | * R796 (0x31C) - IN2R Control |
| 2402 | */ | 2464 | */ |
| 2465 | #define ARIZONA_IN2R_HPF_MASK 0x8000 /* IN2R_HPF - [15] */ | ||
| 2466 | #define ARIZONA_IN2R_HPF_SHIFT 15 /* IN2R_HPF - [15] */ | ||
| 2467 | #define ARIZONA_IN2R_HPF_WIDTH 1 /* IN2R_HPF - [15] */ | ||
| 2403 | #define ARIZONA_IN2R_PGA_VOL_MASK 0x00FE /* IN2R_PGA_VOL - [7:1] */ | 2468 | #define ARIZONA_IN2R_PGA_VOL_MASK 0x00FE /* IN2R_PGA_VOL - [7:1] */ |
| 2404 | #define ARIZONA_IN2R_PGA_VOL_SHIFT 1 /* IN2R_PGA_VOL - [7:1] */ | 2469 | #define ARIZONA_IN2R_PGA_VOL_SHIFT 1 /* IN2R_PGA_VOL - [7:1] */ |
| 2405 | #define ARIZONA_IN2R_PGA_VOL_WIDTH 7 /* IN2R_PGA_VOL - [7:1] */ | 2470 | #define ARIZONA_IN2R_PGA_VOL_WIDTH 7 /* IN2R_PGA_VOL - [7:1] */ |
| @@ -2429,6 +2494,9 @@ | |||
| 2429 | /* | 2494 | /* |
| 2430 | * R800 (0x320) - IN3L Control | 2495 | * R800 (0x320) - IN3L Control |
| 2431 | */ | 2496 | */ |
| 2497 | #define ARIZONA_IN3L_HPF_MASK 0x8000 /* IN3L_HPF - [15] */ | ||
| 2498 | #define ARIZONA_IN3L_HPF_SHIFT 15 /* IN3L_HPF - [15] */ | ||
| 2499 | #define ARIZONA_IN3L_HPF_WIDTH 1 /* IN3L_HPF - [15] */ | ||
| 2432 | #define ARIZONA_IN3_OSR_MASK 0x6000 /* IN3_OSR - [14:13] */ | 2500 | #define ARIZONA_IN3_OSR_MASK 0x6000 /* IN3_OSR - [14:13] */ |
| 2433 | #define ARIZONA_IN3_OSR_SHIFT 13 /* IN3_OSR - [14:13] */ | 2501 | #define ARIZONA_IN3_OSR_SHIFT 13 /* IN3_OSR - [14:13] */ |
| 2434 | #define ARIZONA_IN3_OSR_WIDTH 2 /* IN3_OSR - [14:13] */ | 2502 | #define ARIZONA_IN3_OSR_WIDTH 2 /* IN3_OSR - [14:13] */ |
| @@ -2467,6 +2535,9 @@ | |||
| 2467 | /* | 2535 | /* |
| 2468 | * R804 (0x324) - IN3R Control | 2536 | * R804 (0x324) - IN3R Control |
| 2469 | */ | 2537 | */ |
| 2538 | #define ARIZONA_IN3R_HPF_MASK 0x8000 /* IN3R_HPF - [15] */ | ||
| 2539 | #define ARIZONA_IN3R_HPF_SHIFT 15 /* IN3R_HPF - [15] */ | ||
| 2540 | #define ARIZONA_IN3R_HPF_WIDTH 1 /* IN3R_HPF - [15] */ | ||
| 2470 | #define ARIZONA_IN3R_PGA_VOL_MASK 0x00FE /* IN3R_PGA_VOL - [7:1] */ | 2541 | #define ARIZONA_IN3R_PGA_VOL_MASK 0x00FE /* IN3R_PGA_VOL - [7:1] */ |
| 2471 | #define ARIZONA_IN3R_PGA_VOL_SHIFT 1 /* IN3R_PGA_VOL - [7:1] */ | 2542 | #define ARIZONA_IN3R_PGA_VOL_SHIFT 1 /* IN3R_PGA_VOL - [7:1] */ |
| 2472 | #define ARIZONA_IN3R_PGA_VOL_WIDTH 7 /* IN3R_PGA_VOL - [7:1] */ | 2543 | #define ARIZONA_IN3R_PGA_VOL_WIDTH 7 /* IN3R_PGA_VOL - [7:1] */ |
| @@ -2496,6 +2567,9 @@ | |||
| 2496 | /* | 2567 | /* |
| 2497 | * R808 (0x328) - IN4 Control | 2568 | * R808 (0x328) - IN4 Control |
| 2498 | */ | 2569 | */ |
| 2570 | #define ARIZONA_IN4L_HPF_MASK 0x8000 /* IN4L_HPF - [15] */ | ||
| 2571 | #define ARIZONA_IN4L_HPF_SHIFT 15 /* IN4L_HPF - [15] */ | ||
| 2572 | #define ARIZONA_IN4L_HPF_WIDTH 1 /* IN4L_HPF - [15] */ | ||
| 2499 | #define ARIZONA_IN4_OSR_MASK 0x6000 /* IN4_OSR - [14:13] */ | 2573 | #define ARIZONA_IN4_OSR_MASK 0x6000 /* IN4_OSR - [14:13] */ |
| 2500 | #define ARIZONA_IN4_OSR_SHIFT 13 /* IN4_OSR - [14:13] */ | 2574 | #define ARIZONA_IN4_OSR_SHIFT 13 /* IN4_OSR - [14:13] */ |
| 2501 | #define ARIZONA_IN4_OSR_WIDTH 2 /* IN4_OSR - [14:13] */ | 2575 | #define ARIZONA_IN4_OSR_WIDTH 2 /* IN4_OSR - [14:13] */ |
| @@ -2526,6 +2600,13 @@ | |||
| 2526 | #define ARIZONA_IN4L_DMIC_DLY_WIDTH 6 /* IN4L_DMIC_DLY - [5:0] */ | 2600 | #define ARIZONA_IN4L_DMIC_DLY_WIDTH 6 /* IN4L_DMIC_DLY - [5:0] */ |
| 2527 | 2601 | ||
| 2528 | /* | 2602 | /* |
| 2603 | * R812 (0x32C) - IN4R Control | ||
| 2604 | */ | ||
| 2605 | #define ARIZONA_IN4R_HPF_MASK 0x8000 /* IN4R_HPF - [15] */ | ||
| 2606 | #define ARIZONA_IN4R_HPF_SHIFT 15 /* IN4R_HPF - [15] */ | ||
| 2607 | #define ARIZONA_IN4R_HPF_WIDTH 1 /* IN4R_HPF - [15] */ | ||
| 2608 | |||
| 2609 | /* | ||
| 2529 | * R813 (0x32D) - ADC Digital Volume 4R | 2610 | * R813 (0x32D) - ADC Digital Volume 4R |
| 2530 | */ | 2611 | */ |
| 2531 | #define ARIZONA_IN_VU 0x0200 /* IN_VU */ | 2612 | #define ARIZONA_IN_VU 0x0200 /* IN_VU */ |
| @@ -3138,6 +3219,10 @@ | |||
| 3138 | /* | 3219 | /* |
| 3139 | * R1088 (0x440) - DRE Enable | 3220 | * R1088 (0x440) - DRE Enable |
| 3140 | */ | 3221 | */ |
| 3222 | #define ARIZONA_DRE3R_ENA 0x0020 /* DRE3R_ENA */ | ||
| 3223 | #define ARIZONA_DRE3R_ENA_MASK 0x0020 /* DRE3R_ENA */ | ||
| 3224 | #define ARIZONA_DRE3R_ENA_SHIFT 5 /* DRE3R_ENA */ | ||
| 3225 | #define ARIZONA_DRE3R_ENA_WIDTH 1 /* DRE3R_ENA */ | ||
| 3141 | #define ARIZONA_DRE3L_ENA 0x0010 /* DRE3L_ENA */ | 3226 | #define ARIZONA_DRE3L_ENA 0x0010 /* DRE3L_ENA */ |
| 3142 | #define ARIZONA_DRE3L_ENA_MASK 0x0010 /* DRE3L_ENA */ | 3227 | #define ARIZONA_DRE3L_ENA_MASK 0x0010 /* DRE3L_ENA */ |
| 3143 | #define ARIZONA_DRE3L_ENA_SHIFT 4 /* DRE3L_ENA */ | 3228 | #define ARIZONA_DRE3L_ENA_SHIFT 4 /* DRE3L_ENA */ |
| @@ -3260,6 +3345,30 @@ | |||
| 3260 | #define ARIZONA_SPK2_FMT_WIDTH 1 /* SPK2_FMT */ | 3345 | #define ARIZONA_SPK2_FMT_WIDTH 1 /* SPK2_FMT */ |
| 3261 | 3346 | ||
| 3262 | /* | 3347 | /* |
| 3348 | * R1184 (0x4A0) - HP1 Short Circuit Ctrl | ||
| 3349 | */ | ||
| 3350 | #define ARIZONA_HP1_SC_ENA 0x1000 /* HP1_SC_ENA */ | ||
| 3351 | #define ARIZONA_HP1_SC_ENA_MASK 0x1000 /* HP1_SC_ENA */ | ||
| 3352 | #define ARIZONA_HP1_SC_ENA_SHIFT 12 /* HP1_SC_ENA */ | ||
| 3353 | #define ARIZONA_HP1_SC_ENA_WIDTH 1 /* HP1_SC_ENA */ | ||
| 3354 | |||
| 3355 | /* | ||
| 3356 | * R1185 (0x4A1) - HP2 Short Circuit Ctrl | ||
| 3357 | */ | ||
| 3358 | #define ARIZONA_HP2_SC_ENA 0x1000 /* HP2_SC_ENA */ | ||
| 3359 | #define ARIZONA_HP2_SC_ENA_MASK 0x1000 /* HP2_SC_ENA */ | ||
| 3360 | #define ARIZONA_HP2_SC_ENA_SHIFT 12 /* HP2_SC_ENA */ | ||
| 3361 | #define ARIZONA_HP2_SC_ENA_WIDTH 1 /* HP2_SC_ENA */ | ||
| 3362 | |||
| 3363 | /* | ||
| 3364 | * R1186 (0x4A2) - HP3 Short Circuit Ctrl | ||
| 3365 | */ | ||
| 3366 | #define ARIZONA_HP3_SC_ENA 0x1000 /* HP3_SC_ENA */ | ||
| 3367 | #define ARIZONA_HP3_SC_ENA_MASK 0x1000 /* HP3_SC_ENA */ | ||
| 3368 | #define ARIZONA_HP3_SC_ENA_SHIFT 12 /* HP3_SC_ENA */ | ||
| 3369 | #define ARIZONA_HP3_SC_ENA_WIDTH 1 /* HP3_SC_ENA */ | ||
| 3370 | |||
| 3371 | /* | ||
| 3263 | * R1244 (0x4DC) - DAC comp 1 | 3372 | * R1244 (0x4DC) - DAC comp 1 |
| 3264 | */ | 3373 | */ |
| 3265 | #define ARIZONA_OUT_COMP_COEFF_MASK 0xFFFF /* OUT_COMP_COEFF - [15:0] */ | 3374 | #define ARIZONA_OUT_COMP_COEFF_MASK 0xFFFF /* OUT_COMP_COEFF - [15:0] */ |
| @@ -3726,6 +3835,35 @@ | |||
| 3726 | #define ARIZONA_AIF2TX2_SLOT_WIDTH 6 /* AIF2TX2_SLOT - [5:0] */ | 3835 | #define ARIZONA_AIF2TX2_SLOT_WIDTH 6 /* AIF2TX2_SLOT - [5:0] */ |
| 3727 | 3836 | ||
| 3728 | /* | 3837 | /* |
| 3838 | * R1355 (0x54B) - AIF2 Frame Ctrl 5 | ||
| 3839 | */ | ||
| 3840 | #define ARIZONA_AIF2TX3_SLOT_MASK 0x003F /* AIF2TX3_SLOT - [5:0] */ | ||
| 3841 | #define ARIZONA_AIF2TX3_SLOT_SHIFT 0 /* AIF2TX3_SLOT - [5:0] */ | ||
| 3842 | #define ARIZONA_AIF2TX3_SLOT_WIDTH 6 /* AIF2TX3_SLOT - [5:0] */ | ||
| 3843 | |||
| 3844 | /* | ||
| 3845 | * R1356 (0x54C) - AIF2 Frame Ctrl 6 | ||
| 3846 | */ | ||
| 3847 | #define ARIZONA_AIF2TX4_SLOT_MASK 0x003F /* AIF2TX4_SLOT - [5:0] */ | ||
| 3848 | #define ARIZONA_AIF2TX4_SLOT_SHIFT 0 /* AIF2TX4_SLOT - [5:0] */ | ||
| 3849 | #define ARIZONA_AIF2TX4_SLOT_WIDTH 6 /* AIF2TX4_SLOT - [5:0] */ | ||
| 3850 | |||
| 3851 | |||
| 3852 | /* | ||
| 3853 | * R1357 (0x54D) - AIF2 Frame Ctrl 7 | ||
| 3854 | */ | ||
| 3855 | #define ARIZONA_AIF2TX5_SLOT_MASK 0x003F /* AIF2TX5_SLOT - [5:0] */ | ||
| 3856 | #define ARIZONA_AIF2TX5_SLOT_SHIFT 0 /* AIF2TX5_SLOT - [5:0] */ | ||
| 3857 | #define ARIZONA_AIF2TX5_SLOT_WIDTH 6 /* AIF2TX5_SLOT - [5:0] */ | ||
| 3858 | |||
| 3859 | /* | ||
| 3860 | * R1358 (0x54E) - AIF2 Frame Ctrl 8 | ||
| 3861 | */ | ||
| 3862 | #define ARIZONA_AIF2TX6_SLOT_MASK 0x003F /* AIF2TX6_SLOT - [5:0] */ | ||
| 3863 | #define ARIZONA_AIF2TX6_SLOT_SHIFT 0 /* AIF2TX6_SLOT - [5:0] */ | ||
| 3864 | #define ARIZONA_AIF2TX6_SLOT_WIDTH 6 /* AIF2TX6_SLOT - [5:0] */ | ||
| 3865 | |||
| 3866 | /* | ||
| 3729 | * R1361 (0x551) - AIF2 Frame Ctrl 11 | 3867 | * R1361 (0x551) - AIF2 Frame Ctrl 11 |
| 3730 | */ | 3868 | */ |
| 3731 | #define ARIZONA_AIF2RX1_SLOT_MASK 0x003F /* AIF2RX1_SLOT - [5:0] */ | 3869 | #define ARIZONA_AIF2RX1_SLOT_MASK 0x003F /* AIF2RX1_SLOT - [5:0] */ |
| @@ -3740,8 +3878,52 @@ | |||
| 3740 | #define ARIZONA_AIF2RX2_SLOT_WIDTH 6 /* AIF2RX2_SLOT - [5:0] */ | 3878 | #define ARIZONA_AIF2RX2_SLOT_WIDTH 6 /* AIF2RX2_SLOT - [5:0] */ |
| 3741 | 3879 | ||
| 3742 | /* | 3880 | /* |
| 3881 | * R1363 (0x553) - AIF2 Frame Ctrl 13 | ||
| 3882 | */ | ||
| 3883 | #define ARIZONA_AIF2RX3_SLOT_MASK 0x003F /* AIF2RX3_SLOT - [5:0] */ | ||
| 3884 | #define ARIZONA_AIF2RX3_SLOT_SHIFT 0 /* AIF2RX3_SLOT - [5:0] */ | ||
| 3885 | #define ARIZONA_AIF2RX3_SLOT_WIDTH 6 /* AIF2RX3_SLOT - [5:0] */ | ||
| 3886 | |||
| 3887 | /* | ||
| 3888 | * R1364 (0x554) - AIF2 Frame Ctrl 14 | ||
| 3889 | */ | ||
| 3890 | #define ARIZONA_AIF2RX4_SLOT_MASK 0x003F /* AIF2RX4_SLOT - [5:0] */ | ||
| 3891 | #define ARIZONA_AIF2RX4_SLOT_SHIFT 0 /* AIF2RX4_SLOT - [5:0] */ | ||
| 3892 | #define ARIZONA_AIF2RX4_SLOT_WIDTH 6 /* AIF2RX4_SLOT - [5:0] */ | ||
| 3893 | |||
| 3894 | /* | ||
| 3895 | * R1365 (0x555) - AIF2 Frame Ctrl 15 | ||
| 3896 | */ | ||
| 3897 | #define ARIZONA_AIF2RX5_SLOT_MASK 0x003F /* AIF2RX5_SLOT - [5:0] */ | ||
| 3898 | #define ARIZONA_AIF2RX5_SLOT_SHIFT 0 /* AIF2RX5_SLOT - [5:0] */ | ||
| 3899 | #define ARIZONA_AIF2RX5_SLOT_WIDTH 6 /* AIF2RX5_SLOT - [5:0] */ | ||
| 3900 | |||
| 3901 | /* | ||
| 3902 | * R1366 (0x556) - AIF2 Frame Ctrl 16 | ||
| 3903 | */ | ||
| 3904 | #define ARIZONA_AIF2RX6_SLOT_MASK 0x003F /* AIF2RX6_SLOT - [5:0] */ | ||
| 3905 | #define ARIZONA_AIF2RX6_SLOT_SHIFT 0 /* AIF2RX6_SLOT - [5:0] */ | ||
| 3906 | #define ARIZONA_AIF2RX6_SLOT_WIDTH 6 /* AIF2RX6_SLOT - [5:0] */ | ||
| 3907 | |||
| 3908 | /* | ||
| 3743 | * R1369 (0x559) - AIF2 Tx Enables | 3909 | * R1369 (0x559) - AIF2 Tx Enables |
| 3744 | */ | 3910 | */ |
| 3911 | #define ARIZONA_AIF2TX6_ENA 0x0020 /* AIF2TX6_ENA */ | ||
| 3912 | #define ARIZONA_AIF2TX6_ENA_MASK 0x0020 /* AIF2TX6_ENA */ | ||
| 3913 | #define ARIZONA_AIF2TX6_ENA_SHIFT 5 /* AIF2TX6_ENA */ | ||
| 3914 | #define ARIZONA_AIF2TX6_ENA_WIDTH 1 /* AIF2TX6_ENA */ | ||
| 3915 | #define ARIZONA_AIF2TX5_ENA 0x0010 /* AIF2TX5_ENA */ | ||
| 3916 | #define ARIZONA_AIF2TX5_ENA_MASK 0x0010 /* AIF2TX5_ENA */ | ||
| 3917 | #define ARIZONA_AIF2TX5_ENA_SHIFT 4 /* AIF2TX5_ENA */ | ||
| 3918 | #define ARIZONA_AIF2TX5_ENA_WIDTH 1 /* AIF2TX5_ENA */ | ||
| 3919 | #define ARIZONA_AIF2TX4_ENA 0x0008 /* AIF2TX4_ENA */ | ||
| 3920 | #define ARIZONA_AIF2TX4_ENA_MASK 0x0008 /* AIF2TX4_ENA */ | ||
| 3921 | #define ARIZONA_AIF2TX4_ENA_SHIFT 3 /* AIF2TX4_ENA */ | ||
| 3922 | #define ARIZONA_AIF2TX4_ENA_WIDTH 1 /* AIF2TX4_ENA */ | ||
| 3923 | #define ARIZONA_AIF2TX3_ENA 0x0004 /* AIF2TX3_ENA */ | ||
| 3924 | #define ARIZONA_AIF2TX3_ENA_MASK 0x0004 /* AIF2TX3_ENA */ | ||
| 3925 | #define ARIZONA_AIF2TX3_ENA_SHIFT 2 /* AIF2TX3_ENA */ | ||
| 3926 | #define ARIZONA_AIF2TX3_ENA_WIDTH 1 /* AIF2TX3_ENA */ | ||
| 3745 | #define ARIZONA_AIF2TX2_ENA 0x0002 /* AIF2TX2_ENA */ | 3927 | #define ARIZONA_AIF2TX2_ENA 0x0002 /* AIF2TX2_ENA */ |
| 3746 | #define ARIZONA_AIF2TX2_ENA_MASK 0x0002 /* AIF2TX2_ENA */ | 3928 | #define ARIZONA_AIF2TX2_ENA_MASK 0x0002 /* AIF2TX2_ENA */ |
| 3747 | #define ARIZONA_AIF2TX2_ENA_SHIFT 1 /* AIF2TX2_ENA */ | 3929 | #define ARIZONA_AIF2TX2_ENA_SHIFT 1 /* AIF2TX2_ENA */ |
| @@ -3754,6 +3936,22 @@ | |||
| 3754 | /* | 3936 | /* |
| 3755 | * R1370 (0x55A) - AIF2 Rx Enables | 3937 | * R1370 (0x55A) - AIF2 Rx Enables |
| 3756 | */ | 3938 | */ |
| 3939 | #define ARIZONA_AIF2RX6_ENA 0x0020 /* AIF2RX6_ENA */ | ||
| 3940 | #define ARIZONA_AIF2RX6_ENA_MASK 0x0020 /* AIF2RX6_ENA */ | ||
| 3941 | #define ARIZONA_AIF2RX6_ENA_SHIFT 5 /* AIF2RX6_ENA */ | ||
| 3942 | #define ARIZONA_AIF2RX6_ENA_WIDTH 1 /* AIF2RX6_ENA */ | ||
| 3943 | #define ARIZONA_AIF2RX5_ENA 0x0010 /* AIF2RX5_ENA */ | ||
| 3944 | #define ARIZONA_AIF2RX5_ENA_MASK 0x0010 /* AIF2RX5_ENA */ | ||
| 3945 | #define ARIZONA_AIF2RX5_ENA_SHIFT 4 /* AIF2RX5_ENA */ | ||
| 3946 | #define ARIZONA_AIF2RX5_ENA_WIDTH 1 /* AIF2RX5_ENA */ | ||
| 3947 | #define ARIZONA_AIF2RX4_ENA 0x0008 /* AIF2RX4_ENA */ | ||
| 3948 | #define ARIZONA_AIF2RX4_ENA_MASK 0x0008 /* AIF2RX4_ENA */ | ||
| 3949 | #define ARIZONA_AIF2RX4_ENA_SHIFT 3 /* AIF2RX4_ENA */ | ||
| 3950 | #define ARIZONA_AIF2RX4_ENA_WIDTH 1 /* AIF2RX4_ENA */ | ||
| 3951 | #define ARIZONA_AIF2RX3_ENA 0x0004 /* AIF2RX3_ENA */ | ||
| 3952 | #define ARIZONA_AIF2RX3_ENA_MASK 0x0004 /* AIF2RX3_ENA */ | ||
| 3953 | #define ARIZONA_AIF2RX3_ENA_SHIFT 2 /* AIF2RX3_ENA */ | ||
| 3954 | #define ARIZONA_AIF2RX3_ENA_WIDTH 1 /* AIF2RX3_ENA */ | ||
| 3757 | #define ARIZONA_AIF2RX2_ENA 0x0002 /* AIF2RX2_ENA */ | 3955 | #define ARIZONA_AIF2RX2_ENA 0x0002 /* AIF2RX2_ENA */ |
| 3758 | #define ARIZONA_AIF2RX2_ENA_MASK 0x0002 /* AIF2RX2_ENA */ | 3956 | #define ARIZONA_AIF2RX2_ENA_MASK 0x0002 /* AIF2RX2_ENA */ |
| 3759 | #define ARIZONA_AIF2RX2_ENA_SHIFT 1 /* AIF2RX2_ENA */ | 3957 | #define ARIZONA_AIF2RX2_ENA_SHIFT 1 /* AIF2RX2_ENA */ |
diff --git a/include/linux/mfd/as3722.h b/include/linux/mfd/as3722.h index 16bf8a0dcd97..f654a7a42260 100644 --- a/include/linux/mfd/as3722.h +++ b/include/linux/mfd/as3722.h | |||
| @@ -314,6 +314,7 @@ | |||
| 314 | #define AS3722_GPIO_IOSF_GPIO_INTERRUPT_IN AS3722_GPIO_IOSF_VAL(3) | 314 | #define AS3722_GPIO_IOSF_GPIO_INTERRUPT_IN AS3722_GPIO_IOSF_VAL(3) |
| 315 | #define AS3722_GPIO_IOSF_ISINK_PWM_IN AS3722_GPIO_IOSF_VAL(4) | 315 | #define AS3722_GPIO_IOSF_ISINK_PWM_IN AS3722_GPIO_IOSF_VAL(4) |
| 316 | #define AS3722_GPIO_IOSF_VOLTAGE_STBY AS3722_GPIO_IOSF_VAL(5) | 316 | #define AS3722_GPIO_IOSF_VOLTAGE_STBY AS3722_GPIO_IOSF_VAL(5) |
| 317 | #define AS3722_GPIO_IOSF_SD0_OUT AS3722_GPIO_IOSF_VAL(6) | ||
| 317 | #define AS3722_GPIO_IOSF_PWR_GOOD_OUT AS3722_GPIO_IOSF_VAL(7) | 318 | #define AS3722_GPIO_IOSF_PWR_GOOD_OUT AS3722_GPIO_IOSF_VAL(7) |
| 318 | #define AS3722_GPIO_IOSF_Q32K_OUT AS3722_GPIO_IOSF_VAL(8) | 319 | #define AS3722_GPIO_IOSF_Q32K_OUT AS3722_GPIO_IOSF_VAL(8) |
| 319 | #define AS3722_GPIO_IOSF_WATCHDOG_IN AS3722_GPIO_IOSF_VAL(9) | 320 | #define AS3722_GPIO_IOSF_WATCHDOG_IN AS3722_GPIO_IOSF_VAL(9) |
diff --git a/include/linux/mfd/lp3943.h b/include/linux/mfd/lp3943.h new file mode 100644 index 000000000000..3490db782988 --- /dev/null +++ b/include/linux/mfd/lp3943.h | |||
| @@ -0,0 +1,114 @@ | |||
| 1 | /* | ||
| 2 | * TI/National Semiconductor LP3943 Device | ||
| 3 | * | ||
| 4 | * Copyright 2013 Texas Instruments | ||
| 5 | * | ||
| 6 | * Author: Milo Kim <milo.kim@ti.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MFD_LP3943_H__ | ||
| 15 | #define __MFD_LP3943_H__ | ||
| 16 | |||
| 17 | #include <linux/gpio.h> | ||
| 18 | #include <linux/pwm.h> | ||
| 19 | #include <linux/regmap.h> | ||
| 20 | |||
| 21 | /* Registers */ | ||
| 22 | #define LP3943_REG_GPIO_A 0x00 | ||
| 23 | #define LP3943_REG_GPIO_B 0x01 | ||
| 24 | #define LP3943_REG_PRESCALE0 0x02 | ||
| 25 | #define LP3943_REG_PWM0 0x03 | ||
| 26 | #define LP3943_REG_PRESCALE1 0x04 | ||
| 27 | #define LP3943_REG_PWM1 0x05 | ||
| 28 | #define LP3943_REG_MUX0 0x06 | ||
| 29 | #define LP3943_REG_MUX1 0x07 | ||
| 30 | #define LP3943_REG_MUX2 0x08 | ||
| 31 | #define LP3943_REG_MUX3 0x09 | ||
| 32 | |||
| 33 | /* Bit description for LP3943_REG_MUX0 ~ 3 */ | ||
| 34 | #define LP3943_GPIO_IN 0x00 | ||
| 35 | #define LP3943_GPIO_OUT_HIGH 0x00 | ||
| 36 | #define LP3943_GPIO_OUT_LOW 0x01 | ||
| 37 | #define LP3943_DIM_PWM0 0x02 | ||
| 38 | #define LP3943_DIM_PWM1 0x03 | ||
| 39 | |||
| 40 | #define LP3943_NUM_PWMS 2 | ||
| 41 | |||
| 42 | enum lp3943_pwm_output { | ||
| 43 | LP3943_PWM_OUT0, | ||
| 44 | LP3943_PWM_OUT1, | ||
| 45 | LP3943_PWM_OUT2, | ||
| 46 | LP3943_PWM_OUT3, | ||
| 47 | LP3943_PWM_OUT4, | ||
| 48 | LP3943_PWM_OUT5, | ||
| 49 | LP3943_PWM_OUT6, | ||
| 50 | LP3943_PWM_OUT7, | ||
| 51 | LP3943_PWM_OUT8, | ||
| 52 | LP3943_PWM_OUT9, | ||
| 53 | LP3943_PWM_OUT10, | ||
| 54 | LP3943_PWM_OUT11, | ||
| 55 | LP3943_PWM_OUT12, | ||
| 56 | LP3943_PWM_OUT13, | ||
| 57 | LP3943_PWM_OUT14, | ||
| 58 | LP3943_PWM_OUT15, | ||
| 59 | }; | ||
| 60 | |||
| 61 | /* | ||
| 62 | * struct lp3943_pwm_map | ||
| 63 | * @output: Output pins which are mapped to each PWM channel | ||
| 64 | * @num_outputs: Number of outputs | ||
| 65 | */ | ||
| 66 | struct lp3943_pwm_map { | ||
| 67 | enum lp3943_pwm_output *output; | ||
| 68 | int num_outputs; | ||
| 69 | }; | ||
| 70 | |||
| 71 | /* | ||
| 72 | * struct lp3943_platform_data | ||
| 73 | * @pwms: Output channel definitions for PWM channel 0 and 1 | ||
| 74 | */ | ||
| 75 | struct lp3943_platform_data { | ||
| 76 | struct lp3943_pwm_map *pwms[LP3943_NUM_PWMS]; | ||
| 77 | }; | ||
| 78 | |||
| 79 | /* | ||
| 80 | * struct lp3943_reg_cfg | ||
| 81 | * @reg: Register address | ||
| 82 | * @mask: Register bit mask to be updated | ||
| 83 | * @shift: Register bit shift | ||
| 84 | */ | ||
| 85 | struct lp3943_reg_cfg { | ||
| 86 | u8 reg; | ||
| 87 | u8 mask; | ||
| 88 | u8 shift; | ||
| 89 | }; | ||
| 90 | |||
| 91 | /* | ||
| 92 | * struct lp3943 | ||
| 93 | * @dev: Parent device pointer | ||
| 94 | * @regmap: Used for I2C communication on accessing registers | ||
| 95 | * @pdata: LP3943 platform specific data | ||
| 96 | * @mux_cfg: Register configuration for pin MUX | ||
| 97 | * @pin_used: Bit mask for output pin used. | ||
| 98 | * This bitmask is used for pin assignment management. | ||
| 99 | * 1 = pin used, 0 = available. | ||
| 100 | * Only LSB 16 bits are used, but it is unsigned long type | ||
| 101 | * for atomic bitwise operations. | ||
| 102 | */ | ||
| 103 | struct lp3943 { | ||
| 104 | struct device *dev; | ||
| 105 | struct regmap *regmap; | ||
| 106 | struct lp3943_platform_data *pdata; | ||
| 107 | const struct lp3943_reg_cfg *mux_cfg; | ||
| 108 | unsigned long pin_used; | ||
| 109 | }; | ||
| 110 | |||
| 111 | int lp3943_read_byte(struct lp3943 *lp3943, u8 reg, u8 *read); | ||
| 112 | int lp3943_write_byte(struct lp3943 *lp3943, u8 reg, u8 data); | ||
| 113 | int lp3943_update_bits(struct lp3943 *lp3943, u8 reg, u8 mask, u8 data); | ||
| 114 | #endif | ||
diff --git a/include/linux/mfd/max14577-private.h b/include/linux/mfd/max14577-private.h new file mode 100644 index 000000000000..a3d0185196d3 --- /dev/null +++ b/include/linux/mfd/max14577-private.h | |||
| @@ -0,0 +1,330 @@ | |||
| 1 | /* | ||
| 2 | * max14577-private.h - Common API for the Maxim 14577 internal sub chip | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 Samsung Electrnoics | ||
| 5 | * Chanwoo Choi <cw00.choi@samsung.com> | ||
| 6 | * Krzysztof Kozlowski <k.kozlowski@samsung.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __MAX14577_PRIVATE_H__ | ||
| 20 | #define __MAX14577_PRIVATE_H__ | ||
| 21 | |||
| 22 | #include <linux/i2c.h> | ||
| 23 | #include <linux/regmap.h> | ||
| 24 | |||
| 25 | #define MAX14577_REG_INVALID (0xff) | ||
| 26 | |||
| 27 | /* Slave addr = 0x4A: Interrupt */ | ||
| 28 | enum max14577_reg { | ||
| 29 | MAX14577_REG_DEVICEID = 0x00, | ||
| 30 | MAX14577_REG_INT1 = 0x01, | ||
| 31 | MAX14577_REG_INT2 = 0x02, | ||
| 32 | MAX14577_REG_INT3 = 0x03, | ||
| 33 | MAX14577_REG_STATUS1 = 0x04, | ||
| 34 | MAX14577_REG_STATUS2 = 0x05, | ||
| 35 | MAX14577_REG_STATUS3 = 0x06, | ||
| 36 | MAX14577_REG_INTMASK1 = 0x07, | ||
| 37 | MAX14577_REG_INTMASK2 = 0x08, | ||
| 38 | MAX14577_REG_INTMASK3 = 0x09, | ||
| 39 | MAX14577_REG_CDETCTRL1 = 0x0A, | ||
| 40 | MAX14577_REG_RFU = 0x0B, | ||
| 41 | MAX14577_REG_CONTROL1 = 0x0C, | ||
| 42 | MAX14577_REG_CONTROL2 = 0x0D, | ||
| 43 | MAX14577_REG_CONTROL3 = 0x0E, | ||
| 44 | MAX14577_REG_CHGCTRL1 = 0x0F, | ||
| 45 | MAX14577_REG_CHGCTRL2 = 0x10, | ||
| 46 | MAX14577_REG_CHGCTRL3 = 0x11, | ||
| 47 | MAX14577_REG_CHGCTRL4 = 0x12, | ||
| 48 | MAX14577_REG_CHGCTRL5 = 0x13, | ||
| 49 | MAX14577_REG_CHGCTRL6 = 0x14, | ||
| 50 | MAX14577_REG_CHGCTRL7 = 0x15, | ||
| 51 | |||
| 52 | MAX14577_REG_END, | ||
| 53 | }; | ||
| 54 | |||
| 55 | /* Slave addr = 0x4A: MUIC */ | ||
| 56 | enum max14577_muic_reg { | ||
| 57 | MAX14577_MUIC_REG_STATUS1 = 0x04, | ||
| 58 | MAX14577_MUIC_REG_STATUS2 = 0x05, | ||
| 59 | MAX14577_MUIC_REG_CONTROL1 = 0x0C, | ||
| 60 | MAX14577_MUIC_REG_CONTROL3 = 0x0E, | ||
| 61 | |||
| 62 | MAX14577_MUIC_REG_END, | ||
| 63 | }; | ||
| 64 | |||
| 65 | enum max14577_muic_charger_type { | ||
| 66 | MAX14577_CHARGER_TYPE_NONE = 0, | ||
| 67 | MAX14577_CHARGER_TYPE_USB, | ||
| 68 | MAX14577_CHARGER_TYPE_DOWNSTREAM_PORT, | ||
| 69 | MAX14577_CHARGER_TYPE_DEDICATED_CHG, | ||
| 70 | MAX14577_CHARGER_TYPE_SPECIAL_500MA, | ||
| 71 | MAX14577_CHARGER_TYPE_SPECIAL_1A, | ||
| 72 | MAX14577_CHARGER_TYPE_RESERVED, | ||
| 73 | MAX14577_CHARGER_TYPE_DEAD_BATTERY = 7, | ||
| 74 | }; | ||
| 75 | |||
| 76 | /* MAX14577 interrupts */ | ||
| 77 | #define INT1_ADC_MASK (0x1 << 0) | ||
| 78 | #define INT1_ADCLOW_MASK (0x1 << 1) | ||
| 79 | #define INT1_ADCERR_MASK (0x1 << 2) | ||
| 80 | |||
| 81 | #define INT2_CHGTYP_MASK (0x1 << 0) | ||
| 82 | #define INT2_CHGDETRUN_MASK (0x1 << 1) | ||
| 83 | #define INT2_DCDTMR_MASK (0x1 << 2) | ||
| 84 | #define INT2_DBCHG_MASK (0x1 << 3) | ||
| 85 | #define INT2_VBVOLT_MASK (0x1 << 4) | ||
| 86 | |||
| 87 | #define INT3_EOC_MASK (0x1 << 0) | ||
| 88 | #define INT3_CGMBC_MASK (0x1 << 1) | ||
| 89 | #define INT3_OVP_MASK (0x1 << 2) | ||
| 90 | #define INT3_MBCCHGERR_MASK (0x1 << 3) | ||
| 91 | |||
| 92 | /* MAX14577 DEVICE ID register */ | ||
| 93 | #define DEVID_VENDORID_SHIFT 0 | ||
| 94 | #define DEVID_DEVICEID_SHIFT 3 | ||
| 95 | #define DEVID_VENDORID_MASK (0x07 << DEVID_VENDORID_SHIFT) | ||
| 96 | #define DEVID_DEVICEID_MASK (0x1f << DEVID_DEVICEID_SHIFT) | ||
| 97 | |||
| 98 | /* MAX14577 STATUS1 register */ | ||
| 99 | #define STATUS1_ADC_SHIFT 0 | ||
| 100 | #define STATUS1_ADCLOW_SHIFT 5 | ||
| 101 | #define STATUS1_ADCERR_SHIFT 6 | ||
| 102 | #define STATUS1_ADC_MASK (0x1f << STATUS1_ADC_SHIFT) | ||
| 103 | #define STATUS1_ADCLOW_MASK (0x1 << STATUS1_ADCLOW_SHIFT) | ||
| 104 | #define STATUS1_ADCERR_MASK (0x1 << STATUS1_ADCERR_SHIFT) | ||
| 105 | |||
| 106 | /* MAX14577 STATUS2 register */ | ||
| 107 | #define STATUS2_CHGTYP_SHIFT 0 | ||
| 108 | #define STATUS2_CHGDETRUN_SHIFT 3 | ||
| 109 | #define STATUS2_DCDTMR_SHIFT 4 | ||
| 110 | #define STATUS2_DBCHG_SHIFT 5 | ||
| 111 | #define STATUS2_VBVOLT_SHIFT 6 | ||
| 112 | #define STATUS2_CHGTYP_MASK (0x7 << STATUS2_CHGTYP_SHIFT) | ||
| 113 | #define STATUS2_CHGDETRUN_MASK (0x1 << STATUS2_CHGDETRUN_SHIFT) | ||
| 114 | #define STATUS2_DCDTMR_MASK (0x1 << STATUS2_DCDTMR_SHIFT) | ||
| 115 | #define STATUS2_DBCHG_MASK (0x1 << STATUS2_DBCHG_SHIFT) | ||
| 116 | #define STATUS2_VBVOLT_MASK (0x1 << STATUS2_VBVOLT_SHIFT) | ||
| 117 | |||
| 118 | /* MAX14577 CONTROL1 register */ | ||
| 119 | #define COMN1SW_SHIFT 0 | ||
| 120 | #define COMP2SW_SHIFT 3 | ||
| 121 | #define MICEN_SHIFT 6 | ||
| 122 | #define IDBEN_SHIFT 7 | ||
| 123 | #define COMN1SW_MASK (0x7 << COMN1SW_SHIFT) | ||
| 124 | #define COMP2SW_MASK (0x7 << COMP2SW_SHIFT) | ||
| 125 | #define MICEN_MASK (0x1 << MICEN_SHIFT) | ||
| 126 | #define IDBEN_MASK (0x1 << IDBEN_SHIFT) | ||
| 127 | #define CLEAR_IDBEN_MICEN_MASK (COMN1SW_MASK | COMP2SW_MASK) | ||
| 128 | #define CTRL1_SW_USB ((1 << COMP2SW_SHIFT) \ | ||
| 129 | | (1 << COMN1SW_SHIFT)) | ||
| 130 | #define CTRL1_SW_AUDIO ((2 << COMP2SW_SHIFT) \ | ||
| 131 | | (2 << COMN1SW_SHIFT)) | ||
| 132 | #define CTRL1_SW_UART ((3 << COMP2SW_SHIFT) \ | ||
| 133 | | (3 << COMN1SW_SHIFT)) | ||
| 134 | #define CTRL1_SW_OPEN ((0 << COMP2SW_SHIFT) \ | ||
| 135 | | (0 << COMN1SW_SHIFT)) | ||
| 136 | |||
| 137 | /* MAX14577 CONTROL2 register */ | ||
| 138 | #define CTRL2_LOWPWR_SHIFT (0) | ||
| 139 | #define CTRL2_ADCEN_SHIFT (1) | ||
| 140 | #define CTRL2_CPEN_SHIFT (2) | ||
| 141 | #define CTRL2_SFOUTASRT_SHIFT (3) | ||
| 142 | #define CTRL2_SFOUTORD_SHIFT (4) | ||
| 143 | #define CTRL2_ACCDET_SHIFT (5) | ||
| 144 | #define CTRL2_USBCPINT_SHIFT (6) | ||
| 145 | #define CTRL2_RCPS_SHIFT (7) | ||
| 146 | #define CTRL2_LOWPWR_MASK (0x1 << CTRL2_LOWPWR_SHIFT) | ||
| 147 | #define CTRL2_ADCEN_MASK (0x1 << CTRL2_ADCEN_SHIFT) | ||
| 148 | #define CTRL2_CPEN_MASK (0x1 << CTRL2_CPEN_SHIFT) | ||
| 149 | #define CTRL2_SFOUTASRT_MASK (0x1 << CTRL2_SFOUTASRT_SHIFT) | ||
| 150 | #define CTRL2_SFOUTORD_MASK (0x1 << CTRL2_SFOUTORD_SHIFT) | ||
| 151 | #define CTRL2_ACCDET_MASK (0x1 << CTRL2_ACCDET_SHIFT) | ||
| 152 | #define CTRL2_USBCPINT_MASK (0x1 << CTRL2_USBCPINT_SHIFT) | ||
| 153 | #define CTRL2_RCPS_MASK (0x1 << CTR2_RCPS_SHIFT) | ||
| 154 | |||
| 155 | #define CTRL2_CPEN1_LOWPWR0 ((1 << CTRL2_CPEN_SHIFT) | \ | ||
| 156 | (0 << CTRL2_LOWPWR_SHIFT)) | ||
| 157 | #define CTRL2_CPEN0_LOWPWR1 ((0 << CTRL2_CPEN_SHIFT) | \ | ||
| 158 | (1 << CTRL2_LOWPWR_SHIFT)) | ||
| 159 | |||
| 160 | /* MAX14577 CONTROL3 register */ | ||
| 161 | #define CTRL3_JIGSET_SHIFT 0 | ||
| 162 | #define CTRL3_BOOTSET_SHIFT 2 | ||
| 163 | #define CTRL3_ADCDBSET_SHIFT 4 | ||
| 164 | #define CTRL3_JIGSET_MASK (0x3 << CTRL3_JIGSET_SHIFT) | ||
| 165 | #define CTRL3_BOOTSET_MASK (0x3 << CTRL3_BOOTSET_SHIFT) | ||
| 166 | #define CTRL3_ADCDBSET_MASK (0x3 << CTRL3_ADCDBSET_SHIFT) | ||
| 167 | |||
| 168 | /* Slave addr = 0x4A: Charger */ | ||
| 169 | enum max14577_charger_reg { | ||
| 170 | MAX14577_CHG_REG_STATUS3 = 0x06, | ||
| 171 | MAX14577_CHG_REG_CHG_CTRL1 = 0x0F, | ||
| 172 | MAX14577_CHG_REG_CHG_CTRL2 = 0x10, | ||
| 173 | MAX14577_CHG_REG_CHG_CTRL3 = 0x11, | ||
| 174 | MAX14577_CHG_REG_CHG_CTRL4 = 0x12, | ||
| 175 | MAX14577_CHG_REG_CHG_CTRL5 = 0x13, | ||
| 176 | MAX14577_CHG_REG_CHG_CTRL6 = 0x14, | ||
| 177 | MAX14577_CHG_REG_CHG_CTRL7 = 0x15, | ||
| 178 | |||
| 179 | MAX14577_CHG_REG_END, | ||
| 180 | }; | ||
| 181 | |||
| 182 | /* MAX14577 STATUS3 register */ | ||
| 183 | #define STATUS3_EOC_SHIFT 0 | ||
| 184 | #define STATUS3_CGMBC_SHIFT 1 | ||
| 185 | #define STATUS3_OVP_SHIFT 2 | ||
| 186 | #define STATUS3_MBCCHGERR_SHIFT 3 | ||
| 187 | #define STATUS3_EOC_MASK (0x1 << STATUS3_EOC_SHIFT) | ||
| 188 | #define STATUS3_CGMBC_MASK (0x1 << STATUS3_CGMBC_SHIFT) | ||
| 189 | #define STATUS3_OVP_MASK (0x1 << STATUS3_OVP_SHIFT) | ||
| 190 | #define STATUS3_MBCCHGERR_MASK (0x1 << STATUS3_MBCCHGERR_SHIFT) | ||
| 191 | |||
| 192 | /* MAX14577 CDETCTRL1 register */ | ||
| 193 | #define CDETCTRL1_CHGDETEN_SHIFT 0 | ||
| 194 | #define CDETCTRL1_CHGTYPMAN_SHIFT 1 | ||
| 195 | #define CDETCTRL1_DCDEN_SHIFT 2 | ||
| 196 | #define CDETCTRL1_DCD2SCT_SHIFT 3 | ||
| 197 | #define CDETCTRL1_DCHKTM_SHIFT 4 | ||
| 198 | #define CDETCTRL1_DBEXIT_SHIFT 5 | ||
| 199 | #define CDETCTRL1_DBIDLE_SHIFT 6 | ||
| 200 | #define CDETCTRL1_CDPDET_SHIFT 7 | ||
| 201 | #define CDETCTRL1_CHGDETEN_MASK (0x1 << CDETCTRL1_CHGDETEN_SHIFT) | ||
| 202 | #define CDETCTRL1_CHGTYPMAN_MASK (0x1 << CDETCTRL1_CHGTYPMAN_SHIFT) | ||
| 203 | #define CDETCTRL1_DCDEN_MASK (0x1 << CDETCTRL1_DCDEN_SHIFT) | ||
| 204 | #define CDETCTRL1_DCD2SCT_MASK (0x1 << CDETCTRL1_DCD2SCT_SHIFT) | ||
| 205 | #define CDETCTRL1_DCHKTM_MASK (0x1 << CDETCTRL1_DCHKTM_SHIFT) | ||
| 206 | #define CDETCTRL1_DBEXIT_MASK (0x1 << CDETCTRL1_DBEXIT_SHIFT) | ||
| 207 | #define CDETCTRL1_DBIDLE_MASK (0x1 << CDETCTRL1_DBIDLE_SHIFT) | ||
| 208 | #define CDETCTRL1_CDPDET_MASK (0x1 << CDETCTRL1_CDPDET_SHIFT) | ||
| 209 | |||
| 210 | /* MAX14577 CHGCTRL1 register */ | ||
| 211 | #define CHGCTRL1_TCHW_SHIFT 4 | ||
| 212 | #define CHGCTRL1_TCHW_MASK (0x7 << CHGCTRL1_TCHW_SHIFT) | ||
| 213 | |||
| 214 | /* MAX14577 CHGCTRL2 register */ | ||
| 215 | #define CHGCTRL2_MBCHOSTEN_SHIFT 6 | ||
| 216 | #define CHGCTRL2_MBCHOSTEN_MASK (0x1 << CHGCTRL2_MBCHOSTEN_SHIFT) | ||
| 217 | #define CHGCTRL2_VCHGR_RC_SHIFT 7 | ||
| 218 | #define CHGCTRL2_VCHGR_RC_MASK (0x1 << CHGCTRL2_VCHGR_RC_SHIFT) | ||
| 219 | |||
| 220 | /* MAX14577 CHGCTRL3 register */ | ||
| 221 | #define CHGCTRL3_MBCCVWRC_SHIFT 0 | ||
| 222 | #define CHGCTRL3_MBCCVWRC_MASK (0xf << CHGCTRL3_MBCCVWRC_SHIFT) | ||
| 223 | |||
| 224 | /* MAX14577 CHGCTRL4 register */ | ||
| 225 | #define CHGCTRL4_MBCICHWRCH_SHIFT 0 | ||
| 226 | #define CHGCTRL4_MBCICHWRCH_MASK (0xf << CHGCTRL4_MBCICHWRCH_SHIFT) | ||
| 227 | #define CHGCTRL4_MBCICHWRCL_SHIFT 4 | ||
| 228 | #define CHGCTRL4_MBCICHWRCL_MASK (0x1 << CHGCTRL4_MBCICHWRCL_SHIFT) | ||
| 229 | |||
| 230 | /* MAX14577 CHGCTRL5 register */ | ||
| 231 | #define CHGCTRL5_EOCS_SHIFT 0 | ||
| 232 | #define CHGCTRL5_EOCS_MASK (0xf << CHGCTRL5_EOCS_SHIFT) | ||
| 233 | |||
| 234 | /* MAX14577 CHGCTRL6 register */ | ||
| 235 | #define CHGCTRL6_AUTOSTOP_SHIFT 5 | ||
| 236 | #define CHGCTRL6_AUTOSTOP_MASK (0x1 << CHGCTRL6_AUTOSTOP_SHIFT) | ||
| 237 | |||
| 238 | /* MAX14577 CHGCTRL7 register */ | ||
| 239 | #define CHGCTRL7_OTPCGHCVS_SHIFT 0 | ||
| 240 | #define CHGCTRL7_OTPCGHCVS_MASK (0x3 << CHGCTRL7_OTPCGHCVS_SHIFT) | ||
| 241 | |||
| 242 | /* MAX14577 regulator current limits (as in CHGCTRL4 register), uA */ | ||
| 243 | #define MAX14577_REGULATOR_CURRENT_LIMIT_MIN 90000 | ||
| 244 | #define MAX14577_REGULATOR_CURRENT_LIMIT_HIGH_START 200000 | ||
| 245 | #define MAX14577_REGULATOR_CURRENT_LIMIT_HIGH_STEP 50000 | ||
| 246 | #define MAX14577_REGULATOR_CURRENT_LIMIT_MAX 950000 | ||
| 247 | |||
| 248 | /* MAX14577 regulator SFOUT LDO voltage, fixed, uV */ | ||
| 249 | #define MAX14577_REGULATOR_SAFEOUT_VOLTAGE 4900000 | ||
| 250 | |||
| 251 | enum max14577_irq_source { | ||
| 252 | MAX14577_IRQ_INT1 = 0, | ||
| 253 | MAX14577_IRQ_INT2, | ||
| 254 | MAX14577_IRQ_INT3, | ||
| 255 | |||
| 256 | MAX14577_IRQ_REGS_NUM, | ||
| 257 | }; | ||
| 258 | |||
| 259 | enum max14577_irq { | ||
| 260 | /* INT1 */ | ||
| 261 | MAX14577_IRQ_INT1_ADC, | ||
| 262 | MAX14577_IRQ_INT1_ADCLOW, | ||
| 263 | MAX14577_IRQ_INT1_ADCERR, | ||
| 264 | |||
| 265 | /* INT2 */ | ||
| 266 | MAX14577_IRQ_INT2_CHGTYP, | ||
| 267 | MAX14577_IRQ_INT2_CHGDETRUN, | ||
| 268 | MAX14577_IRQ_INT2_DCDTMR, | ||
| 269 | MAX14577_IRQ_INT2_DBCHG, | ||
| 270 | MAX14577_IRQ_INT2_VBVOLT, | ||
| 271 | |||
| 272 | /* INT3 */ | ||
| 273 | MAX14577_IRQ_INT3_EOC, | ||
| 274 | MAX14577_IRQ_INT3_CGMBC, | ||
| 275 | MAX14577_IRQ_INT3_OVP, | ||
| 276 | MAX14577_IRQ_INT3_MBCCHGERR, | ||
| 277 | |||
| 278 | MAX14577_IRQ_NUM, | ||
| 279 | }; | ||
| 280 | |||
| 281 | struct max14577 { | ||
| 282 | struct device *dev; | ||
| 283 | struct i2c_client *i2c; /* Slave addr = 0x4A */ | ||
| 284 | |||
| 285 | struct regmap *regmap; | ||
| 286 | |||
| 287 | struct regmap_irq_chip_data *irq_data; | ||
| 288 | int irq; | ||
| 289 | |||
| 290 | /* Device ID */ | ||
| 291 | u8 vendor_id; /* Vendor Identification */ | ||
| 292 | u8 device_id; /* Chip Version */ | ||
| 293 | }; | ||
| 294 | |||
| 295 | /* MAX14577 shared regmap API function */ | ||
| 296 | static inline int max14577_read_reg(struct regmap *map, u8 reg, u8 *dest) | ||
| 297 | { | ||
| 298 | unsigned int val; | ||
| 299 | int ret; | ||
| 300 | |||
| 301 | ret = regmap_read(map, reg, &val); | ||
| 302 | *dest = val; | ||
| 303 | |||
| 304 | return ret; | ||
| 305 | } | ||
| 306 | |||
| 307 | static inline int max14577_bulk_read(struct regmap *map, u8 reg, u8 *buf, | ||
| 308 | int count) | ||
| 309 | { | ||
| 310 | return regmap_bulk_read(map, reg, buf, count); | ||
| 311 | } | ||
| 312 | |||
| 313 | static inline int max14577_write_reg(struct regmap *map, u8 reg, u8 value) | ||
| 314 | { | ||
| 315 | return regmap_write(map, reg, value); | ||
| 316 | } | ||
| 317 | |||
| 318 | static inline int max14577_bulk_write(struct regmap *map, u8 reg, u8 *buf, | ||
| 319 | int count) | ||
| 320 | { | ||
| 321 | return regmap_bulk_write(map, reg, buf, count); | ||
| 322 | } | ||
| 323 | |||
| 324 | static inline int max14577_update_reg(struct regmap *map, u8 reg, u8 mask, | ||
| 325 | u8 val) | ||
| 326 | { | ||
| 327 | return regmap_update_bits(map, reg, mask, val); | ||
| 328 | } | ||
| 329 | |||
| 330 | #endif /* __MAX14577_PRIVATE_H__ */ | ||
diff --git a/include/linux/mfd/max14577.h b/include/linux/mfd/max14577.h new file mode 100644 index 000000000000..247b021dfaaf --- /dev/null +++ b/include/linux/mfd/max14577.h | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | /* | ||
| 2 | * max14577.h - Driver for the Maxim 14577 | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 Samsung Electrnoics | ||
| 5 | * Chanwoo Choi <cw00.choi@samsung.com> | ||
| 6 | * Krzysztof Kozlowski <k.kozlowski@samsung.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * This driver is based on max8997.h | ||
| 19 | * | ||
| 20 | * MAX14577 has MUIC, Charger devices. | ||
| 21 | * The devices share the same I2C bus and interrupt line | ||
| 22 | * included in this mfd driver. | ||
| 23 | */ | ||
| 24 | |||
| 25 | #ifndef __MAX14577_H__ | ||
| 26 | #define __MAX14577_H__ | ||
| 27 | |||
| 28 | #include <linux/mfd/max14577-private.h> | ||
| 29 | #include <linux/regulator/consumer.h> | ||
| 30 | |||
| 31 | /* | ||
| 32 | * MAX14577 Regulator | ||
| 33 | */ | ||
| 34 | |||
| 35 | /* MAX14577 regulator IDs */ | ||
| 36 | enum max14577_regulators { | ||
| 37 | MAX14577_SAFEOUT = 0, | ||
| 38 | MAX14577_CHARGER, | ||
| 39 | |||
| 40 | MAX14577_REG_MAX, | ||
| 41 | }; | ||
| 42 | |||
| 43 | struct max14577_regulator_platform_data { | ||
| 44 | int id; | ||
| 45 | struct regulator_init_data *initdata; | ||
| 46 | struct device_node *of_node; | ||
| 47 | }; | ||
| 48 | |||
| 49 | /* | ||
| 50 | * MAX14577 MFD platform data | ||
| 51 | */ | ||
| 52 | struct max14577_platform_data { | ||
| 53 | /* IRQ */ | ||
| 54 | int irq_base; | ||
| 55 | |||
| 56 | /* current control GPIOs */ | ||
| 57 | int gpio_pogo_vbatt_en; | ||
| 58 | int gpio_pogo_vbus_en; | ||
| 59 | |||
| 60 | /* current control GPIO control function */ | ||
| 61 | int (*set_gpio_pogo_vbatt_en) (int gpio_val); | ||
| 62 | int (*set_gpio_pogo_vbus_en) (int gpio_val); | ||
| 63 | |||
| 64 | int (*set_gpio_pogo_cb) (int new_dev); | ||
| 65 | |||
| 66 | struct max14577_regulator_platform_data *regulators; | ||
| 67 | }; | ||
| 68 | |||
| 69 | #endif /* __MAX14577_H__ */ | ||
diff --git a/include/linux/mfd/max77686-private.h b/include/linux/mfd/max77686-private.h index d327d4971e4f..8c75a9c8dfab 100644 --- a/include/linux/mfd/max77686-private.h +++ b/include/linux/mfd/max77686-private.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * max77686.h - Voltage regulator driver for the Maxim 77686 | 2 | * max77686-private.h - Voltage regulator driver for the Maxim 77686 |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2012 Samsung Electrnoics | 4 | * Copyright (C) 2012 Samsung Electrnoics |
| 5 | * Chiwoong Byun <woong.byun@samsung.com> | 5 | * Chiwoong Byun <woong.byun@samsung.com> |
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h index fb465dfbb59e..ad1ae7f345ad 100644 --- a/include/linux/mfd/max8997-private.h +++ b/include/linux/mfd/max8997-private.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * max8997.h - Voltage regulator driver for the Maxim 8997 | 2 | * max8997-private.h - Voltage regulator driver for the Maxim 8997 |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2010 Samsung Electrnoics | 4 | * Copyright (C) 2010 Samsung Electrnoics |
| 5 | * MyungJoo Ham <myungjoo.ham@samsung.com> | 5 | * MyungJoo Ham <myungjoo.ham@samsung.com> |
diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h index 84844e0a5704..4ecb24b4b863 100644 --- a/include/linux/mfd/max8998-private.h +++ b/include/linux/mfd/max8998-private.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * max8998.h - Voltage regulator driver for the Maxim 8998 | 2 | * max8998-private.h - Voltage regulator driver for the Maxim 8998 |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2009-2010 Samsung Electrnoics | 4 | * Copyright (C) 2009-2010 Samsung Electrnoics |
| 5 | * Kyungmin Park <kyungmin.park@samsung.com> | 5 | * Kyungmin Park <kyungmin.park@samsung.com> |
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h index 67c17b5a6f44..6156686bf108 100644 --- a/include/linux/mfd/mc13xxx.h +++ b/include/linux/mfd/mc13xxx.h | |||
| @@ -21,8 +21,6 @@ int mc13xxx_reg_write(struct mc13xxx *mc13xxx, unsigned int offset, u32 val); | |||
| 21 | int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset, | 21 | int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset, |
| 22 | u32 mask, u32 val); | 22 | u32 mask, u32 val); |
| 23 | 23 | ||
| 24 | int mc13xxx_get_flags(struct mc13xxx *mc13xxx); | ||
| 25 | |||
| 26 | int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq, | 24 | int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq, |
| 27 | irq_handler_t handler, const char *name, void *dev); | 25 | irq_handler_t handler, const char *name, void *dev); |
| 28 | int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq, | 26 | int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq, |
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index 2d0c9071bcfb..cab2dd279076 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h | |||
| @@ -39,7 +39,8 @@ enum sec_device_type { | |||
| 39 | struct sec_pmic_dev { | 39 | struct sec_pmic_dev { |
| 40 | struct device *dev; | 40 | struct device *dev; |
| 41 | struct sec_platform_data *pdata; | 41 | struct sec_platform_data *pdata; |
| 42 | struct regmap *regmap; | 42 | struct regmap *regmap_pmic; |
| 43 | struct regmap *regmap_rtc; | ||
| 43 | struct i2c_client *i2c; | 44 | struct i2c_client *i2c; |
| 44 | struct i2c_client *rtc; | 45 | struct i2c_client *rtc; |
| 45 | 46 | ||
diff --git a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h index b6d36b38b99c..866e355fa409 100644 --- a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h +++ b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h | |||
| @@ -212,6 +212,7 @@ | |||
| 212 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU1_DI1 (0x1 << 4) | 212 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU1_DI1 (0x1 << 4) |
| 213 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI0 (0x2 << 4) | 213 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI0 (0x2 << 4) |
| 214 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI1 (0x3 << 4) | 214 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI1 (0x3 << 4) |
| 215 | #define IMX6Q_GPR3_HDMI_MUX_CTL_SHIFT 2 | ||
| 215 | #define IMX6Q_GPR3_HDMI_MUX_CTL_MASK (0x3 << 2) | 216 | #define IMX6Q_GPR3_HDMI_MUX_CTL_MASK (0x3 << 2) |
| 216 | #define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI0 (0x0 << 2) | 217 | #define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI0 (0x0 << 2) |
| 217 | #define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI1 (0x1 << 2) | 218 | #define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI1 (0x1 << 2) |
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h index d498d98f0c2c..fb96c84dada5 100644 --- a/include/linux/mfd/ti_am335x_tscadc.h +++ b/include/linux/mfd/ti_am335x_tscadc.h | |||
| @@ -159,6 +159,9 @@ struct ti_tscadc_dev { | |||
| 159 | int adc_cell; /* -1 if not used */ | 159 | int adc_cell; /* -1 if not used */ |
| 160 | struct mfd_cell cells[TSCADC_CELLS]; | 160 | struct mfd_cell cells[TSCADC_CELLS]; |
| 161 | u32 reg_se_cache; | 161 | u32 reg_se_cache; |
| 162 | bool adc_waiting; | ||
| 163 | bool adc_in_use; | ||
| 164 | wait_queue_head_t reg_se_wait; | ||
| 162 | spinlock_t reg_lock; | 165 | spinlock_t reg_lock; |
| 163 | unsigned int clk_div; | 166 | unsigned int clk_div; |
| 164 | 167 | ||
| @@ -176,8 +179,9 @@ static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p) | |||
| 176 | return *tscadc_dev; | 179 | return *tscadc_dev; |
| 177 | } | 180 | } |
| 178 | 181 | ||
| 179 | void am335x_tsc_se_update(struct ti_tscadc_dev *tsadc); | 182 | void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tsadc, u32 val); |
| 180 | void am335x_tsc_se_set(struct ti_tscadc_dev *tsadc, u32 val); | 183 | void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val); |
| 181 | void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val); | 184 | void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val); |
| 185 | void am335x_tsc_se_adc_done(struct ti_tscadc_dev *tsadc); | ||
| 182 | 186 | ||
| 183 | #endif | 187 | #endif |
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h index 87994542573b..cbecec2e353a 100644 --- a/include/linux/mfd/tps6586x.h +++ b/include/linux/mfd/tps6586x.h | |||
| @@ -13,6 +13,12 @@ | |||
| 13 | #define TPS6586X_SLEW_RATE_SET 0x08 | 13 | #define TPS6586X_SLEW_RATE_SET 0x08 |
| 14 | #define TPS6586X_SLEW_RATE_MASK 0x07 | 14 | #define TPS6586X_SLEW_RATE_MASK 0x07 |
| 15 | 15 | ||
| 16 | /* VERSION CRC */ | ||
| 17 | #define TPS658621A 0x15 | ||
| 18 | #define TPS658621CD 0x2c | ||
| 19 | #define TPS658623 0x1b | ||
| 20 | #define TPS658643 0x03 | ||
| 21 | |||
| 16 | enum { | 22 | enum { |
| 17 | TPS6586X_ID_SYS, | 23 | TPS6586X_ID_SYS, |
| 18 | TPS6586X_ID_SM_0, | 24 | TPS6586X_ID_SM_0, |
| @@ -97,5 +103,6 @@ extern int tps6586x_clr_bits(struct device *dev, int reg, uint8_t bit_mask); | |||
| 97 | extern int tps6586x_update(struct device *dev, int reg, uint8_t val, | 103 | extern int tps6586x_update(struct device *dev, int reg, uint8_t val, |
| 98 | uint8_t mask); | 104 | uint8_t mask); |
| 99 | extern int tps6586x_irq_get_virq(struct device *dev, int irq); | 105 | extern int tps6586x_irq_get_virq(struct device *dev, int irq); |
| 106 | extern int tps6586x_get_version(struct device *dev); | ||
| 100 | 107 | ||
| 101 | #endif /*__LINUX_MFD_TPS6586X_H */ | 108 | #endif /*__LINUX_MFD_TPS6586X_H */ |
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h index ad05ce60c1c9..2e5b194b9b19 100644 --- a/include/linux/micrel_phy.h +++ b/include/linux/micrel_phy.h | |||
| @@ -22,6 +22,8 @@ | |||
| 22 | #define PHY_ID_KSZ8021 0x00221555 | 22 | #define PHY_ID_KSZ8021 0x00221555 |
| 23 | #define PHY_ID_KSZ8031 0x00221556 | 23 | #define PHY_ID_KSZ8031 0x00221556 |
| 24 | #define PHY_ID_KSZ8041 0x00221510 | 24 | #define PHY_ID_KSZ8041 0x00221510 |
| 25 | /* undocumented */ | ||
| 26 | #define PHY_ID_KSZ8041RNLI 0x00221537 | ||
| 25 | #define PHY_ID_KSZ8051 0x00221550 | 27 | #define PHY_ID_KSZ8051 0x00221550 |
| 26 | /* same id: ks8001 Rev. A/B, and ks8721 Rev 3. */ | 28 | /* same id: ks8001 Rev. A/B, and ks8721 Rev 3. */ |
| 27 | #define PHY_ID_KSZ8001 0x0022161A | 29 | #define PHY_ID_KSZ8001 0x0022161A |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index f5096b58b20d..84a31ad0b791 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
| @@ -35,16 +35,12 @@ enum migrate_reason { | |||
| 35 | 35 | ||
| 36 | #ifdef CONFIG_MIGRATION | 36 | #ifdef CONFIG_MIGRATION |
| 37 | 37 | ||
| 38 | extern void putback_lru_pages(struct list_head *l); | ||
| 39 | extern void putback_movable_pages(struct list_head *l); | 38 | extern void putback_movable_pages(struct list_head *l); |
| 40 | extern int migrate_page(struct address_space *, | 39 | extern int migrate_page(struct address_space *, |
| 41 | struct page *, struct page *, enum migrate_mode); | 40 | struct page *, struct page *, enum migrate_mode); |
| 42 | extern int migrate_pages(struct list_head *l, new_page_t x, | 41 | extern int migrate_pages(struct list_head *l, new_page_t x, |
| 43 | unsigned long private, enum migrate_mode mode, int reason); | 42 | unsigned long private, enum migrate_mode mode, int reason); |
| 44 | 43 | ||
| 45 | extern int fail_migrate_page(struct address_space *, | ||
| 46 | struct page *, struct page *); | ||
| 47 | |||
| 48 | extern int migrate_prep(void); | 44 | extern int migrate_prep(void); |
| 49 | extern int migrate_prep_local(void); | 45 | extern int migrate_prep_local(void); |
| 50 | extern int migrate_vmas(struct mm_struct *mm, | 46 | extern int migrate_vmas(struct mm_struct *mm, |
| @@ -55,10 +51,10 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
| 55 | struct page *newpage, struct page *page); | 51 | struct page *newpage, struct page *page); |
| 56 | extern int migrate_page_move_mapping(struct address_space *mapping, | 52 | extern int migrate_page_move_mapping(struct address_space *mapping, |
| 57 | struct page *newpage, struct page *page, | 53 | struct page *newpage, struct page *page, |
| 58 | struct buffer_head *head, enum migrate_mode mode); | 54 | struct buffer_head *head, enum migrate_mode mode, |
| 55 | int extra_count); | ||
| 59 | #else | 56 | #else |
| 60 | 57 | ||
| 61 | static inline void putback_lru_pages(struct list_head *l) {} | ||
| 62 | static inline void putback_movable_pages(struct list_head *l) {} | 58 | static inline void putback_movable_pages(struct list_head *l) {} |
| 63 | static inline int migrate_pages(struct list_head *l, new_page_t x, | 59 | static inline int migrate_pages(struct list_head *l, new_page_t x, |
| 64 | unsigned long private, enum migrate_mode mode, int reason) | 60 | unsigned long private, enum migrate_mode mode, int reason) |
| @@ -85,15 +81,23 @@ static inline int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
| 85 | 81 | ||
| 86 | /* Possible settings for the migrate_page() method in address_operations */ | 82 | /* Possible settings for the migrate_page() method in address_operations */ |
| 87 | #define migrate_page NULL | 83 | #define migrate_page NULL |
| 88 | #define fail_migrate_page NULL | ||
| 89 | 84 | ||
| 90 | #endif /* CONFIG_MIGRATION */ | 85 | #endif /* CONFIG_MIGRATION */ |
| 91 | 86 | ||
| 92 | #ifdef CONFIG_NUMA_BALANCING | 87 | #ifdef CONFIG_NUMA_BALANCING |
| 88 | extern bool pmd_trans_migrating(pmd_t pmd); | ||
| 89 | extern void wait_migrate_huge_page(struct anon_vma *anon_vma, pmd_t *pmd); | ||
| 93 | extern int migrate_misplaced_page(struct page *page, | 90 | extern int migrate_misplaced_page(struct page *page, |
| 94 | struct vm_area_struct *vma, int node); | 91 | struct vm_area_struct *vma, int node); |
| 95 | extern bool migrate_ratelimited(int node); | 92 | extern bool migrate_ratelimited(int node); |
| 96 | #else | 93 | #else |
| 94 | static inline bool pmd_trans_migrating(pmd_t pmd) | ||
| 95 | { | ||
| 96 | return false; | ||
| 97 | } | ||
| 98 | static inline void wait_migrate_huge_page(struct anon_vma *anon_vma, pmd_t *pmd) | ||
| 99 | { | ||
| 100 | } | ||
| 97 | static inline int migrate_misplaced_page(struct page *page, | 101 | static inline int migrate_misplaced_page(struct page *page, |
| 98 | struct vm_area_struct *vma, int node) | 102 | struct vm_area_struct *vma, int node) |
| 99 | { | 103 | { |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 1cedd000cf29..d9992fc128ca 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
| 7 | 7 | ||
| 8 | #include <linux/mmdebug.h> | ||
| 8 | #include <linux/gfp.h> | 9 | #include <linux/gfp.h> |
| 9 | #include <linux/bug.h> | 10 | #include <linux/bug.h> |
| 10 | #include <linux/list.h> | 11 | #include <linux/list.h> |
| @@ -57,6 +58,15 @@ extern int sysctl_legacy_va_layout; | |||
| 57 | extern unsigned long sysctl_user_reserve_kbytes; | 58 | extern unsigned long sysctl_user_reserve_kbytes; |
| 58 | extern unsigned long sysctl_admin_reserve_kbytes; | 59 | extern unsigned long sysctl_admin_reserve_kbytes; |
| 59 | 60 | ||
| 61 | extern int sysctl_overcommit_memory; | ||
| 62 | extern int sysctl_overcommit_ratio; | ||
| 63 | extern unsigned long sysctl_overcommit_kbytes; | ||
| 64 | |||
| 65 | extern int overcommit_ratio_handler(struct ctl_table *, int, void __user *, | ||
| 66 | size_t *, loff_t *); | ||
| 67 | extern int overcommit_kbytes_handler(struct ctl_table *, int, void __user *, | ||
| 68 | size_t *, loff_t *); | ||
| 69 | |||
| 60 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) | 70 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) |
| 61 | 71 | ||
| 62 | /* to align the pointer to the (next) page boundary */ | 72 | /* to align the pointer to the (next) page boundary */ |
| @@ -294,7 +304,7 @@ static inline int get_freepage_migratetype(struct page *page) | |||
| 294 | */ | 304 | */ |
| 295 | static inline int put_page_testzero(struct page *page) | 305 | static inline int put_page_testzero(struct page *page) |
| 296 | { | 306 | { |
| 297 | VM_BUG_ON(atomic_read(&page->_count) == 0); | 307 | VM_BUG_ON_PAGE(atomic_read(&page->_count) == 0, page); |
| 298 | return atomic_dec_and_test(&page->_count); | 308 | return atomic_dec_and_test(&page->_count); |
| 299 | } | 309 | } |
| 300 | 310 | ||
| @@ -355,7 +365,7 @@ static inline int is_vmalloc_or_module_addr(const void *x) | |||
| 355 | static inline void compound_lock(struct page *page) | 365 | static inline void compound_lock(struct page *page) |
| 356 | { | 366 | { |
| 357 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 367 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
| 358 | VM_BUG_ON(PageSlab(page)); | 368 | VM_BUG_ON_PAGE(PageSlab(page), page); |
| 359 | bit_spin_lock(PG_compound_lock, &page->flags); | 369 | bit_spin_lock(PG_compound_lock, &page->flags); |
| 360 | #endif | 370 | #endif |
| 361 | } | 371 | } |
| @@ -363,7 +373,7 @@ static inline void compound_lock(struct page *page) | |||
| 363 | static inline void compound_unlock(struct page *page) | 373 | static inline void compound_unlock(struct page *page) |
| 364 | { | 374 | { |
| 365 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 375 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
| 366 | VM_BUG_ON(PageSlab(page)); | 376 | VM_BUG_ON_PAGE(PageSlab(page), page); |
| 367 | bit_spin_unlock(PG_compound_lock, &page->flags); | 377 | bit_spin_unlock(PG_compound_lock, &page->flags); |
| 368 | #endif | 378 | #endif |
| 369 | } | 379 | } |
| @@ -414,15 +424,44 @@ static inline int page_count(struct page *page) | |||
| 414 | return atomic_read(&compound_head(page)->_count); | 424 | return atomic_read(&compound_head(page)->_count); |
| 415 | } | 425 | } |
| 416 | 426 | ||
| 427 | #ifdef CONFIG_HUGETLB_PAGE | ||
| 428 | extern int PageHeadHuge(struct page *page_head); | ||
| 429 | #else /* CONFIG_HUGETLB_PAGE */ | ||
| 430 | static inline int PageHeadHuge(struct page *page_head) | ||
| 431 | { | ||
| 432 | return 0; | ||
| 433 | } | ||
| 434 | #endif /* CONFIG_HUGETLB_PAGE */ | ||
| 435 | |||
| 436 | static inline bool __compound_tail_refcounted(struct page *page) | ||
| 437 | { | ||
| 438 | return !PageSlab(page) && !PageHeadHuge(page); | ||
| 439 | } | ||
| 440 | |||
| 441 | /* | ||
| 442 | * This takes a head page as parameter and tells if the | ||
| 443 | * tail page reference counting can be skipped. | ||
| 444 | * | ||
| 445 | * For this to be safe, PageSlab and PageHeadHuge must remain true on | ||
| 446 | * any given page where they return true here, until all tail pins | ||
| 447 | * have been released. | ||
| 448 | */ | ||
| 449 | static inline bool compound_tail_refcounted(struct page *page) | ||
| 450 | { | ||
| 451 | VM_BUG_ON_PAGE(!PageHead(page), page); | ||
| 452 | return __compound_tail_refcounted(page); | ||
| 453 | } | ||
| 454 | |||
| 417 | static inline void get_huge_page_tail(struct page *page) | 455 | static inline void get_huge_page_tail(struct page *page) |
| 418 | { | 456 | { |
| 419 | /* | 457 | /* |
| 420 | * __split_huge_page_refcount() cannot run | 458 | * __split_huge_page_refcount() cannot run from under us. |
| 421 | * from under us. | ||
| 422 | */ | 459 | */ |
| 423 | VM_BUG_ON(page_mapcount(page) < 0); | 460 | VM_BUG_ON_PAGE(!PageTail(page), page); |
| 424 | VM_BUG_ON(atomic_read(&page->_count) != 0); | 461 | VM_BUG_ON_PAGE(page_mapcount(page) < 0, page); |
| 425 | atomic_inc(&page->_mapcount); | 462 | VM_BUG_ON_PAGE(atomic_read(&page->_count) != 0, page); |
| 463 | if (compound_tail_refcounted(page->first_page)) | ||
| 464 | atomic_inc(&page->_mapcount); | ||
| 426 | } | 465 | } |
| 427 | 466 | ||
| 428 | extern bool __get_page_tail(struct page *page); | 467 | extern bool __get_page_tail(struct page *page); |
| @@ -436,7 +475,7 @@ static inline void get_page(struct page *page) | |||
| 436 | * Getting a normal page or the head of a compound page | 475 | * Getting a normal page or the head of a compound page |
| 437 | * requires to already have an elevated page->_count. | 476 | * requires to already have an elevated page->_count. |
| 438 | */ | 477 | */ |
| 439 | VM_BUG_ON(atomic_read(&page->_count) <= 0); | 478 | VM_BUG_ON_PAGE(atomic_read(&page->_count) <= 0, page); |
| 440 | atomic_inc(&page->_count); | 479 | atomic_inc(&page->_count); |
| 441 | } | 480 | } |
| 442 | 481 | ||
| @@ -473,13 +512,13 @@ static inline int PageBuddy(struct page *page) | |||
| 473 | 512 | ||
| 474 | static inline void __SetPageBuddy(struct page *page) | 513 | static inline void __SetPageBuddy(struct page *page) |
| 475 | { | 514 | { |
| 476 | VM_BUG_ON(atomic_read(&page->_mapcount) != -1); | 515 | VM_BUG_ON_PAGE(atomic_read(&page->_mapcount) != -1, page); |
| 477 | atomic_set(&page->_mapcount, PAGE_BUDDY_MAPCOUNT_VALUE); | 516 | atomic_set(&page->_mapcount, PAGE_BUDDY_MAPCOUNT_VALUE); |
| 478 | } | 517 | } |
| 479 | 518 | ||
| 480 | static inline void __ClearPageBuddy(struct page *page) | 519 | static inline void __ClearPageBuddy(struct page *page) |
| 481 | { | 520 | { |
| 482 | VM_BUG_ON(!PageBuddy(page)); | 521 | VM_BUG_ON_PAGE(!PageBuddy(page), page); |
| 483 | atomic_set(&page->_mapcount, -1); | 522 | atomic_set(&page->_mapcount, -1); |
| 484 | } | 523 | } |
| 485 | 524 | ||
| @@ -846,11 +885,14 @@ static __always_inline void *lowmem_page_address(const struct page *page) | |||
| 846 | #endif | 885 | #endif |
| 847 | 886 | ||
| 848 | #if defined(WANT_PAGE_VIRTUAL) | 887 | #if defined(WANT_PAGE_VIRTUAL) |
| 849 | #define page_address(page) ((page)->virtual) | 888 | static inline void *page_address(const struct page *page) |
| 850 | #define set_page_address(page, address) \ | 889 | { |
| 851 | do { \ | 890 | return page->virtual; |
| 852 | (page)->virtual = (address); \ | 891 | } |
| 853 | } while(0) | 892 | static inline void set_page_address(struct page *page, void *address) |
| 893 | { | ||
| 894 | page->virtual = address; | ||
| 895 | } | ||
| 854 | #define page_address_init() do { } while(0) | 896 | #define page_address_init() do { } while(0) |
| 855 | #endif | 897 | #endif |
| 856 | 898 | ||
| @@ -984,7 +1026,6 @@ extern void pagefault_out_of_memory(void); | |||
| 984 | * various contexts. | 1026 | * various contexts. |
| 985 | */ | 1027 | */ |
| 986 | #define SHOW_MEM_FILTER_NODES (0x0001u) /* disallowed nodes */ | 1028 | #define SHOW_MEM_FILTER_NODES (0x0001u) /* disallowed nodes */ |
| 987 | #define SHOW_MEM_FILTER_PAGE_COUNT (0x0002u) /* page type count */ | ||
| 988 | 1029 | ||
| 989 | extern void show_free_areas(unsigned int flags); | 1030 | extern void show_free_areas(unsigned int flags); |
| 990 | extern bool skip_free_areas_node(unsigned int flags, int nid); | 1031 | extern bool skip_free_areas_node(unsigned int flags, int nid); |
| @@ -1317,7 +1358,8 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a | |||
| 1317 | #endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ | 1358 | #endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ |
| 1318 | 1359 | ||
| 1319 | #if USE_SPLIT_PTE_PTLOCKS | 1360 | #if USE_SPLIT_PTE_PTLOCKS |
| 1320 | #if BLOATED_SPINLOCKS | 1361 | #if ALLOC_SPLIT_PTLOCKS |
| 1362 | void __init ptlock_cache_init(void); | ||
| 1321 | extern bool ptlock_alloc(struct page *page); | 1363 | extern bool ptlock_alloc(struct page *page); |
| 1322 | extern void ptlock_free(struct page *page); | 1364 | extern void ptlock_free(struct page *page); |
| 1323 | 1365 | ||
| @@ -1325,7 +1367,11 @@ static inline spinlock_t *ptlock_ptr(struct page *page) | |||
| 1325 | { | 1367 | { |
| 1326 | return page->ptl; | 1368 | return page->ptl; |
| 1327 | } | 1369 | } |
| 1328 | #else /* BLOATED_SPINLOCKS */ | 1370 | #else /* ALLOC_SPLIT_PTLOCKS */ |
| 1371 | static inline void ptlock_cache_init(void) | ||
| 1372 | { | ||
| 1373 | } | ||
| 1374 | |||
| 1329 | static inline bool ptlock_alloc(struct page *page) | 1375 | static inline bool ptlock_alloc(struct page *page) |
| 1330 | { | 1376 | { |
| 1331 | return true; | 1377 | return true; |
| @@ -1339,7 +1385,7 @@ static inline spinlock_t *ptlock_ptr(struct page *page) | |||
| 1339 | { | 1385 | { |
| 1340 | return &page->ptl; | 1386 | return &page->ptl; |
| 1341 | } | 1387 | } |
| 1342 | #endif /* BLOATED_SPINLOCKS */ | 1388 | #endif /* ALLOC_SPLIT_PTLOCKS */ |
| 1343 | 1389 | ||
| 1344 | static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) | 1390 | static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) |
| 1345 | { | 1391 | { |
| @@ -1356,7 +1402,7 @@ static inline bool ptlock_init(struct page *page) | |||
| 1356 | * slab code uses page->slab_cache and page->first_page (for tail | 1402 | * slab code uses page->slab_cache and page->first_page (for tail |
| 1357 | * pages), which share storage with page->ptl. | 1403 | * pages), which share storage with page->ptl. |
| 1358 | */ | 1404 | */ |
| 1359 | VM_BUG_ON(*(unsigned long *)&page->ptl); | 1405 | VM_BUG_ON_PAGE(*(unsigned long *)&page->ptl, page); |
| 1360 | if (!ptlock_alloc(page)) | 1406 | if (!ptlock_alloc(page)) |
| 1361 | return false; | 1407 | return false; |
| 1362 | spin_lock_init(ptlock_ptr(page)); | 1408 | spin_lock_init(ptlock_ptr(page)); |
| @@ -1378,10 +1424,17 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) | |||
| 1378 | { | 1424 | { |
| 1379 | return &mm->page_table_lock; | 1425 | return &mm->page_table_lock; |
| 1380 | } | 1426 | } |
| 1427 | static inline void ptlock_cache_init(void) {} | ||
| 1381 | static inline bool ptlock_init(struct page *page) { return true; } | 1428 | static inline bool ptlock_init(struct page *page) { return true; } |
| 1382 | static inline void pte_lock_deinit(struct page *page) {} | 1429 | static inline void pte_lock_deinit(struct page *page) {} |
| 1383 | #endif /* USE_SPLIT_PTE_PTLOCKS */ | 1430 | #endif /* USE_SPLIT_PTE_PTLOCKS */ |
| 1384 | 1431 | ||
| 1432 | static inline void pgtable_init(void) | ||
| 1433 | { | ||
| 1434 | ptlock_cache_init(); | ||
| 1435 | pgtable_cache_init(); | ||
| 1436 | } | ||
| 1437 | |||
| 1385 | static inline bool pgtable_page_ctor(struct page *page) | 1438 | static inline bool pgtable_page_ctor(struct page *page) |
| 1386 | { | 1439 | { |
| 1387 | inc_zone_page_state(page, NR_PAGETABLE); | 1440 | inc_zone_page_state(page, NR_PAGETABLE); |
| @@ -1440,7 +1493,7 @@ static inline bool pgtable_pmd_page_ctor(struct page *page) | |||
| 1440 | static inline void pgtable_pmd_page_dtor(struct page *page) | 1493 | static inline void pgtable_pmd_page_dtor(struct page *page) |
| 1441 | { | 1494 | { |
| 1442 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 1495 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
| 1443 | VM_BUG_ON(page->pmd_huge_pte); | 1496 | VM_BUG_ON_PAGE(page->pmd_huge_pte, page); |
| 1444 | #endif | 1497 | #endif |
| 1445 | ptlock_free(page); | 1498 | ptlock_free(page); |
| 1446 | } | 1499 | } |
| @@ -1977,8 +2030,6 @@ extern void shake_page(struct page *p, int access); | |||
| 1977 | extern atomic_long_t num_poisoned_pages; | 2030 | extern atomic_long_t num_poisoned_pages; |
| 1978 | extern int soft_offline_page(struct page *page, int flags); | 2031 | extern int soft_offline_page(struct page *page, int flags); |
| 1979 | 2032 | ||
| 1980 | extern void dump_page(struct page *page); | ||
| 1981 | |||
| 1982 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS) | 2033 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS) |
| 1983 | extern void clear_huge_page(struct page *page, | 2034 | extern void clear_huge_page(struct page *page, |
| 1984 | unsigned long addr, | 2035 | unsigned long addr, |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index bd299418a934..290901a8c1de 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -26,6 +26,7 @@ struct address_space; | |||
| 26 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) | 26 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) |
| 27 | #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \ | 27 | #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \ |
| 28 | IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK)) | 28 | IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK)) |
| 29 | #define ALLOC_SPLIT_PTLOCKS (SPINLOCK_SIZE > BITS_PER_LONG/8) | ||
| 29 | 30 | ||
| 30 | /* | 31 | /* |
| 31 | * Each physical page in the system has a struct page associated with | 32 | * Each physical page in the system has a struct page associated with |
| @@ -155,7 +156,7 @@ struct page { | |||
| 155 | * system if PG_buddy is set. | 156 | * system if PG_buddy is set. |
| 156 | */ | 157 | */ |
| 157 | #if USE_SPLIT_PTE_PTLOCKS | 158 | #if USE_SPLIT_PTE_PTLOCKS |
| 158 | #if BLOATED_SPINLOCKS | 159 | #if ALLOC_SPLIT_PTLOCKS |
| 159 | spinlock_t *ptl; | 160 | spinlock_t *ptl; |
| 160 | #else | 161 | #else |
| 161 | spinlock_t ptl; | 162 | spinlock_t ptl; |
| @@ -443,6 +444,14 @@ struct mm_struct { | |||
| 443 | /* numa_scan_seq prevents two threads setting pte_numa */ | 444 | /* numa_scan_seq prevents two threads setting pte_numa */ |
| 444 | int numa_scan_seq; | 445 | int numa_scan_seq; |
| 445 | #endif | 446 | #endif |
| 447 | #if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION) | ||
| 448 | /* | ||
| 449 | * An operation with batched TLB flushing is going on. Anything that | ||
| 450 | * can move process memory needs to flush the TLB when moving a | ||
| 451 | * PROT_NONE or PROT_NUMA mapped page. | ||
| 452 | */ | ||
| 453 | bool tlb_flush_pending; | ||
| 454 | #endif | ||
| 446 | struct uprobes_state uprobes_state; | 455 | struct uprobes_state uprobes_state; |
| 447 | }; | 456 | }; |
| 448 | 457 | ||
| @@ -459,4 +468,45 @@ static inline cpumask_t *mm_cpumask(struct mm_struct *mm) | |||
| 459 | return mm->cpu_vm_mask_var; | 468 | return mm->cpu_vm_mask_var; |
| 460 | } | 469 | } |
| 461 | 470 | ||
| 471 | #if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION) | ||
| 472 | /* | ||
| 473 | * Memory barriers to keep this state in sync are graciously provided by | ||
| 474 | * the page table locks, outside of which no page table modifications happen. | ||
| 475 | * The barriers below prevent the compiler from re-ordering the instructions | ||
| 476 | * around the memory barriers that are already present in the code. | ||
| 477 | */ | ||
| 478 | static inline bool mm_tlb_flush_pending(struct mm_struct *mm) | ||
| 479 | { | ||
| 480 | barrier(); | ||
| 481 | return mm->tlb_flush_pending; | ||
| 482 | } | ||
| 483 | static inline void set_tlb_flush_pending(struct mm_struct *mm) | ||
| 484 | { | ||
| 485 | mm->tlb_flush_pending = true; | ||
| 486 | |||
| 487 | /* | ||
| 488 | * Guarantee that the tlb_flush_pending store does not leak into the | ||
| 489 | * critical section updating the page tables | ||
| 490 | */ | ||
| 491 | smp_mb__before_spinlock(); | ||
| 492 | } | ||
| 493 | /* Clearing is done after a TLB flush, which also provides a barrier. */ | ||
| 494 | static inline void clear_tlb_flush_pending(struct mm_struct *mm) | ||
| 495 | { | ||
| 496 | barrier(); | ||
| 497 | mm->tlb_flush_pending = false; | ||
| 498 | } | ||
| 499 | #else | ||
| 500 | static inline bool mm_tlb_flush_pending(struct mm_struct *mm) | ||
| 501 | { | ||
| 502 | return false; | ||
| 503 | } | ||
| 504 | static inline void set_tlb_flush_pending(struct mm_struct *mm) | ||
| 505 | { | ||
| 506 | } | ||
| 507 | static inline void clear_tlb_flush_pending(struct mm_struct *mm) | ||
| 508 | { | ||
| 509 | } | ||
| 510 | #endif | ||
| 511 | |||
| 462 | #endif /* _LINUX_MM_TYPES_H */ | 512 | #endif /* _LINUX_MM_TYPES_H */ |
diff --git a/include/linux/mman.h b/include/linux/mman.h index 7f7f8dae4b1d..16373c8f5f57 100644 --- a/include/linux/mman.h +++ b/include/linux/mman.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | extern int sysctl_overcommit_memory; | 10 | extern int sysctl_overcommit_memory; |
| 11 | extern int sysctl_overcommit_ratio; | 11 | extern int sysctl_overcommit_ratio; |
| 12 | extern unsigned long sysctl_overcommit_kbytes; | ||
| 12 | extern struct percpu_counter vm_committed_as; | 13 | extern struct percpu_counter vm_committed_as; |
| 13 | 14 | ||
| 14 | #ifdef CONFIG_SMP | 15 | #ifdef CONFIG_SMP |
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h index 580bd587d916..5042c036dda9 100644 --- a/include/linux/mmdebug.h +++ b/include/linux/mmdebug.h | |||
| @@ -1,10 +1,19 @@ | |||
| 1 | #ifndef LINUX_MM_DEBUG_H | 1 | #ifndef LINUX_MM_DEBUG_H |
| 2 | #define LINUX_MM_DEBUG_H 1 | 2 | #define LINUX_MM_DEBUG_H 1 |
| 3 | 3 | ||
| 4 | struct page; | ||
| 5 | |||
| 6 | extern void dump_page(struct page *page, char *reason); | ||
| 7 | extern void dump_page_badflags(struct page *page, char *reason, | ||
| 8 | unsigned long badflags); | ||
| 9 | |||
| 4 | #ifdef CONFIG_DEBUG_VM | 10 | #ifdef CONFIG_DEBUG_VM |
| 5 | #define VM_BUG_ON(cond) BUG_ON(cond) | 11 | #define VM_BUG_ON(cond) BUG_ON(cond) |
| 12 | #define VM_BUG_ON_PAGE(cond, page) \ | ||
| 13 | do { if (unlikely(cond)) { dump_page(page, NULL); BUG(); } } while (0) | ||
| 6 | #else | 14 | #else |
| 7 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond) | 15 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond) |
| 16 | #define VM_BUG_ON_PAGE(cond, page) VM_BUG_ON(cond) | ||
| 8 | #endif | 17 | #endif |
| 9 | 18 | ||
| 10 | #ifdef CONFIG_DEBUG_VIRTUAL | 19 | #ifdef CONFIG_DEBUG_VIRTUAL |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index bd791e452ad7..5f2052c83154 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -490,6 +490,12 @@ struct zone { | |||
| 490 | unsigned long managed_pages; | 490 | unsigned long managed_pages; |
| 491 | 491 | ||
| 492 | /* | 492 | /* |
| 493 | * Number of MIGRATE_RESEVE page block. To maintain for just | ||
| 494 | * optimization. Protected by zone->lock. | ||
| 495 | */ | ||
| 496 | int nr_migrate_reserve_block; | ||
| 497 | |||
| 498 | /* | ||
| 493 | * rarely used fields: | 499 | * rarely used fields: |
| 494 | */ | 500 | */ |
| 495 | const char *name; | 501 | const char *name; |
| @@ -758,10 +764,7 @@ typedef struct pglist_data { | |||
| 758 | int kswapd_max_order; | 764 | int kswapd_max_order; |
| 759 | enum zone_type classzone_idx; | 765 | enum zone_type classzone_idx; |
| 760 | #ifdef CONFIG_NUMA_BALANCING | 766 | #ifdef CONFIG_NUMA_BALANCING |
| 761 | /* | 767 | /* Lock serializing the migrate rate limiting window */ |
| 762 | * Lock serializing the per destination node AutoNUMA memory | ||
| 763 | * migration rate limiting data. | ||
| 764 | */ | ||
| 765 | spinlock_t numabalancing_migrate_lock; | 768 | spinlock_t numabalancing_migrate_lock; |
| 766 | 769 | ||
| 767 | /* Rate limiting time interval */ | 770 | /* Rate limiting time interval */ |
diff --git a/include/linux/module.h b/include/linux/module.h index 15cd6b1b211e..eaf60ff9ba94 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -29,8 +29,7 @@ | |||
| 29 | 29 | ||
| 30 | #define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN | 30 | #define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN |
| 31 | 31 | ||
| 32 | struct modversion_info | 32 | struct modversion_info { |
| 33 | { | ||
| 34 | unsigned long crc; | 33 | unsigned long crc; |
| 35 | char name[MODULE_NAME_LEN]; | 34 | char name[MODULE_NAME_LEN]; |
| 36 | }; | 35 | }; |
| @@ -84,12 +83,12 @@ void sort_main_extable(void); | |||
| 84 | void trim_init_extable(struct module *m); | 83 | void trim_init_extable(struct module *m); |
| 85 | 84 | ||
| 86 | #ifdef MODULE | 85 | #ifdef MODULE |
| 87 | #define MODULE_GENERIC_TABLE(gtype,name) \ | 86 | #define MODULE_GENERIC_TABLE(gtype, name) \ |
| 88 | extern const struct gtype##_id __mod_##gtype##_table \ | 87 | extern const struct gtype##_id __mod_##gtype##_table \ |
| 89 | __attribute__ ((unused, alias(__stringify(name)))) | 88 | __attribute__ ((unused, alias(__stringify(name)))) |
| 90 | 89 | ||
| 91 | #else /* !MODULE */ | 90 | #else /* !MODULE */ |
| 92 | #define MODULE_GENERIC_TABLE(gtype,name) | 91 | #define MODULE_GENERIC_TABLE(gtype, name) |
| 93 | #endif | 92 | #endif |
| 94 | 93 | ||
| 95 | /* Generic info of form tag = "info" */ | 94 | /* Generic info of form tag = "info" */ |
| @@ -126,7 +125,7 @@ extern const struct gtype##_id __mod_##gtype##_table \ | |||
| 126 | * is a GPL combined work. | 125 | * is a GPL combined work. |
| 127 | * | 126 | * |
| 128 | * This exists for several reasons | 127 | * This exists for several reasons |
| 129 | * 1. So modinfo can show license info for users wanting to vet their setup | 128 | * 1. So modinfo can show license info for users wanting to vet their setup |
| 130 | * is free | 129 | * is free |
| 131 | * 2. So the community can ignore bug reports including proprietary modules | 130 | * 2. So the community can ignore bug reports including proprietary modules |
| 132 | * 3. So vendors can do likewise based on their own policies | 131 | * 3. So vendors can do likewise based on their own policies |
| @@ -138,27 +137,29 @@ extern const struct gtype##_id __mod_##gtype##_table \ | |||
| 138 | * authors use multiple MODULE_AUTHOR() statements/lines. | 137 | * authors use multiple MODULE_AUTHOR() statements/lines. |
| 139 | */ | 138 | */ |
| 140 | #define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) | 139 | #define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) |
| 141 | 140 | ||
| 142 | /* What your module does. */ | 141 | /* What your module does. */ |
| 143 | #define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) | 142 | #define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) |
| 144 | 143 | ||
| 145 | #define MODULE_DEVICE_TABLE(type,name) \ | 144 | #define MODULE_DEVICE_TABLE(type, name) \ |
| 146 | MODULE_GENERIC_TABLE(type##_device,name) | 145 | MODULE_GENERIC_TABLE(type##_device, name) |
| 147 | 146 | ||
| 148 | /* Version of form [<epoch>:]<version>[-<extra-version>]. | 147 | /* Version of form [<epoch>:]<version>[-<extra-version>]. |
| 149 | Or for CVS/RCS ID version, everything but the number is stripped. | 148 | * Or for CVS/RCS ID version, everything but the number is stripped. |
| 150 | <epoch>: A (small) unsigned integer which allows you to start versions | 149 | * <epoch>: A (small) unsigned integer which allows you to start versions |
| 151 | anew. If not mentioned, it's zero. eg. "2:1.0" is after | 150 | * anew. If not mentioned, it's zero. eg. "2:1.0" is after |
| 152 | "1:2.0". | 151 | * "1:2.0". |
| 153 | <version>: The <version> may contain only alphanumerics and the | 152 | |
| 154 | character `.'. Ordered by numeric sort for numeric parts, | 153 | * <version>: The <version> may contain only alphanumerics and the |
| 155 | ascii sort for ascii parts (as per RPM or DEB algorithm). | 154 | * character `.'. Ordered by numeric sort for numeric parts, |
| 156 | <extraversion>: Like <version>, but inserted for local | 155 | * ascii sort for ascii parts (as per RPM or DEB algorithm). |
| 157 | customizations, eg "rh3" or "rusty1". | 156 | |
| 158 | 157 | * <extraversion>: Like <version>, but inserted for local | |
| 159 | Using this automatically adds a checksum of the .c files and the | 158 | * customizations, eg "rh3" or "rusty1". |
| 160 | local headers in "srcversion". | 159 | |
| 161 | */ | 160 | * Using this automatically adds a checksum of the .c files and the |
| 161 | * local headers in "srcversion". | ||
| 162 | */ | ||
| 162 | 163 | ||
| 163 | #if defined(MODULE) || !defined(CONFIG_SYSFS) | 164 | #if defined(MODULE) || !defined(CONFIG_SYSFS) |
| 164 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) | 165 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) |
| @@ -226,8 +227,7 @@ struct module_ref { | |||
| 226 | unsigned long decs; | 227 | unsigned long decs; |
| 227 | } __attribute((aligned(2 * sizeof(unsigned long)))); | 228 | } __attribute((aligned(2 * sizeof(unsigned long)))); |
| 228 | 229 | ||
| 229 | struct module | 230 | struct module { |
| 230 | { | ||
| 231 | enum module_state state; | 231 | enum module_state state; |
| 232 | 232 | ||
| 233 | /* Member of list of modules */ | 233 | /* Member of list of modules */ |
| @@ -451,7 +451,7 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *, | |||
| 451 | 451 | ||
| 452 | extern void __module_put_and_exit(struct module *mod, long code) | 452 | extern void __module_put_and_exit(struct module *mod, long code) |
| 453 | __attribute__((noreturn)); | 453 | __attribute__((noreturn)); |
| 454 | #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code); | 454 | #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code) |
| 455 | 455 | ||
| 456 | #ifdef CONFIG_MODULE_UNLOAD | 456 | #ifdef CONFIG_MODULE_UNLOAD |
| 457 | unsigned long module_refcount(struct module *mod); | 457 | unsigned long module_refcount(struct module *mod); |
| @@ -480,8 +480,8 @@ static inline void module_put(struct module *module) | |||
| 480 | static inline void __module_get(struct module *module) | 480 | static inline void __module_get(struct module *module) |
| 481 | { | 481 | { |
| 482 | } | 482 | } |
| 483 | #define symbol_put(x) do { } while(0) | 483 | #define symbol_put(x) do { } while (0) |
| 484 | #define symbol_put_addr(p) do { } while(0) | 484 | #define symbol_put_addr(p) do { } while (0) |
| 485 | 485 | ||
| 486 | #endif /* CONFIG_MODULE_UNLOAD */ | 486 | #endif /* CONFIG_MODULE_UNLOAD */ |
| 487 | int ref_module(struct module *a, struct module *b); | 487 | int ref_module(struct module *a, struct module *b); |
| @@ -507,8 +507,8 @@ int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned | |||
| 507 | /* For extable.c to search modules' exception tables. */ | 507 | /* For extable.c to search modules' exception tables. */ |
| 508 | const struct exception_table_entry *search_module_extables(unsigned long addr); | 508 | const struct exception_table_entry *search_module_extables(unsigned long addr); |
| 509 | 509 | ||
| 510 | int register_module_notifier(struct notifier_block * nb); | 510 | int register_module_notifier(struct notifier_block *nb); |
| 511 | int unregister_module_notifier(struct notifier_block * nb); | 511 | int unregister_module_notifier(struct notifier_block *nb); |
| 512 | 512 | ||
| 513 | extern void print_modules(void); | 513 | extern void print_modules(void); |
| 514 | 514 | ||
| @@ -548,8 +548,8 @@ static inline bool is_module_text_address(unsigned long addr) | |||
| 548 | 548 | ||
| 549 | /* Get/put a kernel symbol (calls should be symmetric) */ | 549 | /* Get/put a kernel symbol (calls should be symmetric) */ |
| 550 | #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); }) | 550 | #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); }) |
| 551 | #define symbol_put(x) do { } while(0) | 551 | #define symbol_put(x) do { } while (0) |
| 552 | #define symbol_put_addr(x) do { } while(0) | 552 | #define symbol_put_addr(x) do { } while (0) |
| 553 | 553 | ||
| 554 | static inline void __module_get(struct module *module) | 554 | static inline void __module_get(struct module *module) |
| 555 | { | 555 | { |
| @@ -606,13 +606,13 @@ static inline int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *, | |||
| 606 | return 0; | 606 | return 0; |
| 607 | } | 607 | } |
| 608 | 608 | ||
| 609 | static inline int register_module_notifier(struct notifier_block * nb) | 609 | static inline int register_module_notifier(struct notifier_block *nb) |
| 610 | { | 610 | { |
| 611 | /* no events will happen anyway, so this can always succeed */ | 611 | /* no events will happen anyway, so this can always succeed */ |
| 612 | return 0; | 612 | return 0; |
| 613 | } | 613 | } |
| 614 | 614 | ||
| 615 | static inline int unregister_module_notifier(struct notifier_block * nb) | 615 | static inline int unregister_module_notifier(struct notifier_block *nb) |
| 616 | { | 616 | { |
| 617 | return 0; | 617 | return 0; |
| 618 | } | 618 | } |
diff --git a/include/linux/msi.h b/include/linux/msi.h index 009b02481436..92a2f991262a 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
| @@ -60,10 +60,10 @@ void arch_teardown_msi_irq(unsigned int irq); | |||
| 60 | int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); | 60 | int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); |
| 61 | void arch_teardown_msi_irqs(struct pci_dev *dev); | 61 | void arch_teardown_msi_irqs(struct pci_dev *dev); |
| 62 | int arch_msi_check_device(struct pci_dev* dev, int nvec, int type); | 62 | int arch_msi_check_device(struct pci_dev* dev, int nvec, int type); |
| 63 | void arch_restore_msi_irqs(struct pci_dev *dev, int irq); | 63 | void arch_restore_msi_irqs(struct pci_dev *dev); |
| 64 | 64 | ||
| 65 | void default_teardown_msi_irqs(struct pci_dev *dev); | 65 | void default_teardown_msi_irqs(struct pci_dev *dev); |
| 66 | void default_restore_msi_irqs(struct pci_dev *dev, int irq); | 66 | void default_restore_msi_irqs(struct pci_dev *dev); |
| 67 | u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag); | 67 | u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag); |
| 68 | u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag); | 68 | u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag); |
| 69 | 69 | ||
diff --git a/include/linux/net.h b/include/linux/net.h index 4bcee94cef93..69be3e6079c8 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
| @@ -181,7 +181,7 @@ struct proto_ops { | |||
| 181 | int offset, size_t size, int flags); | 181 | int offset, size_t size, int flags); |
| 182 | ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, | 182 | ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, |
| 183 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); | 183 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); |
| 184 | void (*set_peek_off)(struct sock *sk, int val); | 184 | int (*set_peek_off)(struct sock *sk, int val); |
| 185 | }; | 185 | }; |
| 186 | 186 | ||
| 187 | #define DECLARE_SOCKADDR(type, dst, src) \ | 187 | #define DECLARE_SOCKADDR(type, dst, src) \ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7f0ed423a360..ce2a1f5f9a1e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -769,7 +769,8 @@ struct netdev_phys_port_id { | |||
| 769 | * (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX) | 769 | * (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX) |
| 770 | * Required can not be NULL. | 770 | * Required can not be NULL. |
| 771 | * | 771 | * |
| 772 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb); | 772 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb, |
| 773 | * void *accel_priv); | ||
| 773 | * Called to decide which queue to when device supports multiple | 774 | * Called to decide which queue to when device supports multiple |
| 774 | * transmit queues. | 775 | * transmit queues. |
| 775 | * | 776 | * |
| @@ -990,7 +991,8 @@ struct net_device_ops { | |||
| 990 | netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb, | 991 | netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb, |
| 991 | struct net_device *dev); | 992 | struct net_device *dev); |
| 992 | u16 (*ndo_select_queue)(struct net_device *dev, | 993 | u16 (*ndo_select_queue)(struct net_device *dev, |
| 993 | struct sk_buff *skb); | 994 | struct sk_buff *skb, |
| 995 | void *accel_priv); | ||
| 994 | void (*ndo_change_rx_flags)(struct net_device *dev, | 996 | void (*ndo_change_rx_flags)(struct net_device *dev, |
| 995 | int flags); | 997 | int flags); |
| 996 | void (*ndo_set_rx_mode)(struct net_device *dev); | 998 | void (*ndo_set_rx_mode)(struct net_device *dev); |
| @@ -1255,7 +1257,7 @@ struct net_device { | |||
| 1255 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ | 1257 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ |
| 1256 | unsigned char addr_assign_type; /* hw address assignment type */ | 1258 | unsigned char addr_assign_type; /* hw address assignment type */ |
| 1257 | unsigned char addr_len; /* hardware address length */ | 1259 | unsigned char addr_len; /* hardware address length */ |
| 1258 | unsigned char neigh_priv_len; | 1260 | unsigned short neigh_priv_len; |
| 1259 | unsigned short dev_id; /* Used to differentiate devices | 1261 | unsigned short dev_id; /* Used to differentiate devices |
| 1260 | * that share the same link | 1262 | * that share the same link |
| 1261 | * layer address | 1263 | * layer address |
| @@ -1529,7 +1531,8 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev, | |||
| 1529 | } | 1531 | } |
| 1530 | 1532 | ||
| 1531 | struct netdev_queue *netdev_pick_tx(struct net_device *dev, | 1533 | struct netdev_queue *netdev_pick_tx(struct net_device *dev, |
| 1532 | struct sk_buff *skb); | 1534 | struct sk_buff *skb, |
| 1535 | void *accel_priv); | ||
| 1533 | u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); | 1536 | u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); |
| 1534 | 1537 | ||
| 1535 | /* | 1538 | /* |
| @@ -1819,6 +1822,7 @@ int dev_close(struct net_device *dev); | |||
| 1819 | void dev_disable_lro(struct net_device *dev); | 1822 | void dev_disable_lro(struct net_device *dev); |
| 1820 | int dev_loopback_xmit(struct sk_buff *newskb); | 1823 | int dev_loopback_xmit(struct sk_buff *newskb); |
| 1821 | int dev_queue_xmit(struct sk_buff *skb); | 1824 | int dev_queue_xmit(struct sk_buff *skb); |
| 1825 | int dev_queue_xmit_accel(struct sk_buff *skb, void *accel_priv); | ||
| 1822 | int register_netdevice(struct net_device *dev); | 1826 | int register_netdevice(struct net_device *dev); |
| 1823 | void unregister_netdevice_queue(struct net_device *dev, struct list_head *head); | 1827 | void unregister_netdevice_queue(struct net_device *dev, struct list_head *head); |
| 1824 | void unregister_netdevice_many(struct list_head *head); | 1828 | void unregister_netdevice_many(struct list_head *head); |
| @@ -1912,6 +1916,15 @@ static inline int dev_parse_header(const struct sk_buff *skb, | |||
| 1912 | return dev->header_ops->parse(skb, haddr); | 1916 | return dev->header_ops->parse(skb, haddr); |
| 1913 | } | 1917 | } |
| 1914 | 1918 | ||
| 1919 | static inline int dev_rebuild_header(struct sk_buff *skb) | ||
| 1920 | { | ||
| 1921 | const struct net_device *dev = skb->dev; | ||
| 1922 | |||
| 1923 | if (!dev->header_ops || !dev->header_ops->rebuild) | ||
| 1924 | return 0; | ||
| 1925 | return dev->header_ops->rebuild(skb); | ||
| 1926 | } | ||
| 1927 | |||
| 1915 | typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); | 1928 | typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); |
| 1916 | int register_gifconf(unsigned int family, gifconf_func_t *gifconf); | 1929 | int register_gifconf(unsigned int family, gifconf_func_t *gifconf); |
| 1917 | static inline int unregister_gifconf(unsigned int family) | 1930 | static inline int unregister_gifconf(unsigned int family) |
| @@ -2417,7 +2430,7 @@ int dev_change_carrier(struct net_device *, bool new_carrier); | |||
| 2417 | int dev_get_phys_port_id(struct net_device *dev, | 2430 | int dev_get_phys_port_id(struct net_device *dev, |
| 2418 | struct netdev_phys_port_id *ppid); | 2431 | struct netdev_phys_port_id *ppid); |
| 2419 | int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, | 2432 | int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, |
| 2420 | struct netdev_queue *txq, void *accel_priv); | 2433 | struct netdev_queue *txq); |
| 2421 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); | 2434 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); |
| 2422 | 2435 | ||
| 2423 | extern int netdev_budget; | 2436 | extern int netdev_budget; |
| @@ -3008,6 +3021,19 @@ static inline void netif_set_gso_max_size(struct net_device *dev, | |||
| 3008 | dev->gso_max_size = size; | 3021 | dev->gso_max_size = size; |
| 3009 | } | 3022 | } |
| 3010 | 3023 | ||
| 3024 | static inline void skb_gso_error_unwind(struct sk_buff *skb, __be16 protocol, | ||
| 3025 | int pulled_hlen, u16 mac_offset, | ||
| 3026 | int mac_len) | ||
| 3027 | { | ||
| 3028 | skb->protocol = protocol; | ||
| 3029 | skb->encapsulation = 1; | ||
| 3030 | skb_push(skb, pulled_hlen); | ||
| 3031 | skb_reset_transport_header(skb); | ||
| 3032 | skb->mac_header = mac_offset; | ||
| 3033 | skb->network_header = skb->mac_header + mac_len; | ||
| 3034 | skb->mac_len = mac_len; | ||
| 3035 | } | ||
| 3036 | |||
| 3011 | static inline bool netif_is_macvlan(struct net_device *dev) | 3037 | static inline bool netif_is_macvlan(struct net_device *dev) |
| 3012 | { | 3038 | { |
| 3013 | return dev->priv_flags & IFF_MACVLAN; | 3039 | return dev->priv_flags & IFF_MACVLAN; |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index c1637062c1ce..12c2cb947df5 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -413,16 +413,6 @@ enum lock_type4 { | |||
| 413 | #define NFS4_VERSION 4 | 413 | #define NFS4_VERSION 4 |
| 414 | #define NFS4_MINOR_VERSION 0 | 414 | #define NFS4_MINOR_VERSION 0 |
| 415 | 415 | ||
| 416 | #if defined(CONFIG_NFS_V4_2) | ||
| 417 | #define NFS4_MAX_MINOR_VERSION 2 | ||
| 418 | #else | ||
| 419 | #if defined(CONFIG_NFS_V4_1) | ||
| 420 | #define NFS4_MAX_MINOR_VERSION 1 | ||
| 421 | #else | ||
| 422 | #define NFS4_MAX_MINOR_VERSION 0 | ||
| 423 | #endif /* CONFIG_NFS_V4_1 */ | ||
| 424 | #endif /* CONFIG_NFS_V4_2 */ | ||
| 425 | |||
| 426 | #define NFS4_DEBUG 1 | 416 | #define NFS4_DEBUG 1 |
| 427 | 417 | ||
| 428 | /* Index of predefined Linux client operations */ | 418 | /* Index of predefined Linux client operations */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 14a48207a304..48997374eaf0 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -507,24 +507,6 @@ extern int nfs_mountpoint_expiry_timeout; | |||
| 507 | extern void nfs_release_automount_timer(void); | 507 | extern void nfs_release_automount_timer(void); |
| 508 | 508 | ||
| 509 | /* | 509 | /* |
| 510 | * linux/fs/nfs/nfs4proc.c | ||
| 511 | */ | ||
| 512 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL | ||
| 513 | extern struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags); | ||
| 514 | static inline void nfs4_label_free(struct nfs4_label *label) | ||
| 515 | { | ||
| 516 | if (label) { | ||
| 517 | kfree(label->label); | ||
| 518 | kfree(label); | ||
| 519 | } | ||
| 520 | return; | ||
| 521 | } | ||
| 522 | #else | ||
| 523 | static inline struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) { return NULL; } | ||
| 524 | static inline void nfs4_label_free(void *label) {} | ||
| 525 | #endif | ||
| 526 | |||
| 527 | /* | ||
| 528 | * linux/fs/nfs/unlink.c | 510 | * linux/fs/nfs/unlink.c |
| 529 | */ | 511 | */ |
| 530 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); | 512 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); |
diff --git a/include/linux/of.h b/include/linux/of.h index 276c546980d8..70c64ba17fa5 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -377,8 +377,13 @@ static inline bool of_have_populated_dt(void) | |||
| 377 | return false; | 377 | return false; |
| 378 | } | 378 | } |
| 379 | 379 | ||
| 380 | /* Kill an unused variable warning on a device_node pointer */ | ||
| 381 | static inline void __of_use_dn(const struct device_node *np) | ||
| 382 | { | ||
| 383 | } | ||
| 384 | |||
| 380 | #define for_each_child_of_node(parent, child) \ | 385 | #define for_each_child_of_node(parent, child) \ |
| 381 | while (0) | 386 | while (__of_use_dn(parent), __of_use_dn(child), 0) |
| 382 | 387 | ||
| 383 | #define for_each_available_child_of_node(parent, child) \ | 388 | #define for_each_available_child_of_node(parent, child) \ |
| 384 | while (0) | 389 | while (0) |
diff --git a/include/linux/of_device.h b/include/linux/of_device.h index 82ce324fdce7..8d7dd6768cb7 100644 --- a/include/linux/of_device.h +++ b/include/linux/of_device.h | |||
| @@ -64,6 +64,12 @@ static inline int of_driver_match_device(struct device *dev, | |||
| 64 | static inline void of_device_uevent(struct device *dev, | 64 | static inline void of_device_uevent(struct device *dev, |
| 65 | struct kobj_uevent_env *env) { } | 65 | struct kobj_uevent_env *env) { } |
| 66 | 66 | ||
| 67 | static inline int of_device_get_modalias(struct device *dev, | ||
| 68 | char *str, ssize_t len) | ||
| 69 | { | ||
| 70 | return -ENODEV; | ||
| 71 | } | ||
| 72 | |||
| 67 | static inline int of_device_uevent_modalias(struct device *dev, | 73 | static inline int of_device_uevent_modalias(struct device *dev, |
| 68 | struct kobj_uevent_env *env) | 74 | struct kobj_uevent_env *env) |
| 69 | { | 75 | { |
diff --git a/include/linux/padata.h b/include/linux/padata.h index 86292beebfe2..438694650471 100644 --- a/include/linux/padata.h +++ b/include/linux/padata.h | |||
| @@ -129,10 +129,9 @@ struct parallel_data { | |||
| 129 | struct padata_serial_queue __percpu *squeue; | 129 | struct padata_serial_queue __percpu *squeue; |
| 130 | atomic_t reorder_objects; | 130 | atomic_t reorder_objects; |
| 131 | atomic_t refcnt; | 131 | atomic_t refcnt; |
| 132 | atomic_t seq_nr; | ||
| 132 | struct padata_cpumask cpumask; | 133 | struct padata_cpumask cpumask; |
| 133 | spinlock_t lock ____cacheline_aligned; | 134 | spinlock_t lock ____cacheline_aligned; |
| 134 | spinlock_t seq_lock; | ||
| 135 | unsigned int seq_nr; | ||
| 136 | unsigned int processed; | 135 | unsigned int processed; |
| 137 | struct timer_list timer; | 136 | struct timer_list timer; |
| 138 | }; | 137 | }; |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 98ada58f9942..e464b4e987e8 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
| @@ -412,7 +412,7 @@ static inline void ClearPageCompound(struct page *page) | |||
| 412 | */ | 412 | */ |
| 413 | static inline int PageTransHuge(struct page *page) | 413 | static inline int PageTransHuge(struct page *page) |
| 414 | { | 414 | { |
| 415 | VM_BUG_ON(PageTail(page)); | 415 | VM_BUG_ON_PAGE(PageTail(page), page); |
| 416 | return PageHead(page); | 416 | return PageHead(page); |
| 417 | } | 417 | } |
| 418 | 418 | ||
| @@ -460,25 +460,25 @@ static inline int PageTransTail(struct page *page) | |||
| 460 | */ | 460 | */ |
| 461 | static inline int PageSlabPfmemalloc(struct page *page) | 461 | static inline int PageSlabPfmemalloc(struct page *page) |
| 462 | { | 462 | { |
| 463 | VM_BUG_ON(!PageSlab(page)); | 463 | VM_BUG_ON_PAGE(!PageSlab(page), page); |
| 464 | return PageActive(page); | 464 | return PageActive(page); |
| 465 | } | 465 | } |
| 466 | 466 | ||
| 467 | static inline void SetPageSlabPfmemalloc(struct page *page) | 467 | static inline void SetPageSlabPfmemalloc(struct page *page) |
| 468 | { | 468 | { |
| 469 | VM_BUG_ON(!PageSlab(page)); | 469 | VM_BUG_ON_PAGE(!PageSlab(page), page); |
| 470 | SetPageActive(page); | 470 | SetPageActive(page); |
| 471 | } | 471 | } |
| 472 | 472 | ||
| 473 | static inline void __ClearPageSlabPfmemalloc(struct page *page) | 473 | static inline void __ClearPageSlabPfmemalloc(struct page *page) |
| 474 | { | 474 | { |
| 475 | VM_BUG_ON(!PageSlab(page)); | 475 | VM_BUG_ON_PAGE(!PageSlab(page), page); |
| 476 | __ClearPageActive(page); | 476 | __ClearPageActive(page); |
| 477 | } | 477 | } |
| 478 | 478 | ||
| 479 | static inline void ClearPageSlabPfmemalloc(struct page *page) | 479 | static inline void ClearPageSlabPfmemalloc(struct page *page) |
| 480 | { | 480 | { |
| 481 | VM_BUG_ON(!PageSlab(page)); | 481 | VM_BUG_ON_PAGE(!PageSlab(page), page); |
| 482 | ClearPageActive(page); | 482 | ClearPageActive(page); |
| 483 | } | 483 | } |
| 484 | 484 | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index e3dea75a078b..1710d1b060ba 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
| @@ -162,7 +162,7 @@ static inline int page_cache_get_speculative(struct page *page) | |||
| 162 | * disabling preempt, and hence no need for the "speculative get" that | 162 | * disabling preempt, and hence no need for the "speculative get" that |
| 163 | * SMP requires. | 163 | * SMP requires. |
| 164 | */ | 164 | */ |
| 165 | VM_BUG_ON(page_count(page) == 0); | 165 | VM_BUG_ON_PAGE(page_count(page) == 0, page); |
| 166 | atomic_inc(&page->_count); | 166 | atomic_inc(&page->_count); |
| 167 | 167 | ||
| 168 | #else | 168 | #else |
| @@ -175,7 +175,7 @@ static inline int page_cache_get_speculative(struct page *page) | |||
| 175 | return 0; | 175 | return 0; |
| 176 | } | 176 | } |
| 177 | #endif | 177 | #endif |
| 178 | VM_BUG_ON(PageTail(page)); | 178 | VM_BUG_ON_PAGE(PageTail(page), page); |
| 179 | 179 | ||
| 180 | return 1; | 180 | return 1; |
| 181 | } | 181 | } |
| @@ -191,14 +191,14 @@ static inline int page_cache_add_speculative(struct page *page, int count) | |||
| 191 | # ifdef CONFIG_PREEMPT_COUNT | 191 | # ifdef CONFIG_PREEMPT_COUNT |
| 192 | VM_BUG_ON(!in_atomic()); | 192 | VM_BUG_ON(!in_atomic()); |
| 193 | # endif | 193 | # endif |
| 194 | VM_BUG_ON(page_count(page) == 0); | 194 | VM_BUG_ON_PAGE(page_count(page) == 0, page); |
| 195 | atomic_add(count, &page->_count); | 195 | atomic_add(count, &page->_count); |
| 196 | 196 | ||
| 197 | #else | 197 | #else |
| 198 | if (unlikely(!atomic_add_unless(&page->_count, count, 0))) | 198 | if (unlikely(!atomic_add_unless(&page->_count, count, 0))) |
| 199 | return 0; | 199 | return 0; |
| 200 | #endif | 200 | #endif |
| 201 | VM_BUG_ON(PageCompound(page) && page != compound_head(page)); | 201 | VM_BUG_ON_PAGE(PageCompound(page) && page != compound_head(page), page); |
| 202 | 202 | ||
| 203 | return 1; | 203 | return 1; |
| 204 | } | 204 | } |
| @@ -210,7 +210,7 @@ static inline int page_freeze_refs(struct page *page, int count) | |||
| 210 | 210 | ||
| 211 | static inline void page_unfreeze_refs(struct page *page, int count) | 211 | static inline void page_unfreeze_refs(struct page *page, int count) |
| 212 | { | 212 | { |
| 213 | VM_BUG_ON(page_count(page) != 0); | 213 | VM_BUG_ON_PAGE(page_count(page) != 0, page); |
| 214 | VM_BUG_ON(count == 0); | 214 | VM_BUG_ON(count == 0); |
| 215 | 215 | ||
| 216 | atomic_set(&page->_count, count); | 216 | atomic_set(&page->_count, count); |
diff --git a/include/linux/parser.h b/include/linux/parser.h index ea2281e726f6..39d5b7955b23 100644 --- a/include/linux/parser.h +++ b/include/linux/parser.h | |||
| @@ -29,5 +29,6 @@ int match_token(char *, const match_table_t table, substring_t args[]); | |||
| 29 | int match_int(substring_t *, int *result); | 29 | int match_int(substring_t *, int *result); |
| 30 | int match_octal(substring_t *, int *result); | 30 | int match_octal(substring_t *, int *result); |
| 31 | int match_hex(substring_t *, int *result); | 31 | int match_hex(substring_t *, int *result); |
| 32 | bool match_wildcard(const char *pattern, const char *str); | ||
| 32 | size_t match_strlcpy(char *, const substring_t *, size_t); | 33 | size_t match_strlcpy(char *, const substring_t *, size_t); |
| 33 | char *match_strdup(const substring_t *); | 34 | char *match_strdup(const substring_t *); |
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h index 68bcefd7fca0..72031785fe1d 100644 --- a/include/linux/pci-ats.h +++ b/include/linux/pci-ats.h | |||
| @@ -56,10 +56,7 @@ static inline int pci_ats_enabled(struct pci_dev *dev) | |||
| 56 | 56 | ||
| 57 | int pci_enable_pri(struct pci_dev *pdev, u32 reqs); | 57 | int pci_enable_pri(struct pci_dev *pdev, u32 reqs); |
| 58 | void pci_disable_pri(struct pci_dev *pdev); | 58 | void pci_disable_pri(struct pci_dev *pdev); |
| 59 | bool pci_pri_enabled(struct pci_dev *pdev); | ||
| 60 | int pci_reset_pri(struct pci_dev *pdev); | 59 | int pci_reset_pri(struct pci_dev *pdev); |
| 61 | bool pci_pri_stopped(struct pci_dev *pdev); | ||
| 62 | int pci_pri_status(struct pci_dev *pdev); | ||
| 63 | 60 | ||
| 64 | #else /* CONFIG_PCI_PRI */ | 61 | #else /* CONFIG_PCI_PRI */ |
| 65 | 62 | ||
| @@ -72,25 +69,11 @@ static inline void pci_disable_pri(struct pci_dev *pdev) | |||
| 72 | { | 69 | { |
| 73 | } | 70 | } |
| 74 | 71 | ||
| 75 | static inline bool pci_pri_enabled(struct pci_dev *pdev) | ||
| 76 | { | ||
| 77 | return false; | ||
| 78 | } | ||
| 79 | |||
| 80 | static inline int pci_reset_pri(struct pci_dev *pdev) | 72 | static inline int pci_reset_pri(struct pci_dev *pdev) |
| 81 | { | 73 | { |
| 82 | return -ENODEV; | 74 | return -ENODEV; |
| 83 | } | 75 | } |
| 84 | 76 | ||
| 85 | static inline bool pci_pri_stopped(struct pci_dev *pdev) | ||
| 86 | { | ||
| 87 | return true; | ||
| 88 | } | ||
| 89 | |||
| 90 | static inline int pci_pri_status(struct pci_dev *pdev) | ||
| 91 | { | ||
| 92 | return -ENODEV; | ||
| 93 | } | ||
| 94 | #endif /* CONFIG_PCI_PRI */ | 77 | #endif /* CONFIG_PCI_PRI */ |
| 95 | 78 | ||
| 96 | #ifdef CONFIG_PCI_PASID | 79 | #ifdef CONFIG_PCI_PASID |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 1084a15175e0..fb57c892b214 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -224,7 +224,8 @@ enum pci_bus_speed { | |||
| 224 | }; | 224 | }; |
| 225 | 225 | ||
| 226 | struct pci_cap_saved_data { | 226 | struct pci_cap_saved_data { |
| 227 | char cap_nr; | 227 | u16 cap_nr; |
| 228 | bool cap_extended; | ||
| 228 | unsigned int size; | 229 | unsigned int size; |
| 229 | u32 data[0]; | 230 | u32 data[0]; |
| 230 | }; | 231 | }; |
| @@ -351,7 +352,7 @@ struct pci_dev { | |||
| 351 | struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */ | 352 | struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */ |
| 352 | #ifdef CONFIG_PCI_MSI | 353 | #ifdef CONFIG_PCI_MSI |
| 353 | struct list_head msi_list; | 354 | struct list_head msi_list; |
| 354 | struct kset *msi_kset; | 355 | const struct attribute_group **msi_irq_groups; |
| 355 | #endif | 356 | #endif |
| 356 | struct pci_vpd *vpd; | 357 | struct pci_vpd *vpd; |
| 357 | #ifdef CONFIG_PCI_ATS | 358 | #ifdef CONFIG_PCI_ATS |
| @@ -375,7 +376,6 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev) | |||
| 375 | } | 376 | } |
| 376 | 377 | ||
| 377 | struct pci_dev *pci_alloc_dev(struct pci_bus *bus); | 378 | struct pci_dev *pci_alloc_dev(struct pci_bus *bus); |
| 378 | struct pci_dev * __deprecated alloc_pci_dev(void); | ||
| 379 | 379 | ||
| 380 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) | 380 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) |
| 381 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) | 381 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) |
| @@ -385,8 +385,6 @@ static inline int pci_channel_offline(struct pci_dev *pdev) | |||
| 385 | return (pdev->error_state != pci_channel_io_normal); | 385 | return (pdev->error_state != pci_channel_io_normal); |
| 386 | } | 386 | } |
| 387 | 387 | ||
| 388 | extern struct resource busn_resource; | ||
| 389 | |||
| 390 | struct pci_host_bridge_window { | 388 | struct pci_host_bridge_window { |
| 391 | struct list_head list; | 389 | struct list_head list; |
| 392 | struct resource *res; /* host bridge aperture (CPU address) */ | 390 | struct resource *res; /* host bridge aperture (CPU address) */ |
| @@ -551,8 +549,8 @@ int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, | |||
| 551 | int reg, int len, u32 val); | 549 | int reg, int len, u32 val); |
| 552 | 550 | ||
| 553 | struct pci_bus_region { | 551 | struct pci_bus_region { |
| 554 | resource_size_t start; | 552 | dma_addr_t start; |
| 555 | resource_size_t end; | 553 | dma_addr_t end; |
| 556 | }; | 554 | }; |
| 557 | 555 | ||
| 558 | struct pci_dynids { | 556 | struct pci_dynids { |
| @@ -634,8 +632,7 @@ struct pci_driver { | |||
| 634 | * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table | 632 | * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table |
| 635 | * @_table: device table name | 633 | * @_table: device table name |
| 636 | * | 634 | * |
| 637 | * This macro is used to create a struct pci_device_id array (a device table) | 635 | * This macro is deprecated and should not be used in new code. |
| 638 | * in a generic manner. | ||
| 639 | */ | 636 | */ |
| 640 | #define DEFINE_PCI_DEVICE_TABLE(_table) \ | 637 | #define DEFINE_PCI_DEVICE_TABLE(_table) \ |
| 641 | const struct pci_device_id _table[] | 638 | const struct pci_device_id _table[] |
| @@ -737,9 +734,9 @@ void pci_fixup_cardbus(struct pci_bus *); | |||
| 737 | 734 | ||
| 738 | /* Generic PCI functions used internally */ | 735 | /* Generic PCI functions used internally */ |
| 739 | 736 | ||
| 740 | void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 737 | void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region, |
| 741 | struct resource *res); | 738 | struct resource *res); |
| 742 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | 739 | void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res, |
| 743 | struct pci_bus_region *region); | 740 | struct pci_bus_region *region); |
| 744 | void pcibios_scan_specific_bus(int busn); | 741 | void pcibios_scan_specific_bus(int busn); |
| 745 | struct pci_bus *pci_find_bus(int domain, int busnr); | 742 | struct pci_bus *pci_find_bus(int domain, int busnr); |
| @@ -763,7 +760,6 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, | |||
| 763 | const char *name, | 760 | const char *name, |
| 764 | struct hotplug_slot *hotplug); | 761 | struct hotplug_slot *hotplug); |
| 765 | void pci_destroy_slot(struct pci_slot *slot); | 762 | void pci_destroy_slot(struct pci_slot *slot); |
| 766 | void pci_renumber_slot(struct pci_slot *slot, int slot_nr); | ||
| 767 | int pci_scan_slot(struct pci_bus *bus, int devfn); | 763 | int pci_scan_slot(struct pci_bus *bus, int devfn); |
| 768 | struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); | 764 | struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); |
| 769 | void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); | 765 | void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); |
| @@ -779,6 +775,7 @@ struct pci_dev *pci_dev_get(struct pci_dev *dev); | |||
| 779 | void pci_dev_put(struct pci_dev *dev); | 775 | void pci_dev_put(struct pci_dev *dev); |
| 780 | void pci_remove_bus(struct pci_bus *b); | 776 | void pci_remove_bus(struct pci_bus *b); |
| 781 | void pci_stop_and_remove_bus_device(struct pci_dev *dev); | 777 | void pci_stop_and_remove_bus_device(struct pci_dev *dev); |
| 778 | void pci_stop_and_remove_bus_device_locked(struct pci_dev *dev); | ||
| 782 | void pci_stop_root_bus(struct pci_bus *bus); | 779 | void pci_stop_root_bus(struct pci_bus *bus); |
| 783 | void pci_remove_root_bus(struct pci_bus *bus); | 780 | void pci_remove_root_bus(struct pci_bus *bus); |
| 784 | void pci_setup_cardbus(struct pci_bus *bus); | 781 | void pci_setup_cardbus(struct pci_bus *bus); |
| @@ -938,6 +935,7 @@ bool pci_check_and_unmask_intx(struct pci_dev *dev); | |||
| 938 | void pci_msi_off(struct pci_dev *dev); | 935 | void pci_msi_off(struct pci_dev *dev); |
| 939 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); | 936 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); |
| 940 | int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); | 937 | int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); |
| 938 | int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask); | ||
| 941 | int pci_wait_for_pending_transaction(struct pci_dev *dev); | 939 | int pci_wait_for_pending_transaction(struct pci_dev *dev); |
| 942 | int pcix_get_max_mmrbc(struct pci_dev *dev); | 940 | int pcix_get_max_mmrbc(struct pci_dev *dev); |
| 943 | int pcix_get_mmrbc(struct pci_dev *dev); | 941 | int pcix_get_mmrbc(struct pci_dev *dev); |
| @@ -951,15 +949,19 @@ int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed, | |||
| 951 | int __pci_reset_function(struct pci_dev *dev); | 949 | int __pci_reset_function(struct pci_dev *dev); |
| 952 | int __pci_reset_function_locked(struct pci_dev *dev); | 950 | int __pci_reset_function_locked(struct pci_dev *dev); |
| 953 | int pci_reset_function(struct pci_dev *dev); | 951 | int pci_reset_function(struct pci_dev *dev); |
| 952 | int pci_try_reset_function(struct pci_dev *dev); | ||
| 954 | int pci_probe_reset_slot(struct pci_slot *slot); | 953 | int pci_probe_reset_slot(struct pci_slot *slot); |
| 955 | int pci_reset_slot(struct pci_slot *slot); | 954 | int pci_reset_slot(struct pci_slot *slot); |
| 955 | int pci_try_reset_slot(struct pci_slot *slot); | ||
| 956 | int pci_probe_reset_bus(struct pci_bus *bus); | 956 | int pci_probe_reset_bus(struct pci_bus *bus); |
| 957 | int pci_reset_bus(struct pci_bus *bus); | 957 | int pci_reset_bus(struct pci_bus *bus); |
| 958 | int pci_try_reset_bus(struct pci_bus *bus); | ||
| 958 | void pci_reset_bridge_secondary_bus(struct pci_dev *dev); | 959 | void pci_reset_bridge_secondary_bus(struct pci_dev *dev); |
| 959 | void pci_update_resource(struct pci_dev *dev, int resno); | 960 | void pci_update_resource(struct pci_dev *dev, int resno); |
| 960 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); | 961 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
| 961 | int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align); | 962 | int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align); |
| 962 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); | 963 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); |
| 964 | bool pci_device_is_present(struct pci_dev *pdev); | ||
| 963 | 965 | ||
| 964 | /* ROM control related routines */ | 966 | /* ROM control related routines */ |
| 965 | int pci_enable_rom(struct pci_dev *pdev); | 967 | int pci_enable_rom(struct pci_dev *pdev); |
| @@ -973,9 +975,14 @@ void __iomem __must_check *pci_platform_rom(struct pci_dev *pdev, size_t *size); | |||
| 973 | int pci_save_state(struct pci_dev *dev); | 975 | int pci_save_state(struct pci_dev *dev); |
| 974 | void pci_restore_state(struct pci_dev *dev); | 976 | void pci_restore_state(struct pci_dev *dev); |
| 975 | struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev); | 977 | struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev); |
| 976 | int pci_load_saved_state(struct pci_dev *dev, struct pci_saved_state *state); | ||
| 977 | int pci_load_and_free_saved_state(struct pci_dev *dev, | 978 | int pci_load_and_free_saved_state(struct pci_dev *dev, |
| 978 | struct pci_saved_state **state); | 979 | struct pci_saved_state **state); |
| 980 | struct pci_cap_saved_state *pci_find_saved_cap(struct pci_dev *dev, char cap); | ||
| 981 | struct pci_cap_saved_state *pci_find_saved_ext_cap(struct pci_dev *dev, | ||
| 982 | u16 cap); | ||
| 983 | int pci_add_cap_save_buffer(struct pci_dev *dev, char cap, unsigned int size); | ||
| 984 | int pci_add_ext_cap_save_buffer(struct pci_dev *dev, | ||
| 985 | u16 cap, unsigned int size); | ||
| 979 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); | 986 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); |
| 980 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | 987 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); |
| 981 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 988 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
| @@ -984,7 +991,6 @@ void pci_pme_active(struct pci_dev *dev, bool enable); | |||
| 984 | int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, | 991 | int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, |
| 985 | bool runtime, bool enable); | 992 | bool runtime, bool enable); |
| 986 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); | 993 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); |
| 987 | pci_power_t pci_target_state(struct pci_dev *dev); | ||
| 988 | int pci_prepare_to_sleep(struct pci_dev *dev); | 994 | int pci_prepare_to_sleep(struct pci_dev *dev); |
| 989 | int pci_back_from_sleep(struct pci_dev *dev); | 995 | int pci_back_from_sleep(struct pci_dev *dev); |
| 990 | bool pci_dev_run_wake(struct pci_dev *dev); | 996 | bool pci_dev_run_wake(struct pci_dev *dev); |
| @@ -997,21 +1003,10 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | |||
| 997 | return __pci_enable_wake(dev, state, false, enable); | 1003 | return __pci_enable_wake(dev, state, false, enable); |
| 998 | } | 1004 | } |
| 999 | 1005 | ||
| 1000 | #define PCI_EXP_IDO_REQUEST (1<<0) | 1006 | /* PCI Virtual Channel */ |
| 1001 | #define PCI_EXP_IDO_COMPLETION (1<<1) | 1007 | int pci_save_vc_state(struct pci_dev *dev); |
| 1002 | void pci_enable_ido(struct pci_dev *dev, unsigned long type); | 1008 | void pci_restore_vc_state(struct pci_dev *dev); |
| 1003 | void pci_disable_ido(struct pci_dev *dev, unsigned long type); | 1009 | void pci_allocate_vc_save_buffers(struct pci_dev *dev); |
| 1004 | |||
| 1005 | enum pci_obff_signal_type { | ||
| 1006 | PCI_EXP_OBFF_SIGNAL_L0 = 0, | ||
| 1007 | PCI_EXP_OBFF_SIGNAL_ALWAYS = 1, | ||
| 1008 | }; | ||
| 1009 | int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type); | ||
| 1010 | void pci_disable_obff(struct pci_dev *dev); | ||
| 1011 | |||
| 1012 | int pci_enable_ltr(struct pci_dev *dev); | ||
| 1013 | void pci_disable_ltr(struct pci_dev *dev); | ||
| 1014 | int pci_set_ltr(struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns); | ||
| 1015 | 1010 | ||
| 1016 | /* For use by arch with custom probe code */ | 1011 | /* For use by arch with custom probe code */ |
| 1017 | void set_pcie_port_type(struct pci_dev *pdev); | 1012 | void set_pcie_port_type(struct pci_dev *pdev); |
| @@ -1021,11 +1016,12 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev); | |||
| 1021 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); | 1016 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); |
| 1022 | unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge); | 1017 | unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge); |
| 1023 | unsigned int pci_rescan_bus(struct pci_bus *bus); | 1018 | unsigned int pci_rescan_bus(struct pci_bus *bus); |
| 1019 | void pci_lock_rescan_remove(void); | ||
| 1020 | void pci_unlock_rescan_remove(void); | ||
| 1024 | 1021 | ||
| 1025 | /* Vital product data routines */ | 1022 | /* Vital product data routines */ |
| 1026 | ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); | 1023 | ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); |
| 1027 | ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf); | 1024 | ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf); |
| 1028 | int pci_vpd_truncate(struct pci_dev *dev, size_t size); | ||
| 1029 | 1025 | ||
| 1030 | /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ | 1026 | /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ |
| 1031 | resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx); | 1027 | resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx); |
| @@ -1077,6 +1073,14 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus, | |||
| 1077 | resource_size_t), | 1073 | resource_size_t), |
| 1078 | void *alignf_data); | 1074 | void *alignf_data); |
| 1079 | 1075 | ||
| 1076 | static inline dma_addr_t pci_bus_address(struct pci_dev *pdev, int bar) | ||
| 1077 | { | ||
| 1078 | struct pci_bus_region region; | ||
| 1079 | |||
| 1080 | pcibios_resource_to_bus(pdev->bus, ®ion, &pdev->resource[bar]); | ||
| 1081 | return region.start; | ||
| 1082 | } | ||
| 1083 | |||
| 1080 | /* Proper probing supporting hot-pluggable devices */ | 1084 | /* Proper probing supporting hot-pluggable devices */ |
| 1081 | int __must_check __pci_register_driver(struct pci_driver *, struct module *, | 1085 | int __must_check __pci_register_driver(struct pci_driver *, struct module *, |
| 1082 | const char *mod_name); | 1086 | const char *mod_name); |
| @@ -1114,7 +1118,6 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, | |||
| 1114 | 1118 | ||
| 1115 | void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), | 1119 | void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), |
| 1116 | void *userdata); | 1120 | void *userdata); |
| 1117 | int pci_cfg_space_size_ext(struct pci_dev *dev); | ||
| 1118 | int pci_cfg_space_size(struct pci_dev *dev); | 1121 | int pci_cfg_space_size(struct pci_dev *dev); |
| 1119 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); | 1122 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); |
| 1120 | void pci_setup_bridge(struct pci_bus *bus); | 1123 | void pci_setup_bridge(struct pci_bus *bus); |
| @@ -1153,59 +1156,42 @@ struct msix_entry { | |||
| 1153 | }; | 1156 | }; |
| 1154 | 1157 | ||
| 1155 | 1158 | ||
| 1156 | #ifndef CONFIG_PCI_MSI | 1159 | #ifdef CONFIG_PCI_MSI |
| 1157 | static inline int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec) | 1160 | int pci_msi_vec_count(struct pci_dev *dev); |
| 1158 | { | 1161 | int pci_enable_msi_block(struct pci_dev *dev, int nvec); |
| 1159 | return -1; | ||
| 1160 | } | ||
| 1161 | |||
| 1162 | static inline int | ||
| 1163 | pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec) | ||
| 1164 | { | ||
| 1165 | return -1; | ||
| 1166 | } | ||
| 1167 | |||
| 1168 | static inline void pci_msi_shutdown(struct pci_dev *dev) | ||
| 1169 | { } | ||
| 1170 | static inline void pci_disable_msi(struct pci_dev *dev) | ||
| 1171 | { } | ||
| 1172 | |||
| 1173 | static inline int pci_msix_table_size(struct pci_dev *dev) | ||
| 1174 | { | ||
| 1175 | return 0; | ||
| 1176 | } | ||
| 1177 | static inline int pci_enable_msix(struct pci_dev *dev, | ||
| 1178 | struct msix_entry *entries, int nvec) | ||
| 1179 | { | ||
| 1180 | return -1; | ||
| 1181 | } | ||
| 1182 | |||
| 1183 | static inline void pci_msix_shutdown(struct pci_dev *dev) | ||
| 1184 | { } | ||
| 1185 | static inline void pci_disable_msix(struct pci_dev *dev) | ||
| 1186 | { } | ||
| 1187 | |||
| 1188 | static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) | ||
| 1189 | { } | ||
| 1190 | |||
| 1191 | static inline void pci_restore_msi_state(struct pci_dev *dev) | ||
| 1192 | { } | ||
| 1193 | static inline int pci_msi_enabled(void) | ||
| 1194 | { | ||
| 1195 | return 0; | ||
| 1196 | } | ||
| 1197 | #else | ||
| 1198 | int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec); | ||
| 1199 | int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec); | ||
| 1200 | void pci_msi_shutdown(struct pci_dev *dev); | 1162 | void pci_msi_shutdown(struct pci_dev *dev); |
| 1201 | void pci_disable_msi(struct pci_dev *dev); | 1163 | void pci_disable_msi(struct pci_dev *dev); |
| 1202 | int pci_msix_table_size(struct pci_dev *dev); | 1164 | int pci_msix_vec_count(struct pci_dev *dev); |
| 1203 | int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); | 1165 | int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); |
| 1204 | void pci_msix_shutdown(struct pci_dev *dev); | 1166 | void pci_msix_shutdown(struct pci_dev *dev); |
| 1205 | void pci_disable_msix(struct pci_dev *dev); | 1167 | void pci_disable_msix(struct pci_dev *dev); |
| 1206 | void msi_remove_pci_irq_vectors(struct pci_dev *dev); | 1168 | void msi_remove_pci_irq_vectors(struct pci_dev *dev); |
| 1207 | void pci_restore_msi_state(struct pci_dev *dev); | 1169 | void pci_restore_msi_state(struct pci_dev *dev); |
| 1208 | int pci_msi_enabled(void); | 1170 | int pci_msi_enabled(void); |
| 1171 | int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec); | ||
| 1172 | int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, | ||
| 1173 | int minvec, int maxvec); | ||
| 1174 | #else | ||
| 1175 | static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; } | ||
| 1176 | static inline int pci_enable_msi_block(struct pci_dev *dev, int nvec) | ||
| 1177 | { return -ENOSYS; } | ||
| 1178 | static inline void pci_msi_shutdown(struct pci_dev *dev) { } | ||
| 1179 | static inline void pci_disable_msi(struct pci_dev *dev) { } | ||
| 1180 | static inline int pci_msix_vec_count(struct pci_dev *dev) { return -ENOSYS; } | ||
| 1181 | static inline int pci_enable_msix(struct pci_dev *dev, | ||
| 1182 | struct msix_entry *entries, int nvec) | ||
| 1183 | { return -ENOSYS; } | ||
| 1184 | static inline void pci_msix_shutdown(struct pci_dev *dev) { } | ||
| 1185 | static inline void pci_disable_msix(struct pci_dev *dev) { } | ||
| 1186 | static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) { } | ||
| 1187 | static inline void pci_restore_msi_state(struct pci_dev *dev) { } | ||
| 1188 | static inline int pci_msi_enabled(void) { return 0; } | ||
| 1189 | static inline int pci_enable_msi_range(struct pci_dev *dev, int minvec, | ||
| 1190 | int maxvec) | ||
| 1191 | { return -ENOSYS; } | ||
| 1192 | static inline int pci_enable_msix_range(struct pci_dev *dev, | ||
| 1193 | struct msix_entry *entries, int minvec, int maxvec) | ||
| 1194 | { return -ENOSYS; } | ||
| 1209 | #endif | 1195 | #endif |
| 1210 | 1196 | ||
| 1211 | #ifdef CONFIG_PCIEPORTBUS | 1197 | #ifdef CONFIG_PCIEPORTBUS |
| @@ -1216,12 +1202,10 @@ extern bool pcie_ports_auto; | |||
| 1216 | #define pcie_ports_auto false | 1202 | #define pcie_ports_auto false |
| 1217 | #endif | 1203 | #endif |
| 1218 | 1204 | ||
| 1219 | #ifndef CONFIG_PCIEASPM | 1205 | #ifdef CONFIG_PCIEASPM |
| 1220 | static inline int pcie_aspm_enabled(void) { return 0; } | ||
| 1221 | static inline bool pcie_aspm_support_enabled(void) { return false; } | ||
| 1222 | #else | ||
| 1223 | int pcie_aspm_enabled(void); | ||
| 1224 | bool pcie_aspm_support_enabled(void); | 1206 | bool pcie_aspm_support_enabled(void); |
| 1207 | #else | ||
| 1208 | static inline bool pcie_aspm_support_enabled(void) { return false; } | ||
| 1225 | #endif | 1209 | #endif |
| 1226 | 1210 | ||
| 1227 | #ifdef CONFIG_PCIEAER | 1211 | #ifdef CONFIG_PCIEAER |
| @@ -1232,15 +1216,12 @@ static inline void pci_no_aer(void) { } | |||
| 1232 | static inline bool pci_aer_available(void) { return false; } | 1216 | static inline bool pci_aer_available(void) { return false; } |
| 1233 | #endif | 1217 | #endif |
| 1234 | 1218 | ||
| 1235 | #ifndef CONFIG_PCIE_ECRC | 1219 | #ifdef CONFIG_PCIE_ECRC |
| 1236 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) | ||
| 1237 | { | ||
| 1238 | return; | ||
| 1239 | } | ||
| 1240 | static inline void pcie_ecrc_get_policy(char *str) {}; | ||
| 1241 | #else | ||
| 1242 | void pcie_set_ecrc_checking(struct pci_dev *dev); | 1220 | void pcie_set_ecrc_checking(struct pci_dev *dev); |
| 1243 | void pcie_ecrc_get_policy(char *str); | 1221 | void pcie_ecrc_get_policy(char *str); |
| 1222 | #else | ||
| 1223 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { } | ||
| 1224 | static inline void pcie_ecrc_get_policy(char *str) { } | ||
| 1244 | #endif | 1225 | #endif |
| 1245 | 1226 | ||
| 1246 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) | 1227 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) |
| @@ -1264,15 +1245,8 @@ void pci_cfg_access_unlock(struct pci_dev *dev); | |||
| 1264 | extern int pci_domains_supported; | 1245 | extern int pci_domains_supported; |
| 1265 | #else | 1246 | #else |
| 1266 | enum { pci_domains_supported = 0 }; | 1247 | enum { pci_domains_supported = 0 }; |
| 1267 | static inline int pci_domain_nr(struct pci_bus *bus) | 1248 | static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } |
| 1268 | { | 1249 | static inline int pci_proc_domain(struct pci_bus *bus) { return 0; } |
| 1269 | return 0; | ||
| 1270 | } | ||
| 1271 | |||
| 1272 | static inline int pci_proc_domain(struct pci_bus *bus) | ||
| 1273 | { | ||
| 1274 | return 0; | ||
| 1275 | } | ||
| 1276 | #endif /* CONFIG_PCI_DOMAINS */ | 1250 | #endif /* CONFIG_PCI_DOMAINS */ |
| 1277 | 1251 | ||
| 1278 | /* some architectures require additional setup to direct VGA traffic */ | 1252 | /* some architectures require additional setup to direct VGA traffic */ |
| @@ -1301,180 +1275,88 @@ _PCI_NOP_ALL(write,) | |||
| 1301 | static inline struct pci_dev *pci_get_device(unsigned int vendor, | 1275 | static inline struct pci_dev *pci_get_device(unsigned int vendor, |
| 1302 | unsigned int device, | 1276 | unsigned int device, |
| 1303 | struct pci_dev *from) | 1277 | struct pci_dev *from) |
| 1304 | { | 1278 | { return NULL; } |
| 1305 | return NULL; | ||
| 1306 | } | ||
| 1307 | 1279 | ||
| 1308 | static inline struct pci_dev *pci_get_subsys(unsigned int vendor, | 1280 | static inline struct pci_dev *pci_get_subsys(unsigned int vendor, |
| 1309 | unsigned int device, | 1281 | unsigned int device, |
| 1310 | unsigned int ss_vendor, | 1282 | unsigned int ss_vendor, |
| 1311 | unsigned int ss_device, | 1283 | unsigned int ss_device, |
| 1312 | struct pci_dev *from) | 1284 | struct pci_dev *from) |
| 1313 | { | 1285 | { return NULL; } |
| 1314 | return NULL; | ||
| 1315 | } | ||
| 1316 | 1286 | ||
| 1317 | static inline struct pci_dev *pci_get_class(unsigned int class, | 1287 | static inline struct pci_dev *pci_get_class(unsigned int class, |
| 1318 | struct pci_dev *from) | 1288 | struct pci_dev *from) |
| 1319 | { | 1289 | { return NULL; } |
| 1320 | return NULL; | ||
| 1321 | } | ||
| 1322 | 1290 | ||
| 1323 | #define pci_dev_present(ids) (0) | 1291 | #define pci_dev_present(ids) (0) |
| 1324 | #define no_pci_devices() (1) | 1292 | #define no_pci_devices() (1) |
| 1325 | #define pci_dev_put(dev) do { } while (0) | 1293 | #define pci_dev_put(dev) do { } while (0) |
| 1326 | 1294 | ||
| 1327 | static inline void pci_set_master(struct pci_dev *dev) | 1295 | static inline void pci_set_master(struct pci_dev *dev) { } |
| 1328 | { } | 1296 | static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; } |
| 1329 | 1297 | static inline void pci_disable_device(struct pci_dev *dev) { } | |
| 1330 | static inline int pci_enable_device(struct pci_dev *dev) | ||
| 1331 | { | ||
| 1332 | return -EIO; | ||
| 1333 | } | ||
| 1334 | |||
| 1335 | static inline void pci_disable_device(struct pci_dev *dev) | ||
| 1336 | { } | ||
| 1337 | |||
| 1338 | static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) | 1298 | static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) |
| 1339 | { | 1299 | { return -EIO; } |
| 1340 | return -EIO; | ||
| 1341 | } | ||
| 1342 | |||
| 1343 | static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) | 1300 | static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) |
| 1344 | { | 1301 | { return -EIO; } |
| 1345 | return -EIO; | ||
| 1346 | } | ||
| 1347 | |||
| 1348 | static inline int pci_set_dma_max_seg_size(struct pci_dev *dev, | 1302 | static inline int pci_set_dma_max_seg_size(struct pci_dev *dev, |
| 1349 | unsigned int size) | 1303 | unsigned int size) |
| 1350 | { | 1304 | { return -EIO; } |
| 1351 | return -EIO; | ||
| 1352 | } | ||
| 1353 | |||
| 1354 | static inline int pci_set_dma_seg_boundary(struct pci_dev *dev, | 1305 | static inline int pci_set_dma_seg_boundary(struct pci_dev *dev, |
| 1355 | unsigned long mask) | 1306 | unsigned long mask) |
| 1356 | { | 1307 | { return -EIO; } |
| 1357 | return -EIO; | ||
| 1358 | } | ||
| 1359 | |||
| 1360 | static inline int pci_assign_resource(struct pci_dev *dev, int i) | 1308 | static inline int pci_assign_resource(struct pci_dev *dev, int i) |
| 1361 | { | 1309 | { return -EBUSY; } |
| 1362 | return -EBUSY; | ||
| 1363 | } | ||
| 1364 | |||
| 1365 | static inline int __pci_register_driver(struct pci_driver *drv, | 1310 | static inline int __pci_register_driver(struct pci_driver *drv, |
| 1366 | struct module *owner) | 1311 | struct module *owner) |
| 1367 | { | 1312 | { return 0; } |
| 1368 | return 0; | ||
| 1369 | } | ||
| 1370 | |||
| 1371 | static inline int pci_register_driver(struct pci_driver *drv) | 1313 | static inline int pci_register_driver(struct pci_driver *drv) |
| 1372 | { | 1314 | { return 0; } |
| 1373 | return 0; | 1315 | static inline void pci_unregister_driver(struct pci_driver *drv) { } |
| 1374 | } | ||
| 1375 | |||
| 1376 | static inline void pci_unregister_driver(struct pci_driver *drv) | ||
| 1377 | { } | ||
| 1378 | |||
| 1379 | static inline int pci_find_capability(struct pci_dev *dev, int cap) | 1316 | static inline int pci_find_capability(struct pci_dev *dev, int cap) |
| 1380 | { | 1317 | { return 0; } |
| 1381 | return 0; | ||
| 1382 | } | ||
| 1383 | |||
| 1384 | static inline int pci_find_next_capability(struct pci_dev *dev, u8 post, | 1318 | static inline int pci_find_next_capability(struct pci_dev *dev, u8 post, |
| 1385 | int cap) | 1319 | int cap) |
| 1386 | { | 1320 | { return 0; } |
| 1387 | return 0; | ||
| 1388 | } | ||
| 1389 | |||
| 1390 | static inline int pci_find_ext_capability(struct pci_dev *dev, int cap) | 1321 | static inline int pci_find_ext_capability(struct pci_dev *dev, int cap) |
| 1391 | { | 1322 | { return 0; } |
| 1392 | return 0; | ||
| 1393 | } | ||
| 1394 | 1323 | ||
| 1395 | /* Power management related routines */ | 1324 | /* Power management related routines */ |
| 1396 | static inline int pci_save_state(struct pci_dev *dev) | 1325 | static inline int pci_save_state(struct pci_dev *dev) { return 0; } |
| 1397 | { | 1326 | static inline void pci_restore_state(struct pci_dev *dev) { } |
| 1398 | return 0; | ||
| 1399 | } | ||
| 1400 | |||
| 1401 | static inline void pci_restore_state(struct pci_dev *dev) | ||
| 1402 | { } | ||
| 1403 | |||
| 1404 | static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) | 1327 | static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) |
| 1405 | { | 1328 | { return 0; } |
| 1406 | return 0; | ||
| 1407 | } | ||
| 1408 | |||
| 1409 | static inline int pci_wake_from_d3(struct pci_dev *dev, bool enable) | 1329 | static inline int pci_wake_from_d3(struct pci_dev *dev, bool enable) |
| 1410 | { | 1330 | { return 0; } |
| 1411 | return 0; | ||
| 1412 | } | ||
| 1413 | |||
| 1414 | static inline pci_power_t pci_choose_state(struct pci_dev *dev, | 1331 | static inline pci_power_t pci_choose_state(struct pci_dev *dev, |
| 1415 | pm_message_t state) | 1332 | pm_message_t state) |
| 1416 | { | 1333 | { return PCI_D0; } |
| 1417 | return PCI_D0; | ||
| 1418 | } | ||
| 1419 | |||
| 1420 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | 1334 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, |
| 1421 | int enable) | 1335 | int enable) |
| 1422 | { | 1336 | { return 0; } |
| 1423 | return 0; | ||
| 1424 | } | ||
| 1425 | |||
| 1426 | static inline void pci_enable_ido(struct pci_dev *dev, unsigned long type) | ||
| 1427 | { | ||
| 1428 | } | ||
| 1429 | |||
| 1430 | static inline void pci_disable_ido(struct pci_dev *dev, unsigned long type) | ||
| 1431 | { | ||
| 1432 | } | ||
| 1433 | |||
| 1434 | static inline int pci_enable_obff(struct pci_dev *dev, unsigned long type) | ||
| 1435 | { | ||
| 1436 | return 0; | ||
| 1437 | } | ||
| 1438 | |||
| 1439 | static inline void pci_disable_obff(struct pci_dev *dev) | ||
| 1440 | { | ||
| 1441 | } | ||
| 1442 | 1337 | ||
| 1443 | static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) | 1338 | static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) |
| 1444 | { | 1339 | { return -EIO; } |
| 1445 | return -EIO; | 1340 | static inline void pci_release_regions(struct pci_dev *dev) { } |
| 1446 | } | ||
| 1447 | |||
| 1448 | static inline void pci_release_regions(struct pci_dev *dev) | ||
| 1449 | { } | ||
| 1450 | 1341 | ||
| 1451 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) | 1342 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) |
| 1452 | 1343 | ||
| 1453 | static inline void pci_block_cfg_access(struct pci_dev *dev) | 1344 | static inline void pci_block_cfg_access(struct pci_dev *dev) { } |
| 1454 | { } | ||
| 1455 | |||
| 1456 | static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev) | 1345 | static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev) |
| 1457 | { return 0; } | 1346 | { return 0; } |
| 1458 | 1347 | static inline void pci_unblock_cfg_access(struct pci_dev *dev) { } | |
| 1459 | static inline void pci_unblock_cfg_access(struct pci_dev *dev) | ||
| 1460 | { } | ||
| 1461 | 1348 | ||
| 1462 | static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) | 1349 | static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) |
| 1463 | { return NULL; } | 1350 | { return NULL; } |
| 1464 | |||
| 1465 | static inline struct pci_dev *pci_get_slot(struct pci_bus *bus, | 1351 | static inline struct pci_dev *pci_get_slot(struct pci_bus *bus, |
| 1466 | unsigned int devfn) | 1352 | unsigned int devfn) |
| 1467 | { return NULL; } | 1353 | { return NULL; } |
| 1468 | |||
| 1469 | static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, | 1354 | static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, |
| 1470 | unsigned int devfn) | 1355 | unsigned int devfn) |
| 1471 | { return NULL; } | 1356 | { return NULL; } |
| 1472 | 1357 | ||
| 1473 | static inline int pci_domain_nr(struct pci_bus *bus) | 1358 | static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } |
| 1474 | { return 0; } | 1359 | static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; } |
| 1475 | |||
| 1476 | static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) | ||
| 1477 | { return NULL; } | ||
| 1478 | 1360 | ||
| 1479 | #define dev_is_pci(d) (false) | 1361 | #define dev_is_pci(d) (false) |
| 1480 | #define dev_is_pf(d) (false) | 1362 | #define dev_is_pf(d) (false) |
| @@ -1485,10 +1367,6 @@ static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) | |||
| 1485 | 1367 | ||
| 1486 | #include <asm/pci.h> | 1368 | #include <asm/pci.h> |
| 1487 | 1369 | ||
| 1488 | #ifndef PCIBIOS_MAX_MEM_32 | ||
| 1489 | #define PCIBIOS_MAX_MEM_32 (-1) | ||
| 1490 | #endif | ||
| 1491 | |||
| 1492 | /* these helpers provide future and backwards compatibility | 1370 | /* these helpers provide future and backwards compatibility |
| 1493 | * for accessing popular PCI BAR info */ | 1371 | * for accessing popular PCI BAR info */ |
| 1494 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) | 1372 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) |
| @@ -1567,65 +1445,65 @@ enum pci_fixup_pass { | |||
| 1567 | /* Anonymous variables would be nice... */ | 1445 | /* Anonymous variables would be nice... */ |
| 1568 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ | 1446 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ |
| 1569 | class_shift, hook) \ | 1447 | class_shift, hook) \ |
| 1570 | static const struct pci_fixup __pci_fixup_##name __used \ | 1448 | static const struct pci_fixup __PASTE(__pci_fixup_##name,__LINE__) __used \ |
| 1571 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ | 1449 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ |
| 1572 | = { vendor, device, class, class_shift, hook }; | 1450 | = { vendor, device, class, class_shift, hook }; |
| 1573 | 1451 | ||
| 1574 | #define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \ | 1452 | #define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \ |
| 1575 | class_shift, hook) \ | 1453 | class_shift, hook) \ |
| 1576 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ | 1454 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ |
| 1577 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1455 | hook, vendor, device, class, class_shift, hook) |
| 1578 | #define DECLARE_PCI_FIXUP_CLASS_HEADER(vendor, device, class, \ | 1456 | #define DECLARE_PCI_FIXUP_CLASS_HEADER(vendor, device, class, \ |
| 1579 | class_shift, hook) \ | 1457 | class_shift, hook) \ |
| 1580 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ | 1458 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ |
| 1581 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1459 | hook, vendor, device, class, class_shift, hook) |
| 1582 | #define DECLARE_PCI_FIXUP_CLASS_FINAL(vendor, device, class, \ | 1460 | #define DECLARE_PCI_FIXUP_CLASS_FINAL(vendor, device, class, \ |
| 1583 | class_shift, hook) \ | 1461 | class_shift, hook) \ |
| 1584 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ | 1462 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ |
| 1585 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1463 | hook, vendor, device, class, class_shift, hook) |
| 1586 | #define DECLARE_PCI_FIXUP_CLASS_ENABLE(vendor, device, class, \ | 1464 | #define DECLARE_PCI_FIXUP_CLASS_ENABLE(vendor, device, class, \ |
| 1587 | class_shift, hook) \ | 1465 | class_shift, hook) \ |
| 1588 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ | 1466 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ |
| 1589 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1467 | hook, vendor, device, class, class_shift, hook) |
| 1590 | #define DECLARE_PCI_FIXUP_CLASS_RESUME(vendor, device, class, \ | 1468 | #define DECLARE_PCI_FIXUP_CLASS_RESUME(vendor, device, class, \ |
| 1591 | class_shift, hook) \ | 1469 | class_shift, hook) \ |
| 1592 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ | 1470 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ |
| 1593 | resume##vendor##device##hook, vendor, device, class, \ | 1471 | resume##hook, vendor, device, class, \ |
| 1594 | class_shift, hook) | 1472 | class_shift, hook) |
| 1595 | #define DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(vendor, device, class, \ | 1473 | #define DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(vendor, device, class, \ |
| 1596 | class_shift, hook) \ | 1474 | class_shift, hook) \ |
| 1597 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ | 1475 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ |
| 1598 | resume_early##vendor##device##hook, vendor, device, \ | 1476 | resume_early##hook, vendor, device, \ |
| 1599 | class, class_shift, hook) | 1477 | class, class_shift, hook) |
| 1600 | #define DECLARE_PCI_FIXUP_CLASS_SUSPEND(vendor, device, class, \ | 1478 | #define DECLARE_PCI_FIXUP_CLASS_SUSPEND(vendor, device, class, \ |
| 1601 | class_shift, hook) \ | 1479 | class_shift, hook) \ |
| 1602 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1480 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
| 1603 | suspend##vendor##device##hook, vendor, device, class, \ | 1481 | suspend##hook, vendor, device, class, \ |
| 1604 | class_shift, hook) | 1482 | class_shift, hook) |
| 1605 | 1483 | ||
| 1606 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ | 1484 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ |
| 1607 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ | 1485 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ |
| 1608 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1486 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
| 1609 | #define DECLARE_PCI_FIXUP_HEADER(vendor, device, hook) \ | 1487 | #define DECLARE_PCI_FIXUP_HEADER(vendor, device, hook) \ |
| 1610 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ | 1488 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ |
| 1611 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1489 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
| 1612 | #define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook) \ | 1490 | #define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook) \ |
| 1613 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ | 1491 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ |
| 1614 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1492 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
| 1615 | #define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ | 1493 | #define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ |
| 1616 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ | 1494 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ |
| 1617 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1495 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
| 1618 | #define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ | 1496 | #define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ |
| 1619 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ | 1497 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ |
| 1620 | resume##vendor##device##hook, vendor, device, \ | 1498 | resume##hook, vendor, device, \ |
| 1621 | PCI_ANY_ID, 0, hook) | 1499 | PCI_ANY_ID, 0, hook) |
| 1622 | #define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \ | 1500 | #define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \ |
| 1623 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ | 1501 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ |
| 1624 | resume_early##vendor##device##hook, vendor, device, \ | 1502 | resume_early##hook, vendor, device, \ |
| 1625 | PCI_ANY_ID, 0, hook) | 1503 | PCI_ANY_ID, 0, hook) |
| 1626 | #define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \ | 1504 | #define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \ |
| 1627 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1505 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
| 1628 | suspend##vendor##device##hook, vendor, device, \ | 1506 | suspend##hook, vendor, device, \ |
| 1629 | PCI_ANY_ID, 0, hook) | 1507 | PCI_ANY_ID, 0, hook) |
| 1630 | 1508 | ||
| 1631 | #ifdef CONFIG_PCI_QUIRKS | 1509 | #ifdef CONFIG_PCI_QUIRKS |
| @@ -1634,7 +1512,7 @@ struct pci_dev *pci_get_dma_source(struct pci_dev *dev); | |||
| 1634 | int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags); | 1512 | int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags); |
| 1635 | #else | 1513 | #else |
| 1636 | static inline void pci_fixup_device(enum pci_fixup_pass pass, | 1514 | static inline void pci_fixup_device(enum pci_fixup_pass pass, |
| 1637 | struct pci_dev *dev) {} | 1515 | struct pci_dev *dev) { } |
| 1638 | static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev) | 1516 | static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev) |
| 1639 | { | 1517 | { |
| 1640 | return pci_dev_get(dev); | 1518 | return pci_dev_get(dev); |
| @@ -1706,32 +1584,17 @@ int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); | |||
| 1706 | int pci_sriov_get_totalvfs(struct pci_dev *dev); | 1584 | int pci_sriov_get_totalvfs(struct pci_dev *dev); |
| 1707 | #else | 1585 | #else |
| 1708 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) | 1586 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) |
| 1709 | { | 1587 | { return -ENODEV; } |
| 1710 | return -ENODEV; | 1588 | static inline void pci_disable_sriov(struct pci_dev *dev) { } |
| 1711 | } | ||
| 1712 | static inline void pci_disable_sriov(struct pci_dev *dev) | ||
| 1713 | { | ||
| 1714 | } | ||
| 1715 | static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) | 1589 | static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) |
| 1716 | { | 1590 | { return IRQ_NONE; } |
| 1717 | return IRQ_NONE; | 1591 | static inline int pci_num_vf(struct pci_dev *dev) { return 0; } |
| 1718 | } | ||
| 1719 | static inline int pci_num_vf(struct pci_dev *dev) | ||
| 1720 | { | ||
| 1721 | return 0; | ||
| 1722 | } | ||
| 1723 | static inline int pci_vfs_assigned(struct pci_dev *dev) | 1592 | static inline int pci_vfs_assigned(struct pci_dev *dev) |
| 1724 | { | 1593 | { return 0; } |
| 1725 | return 0; | ||
| 1726 | } | ||
| 1727 | static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) | 1594 | static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) |
| 1728 | { | 1595 | { return 0; } |
| 1729 | return 0; | ||
| 1730 | } | ||
| 1731 | static inline int pci_sriov_get_totalvfs(struct pci_dev *dev) | 1596 | static inline int pci_sriov_get_totalvfs(struct pci_dev *dev) |
| 1732 | { | 1597 | { return 0; } |
| 1733 | return 0; | ||
| 1734 | } | ||
| 1735 | #endif | 1598 | #endif |
| 1736 | 1599 | ||
| 1737 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) | 1600 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) |
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 57e890abe1f0..a5fc7d01aad6 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
| @@ -69,6 +69,7 @@ | |||
| 69 | __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ | 69 | __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ |
| 70 | extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ | 70 | extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ |
| 71 | __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ | 71 | __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ |
| 72 | extern __PCPU_ATTRS(sec) __typeof__(type) name; \ | ||
| 72 | __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ | 73 | __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ |
| 73 | __typeof__(type) name | 74 | __typeof__(type) name |
| 74 | #else | 75 | #else |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 9e4761caa80c..e3817d2441b6 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef __LINUX_PERCPU_H | 1 | #ifndef __LINUX_PERCPU_H |
| 2 | #define __LINUX_PERCPU_H | 2 | #define __LINUX_PERCPU_H |
| 3 | 3 | ||
| 4 | #include <linux/mmdebug.h> | ||
| 4 | #include <linux/preempt.h> | 5 | #include <linux/preempt.h> |
| 5 | #include <linux/smp.h> | 6 | #include <linux/smp.h> |
| 6 | #include <linux/cpumask.h> | 7 | #include <linux/cpumask.h> |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 2e069d1288df..e56b07f5c9b6 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -320,6 +320,7 @@ struct perf_event { | |||
| 320 | struct list_head migrate_entry; | 320 | struct list_head migrate_entry; |
| 321 | 321 | ||
| 322 | struct hlist_node hlist_entry; | 322 | struct hlist_node hlist_entry; |
| 323 | struct list_head active_entry; | ||
| 323 | int nr_siblings; | 324 | int nr_siblings; |
| 324 | int group_flags; | 325 | int group_flags; |
| 325 | struct perf_event *group_leader; | 326 | struct perf_event *group_leader; |
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 6d722695e027..e273e5ac19c9 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h | |||
| @@ -38,6 +38,14 @@ struct phy_ops { | |||
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| 41 | * struct phy_attrs - represents phy attributes | ||
| 42 | * @bus_width: Data path width implemented by PHY | ||
| 43 | */ | ||
| 44 | struct phy_attrs { | ||
| 45 | u32 bus_width; | ||
| 46 | }; | ||
| 47 | |||
| 48 | /** | ||
| 41 | * struct phy - represents the phy device | 49 | * struct phy - represents the phy device |
| 42 | * @dev: phy device | 50 | * @dev: phy device |
| 43 | * @id: id of the phy device | 51 | * @id: id of the phy device |
| @@ -46,6 +54,7 @@ struct phy_ops { | |||
| 46 | * @mutex: mutex to protect phy_ops | 54 | * @mutex: mutex to protect phy_ops |
| 47 | * @init_count: used to protect when the PHY is used by multiple consumers | 55 | * @init_count: used to protect when the PHY is used by multiple consumers |
| 48 | * @power_count: used to protect when the PHY is used by multiple consumers | 56 | * @power_count: used to protect when the PHY is used by multiple consumers |
| 57 | * @phy_attrs: used to specify PHY specific attributes | ||
| 49 | */ | 58 | */ |
| 50 | struct phy { | 59 | struct phy { |
| 51 | struct device dev; | 60 | struct device dev; |
| @@ -55,6 +64,7 @@ struct phy { | |||
| 55 | struct mutex mutex; | 64 | struct mutex mutex; |
| 56 | int init_count; | 65 | int init_count; |
| 57 | int power_count; | 66 | int power_count; |
| 67 | struct phy_attrs attrs; | ||
| 58 | }; | 68 | }; |
| 59 | 69 | ||
| 60 | /** | 70 | /** |
| @@ -127,6 +137,14 @@ int phy_init(struct phy *phy); | |||
| 127 | int phy_exit(struct phy *phy); | 137 | int phy_exit(struct phy *phy); |
| 128 | int phy_power_on(struct phy *phy); | 138 | int phy_power_on(struct phy *phy); |
| 129 | int phy_power_off(struct phy *phy); | 139 | int phy_power_off(struct phy *phy); |
| 140 | static inline int phy_get_bus_width(struct phy *phy) | ||
| 141 | { | ||
| 142 | return phy->attrs.bus_width; | ||
| 143 | } | ||
| 144 | static inline void phy_set_bus_width(struct phy *phy, int bus_width) | ||
| 145 | { | ||
| 146 | phy->attrs.bus_width = bus_width; | ||
| 147 | } | ||
| 130 | struct phy *phy_get(struct device *dev, const char *string); | 148 | struct phy *phy_get(struct device *dev, const char *string); |
| 131 | struct phy *devm_phy_get(struct device *dev, const char *string); | 149 | struct phy *devm_phy_get(struct device *dev, const char *string); |
| 132 | void phy_put(struct phy *phy); | 150 | void phy_put(struct phy *phy); |
| @@ -199,6 +217,16 @@ static inline int phy_power_off(struct phy *phy) | |||
| 199 | return -ENOSYS; | 217 | return -ENOSYS; |
| 200 | } | 218 | } |
| 201 | 219 | ||
| 220 | static inline int phy_get_bus_width(struct phy *phy) | ||
| 221 | { | ||
| 222 | return -ENOSYS; | ||
| 223 | } | ||
| 224 | |||
| 225 | static inline void phy_set_bus_width(struct phy *phy, int bus_width) | ||
| 226 | { | ||
| 227 | return; | ||
| 228 | } | ||
| 229 | |||
| 202 | static inline struct phy *phy_get(struct device *dev, const char *string) | 230 | static inline struct phy *phy_get(struct device *dev, const char *string) |
| 203 | { | 231 | { |
| 204 | return ERR_PTR(-ENOSYS); | 232 | return ERR_PTR(-ENOSYS); |
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index fb90ef5eb038..a15f10727eb8 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h | |||
| @@ -61,6 +61,9 @@ | |||
| 61 | * argument is ignored. | 61 | * argument is ignored. |
| 62 | * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current | 62 | * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current |
| 63 | * passed as argument. The argument is in mA. | 63 | * passed as argument. The argument is in mA. |
| 64 | * @PIN_CONFIG_INPUT_ENABLE: enable the pin's input. Note that this does not | ||
| 65 | * affect the pin's ability to drive output. 1 enables input, 0 disables | ||
| 66 | * input. | ||
| 64 | * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. | 67 | * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. |
| 65 | * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, | 68 | * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, |
| 66 | * schmitt-trigger mode is disabled. | 69 | * schmitt-trigger mode is disabled. |
| @@ -82,8 +85,10 @@ | |||
| 82 | * operation, if several modes of operation are supported these can be | 85 | * operation, if several modes of operation are supported these can be |
| 83 | * passed in the argument on a custom form, else just use argument 1 | 86 | * passed in the argument on a custom form, else just use argument 1 |
| 84 | * to indicate low power mode, argument 0 turns low power mode off. | 87 | * to indicate low power mode, argument 0 turns low power mode off. |
| 85 | * @PIN_CONFIG_OUTPUT: this will configure the pin in output, use argument | 88 | * @PIN_CONFIG_OUTPUT: this will configure the pin as an output. Use argument |
| 86 | * 1 to indicate high level, argument 0 to indicate low level. | 89 | * 1 to indicate high level, argument 0 to indicate low level. (Please |
| 90 | * see Documentation/pinctrl.txt, section "GPIO mode pitfalls" for a | ||
| 91 | * discussion around this parameter.) | ||
| 87 | * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if | 92 | * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if |
| 88 | * you need to pass in custom configurations to the pin controller, use | 93 | * you need to pass in custom configurations to the pin controller, use |
| 89 | * PIN_CONFIG_END+1 as the base offset. | 94 | * PIN_CONFIG_END+1 as the base offset. |
| @@ -99,6 +104,7 @@ enum pin_config_param { | |||
| 99 | PIN_CONFIG_DRIVE_OPEN_DRAIN, | 104 | PIN_CONFIG_DRIVE_OPEN_DRAIN, |
| 100 | PIN_CONFIG_DRIVE_OPEN_SOURCE, | 105 | PIN_CONFIG_DRIVE_OPEN_SOURCE, |
| 101 | PIN_CONFIG_DRIVE_STRENGTH, | 106 | PIN_CONFIG_DRIVE_STRENGTH, |
| 107 | PIN_CONFIG_INPUT_ENABLE, | ||
| 102 | PIN_CONFIG_INPUT_SCHMITT_ENABLE, | 108 | PIN_CONFIG_INPUT_SCHMITT_ENABLE, |
| 103 | PIN_CONFIG_INPUT_SCHMITT, | 109 | PIN_CONFIG_INPUT_SCHMITT, |
| 104 | PIN_CONFIG_INPUT_DEBOUNCE, | 110 | PIN_CONFIG_INPUT_DEBOUNCE, |
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index fefb88663975..cc8e1aff0e28 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
| @@ -32,10 +32,12 @@ struct device_node; | |||
| 32 | * pins, pads or other muxable units in this struct | 32 | * pins, pads or other muxable units in this struct |
| 33 | * @number: unique pin number from the global pin number space | 33 | * @number: unique pin number from the global pin number space |
| 34 | * @name: a name for this pin | 34 | * @name: a name for this pin |
| 35 | * @drv_data: driver-defined per-pin data. pinctrl core does not touch this | ||
| 35 | */ | 36 | */ |
| 36 | struct pinctrl_pin_desc { | 37 | struct pinctrl_pin_desc { |
| 37 | unsigned number; | 38 | unsigned number; |
| 38 | const char *name; | 39 | const char *name; |
| 40 | void *drv_data; | ||
| 39 | }; | 41 | }; |
| 40 | 42 | ||
| 41 | /* Convenience macro to define a single named or anonymous pin descriptor */ | 43 | /* Convenience macro to define a single named or anonymous pin descriptor */ |
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index b8809fef61f5..ab5752692113 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
| @@ -157,6 +157,8 @@ int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *); | |||
| 157 | int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); | 157 | int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); |
| 158 | void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *); | 158 | void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *); |
| 159 | 159 | ||
| 160 | extern const struct pipe_buf_operations nosteal_pipe_buf_ops; | ||
| 161 | |||
| 160 | /* for F_SETPIPE_SZ and F_GETPIPE_SZ */ | 162 | /* for F_SETPIPE_SZ and F_GETPIPE_SZ */ |
| 161 | long pipe_fcntl(struct file *, unsigned int, unsigned long arg); | 163 | long pipe_fcntl(struct file *, unsigned int, unsigned long arg); |
| 162 | struct pipe_inode_info *get_pipe_info(struct file *file); | 164 | struct pipe_inode_info *get_pipe_info(struct file *file); |
diff --git a/include/linux/platform_data/asoc-ti-mcbsp.h b/include/linux/platform_data/asoc-ti-mcbsp.h index c78d90b28b19..3c73c045f8da 100644 --- a/include/linux/platform_data/asoc-ti-mcbsp.h +++ b/include/linux/platform_data/asoc-ti-mcbsp.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * arch/arm/plat-omap/include/mach/mcbsp.h | ||
| 3 | * | ||
| 4 | * Defines for Multi-Channel Buffered Serial Port | 2 | * Defines for Multi-Channel Buffered Serial Port |
| 5 | * | 3 | * |
| 6 | * Copyright (C) 2002 RidgeRun, Inc. | 4 | * Copyright (C) 2002 RidgeRun, Inc. |
| @@ -21,8 +19,8 @@ | |||
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 | * | 20 | * |
| 23 | */ | 21 | */ |
| 24 | #ifndef __ASM_ARCH_OMAP_MCBSP_H | 22 | #ifndef __ASOC_TI_MCBSP_H |
| 25 | #define __ASM_ARCH_OMAP_MCBSP_H | 23 | #define __ASOC_TI_MCBSP_H |
| 26 | 24 | ||
| 27 | #include <linux/spinlock.h> | 25 | #include <linux/spinlock.h> |
| 28 | #include <linux/clk.h> | 26 | #include <linux/clk.h> |
diff --git a/include/linux/platform_data/asoc-ux500-msp.h b/include/linux/platform_data/asoc-ux500-msp.h index 9991aea3d577..2f34bb98fe2a 100644 --- a/include/linux/platform_data/asoc-ux500-msp.h +++ b/include/linux/platform_data/asoc-ux500-msp.h | |||
| @@ -10,16 +10,9 @@ | |||
| 10 | 10 | ||
| 11 | #include <linux/platform_data/dma-ste-dma40.h> | 11 | #include <linux/platform_data/dma-ste-dma40.h> |
| 12 | 12 | ||
| 13 | enum msp_i2s_id { | ||
| 14 | MSP_I2S_0 = 0, | ||
| 15 | MSP_I2S_1, | ||
| 16 | MSP_I2S_2, | ||
| 17 | MSP_I2S_3, | ||
| 18 | }; | ||
| 19 | |||
| 20 | /* Platform data structure for a MSP I2S-device */ | 13 | /* Platform data structure for a MSP I2S-device */ |
| 21 | struct msp_i2s_platform_data { | 14 | struct msp_i2s_platform_data { |
| 22 | enum msp_i2s_id id; | 15 | int id; |
| 23 | struct stedma40_chan_cfg *msp_i2s_dma_rx; | 16 | struct stedma40_chan_cfg *msp_i2s_dma_rx; |
| 24 | struct stedma40_chan_cfg *msp_i2s_dma_tx; | 17 | struct stedma40_chan_cfg *msp_i2s_dma_tx; |
| 25 | }; | 18 | }; |
diff --git a/include/linux/platform_data/clocksource-nomadik-mtu.h b/include/linux/platform_data/clocksource-nomadik-mtu.h deleted file mode 100644 index 80088973b734..000000000000 --- a/include/linux/platform_data/clocksource-nomadik-mtu.h +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | #ifndef __PLAT_MTU_H | ||
| 2 | #define __PLAT_MTU_H | ||
| 3 | |||
| 4 | void nmdk_timer_init(void __iomem *base, int irq); | ||
| 5 | void nmdk_clkevt_reset(void); | ||
| 6 | void nmdk_clksrc_reset(void); | ||
| 7 | |||
| 8 | #endif /* __PLAT_MTU_H */ | ||
| 9 | |||
diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h index 689a856b86f9..5245992b0367 100644 --- a/include/linux/platform_data/davinci_asp.h +++ b/include/linux/platform_data/davinci_asp.h | |||
| @@ -92,6 +92,7 @@ enum { | |||
| 92 | MCASP_VERSION_1 = 0, /* DM646x */ | 92 | MCASP_VERSION_1 = 0, /* DM646x */ |
| 93 | MCASP_VERSION_2, /* DA8xx/OMAPL1x */ | 93 | MCASP_VERSION_2, /* DA8xx/OMAPL1x */ |
| 94 | MCASP_VERSION_3, /* TI81xx/AM33xx */ | 94 | MCASP_VERSION_3, /* TI81xx/AM33xx */ |
| 95 | MCASP_VERSION_4, /* DRA7xxx */ | ||
| 95 | }; | 96 | }; |
| 96 | 97 | ||
| 97 | enum mcbsp_clk_input_pin { | 98 | enum mcbsp_clk_input_pin { |
diff --git a/include/linux/platform_data/gpio-davinci.h b/include/linux/platform_data/gpio-davinci.h index 6efd20264585..fbe2f7535741 100644 --- a/include/linux/platform_data/gpio-davinci.h +++ b/include/linux/platform_data/gpio-davinci.h | |||
| @@ -28,13 +28,12 @@ enum davinci_gpio_type { | |||
| 28 | struct davinci_gpio_platform_data { | 28 | struct davinci_gpio_platform_data { |
| 29 | u32 ngpio; | 29 | u32 ngpio; |
| 30 | u32 gpio_unbanked; | 30 | u32 gpio_unbanked; |
| 31 | u32 intc_irq_num; | ||
| 32 | }; | 31 | }; |
| 33 | 32 | ||
| 34 | 33 | ||
| 35 | struct davinci_gpio_controller { | 34 | struct davinci_gpio_controller { |
| 36 | struct gpio_chip chip; | 35 | struct gpio_chip chip; |
| 37 | int irq_base; | 36 | struct irq_domain *irq_domain; |
| 38 | /* Serialize access to GPIO registers */ | 37 | /* Serialize access to GPIO registers */ |
| 39 | spinlock_t lock; | 38 | spinlock_t lock; |
| 40 | void __iomem *regs; | 39 | void __iomem *regs; |
diff --git a/include/linux/platform_data/gpio-lpc32xx.h b/include/linux/platform_data/gpio-lpc32xx.h new file mode 100644 index 000000000000..a544e962a818 --- /dev/null +++ b/include/linux/platform_data/gpio-lpc32xx.h | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | /* | ||
| 2 | * Author: Kevin Wells <kevin.wells@nxp.com> | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 NXP Semiconductors | ||
| 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 as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef __MACH_GPIO_LPC32XX_H | ||
| 18 | #define __MACH_GPIO_LPC32XX_H | ||
| 19 | |||
| 20 | /* | ||
| 21 | * Note! | ||
| 22 | * Muxed GP pins need to be setup to the GP state in the board level | ||
| 23 | * code prior to using this driver. | ||
| 24 | * GPI pins : 28xP3 group | ||
| 25 | * GPO pins : 24xP3 group | ||
| 26 | * GPIO pins: 8xP0 group, 24xP1 group, 13xP2 group, 6xP3 group | ||
| 27 | */ | ||
| 28 | |||
| 29 | #define LPC32XX_GPIO_P0_MAX 8 | ||
| 30 | #define LPC32XX_GPIO_P1_MAX 24 | ||
| 31 | #define LPC32XX_GPIO_P2_MAX 13 | ||
| 32 | #define LPC32XX_GPIO_P3_MAX 6 | ||
| 33 | #define LPC32XX_GPI_P3_MAX 29 | ||
| 34 | #define LPC32XX_GPO_P3_MAX 24 | ||
| 35 | |||
| 36 | #define LPC32XX_GPIO_P0_GRP 0 | ||
| 37 | #define LPC32XX_GPIO_P1_GRP (LPC32XX_GPIO_P0_GRP + LPC32XX_GPIO_P0_MAX) | ||
| 38 | #define LPC32XX_GPIO_P2_GRP (LPC32XX_GPIO_P1_GRP + LPC32XX_GPIO_P1_MAX) | ||
| 39 | #define LPC32XX_GPIO_P3_GRP (LPC32XX_GPIO_P2_GRP + LPC32XX_GPIO_P2_MAX) | ||
| 40 | #define LPC32XX_GPI_P3_GRP (LPC32XX_GPIO_P3_GRP + LPC32XX_GPIO_P3_MAX) | ||
| 41 | #define LPC32XX_GPO_P3_GRP (LPC32XX_GPI_P3_GRP + LPC32XX_GPI_P3_MAX) | ||
| 42 | |||
| 43 | /* | ||
| 44 | * A specific GPIO can be selected with this macro | ||
| 45 | * ie, GPIO_05 can be selected with LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 5) | ||
| 46 | * See the LPC32x0 User's guide for GPIO group numbers | ||
| 47 | */ | ||
| 48 | #define LPC32XX_GPIO(x, y) ((x) + (y)) | ||
| 49 | |||
| 50 | #endif /* __MACH_GPIO_LPC32XX_H */ | ||
diff --git a/include/linux/platform_data/hwmon-s3c.h b/include/linux/platform_data/hwmon-s3c.h index c167e4429bc7..0e3cce130fe2 100644 --- a/include/linux/platform_data/hwmon-s3c.h +++ b/include/linux/platform_data/hwmon-s3c.h | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | /* linux/arch/arm/plat-s3c/include/plat/hwmon.h | 1 | /* |
| 2 | * | ||
| 3 | * Copyright 2005 Simtec Electronics | 2 | * Copyright 2005 Simtec Electronics |
| 4 | * Ben Dooks <ben@simtec.co.uk> | 3 | * Ben Dooks <ben@simtec.co.uk> |
| 5 | * http://armlinux.simtec.co.uk/ | 4 | * http://armlinux.simtec.co.uk/ |
| @@ -11,8 +10,8 @@ | |||
| 11 | * published by the Free Software Foundation. | 10 | * published by the Free Software Foundation. |
| 12 | */ | 11 | */ |
| 13 | 12 | ||
| 14 | #ifndef __ASM_ARCH_ADC_HWMON_H | 13 | #ifndef __HWMON_S3C_H__ |
| 15 | #define __ASM_ARCH_ADC_HWMON_H __FILE__ | 14 | #define __HWMON_S3C_H__ |
| 16 | 15 | ||
| 17 | /** | 16 | /** |
| 18 | * s3c_hwmon_chcfg - channel configuration | 17 | * s3c_hwmon_chcfg - channel configuration |
| @@ -47,5 +46,4 @@ struct s3c_hwmon_pdata { | |||
| 47 | */ | 46 | */ |
| 48 | extern void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd); | 47 | extern void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd); |
| 49 | 48 | ||
| 50 | #endif /* __ASM_ARCH_ADC_HWMON_H */ | 49 | #endif /* __HWMON_S3C_H__ */ |
| 51 | |||
diff --git a/include/linux/platform_data/i2c-nomadik.h b/include/linux/platform_data/i2c-nomadik.h deleted file mode 100644 index 3a8be9cdc95c..000000000000 --- a/include/linux/platform_data/i2c-nomadik.h +++ /dev/null | |||
| @@ -1,39 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2009 ST-Ericsson | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2, as | ||
| 6 | * published by the Free Software Foundation. | ||
| 7 | */ | ||
| 8 | #ifndef __PDATA_I2C_NOMADIK_H | ||
| 9 | #define __PDATA_I2C_NOMADIK_H | ||
| 10 | |||
| 11 | enum i2c_freq_mode { | ||
| 12 | I2C_FREQ_MODE_STANDARD, /* up to 100 Kb/s */ | ||
| 13 | I2C_FREQ_MODE_FAST, /* up to 400 Kb/s */ | ||
| 14 | I2C_FREQ_MODE_HIGH_SPEED, /* up to 3.4 Mb/s */ | ||
| 15 | I2C_FREQ_MODE_FAST_PLUS, /* up to 1 Mb/s */ | ||
| 16 | }; | ||
| 17 | |||
| 18 | /** | ||
| 19 | * struct nmk_i2c_controller - client specific controller configuration | ||
| 20 | * @clk_freq: clock frequency for the operation mode | ||
| 21 | * @slsu: Slave data setup time in ns. | ||
| 22 | * The needed setup time for three modes of operation | ||
| 23 | * are 250ns, 100ns and 10ns respectively thus leading | ||
| 24 | * to the values of 14, 6, 2 for a 48 MHz i2c clk | ||
| 25 | * @tft: Tx FIFO Threshold in bytes | ||
| 26 | * @rft: Rx FIFO Threshold in bytes | ||
| 27 | * @timeout Slave response timeout(ms) | ||
| 28 | * @sm: speed mode | ||
| 29 | */ | ||
| 30 | struct nmk_i2c_controller { | ||
| 31 | u32 clk_freq; | ||
| 32 | unsigned short slsu; | ||
| 33 | unsigned char tft; | ||
| 34 | unsigned char rft; | ||
| 35 | int timeout; | ||
| 36 | enum i2c_freq_mode sm; | ||
| 37 | }; | ||
| 38 | |||
| 39 | #endif /* __PDATA_I2C_NOMADIK_H */ | ||
diff --git a/include/linux/platform_data/max197.h b/include/linux/platform_data/max197.h index e2a41dd7690c..8da8f94ee15c 100644 --- a/include/linux/platform_data/max197.h +++ b/include/linux/platform_data/max197.h | |||
| @@ -11,6 +11,9 @@ | |||
| 11 | * For further information, see the Documentation/hwmon/max197 file. | 11 | * For further information, see the Documentation/hwmon/max197 file. |
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | #ifndef _PDATA_MAX197_H | ||
| 15 | #define _PDATA_MAX197_H | ||
| 16 | |||
| 14 | /** | 17 | /** |
| 15 | * struct max197_platform_data - MAX197 connectivity info | 18 | * struct max197_platform_data - MAX197 connectivity info |
| 16 | * @convert: Function used to start a conversion with control byte ctrl. | 19 | * @convert: Function used to start a conversion with control byte ctrl. |
| @@ -19,3 +22,5 @@ | |||
| 19 | struct max197_platform_data { | 22 | struct max197_platform_data { |
| 20 | int (*convert)(u8 ctrl); | 23 | int (*convert)(u8 ctrl); |
| 21 | }; | 24 | }; |
| 25 | |||
| 26 | #endif /* _PDATA_MAX197_H */ | ||
diff --git a/include/linux/platform_data/mfd-mcp-sa11x0.h b/include/linux/platform_data/mfd-mcp-sa11x0.h index 4b2860ae3828..747cd6baf711 100644 --- a/include/linux/platform_data/mfd-mcp-sa11x0.h +++ b/include/linux/platform_data/mfd-mcp-sa11x0.h | |||
| @@ -1,14 +1,12 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * arch/arm/mach-sa1100/include/mach/mcp.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2005 Russell King. | 2 | * Copyright (C) 2005 Russell King. |
| 5 | * | 3 | * |
| 6 | * This program is free software; you can redistribute it and/or modify | 4 | * 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 | 5 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
| 9 | */ | 7 | */ |
| 10 | #ifndef __ASM_ARM_ARCH_MCP_H | 8 | #ifndef __MFD_MCP_SA11X0_H |
| 11 | #define __ASM_ARM_ARCH_MCP_H | 9 | #define __MFD_MCP_SA11X0_H |
| 12 | 10 | ||
| 13 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 14 | 12 | ||
diff --git a/include/linux/platform_data/pinctrl-nomadik.h b/include/linux/platform_data/pinctrl-nomadik.h deleted file mode 100644 index abf5bed84df3..000000000000 --- a/include/linux/platform_data/pinctrl-nomadik.h +++ /dev/null | |||
| @@ -1,242 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Structures and registers for GPIO access in the Nomadik SoC | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008 STMicroelectronics | ||
| 5 | * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com> | ||
| 6 | * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __PLAT_NOMADIK_GPIO | ||
| 14 | #define __PLAT_NOMADIK_GPIO | ||
| 15 | |||
| 16 | /* | ||
| 17 | * pin configurations are represented by 32-bit integers: | ||
| 18 | * | ||
| 19 | * bit 0.. 8 - Pin Number (512 Pins Maximum) | ||
| 20 | * bit 9..10 - Alternate Function Selection | ||
| 21 | * bit 11..12 - Pull up/down state | ||
| 22 | * bit 13 - Sleep mode behaviour | ||
| 23 | * bit 14 - Direction | ||
| 24 | * bit 15 - Value (if output) | ||
| 25 | * bit 16..18 - SLPM pull up/down state | ||
| 26 | * bit 19..20 - SLPM direction | ||
| 27 | * bit 21..22 - SLPM Value (if output) | ||
| 28 | * bit 23..25 - PDIS value (if input) | ||
| 29 | * bit 26 - Gpio mode | ||
| 30 | * bit 27 - Sleep mode | ||
| 31 | * | ||
| 32 | * to facilitate the definition, the following macros are provided | ||
| 33 | * | ||
| 34 | * PIN_CFG_DEFAULT - default config (0): | ||
| 35 | * pull up/down = disabled | ||
| 36 | * sleep mode = input/wakeup | ||
| 37 | * direction = input | ||
| 38 | * value = low | ||
| 39 | * SLPM direction = same as normal | ||
| 40 | * SLPM pull = same as normal | ||
| 41 | * SLPM value = same as normal | ||
| 42 | * | ||
| 43 | * PIN_CFG - default config with alternate function | ||
| 44 | */ | ||
| 45 | |||
| 46 | typedef unsigned long pin_cfg_t; | ||
| 47 | |||
| 48 | #define PIN_NUM_MASK 0x1ff | ||
| 49 | #define PIN_NUM(x) ((x) & PIN_NUM_MASK) | ||
| 50 | |||
| 51 | #define PIN_ALT_SHIFT 9 | ||
| 52 | #define PIN_ALT_MASK (0x3 << PIN_ALT_SHIFT) | ||
| 53 | #define PIN_ALT(x) (((x) & PIN_ALT_MASK) >> PIN_ALT_SHIFT) | ||
| 54 | #define PIN_GPIO (NMK_GPIO_ALT_GPIO << PIN_ALT_SHIFT) | ||
| 55 | #define PIN_ALT_A (NMK_GPIO_ALT_A << PIN_ALT_SHIFT) | ||
| 56 | #define PIN_ALT_B (NMK_GPIO_ALT_B << PIN_ALT_SHIFT) | ||
| 57 | #define PIN_ALT_C (NMK_GPIO_ALT_C << PIN_ALT_SHIFT) | ||
| 58 | |||
| 59 | #define PIN_PULL_SHIFT 11 | ||
| 60 | #define PIN_PULL_MASK (0x3 << PIN_PULL_SHIFT) | ||
| 61 | #define PIN_PULL(x) (((x) & PIN_PULL_MASK) >> PIN_PULL_SHIFT) | ||
| 62 | #define PIN_PULL_NONE (NMK_GPIO_PULL_NONE << PIN_PULL_SHIFT) | ||
| 63 | #define PIN_PULL_UP (NMK_GPIO_PULL_UP << PIN_PULL_SHIFT) | ||
| 64 | #define PIN_PULL_DOWN (NMK_GPIO_PULL_DOWN << PIN_PULL_SHIFT) | ||
| 65 | |||
| 66 | #define PIN_SLPM_SHIFT 13 | ||
| 67 | #define PIN_SLPM_MASK (0x1 << PIN_SLPM_SHIFT) | ||
| 68 | #define PIN_SLPM(x) (((x) & PIN_SLPM_MASK) >> PIN_SLPM_SHIFT) | ||
| 69 | #define PIN_SLPM_MAKE_INPUT (NMK_GPIO_SLPM_INPUT << PIN_SLPM_SHIFT) | ||
| 70 | #define PIN_SLPM_NOCHANGE (NMK_GPIO_SLPM_NOCHANGE << PIN_SLPM_SHIFT) | ||
| 71 | /* These two replace the above in DB8500v2+ */ | ||
| 72 | #define PIN_SLPM_WAKEUP_ENABLE (NMK_GPIO_SLPM_WAKEUP_ENABLE << PIN_SLPM_SHIFT) | ||
| 73 | #define PIN_SLPM_WAKEUP_DISABLE (NMK_GPIO_SLPM_WAKEUP_DISABLE << PIN_SLPM_SHIFT) | ||
| 74 | #define PIN_SLPM_USE_MUX_SETTINGS_IN_SLEEP PIN_SLPM_WAKEUP_DISABLE | ||
| 75 | |||
| 76 | #define PIN_SLPM_GPIO PIN_SLPM_WAKEUP_ENABLE /* In SLPM, pin is a gpio */ | ||
| 77 | #define PIN_SLPM_ALTFUNC PIN_SLPM_WAKEUP_DISABLE /* In SLPM, pin is altfunc */ | ||
| 78 | |||
| 79 | #define PIN_DIR_SHIFT 14 | ||
| 80 | #define PIN_DIR_MASK (0x1 << PIN_DIR_SHIFT) | ||
| 81 | #define PIN_DIR(x) (((x) & PIN_DIR_MASK) >> PIN_DIR_SHIFT) | ||
| 82 | #define PIN_DIR_INPUT (0 << PIN_DIR_SHIFT) | ||
| 83 | #define PIN_DIR_OUTPUT (1 << PIN_DIR_SHIFT) | ||
| 84 | |||
| 85 | #define PIN_VAL_SHIFT 15 | ||
| 86 | #define PIN_VAL_MASK (0x1 << PIN_VAL_SHIFT) | ||
| 87 | #define PIN_VAL(x) (((x) & PIN_VAL_MASK) >> PIN_VAL_SHIFT) | ||
| 88 | #define PIN_VAL_LOW (0 << PIN_VAL_SHIFT) | ||
| 89 | #define PIN_VAL_HIGH (1 << PIN_VAL_SHIFT) | ||
| 90 | |||
| 91 | #define PIN_SLPM_PULL_SHIFT 16 | ||
| 92 | #define PIN_SLPM_PULL_MASK (0x7 << PIN_SLPM_PULL_SHIFT) | ||
| 93 | #define PIN_SLPM_PULL(x) \ | ||
| 94 | (((x) & PIN_SLPM_PULL_MASK) >> PIN_SLPM_PULL_SHIFT) | ||
| 95 | #define PIN_SLPM_PULL_NONE \ | ||
| 96 | ((1 + NMK_GPIO_PULL_NONE) << PIN_SLPM_PULL_SHIFT) | ||
| 97 | #define PIN_SLPM_PULL_UP \ | ||
| 98 | ((1 + NMK_GPIO_PULL_UP) << PIN_SLPM_PULL_SHIFT) | ||
| 99 | #define PIN_SLPM_PULL_DOWN \ | ||
| 100 | ((1 + NMK_GPIO_PULL_DOWN) << PIN_SLPM_PULL_SHIFT) | ||
| 101 | |||
| 102 | #define PIN_SLPM_DIR_SHIFT 19 | ||
| 103 | #define PIN_SLPM_DIR_MASK (0x3 << PIN_SLPM_DIR_SHIFT) | ||
| 104 | #define PIN_SLPM_DIR(x) \ | ||
| 105 | (((x) & PIN_SLPM_DIR_MASK) >> PIN_SLPM_DIR_SHIFT) | ||
| 106 | #define PIN_SLPM_DIR_INPUT ((1 + 0) << PIN_SLPM_DIR_SHIFT) | ||
| 107 | #define PIN_SLPM_DIR_OUTPUT ((1 + 1) << PIN_SLPM_DIR_SHIFT) | ||
| 108 | |||
| 109 | #define PIN_SLPM_VAL_SHIFT 21 | ||
| 110 | #define PIN_SLPM_VAL_MASK (0x3 << PIN_SLPM_VAL_SHIFT) | ||
| 111 | #define PIN_SLPM_VAL(x) \ | ||
| 112 | (((x) & PIN_SLPM_VAL_MASK) >> PIN_SLPM_VAL_SHIFT) | ||
| 113 | #define PIN_SLPM_VAL_LOW ((1 + 0) << PIN_SLPM_VAL_SHIFT) | ||
| 114 | #define PIN_SLPM_VAL_HIGH ((1 + 1) << PIN_SLPM_VAL_SHIFT) | ||
| 115 | |||
| 116 | #define PIN_SLPM_PDIS_SHIFT 23 | ||
| 117 | #define PIN_SLPM_PDIS_MASK (0x3 << PIN_SLPM_PDIS_SHIFT) | ||
| 118 | #define PIN_SLPM_PDIS(x) \ | ||
| 119 | (((x) & PIN_SLPM_PDIS_MASK) >> PIN_SLPM_PDIS_SHIFT) | ||
| 120 | #define PIN_SLPM_PDIS_NO_CHANGE (0 << PIN_SLPM_PDIS_SHIFT) | ||
| 121 | #define PIN_SLPM_PDIS_DISABLED (1 << PIN_SLPM_PDIS_SHIFT) | ||
| 122 | #define PIN_SLPM_PDIS_ENABLED (2 << PIN_SLPM_PDIS_SHIFT) | ||
| 123 | |||
| 124 | #define PIN_LOWEMI_SHIFT 25 | ||
| 125 | #define PIN_LOWEMI_MASK (0x1 << PIN_LOWEMI_SHIFT) | ||
| 126 | #define PIN_LOWEMI(x) (((x) & PIN_LOWEMI_MASK) >> PIN_LOWEMI_SHIFT) | ||
| 127 | #define PIN_LOWEMI_DISABLED (0 << PIN_LOWEMI_SHIFT) | ||
| 128 | #define PIN_LOWEMI_ENABLED (1 << PIN_LOWEMI_SHIFT) | ||
| 129 | |||
| 130 | #define PIN_GPIOMODE_SHIFT 26 | ||
| 131 | #define PIN_GPIOMODE_MASK (0x1 << PIN_GPIOMODE_SHIFT) | ||
| 132 | #define PIN_GPIOMODE(x) (((x) & PIN_GPIOMODE_MASK) >> PIN_GPIOMODE_SHIFT) | ||
| 133 | #define PIN_GPIOMODE_DISABLED (0 << PIN_GPIOMODE_SHIFT) | ||
| 134 | #define PIN_GPIOMODE_ENABLED (1 << PIN_GPIOMODE_SHIFT) | ||
| 135 | |||
| 136 | #define PIN_SLEEPMODE_SHIFT 27 | ||
| 137 | #define PIN_SLEEPMODE_MASK (0x1 << PIN_SLEEPMODE_SHIFT) | ||
| 138 | #define PIN_SLEEPMODE(x) (((x) & PIN_SLEEPMODE_MASK) >> PIN_SLEEPMODE_SHIFT) | ||
| 139 | #define PIN_SLEEPMODE_DISABLED (0 << PIN_SLEEPMODE_SHIFT) | ||
| 140 | #define PIN_SLEEPMODE_ENABLED (1 << PIN_SLEEPMODE_SHIFT) | ||
| 141 | |||
| 142 | |||
| 143 | /* Shortcuts. Use these instead of separate DIR, PULL, and VAL. */ | ||
| 144 | #define PIN_INPUT_PULLDOWN (PIN_DIR_INPUT | PIN_PULL_DOWN) | ||
| 145 | #define PIN_INPUT_PULLUP (PIN_DIR_INPUT | PIN_PULL_UP) | ||
| 146 | #define PIN_INPUT_NOPULL (PIN_DIR_INPUT | PIN_PULL_NONE) | ||
| 147 | #define PIN_OUTPUT_LOW (PIN_DIR_OUTPUT | PIN_VAL_LOW) | ||
| 148 | #define PIN_OUTPUT_HIGH (PIN_DIR_OUTPUT | PIN_VAL_HIGH) | ||
| 149 | |||
| 150 | #define PIN_SLPM_INPUT_PULLDOWN (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_DOWN) | ||
| 151 | #define PIN_SLPM_INPUT_PULLUP (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_UP) | ||
| 152 | #define PIN_SLPM_INPUT_NOPULL (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_NONE) | ||
| 153 | #define PIN_SLPM_OUTPUT_LOW (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_LOW) | ||
| 154 | #define PIN_SLPM_OUTPUT_HIGH (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_HIGH) | ||
| 155 | |||
| 156 | #define PIN_CFG_DEFAULT (0) | ||
| 157 | |||
| 158 | #define PIN_CFG(num, alt) \ | ||
| 159 | (PIN_CFG_DEFAULT |\ | ||
| 160 | (PIN_NUM(num) | PIN_##alt)) | ||
| 161 | |||
| 162 | #define PIN_CFG_INPUT(num, alt, pull) \ | ||
| 163 | (PIN_CFG_DEFAULT |\ | ||
| 164 | (PIN_NUM(num) | PIN_##alt | PIN_INPUT_##pull)) | ||
| 165 | |||
| 166 | #define PIN_CFG_OUTPUT(num, alt, val) \ | ||
| 167 | (PIN_CFG_DEFAULT |\ | ||
| 168 | (PIN_NUM(num) | PIN_##alt | PIN_OUTPUT_##val)) | ||
| 169 | |||
| 170 | /* | ||
| 171 | * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving | ||
| 172 | * the "gpio" namespace for generic and cross-machine functions | ||
| 173 | */ | ||
| 174 | |||
| 175 | #define GPIO_BLOCK_SHIFT 5 | ||
| 176 | #define NMK_GPIO_PER_CHIP (1 << GPIO_BLOCK_SHIFT) | ||
| 177 | |||
| 178 | /* Register in the logic block */ | ||
| 179 | #define NMK_GPIO_DAT 0x00 | ||
| 180 | #define NMK_GPIO_DATS 0x04 | ||
| 181 | #define NMK_GPIO_DATC 0x08 | ||
| 182 | #define NMK_GPIO_PDIS 0x0c | ||
| 183 | #define NMK_GPIO_DIR 0x10 | ||
| 184 | #define NMK_GPIO_DIRS 0x14 | ||
| 185 | #define NMK_GPIO_DIRC 0x18 | ||
| 186 | #define NMK_GPIO_SLPC 0x1c | ||
| 187 | #define NMK_GPIO_AFSLA 0x20 | ||
| 188 | #define NMK_GPIO_AFSLB 0x24 | ||
| 189 | #define NMK_GPIO_LOWEMI 0x28 | ||
| 190 | |||
| 191 | #define NMK_GPIO_RIMSC 0x40 | ||
| 192 | #define NMK_GPIO_FIMSC 0x44 | ||
| 193 | #define NMK_GPIO_IS 0x48 | ||
| 194 | #define NMK_GPIO_IC 0x4c | ||
| 195 | #define NMK_GPIO_RWIMSC 0x50 | ||
| 196 | #define NMK_GPIO_FWIMSC 0x54 | ||
| 197 | #define NMK_GPIO_WKS 0x58 | ||
| 198 | /* These appear in DB8540 and later ASICs */ | ||
| 199 | #define NMK_GPIO_EDGELEVEL 0x5C | ||
| 200 | #define NMK_GPIO_LEVEL 0x60 | ||
| 201 | |||
| 202 | /* Alternate functions: function C is set in hw by setting both A and B */ | ||
| 203 | #define NMK_GPIO_ALT_GPIO 0 | ||
| 204 | #define NMK_GPIO_ALT_A 1 | ||
| 205 | #define NMK_GPIO_ALT_B 2 | ||
| 206 | #define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B) | ||
| 207 | |||
| 208 | #define NMK_GPIO_ALT_CX_SHIFT 2 | ||
| 209 | #define NMK_GPIO_ALT_C1 ((1<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) | ||
| 210 | #define NMK_GPIO_ALT_C2 ((2<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) | ||
| 211 | #define NMK_GPIO_ALT_C3 ((3<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) | ||
| 212 | #define NMK_GPIO_ALT_C4 ((4<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) | ||
| 213 | |||
| 214 | /* Pull up/down values */ | ||
| 215 | enum nmk_gpio_pull { | ||
| 216 | NMK_GPIO_PULL_NONE, | ||
| 217 | NMK_GPIO_PULL_UP, | ||
| 218 | NMK_GPIO_PULL_DOWN, | ||
| 219 | }; | ||
| 220 | |||
| 221 | /* Sleep mode */ | ||
| 222 | enum nmk_gpio_slpm { | ||
| 223 | NMK_GPIO_SLPM_INPUT, | ||
| 224 | NMK_GPIO_SLPM_WAKEUP_ENABLE = NMK_GPIO_SLPM_INPUT, | ||
| 225 | NMK_GPIO_SLPM_NOCHANGE, | ||
| 226 | NMK_GPIO_SLPM_WAKEUP_DISABLE = NMK_GPIO_SLPM_NOCHANGE, | ||
| 227 | }; | ||
| 228 | |||
| 229 | /* | ||
| 230 | * Platform data to register a block: only the initial gpio/irq number. | ||
| 231 | */ | ||
| 232 | struct nmk_gpio_platform_data { | ||
| 233 | char *name; | ||
| 234 | int first_gpio; | ||
| 235 | int first_irq; | ||
| 236 | int num_gpio; | ||
| 237 | u32 (*get_secondary_status)(unsigned int bank); | ||
| 238 | void (*set_ioforce)(bool enable); | ||
| 239 | bool supports_sleepmode; | ||
| 240 | }; | ||
| 241 | |||
| 242 | #endif /* __PLAT_NOMADIK_GPIO */ | ||
diff --git a/include/linux/platform_data/sht15.h b/include/linux/platform_data/sht15.h index 33e0fd27225e..12289c1e9413 100644 --- a/include/linux/platform_data/sht15.h +++ b/include/linux/platform_data/sht15.h | |||
| @@ -12,6 +12,9 @@ | |||
| 12 | * For further information, see the Documentation/hwmon/sht15 file. | 12 | * For further information, see the Documentation/hwmon/sht15 file. |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #ifndef _PDATA_SHT15_H | ||
| 16 | #define _PDATA_SHT15_H | ||
| 17 | |||
| 15 | /** | 18 | /** |
| 16 | * struct sht15_platform_data - sht15 connectivity info | 19 | * struct sht15_platform_data - sht15 connectivity info |
| 17 | * @gpio_data: no. of gpio to which bidirectional data line is | 20 | * @gpio_data: no. of gpio to which bidirectional data line is |
| @@ -31,3 +34,5 @@ struct sht15_platform_data { | |||
| 31 | bool no_otp_reload; | 34 | bool no_otp_reload; |
| 32 | bool low_resolution; | 35 | bool low_resolution; |
| 33 | }; | 36 | }; |
| 37 | |||
| 38 | #endif /* _PDATA_SHT15_H */ | ||
diff --git a/include/linux/platform_data/usb-ehci-orion.h b/include/linux/platform_data/usb-ehci-orion.h index 6fc78e430420..52b0acb35fd7 100644 --- a/include/linux/platform_data/usb-ehci-orion.h +++ b/include/linux/platform_data/usb-ehci-orion.h | |||
| @@ -1,13 +1,11 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * arch/arm/plat-orion/include/plat/ehci-orion.h | ||
| 3 | * | ||
| 4 | * This file is licensed under the terms of the GNU General Public | 2 | * This file is licensed under the terms of the GNU General Public |
| 5 | * License version 2. This program is licensed "as is" without any | 3 | * License version 2. This program is licensed "as is" without any |
| 6 | * warranty of any kind, whether express or implied. | 4 | * warranty of any kind, whether express or implied. |
| 7 | */ | 5 | */ |
| 8 | 6 | ||
| 9 | #ifndef __PLAT_EHCI_ORION_H | 7 | #ifndef __USB_EHCI_ORION_H |
| 10 | #define __PLAT_EHCI_ORION_H | 8 | #define __USB_EHCI_ORION_H |
| 11 | 9 | ||
| 12 | #include <linux/mbus.h> | 10 | #include <linux/mbus.h> |
| 13 | 11 | ||
diff --git a/include/linux/platform_data/usb-omap1.h b/include/linux/platform_data/usb-omap1.h new file mode 100644 index 000000000000..43b5ce139c37 --- /dev/null +++ b/include/linux/platform_data/usb-omap1.h | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /* | ||
| 2 | * Platform data for OMAP1 USB | ||
| 3 | * | ||
| 4 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 5 | * License. See the file "COPYING" in the main directory of this archive for | ||
| 6 | * more details. | ||
| 7 | */ | ||
| 8 | #ifndef __LINUX_USB_OMAP1_H | ||
| 9 | #define __LINUX_USB_OMAP1_H | ||
| 10 | |||
| 11 | #include <linux/platform_device.h> | ||
| 12 | |||
| 13 | struct omap_usb_config { | ||
| 14 | /* Configure drivers according to the connectors on your board: | ||
| 15 | * - "A" connector (rectagular) | ||
| 16 | * ... for host/OHCI use, set "register_host". | ||
| 17 | * - "B" connector (squarish) or "Mini-B" | ||
| 18 | * ... for device/gadget use, set "register_dev". | ||
| 19 | * - "Mini-AB" connector (very similar to Mini-B) | ||
| 20 | * ... for OTG use as device OR host, initialize "otg" | ||
| 21 | */ | ||
| 22 | unsigned register_host:1; | ||
| 23 | unsigned register_dev:1; | ||
| 24 | u8 otg; /* port number, 1-based: usb1 == 2 */ | ||
| 25 | |||
| 26 | const char *extcon; /* extcon device for OTG */ | ||
| 27 | |||
| 28 | u8 hmc_mode; | ||
| 29 | |||
| 30 | /* implicitly true if otg: host supports remote wakeup? */ | ||
| 31 | u8 rwc; | ||
| 32 | |||
| 33 | /* signaling pins used to talk to transceiver on usbN: | ||
| 34 | * 0 == usbN unused | ||
| 35 | * 2 == usb0-only, using internal transceiver | ||
| 36 | * 3 == 3 wire bidirectional | ||
| 37 | * 4 == 4 wire bidirectional | ||
| 38 | * 6 == 6 wire unidirectional (or TLL) | ||
| 39 | */ | ||
| 40 | u8 pins[3]; | ||
| 41 | |||
| 42 | struct platform_device *udc_device; | ||
| 43 | struct platform_device *ohci_device; | ||
| 44 | struct platform_device *otg_device; | ||
| 45 | |||
| 46 | u32 (*usb0_init)(unsigned nwires, unsigned is_device); | ||
| 47 | u32 (*usb1_init)(unsigned nwires); | ||
| 48 | u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup); | ||
| 49 | |||
| 50 | int (*ocpi_enable)(void); | ||
| 51 | }; | ||
| 52 | |||
| 53 | #endif /* __LINUX_USB_OMAP1_H */ | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index a224c7f5c377..8c6583a53a06 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -311,6 +311,18 @@ struct dev_pm_ops { | |||
| 311 | #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) | 311 | #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) |
| 312 | #endif | 312 | #endif |
| 313 | 313 | ||
| 314 | #ifdef CONFIG_PM_SLEEP | ||
| 315 | #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ | ||
| 316 | .suspend_late = suspend_fn, \ | ||
| 317 | .resume_early = resume_fn, \ | ||
| 318 | .freeze_late = suspend_fn, \ | ||
| 319 | .thaw_early = resume_fn, \ | ||
| 320 | .poweroff_late = suspend_fn, \ | ||
| 321 | .restore_early = resume_fn, | ||
| 322 | #else | ||
| 323 | #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) | ||
| 324 | #endif | ||
| 325 | |||
| 314 | #ifdef CONFIG_PM_RUNTIME | 326 | #ifdef CONFIG_PM_RUNTIME |
| 315 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ | 327 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ |
| 316 | .runtime_suspend = suspend_fn, \ | 328 | .runtime_suspend = suspend_fn, \ |
| @@ -320,6 +332,15 @@ struct dev_pm_ops { | |||
| 320 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) | 332 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) |
| 321 | #endif | 333 | #endif |
| 322 | 334 | ||
| 335 | #ifdef CONFIG_PM | ||
| 336 | #define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ | ||
| 337 | .runtime_suspend = suspend_fn, \ | ||
| 338 | .runtime_resume = resume_fn, \ | ||
| 339 | .runtime_idle = idle_fn, | ||
| 340 | #else | ||
| 341 | #define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) | ||
| 342 | #endif | ||
| 343 | |||
| 323 | /* | 344 | /* |
| 324 | * Use this if you want to use the same suspend and resume callbacks for suspend | 345 | * Use this if you want to use the same suspend and resume callbacks for suspend |
| 325 | * to RAM and hibernation. | 346 | * to RAM and hibernation. |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 6fa7cea25da9..16c9a62fa1c0 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
| @@ -23,6 +23,14 @@ | |||
| 23 | usage_count */ | 23 | usage_count */ |
| 24 | #define RPM_AUTO 0x08 /* Use autosuspend_delay */ | 24 | #define RPM_AUTO 0x08 /* Use autosuspend_delay */ |
| 25 | 25 | ||
| 26 | #ifdef CONFIG_PM | ||
| 27 | extern int pm_generic_runtime_suspend(struct device *dev); | ||
| 28 | extern int pm_generic_runtime_resume(struct device *dev); | ||
| 29 | #else | ||
| 30 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | ||
| 31 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | ||
| 32 | #endif | ||
| 33 | |||
| 26 | #ifdef CONFIG_PM_RUNTIME | 34 | #ifdef CONFIG_PM_RUNTIME |
| 27 | 35 | ||
| 28 | extern struct workqueue_struct *pm_wq; | 36 | extern struct workqueue_struct *pm_wq; |
| @@ -37,8 +45,6 @@ extern void pm_runtime_enable(struct device *dev); | |||
| 37 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); | 45 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); |
| 38 | extern void pm_runtime_allow(struct device *dev); | 46 | extern void pm_runtime_allow(struct device *dev); |
| 39 | extern void pm_runtime_forbid(struct device *dev); | 47 | extern void pm_runtime_forbid(struct device *dev); |
| 40 | extern int pm_generic_runtime_suspend(struct device *dev); | ||
| 41 | extern int pm_generic_runtime_resume(struct device *dev); | ||
| 42 | extern void pm_runtime_no_callbacks(struct device *dev); | 48 | extern void pm_runtime_no_callbacks(struct device *dev); |
| 43 | extern void pm_runtime_irq_safe(struct device *dev); | 49 | extern void pm_runtime_irq_safe(struct device *dev); |
| 44 | extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); | 50 | extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); |
| @@ -142,8 +148,6 @@ static inline bool pm_runtime_active(struct device *dev) { return true; } | |||
| 142 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } | 148 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } |
| 143 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } | 149 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } |
| 144 | 150 | ||
| 145 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | ||
| 146 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | ||
| 147 | static inline void pm_runtime_no_callbacks(struct device *dev) {} | 151 | static inline void pm_runtime_no_callbacks(struct device *dev) {} |
| 148 | static inline void pm_runtime_irq_safe(struct device *dev) {} | 152 | static inline void pm_runtime_irq_safe(struct device *dev) {} |
| 149 | 153 | ||
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 7931efe71175..fb616942e4c7 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
| @@ -94,78 +94,12 @@ extern int posix_acl_chmod(struct posix_acl **, gfp_t, umode_t); | |||
| 94 | extern struct posix_acl *get_posix_acl(struct inode *, int); | 94 | extern struct posix_acl *get_posix_acl(struct inode *, int); |
| 95 | extern int set_posix_acl(struct inode *, int, struct posix_acl *); | 95 | extern int set_posix_acl(struct inode *, int, struct posix_acl *); |
| 96 | 96 | ||
| 97 | #ifdef CONFIG_FS_POSIX_ACL | 97 | struct posix_acl **acl_by_type(struct inode *inode, int type); |
| 98 | static inline struct posix_acl **acl_by_type(struct inode *inode, int type) | 98 | struct posix_acl *get_cached_acl(struct inode *inode, int type); |
| 99 | { | 99 | struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type); |
| 100 | switch (type) { | 100 | void set_cached_acl(struct inode *inode, int type, struct posix_acl *acl); |
| 101 | case ACL_TYPE_ACCESS: | 101 | void forget_cached_acl(struct inode *inode, int type); |
| 102 | return &inode->i_acl; | 102 | void forget_all_cached_acls(struct inode *inode); |
| 103 | case ACL_TYPE_DEFAULT: | ||
| 104 | return &inode->i_default_acl; | ||
| 105 | default: | ||
| 106 | BUG(); | ||
| 107 | } | ||
| 108 | } | ||
| 109 | |||
| 110 | static inline struct posix_acl *get_cached_acl(struct inode *inode, int type) | ||
| 111 | { | ||
| 112 | struct posix_acl **p = acl_by_type(inode, type); | ||
| 113 | struct posix_acl *acl = ACCESS_ONCE(*p); | ||
| 114 | if (acl) { | ||
| 115 | spin_lock(&inode->i_lock); | ||
| 116 | acl = *p; | ||
| 117 | if (acl != ACL_NOT_CACHED) | ||
| 118 | acl = posix_acl_dup(acl); | ||
| 119 | spin_unlock(&inode->i_lock); | ||
| 120 | } | ||
| 121 | return acl; | ||
| 122 | } | ||
| 123 | |||
| 124 | static inline struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type) | ||
| 125 | { | ||
| 126 | return rcu_dereference(*acl_by_type(inode, type)); | ||
| 127 | } | ||
| 128 | |||
| 129 | static inline void set_cached_acl(struct inode *inode, | ||
| 130 | int type, | ||
| 131 | struct posix_acl *acl) | ||
| 132 | { | ||
| 133 | struct posix_acl **p = acl_by_type(inode, type); | ||
| 134 | struct posix_acl *old; | ||
| 135 | spin_lock(&inode->i_lock); | ||
| 136 | old = *p; | ||
| 137 | rcu_assign_pointer(*p, posix_acl_dup(acl)); | ||
| 138 | spin_unlock(&inode->i_lock); | ||
| 139 | if (old != ACL_NOT_CACHED) | ||
| 140 | posix_acl_release(old); | ||
| 141 | } | ||
| 142 | |||
| 143 | static inline void forget_cached_acl(struct inode *inode, int type) | ||
| 144 | { | ||
| 145 | struct posix_acl **p = acl_by_type(inode, type); | ||
| 146 | struct posix_acl *old; | ||
| 147 | spin_lock(&inode->i_lock); | ||
| 148 | old = *p; | ||
| 149 | *p = ACL_NOT_CACHED; | ||
| 150 | spin_unlock(&inode->i_lock); | ||
| 151 | if (old != ACL_NOT_CACHED) | ||
| 152 | posix_acl_release(old); | ||
| 153 | } | ||
| 154 | |||
| 155 | static inline void forget_all_cached_acls(struct inode *inode) | ||
| 156 | { | ||
| 157 | struct posix_acl *old_access, *old_default; | ||
| 158 | spin_lock(&inode->i_lock); | ||
| 159 | old_access = inode->i_acl; | ||
| 160 | old_default = inode->i_default_acl; | ||
| 161 | inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED; | ||
| 162 | spin_unlock(&inode->i_lock); | ||
| 163 | if (old_access != ACL_NOT_CACHED) | ||
| 164 | posix_acl_release(old_access); | ||
| 165 | if (old_default != ACL_NOT_CACHED) | ||
| 166 | posix_acl_release(old_default); | ||
| 167 | } | ||
| 168 | #endif | ||
| 169 | 103 | ||
| 170 | static inline void cache_no_acl(struct inode *inode) | 104 | static inline void cache_no_acl(struct inode *inode) |
| 171 | { | 105 | { |
diff --git a/include/linux/power/bq2415x_charger.h b/include/linux/power/bq2415x_charger.h index 8dcc0f46fc0a..50762af8b834 100644 --- a/include/linux/power/bq2415x_charger.h +++ b/include/linux/power/bq2415x_charger.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * bq2415x charger driver | 2 | * bq2415x charger driver |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2011-2012 Pali Rohár <pali.rohar@gmail.com> | 4 | * Copyright (C) 2011-2013 Pali Rohár <pali.rohar@gmail.com> |
| 5 | * | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
| @@ -31,46 +31,9 @@ | |||
| 31 | * termination current. It it is less or equal to zero, configuring charge | 31 | * termination current. It it is less or equal to zero, configuring charge |
| 32 | * and termination current will not be possible. | 32 | * and termination current will not be possible. |
| 33 | * | 33 | * |
| 34 | * Function set_mode_hook is needed for automode (setting correct current | 34 | * For automode support is needed to provide name of power supply device |
| 35 | * limit when charger is connected/disconnected or setting boost mode). | 35 | * in value notify_device. Device driver must immediately report property |
| 36 | * When is NULL, automode function is disabled. When is not NULL, it must | 36 | * POWER_SUPPLY_PROP_CURRENT_MAX when current changed. |
| 37 | * have this prototype: | ||
| 38 | * | ||
| 39 | * int (*set_mode_hook)( | ||
| 40 | * void (*hook)(enum bq2415x_mode mode, void *data), | ||
| 41 | * void *data) | ||
| 42 | * | ||
| 43 | * hook is hook function (see below) and data is pointer to driver private | ||
| 44 | * data | ||
| 45 | * | ||
| 46 | * bq2415x driver will call it as: | ||
| 47 | * | ||
| 48 | * platform_data->set_mode_hook(bq2415x_hook_function, bq2415x_device); | ||
| 49 | * | ||
| 50 | * Board/platform function set_mode_hook return non zero value when hook | ||
| 51 | * function was successful registered. Platform code should call that hook | ||
| 52 | * function (which get from pointer, with data) every time when charger | ||
| 53 | * was connected/disconnected or require to enable boost mode. bq2415x | ||
| 54 | * driver then will set correct current limit, enable/disable charger or | ||
| 55 | * boost mode. | ||
| 56 | * | ||
| 57 | * Hook function has this prototype: | ||
| 58 | * | ||
| 59 | * void hook(enum bq2415x_mode mode, void *data); | ||
| 60 | * | ||
| 61 | * mode is bq2415x mode (charger or boost) | ||
| 62 | * data is pointer to driver private data (which get from | ||
| 63 | * set_charger_type_hook) | ||
| 64 | * | ||
| 65 | * When bq driver is being unloaded, it call function: | ||
| 66 | * | ||
| 67 | * platform_data->set_mode_hook(NULL, NULL); | ||
| 68 | * | ||
| 69 | * (hook function and driver private data are NULL) | ||
| 70 | * | ||
| 71 | * After that board/platform code must not call driver hook function! It | ||
| 72 | * is possible that pointer to hook function will not be valid and calling | ||
| 73 | * will cause undefined result. | ||
| 74 | */ | 37 | */ |
| 75 | 38 | ||
| 76 | /* Supported modes with maximal current limit */ | 39 | /* Supported modes with maximal current limit */ |
| @@ -89,8 +52,7 @@ struct bq2415x_platform_data { | |||
| 89 | int charge_current; /* mA */ | 52 | int charge_current; /* mA */ |
| 90 | int termination_current; /* mA */ | 53 | int termination_current; /* mA */ |
| 91 | int resistor_sense; /* m ohm */ | 54 | int resistor_sense; /* m ohm */ |
| 92 | int (*set_mode_hook)(void (*hook)(enum bq2415x_mode mode, void *data), | 55 | const char *notify_device; /* name */ |
| 93 | void *data); | ||
| 94 | }; | 56 | }; |
| 95 | 57 | ||
| 96 | #endif | 58 | #endif |
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h index 0e86840eb603..07e7945a1ff2 100644 --- a/include/linux/power/charger-manager.h +++ b/include/linux/power/charger-manager.h | |||
| @@ -37,6 +37,8 @@ enum cm_event_types { | |||
| 37 | CM_EVENT_BATT_FULL, | 37 | CM_EVENT_BATT_FULL, |
| 38 | CM_EVENT_BATT_IN, | 38 | CM_EVENT_BATT_IN, |
| 39 | CM_EVENT_BATT_OUT, | 39 | CM_EVENT_BATT_OUT, |
| 40 | CM_EVENT_BATT_OVERHEAT, | ||
| 41 | CM_EVENT_BATT_COLD, | ||
| 40 | CM_EVENT_EXT_PWR_IN_OUT, | 42 | CM_EVENT_EXT_PWR_IN_OUT, |
| 41 | CM_EVENT_CHG_START_STOP, | 43 | CM_EVENT_CHG_START_STOP, |
| 42 | CM_EVENT_OTHERS, | 44 | CM_EVENT_OTHERS, |
| @@ -173,11 +175,10 @@ struct charger_regulator { | |||
| 173 | * @num_charger_regulator: the number of entries in charger_regulators | 175 | * @num_charger_regulator: the number of entries in charger_regulators |
| 174 | * @charger_regulators: array of charger regulators | 176 | * @charger_regulators: array of charger regulators |
| 175 | * @psy_fuel_gauge: the name of power-supply for fuel gauge | 177 | * @psy_fuel_gauge: the name of power-supply for fuel gauge |
| 176 | * @temperature_out_of_range: | 178 | * @thermal_zone : the name of thermal zone for battery |
| 177 | * Determine whether the status is overheat or cold or normal. | 179 | * @temp_min : Minimum battery temperature for charging. |
| 178 | * return_value > 0: overheat | 180 | * @temp_max : Maximum battery temperature for charging. |
| 179 | * return_value == 0: normal | 181 | * @temp_diff : Temperature diffential to restart charging. |
| 180 | * return_value < 0: cold | ||
| 181 | * @measure_battery_temp: | 182 | * @measure_battery_temp: |
| 182 | * true: measure battery temperature | 183 | * true: measure battery temperature |
| 183 | * false: measure ambient temperature | 184 | * false: measure ambient temperature |
| @@ -190,7 +191,7 @@ struct charger_regulator { | |||
| 190 | * max_duration_ms', cm start charging. | 191 | * max_duration_ms', cm start charging. |
| 191 | */ | 192 | */ |
| 192 | struct charger_desc { | 193 | struct charger_desc { |
| 193 | char *psy_name; | 194 | const char *psy_name; |
| 194 | 195 | ||
| 195 | enum polling_modes polling_mode; | 196 | enum polling_modes polling_mode; |
| 196 | unsigned int polling_interval_ms; | 197 | unsigned int polling_interval_ms; |
| @@ -203,18 +204,23 @@ struct charger_desc { | |||
| 203 | 204 | ||
| 204 | enum data_source battery_present; | 205 | enum data_source battery_present; |
| 205 | 206 | ||
| 206 | char **psy_charger_stat; | 207 | const char **psy_charger_stat; |
| 207 | 208 | ||
| 208 | int num_charger_regulators; | 209 | int num_charger_regulators; |
| 209 | struct charger_regulator *charger_regulators; | 210 | struct charger_regulator *charger_regulators; |
| 210 | 211 | ||
| 211 | char *psy_fuel_gauge; | 212 | const char *psy_fuel_gauge; |
| 213 | |||
| 214 | const char *thermal_zone; | ||
| 215 | |||
| 216 | int temp_min; | ||
| 217 | int temp_max; | ||
| 218 | int temp_diff; | ||
| 212 | 219 | ||
| 213 | int (*temperature_out_of_range)(int *mC); | ||
| 214 | bool measure_battery_temp; | 220 | bool measure_battery_temp; |
| 215 | 221 | ||
| 216 | u64 charging_max_duration_ms; | 222 | u32 charging_max_duration_ms; |
| 217 | u64 discharging_max_duration_ms; | 223 | u32 discharging_max_duration_ms; |
| 218 | }; | 224 | }; |
| 219 | 225 | ||
| 220 | #define PSY_NAME_MAX 30 | 226 | #define PSY_NAME_MAX 30 |
| @@ -226,13 +232,13 @@ struct charger_desc { | |||
| 226 | * @desc: instance of charger_desc | 232 | * @desc: instance of charger_desc |
| 227 | * @fuel_gauge: power_supply for fuel gauge | 233 | * @fuel_gauge: power_supply for fuel gauge |
| 228 | * @charger_stat: array of power_supply for chargers | 234 | * @charger_stat: array of power_supply for chargers |
| 235 | * @tzd_batt : thermal zone device for battery | ||
| 229 | * @charger_enabled: the state of charger | 236 | * @charger_enabled: the state of charger |
| 230 | * @fullbatt_vchk_jiffies_at: | 237 | * @fullbatt_vchk_jiffies_at: |
| 231 | * jiffies at the time full battery check will occur. | 238 | * jiffies at the time full battery check will occur. |
| 232 | * @fullbatt_vchk_work: work queue for full battery check | 239 | * @fullbatt_vchk_work: work queue for full battery check |
| 233 | * @emergency_stop: | 240 | * @emergency_stop: |
| 234 | * When setting true, stop charging | 241 | * When setting true, stop charging |
| 235 | * @last_temp_mC: the measured temperature in milli-Celsius | ||
| 236 | * @psy_name_buf: the name of power-supply-class for charger manager | 242 | * @psy_name_buf: the name of power-supply-class for charger manager |
| 237 | * @charger_psy: power_supply for charger manager | 243 | * @charger_psy: power_supply for charger manager |
| 238 | * @status_save_ext_pwr_inserted: | 244 | * @status_save_ext_pwr_inserted: |
| @@ -250,13 +256,15 @@ struct charger_manager { | |||
| 250 | struct power_supply *fuel_gauge; | 256 | struct power_supply *fuel_gauge; |
| 251 | struct power_supply **charger_stat; | 257 | struct power_supply **charger_stat; |
| 252 | 258 | ||
| 259 | #ifdef CONFIG_THERMAL | ||
| 260 | struct thermal_zone_device *tzd_batt; | ||
| 261 | #endif | ||
| 253 | bool charger_enabled; | 262 | bool charger_enabled; |
| 254 | 263 | ||
| 255 | unsigned long fullbatt_vchk_jiffies_at; | 264 | unsigned long fullbatt_vchk_jiffies_at; |
| 256 | struct delayed_work fullbatt_vchk_work; | 265 | struct delayed_work fullbatt_vchk_work; |
| 257 | 266 | ||
| 258 | int emergency_stop; | 267 | int emergency_stop; |
| 259 | int last_temp_mC; | ||
| 260 | 268 | ||
| 261 | char psy_name_buf[PSY_NAME_MAX + 1]; | 269 | char psy_name_buf[PSY_NAME_MAX + 1]; |
| 262 | struct power_supply charger_psy; | 270 | struct power_supply charger_psy; |
diff --git a/include/linux/power/isp1704_charger.h b/include/linux/power/isp1704_charger.h index 68096a6aa2d7..0105d9e7af85 100644 --- a/include/linux/power/isp1704_charger.h +++ b/include/linux/power/isp1704_charger.h | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | struct isp1704_charger_data { | 25 | struct isp1704_charger_data { |
| 26 | void (*set_power)(bool on); | 26 | void (*set_power)(bool on); |
| 27 | int enable_gpio; | ||
| 27 | }; | 28 | }; |
| 28 | 29 | ||
| 29 | #endif | 30 | #endif |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 5c2600630dc9..c9dc4e09854c 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/workqueue.h> | 16 | #include <linux/workqueue.h> |
| 17 | #include <linux/leds.h> | 17 | #include <linux/leds.h> |
| 18 | #include <linux/spinlock.h> | 18 | #include <linux/spinlock.h> |
| 19 | #include <linux/notifier.h> | ||
| 19 | 20 | ||
| 20 | struct device; | 21 | struct device; |
| 21 | 22 | ||
| @@ -158,6 +159,10 @@ enum power_supply_type { | |||
| 158 | POWER_SUPPLY_TYPE_USB_ACA, /* Accessory Charger Adapters */ | 159 | POWER_SUPPLY_TYPE_USB_ACA, /* Accessory Charger Adapters */ |
| 159 | }; | 160 | }; |
| 160 | 161 | ||
| 162 | enum power_supply_notifier_events { | ||
| 163 | PSY_EVENT_PROP_CHANGED, | ||
| 164 | }; | ||
| 165 | |||
| 161 | union power_supply_propval { | 166 | union power_supply_propval { |
| 162 | int intval; | 167 | int intval; |
| 163 | const char *strval; | 168 | const char *strval; |
| @@ -235,7 +240,18 @@ struct power_supply_info { | |||
| 235 | int use_for_apm; | 240 | int use_for_apm; |
| 236 | }; | 241 | }; |
| 237 | 242 | ||
| 243 | extern struct atomic_notifier_head power_supply_notifier; | ||
| 244 | extern int power_supply_reg_notifier(struct notifier_block *nb); | ||
| 245 | extern void power_supply_unreg_notifier(struct notifier_block *nb); | ||
| 238 | extern struct power_supply *power_supply_get_by_name(const char *name); | 246 | extern struct power_supply *power_supply_get_by_name(const char *name); |
| 247 | #ifdef CONFIG_OF | ||
| 248 | extern struct power_supply *power_supply_get_by_phandle(struct device_node *np, | ||
| 249 | const char *property); | ||
| 250 | #else /* !CONFIG_OF */ | ||
| 251 | static inline struct power_supply * | ||
| 252 | power_supply_get_by_phandle(struct device_node *np, const char *property) | ||
| 253 | { return NULL; } | ||
| 254 | #endif /* CONFIG_OF */ | ||
| 239 | extern void power_supply_changed(struct power_supply *psy); | 255 | extern void power_supply_changed(struct power_supply *psy); |
| 240 | extern int power_supply_am_i_supplied(struct power_supply *psy); | 256 | extern int power_supply_am_i_supplied(struct power_supply *psy); |
| 241 | extern int power_supply_set_battery_charged(struct power_supply *psy); | 257 | extern int power_supply_set_battery_charged(struct power_supply *psy); |
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index a3d9dc8c2c00..59749fc48328 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
| @@ -64,7 +64,11 @@ do { \ | |||
| 64 | } while (0) | 64 | } while (0) |
| 65 | 65 | ||
| 66 | #else | 66 | #else |
| 67 | #define preempt_enable() preempt_enable_no_resched() | 67 | #define preempt_enable() \ |
| 68 | do { \ | ||
| 69 | barrier(); \ | ||
| 70 | preempt_count_dec(); \ | ||
| 71 | } while (0) | ||
| 68 | #define preempt_check_resched() do { } while (0) | 72 | #define preempt_check_resched() do { } while (0) |
| 69 | #endif | 73 | #endif |
| 70 | 74 | ||
| @@ -93,7 +97,11 @@ do { \ | |||
| 93 | __preempt_schedule_context(); \ | 97 | __preempt_schedule_context(); \ |
| 94 | } while (0) | 98 | } while (0) |
| 95 | #else | 99 | #else |
| 96 | #define preempt_enable_notrace() preempt_enable_no_resched_notrace() | 100 | #define preempt_enable_notrace() \ |
| 101 | do { \ | ||
| 102 | barrier(); \ | ||
| 103 | __preempt_count_dec(); \ | ||
| 104 | } while (0) | ||
| 97 | #endif | 105 | #endif |
| 98 | 106 | ||
| 99 | #else /* !CONFIG_PREEMPT_COUNT */ | 107 | #else /* !CONFIG_PREEMPT_COUNT */ |
| @@ -116,6 +124,31 @@ do { \ | |||
| 116 | 124 | ||
| 117 | #endif /* CONFIG_PREEMPT_COUNT */ | 125 | #endif /* CONFIG_PREEMPT_COUNT */ |
| 118 | 126 | ||
| 127 | #ifdef MODULE | ||
| 128 | /* | ||
| 129 | * Modules have no business playing preemption tricks. | ||
| 130 | */ | ||
| 131 | #undef sched_preempt_enable_no_resched | ||
| 132 | #undef preempt_enable_no_resched | ||
| 133 | #undef preempt_enable_no_resched_notrace | ||
| 134 | #undef preempt_check_resched | ||
| 135 | #endif | ||
| 136 | |||
| 137 | #ifdef CONFIG_PREEMPT | ||
| 138 | #define preempt_set_need_resched() \ | ||
| 139 | do { \ | ||
| 140 | set_preempt_need_resched(); \ | ||
| 141 | } while (0) | ||
| 142 | #define preempt_fold_need_resched() \ | ||
| 143 | do { \ | ||
| 144 | if (tif_need_resched()) \ | ||
| 145 | set_preempt_need_resched(); \ | ||
| 146 | } while (0) | ||
| 147 | #else | ||
| 148 | #define preempt_set_need_resched() do { } while (0) | ||
| 149 | #define preempt_fold_need_resched() do { } while (0) | ||
| 150 | #endif | ||
| 151 | |||
| 119 | #ifdef CONFIG_PREEMPT_NOTIFIERS | 152 | #ifdef CONFIG_PREEMPT_NOTIFIERS |
| 120 | 153 | ||
| 121 | struct preempt_notifier; | 154 | struct preempt_notifier; |
diff --git a/include/linux/preempt_mask.h b/include/linux/preempt_mask.h index d169820203dd..dbeec4d4a3be 100644 --- a/include/linux/preempt_mask.h +++ b/include/linux/preempt_mask.h | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | #define LINUX_PREEMPT_MASK_H | 2 | #define LINUX_PREEMPT_MASK_H |
| 3 | 3 | ||
| 4 | #include <linux/preempt.h> | 4 | #include <linux/preempt.h> |
| 5 | #include <asm/hardirq.h> | ||
| 6 | 5 | ||
| 7 | /* | 6 | /* |
| 8 | * We put the hardirq and softirq counter into the preemption | 7 | * We put the hardirq and softirq counter into the preemption |
| @@ -79,6 +78,21 @@ | |||
| 79 | #endif | 78 | #endif |
| 80 | 79 | ||
| 81 | /* | 80 | /* |
| 81 | * The preempt_count offset needed for things like: | ||
| 82 | * | ||
| 83 | * spin_lock_bh() | ||
| 84 | * | ||
| 85 | * Which need to disable both preemption (CONFIG_PREEMPT_COUNT) and | ||
| 86 | * softirqs, such that unlock sequences of: | ||
| 87 | * | ||
| 88 | * spin_unlock(); | ||
| 89 | * local_bh_enable(); | ||
| 90 | * | ||
| 91 | * Work as expected. | ||
| 92 | */ | ||
| 93 | #define SOFTIRQ_LOCK_OFFSET (SOFTIRQ_DISABLE_OFFSET + PREEMPT_CHECK_OFFSET) | ||
| 94 | |||
| 95 | /* | ||
| 82 | * Are we running in atomic context? WARNING: this macro cannot | 96 | * Are we running in atomic context? WARNING: this macro cannot |
| 83 | * always detect atomic context; in particular, it cannot know about | 97 | * always detect atomic context; in particular, it cannot know about |
| 84 | * held spinlocks in non-preemptible kernels. Thus it should not be | 98 | * held spinlocks in non-preemptible kernels. Thus it should not be |
diff --git a/include/linux/printk.h b/include/linux/printk.h index 694925837a16..cc6f74d65167 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <linux/init.h> | 5 | #include <linux/init.h> |
| 6 | #include <linux/kern_levels.h> | 6 | #include <linux/kern_levels.h> |
| 7 | #include <linux/linkage.h> | 7 | #include <linux/linkage.h> |
| 8 | #include <linux/cache.h> | ||
| 8 | 9 | ||
| 9 | extern const char linux_banner[]; | 10 | extern const char linux_banner[]; |
| 10 | extern const char linux_proc_banner[]; | 11 | extern const char linux_proc_banner[]; |
| @@ -253,17 +254,17 @@ extern asmlinkage void dump_stack(void) __cold; | |||
| 253 | */ | 254 | */ |
| 254 | 255 | ||
| 255 | #ifdef CONFIG_PRINTK | 256 | #ifdef CONFIG_PRINTK |
| 256 | #define printk_once(fmt, ...) \ | 257 | #define printk_once(fmt, ...) \ |
| 257 | ({ \ | 258 | ({ \ |
| 258 | static bool __print_once; \ | 259 | static bool __print_once __read_mostly; \ |
| 259 | \ | 260 | \ |
| 260 | if (!__print_once) { \ | 261 | if (!__print_once) { \ |
| 261 | __print_once = true; \ | 262 | __print_once = true; \ |
| 262 | printk(fmt, ##__VA_ARGS__); \ | 263 | printk(fmt, ##__VA_ARGS__); \ |
| 263 | } \ | 264 | } \ |
| 264 | }) | 265 | }) |
| 265 | #else | 266 | #else |
| 266 | #define printk_once(fmt, ...) \ | 267 | #define printk_once(fmt, ...) \ |
| 267 | no_printk(fmt, ##__VA_ARGS__) | 268 | no_printk(fmt, ##__VA_ARGS__) |
| 268 | #endif | 269 | #endif |
| 269 | 270 | ||
diff --git a/include/linux/pstore.h b/include/linux/pstore.h index abd437d0a8a7..ece0c6bbfcc5 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h | |||
| @@ -51,6 +51,7 @@ struct pstore_info { | |||
| 51 | char *buf; | 51 | char *buf; |
| 52 | size_t bufsize; | 52 | size_t bufsize; |
| 53 | struct mutex read_mutex; /* serialize open/read/close */ | 53 | struct mutex read_mutex; /* serialize open/read/close */ |
| 54 | int flags; | ||
| 54 | int (*open)(struct pstore_info *psi); | 55 | int (*open)(struct pstore_info *psi); |
| 55 | int (*close)(struct pstore_info *psi); | 56 | int (*close)(struct pstore_info *psi); |
| 56 | ssize_t (*read)(u64 *id, enum pstore_type_id *type, | 57 | ssize_t (*read)(u64 *id, enum pstore_type_id *type, |
| @@ -70,6 +71,8 @@ struct pstore_info { | |||
| 70 | void *data; | 71 | void *data; |
| 71 | }; | 72 | }; |
| 72 | 73 | ||
| 74 | #define PSTORE_FLAGS_FRAGILE 1 | ||
| 75 | |||
| 73 | #ifdef CONFIG_PSTORE | 76 | #ifdef CONFIG_PSTORE |
| 74 | extern int pstore_register(struct pstore_info *); | 77 | extern int pstore_register(struct pstore_info *); |
| 75 | extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason); | 78 | extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason); |
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index 753207c8ce20..ecc730977a5a 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
| @@ -14,13 +14,6 @@ ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) | |||
| 14 | } | 14 | } |
| 15 | #else | 15 | #else |
| 16 | extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); | 16 | extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); |
| 17 | extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, | ||
| 18 | unsigned long addr, | ||
| 19 | unsigned long len, | ||
| 20 | unsigned long pgoff, | ||
| 21 | unsigned long flags); | ||
| 22 | |||
| 23 | extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma); | ||
| 24 | #endif | 17 | #endif |
| 25 | 18 | ||
| 26 | extern const struct file_operations ramfs_file_operations; | 19 | extern const struct file_operations ramfs_file_operations; |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 45a0a9e81478..dbaf99084112 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
| @@ -55,8 +55,8 @@ static inline void __list_add_rcu(struct list_head *new, | |||
| 55 | next->prev = new; | 55 | next->prev = new; |
| 56 | } | 56 | } |
| 57 | #else | 57 | #else |
| 58 | extern void __list_add_rcu(struct list_head *new, | 58 | void __list_add_rcu(struct list_head *new, |
| 59 | struct list_head *prev, struct list_head *next); | 59 | struct list_head *prev, struct list_head *next); |
| 60 | #endif | 60 | #endif |
| 61 | 61 | ||
| 62 | /** | 62 | /** |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 39cbb889e20d..3e355c688618 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -50,13 +50,13 @@ extern int rcutorture_runnable; /* for sysctl */ | |||
| 50 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ | 50 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ |
| 51 | 51 | ||
| 52 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 52 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
| 53 | extern void rcutorture_record_test_transition(void); | 53 | void rcutorture_record_test_transition(void); |
| 54 | extern void rcutorture_record_progress(unsigned long vernum); | 54 | void rcutorture_record_progress(unsigned long vernum); |
| 55 | extern void do_trace_rcu_torture_read(const char *rcutorturename, | 55 | void do_trace_rcu_torture_read(const char *rcutorturename, |
| 56 | struct rcu_head *rhp, | 56 | struct rcu_head *rhp, |
| 57 | unsigned long secs, | 57 | unsigned long secs, |
| 58 | unsigned long c_old, | 58 | unsigned long c_old, |
| 59 | unsigned long c); | 59 | unsigned long c); |
| 60 | #else | 60 | #else |
| 61 | static inline void rcutorture_record_test_transition(void) | 61 | static inline void rcutorture_record_test_transition(void) |
| 62 | { | 62 | { |
| @@ -65,11 +65,11 @@ static inline void rcutorture_record_progress(unsigned long vernum) | |||
| 65 | { | 65 | { |
| 66 | } | 66 | } |
| 67 | #ifdef CONFIG_RCU_TRACE | 67 | #ifdef CONFIG_RCU_TRACE |
| 68 | extern void do_trace_rcu_torture_read(const char *rcutorturename, | 68 | void do_trace_rcu_torture_read(const char *rcutorturename, |
| 69 | struct rcu_head *rhp, | 69 | struct rcu_head *rhp, |
| 70 | unsigned long secs, | 70 | unsigned long secs, |
| 71 | unsigned long c_old, | 71 | unsigned long c_old, |
| 72 | unsigned long c); | 72 | unsigned long c); |
| 73 | #else | 73 | #else |
| 74 | #define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ | 74 | #define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ |
| 75 | do { } while (0) | 75 | do { } while (0) |
| @@ -118,8 +118,8 @@ extern void do_trace_rcu_torture_read(const char *rcutorturename, | |||
| 118 | * if CPU A and CPU B are the same CPU (but again only if the system has | 118 | * if CPU A and CPU B are the same CPU (but again only if the system has |
| 119 | * more than one CPU). | 119 | * more than one CPU). |
| 120 | */ | 120 | */ |
| 121 | extern void call_rcu(struct rcu_head *head, | 121 | void call_rcu(struct rcu_head *head, |
| 122 | void (*func)(struct rcu_head *head)); | 122 | void (*func)(struct rcu_head *head)); |
| 123 | 123 | ||
| 124 | #else /* #ifdef CONFIG_PREEMPT_RCU */ | 124 | #else /* #ifdef CONFIG_PREEMPT_RCU */ |
| 125 | 125 | ||
| @@ -149,8 +149,8 @@ extern void call_rcu(struct rcu_head *head, | |||
| 149 | * See the description of call_rcu() for more detailed information on | 149 | * See the description of call_rcu() for more detailed information on |
| 150 | * memory ordering guarantees. | 150 | * memory ordering guarantees. |
| 151 | */ | 151 | */ |
| 152 | extern void call_rcu_bh(struct rcu_head *head, | 152 | void call_rcu_bh(struct rcu_head *head, |
| 153 | void (*func)(struct rcu_head *head)); | 153 | void (*func)(struct rcu_head *head)); |
| 154 | 154 | ||
| 155 | /** | 155 | /** |
| 156 | * call_rcu_sched() - Queue an RCU for invocation after sched grace period. | 156 | * call_rcu_sched() - Queue an RCU for invocation after sched grace period. |
| @@ -171,16 +171,16 @@ extern void call_rcu_bh(struct rcu_head *head, | |||
| 171 | * See the description of call_rcu() for more detailed information on | 171 | * See the description of call_rcu() for more detailed information on |
| 172 | * memory ordering guarantees. | 172 | * memory ordering guarantees. |
| 173 | */ | 173 | */ |
| 174 | extern void call_rcu_sched(struct rcu_head *head, | 174 | void call_rcu_sched(struct rcu_head *head, |
| 175 | void (*func)(struct rcu_head *rcu)); | 175 | void (*func)(struct rcu_head *rcu)); |
| 176 | 176 | ||
| 177 | extern void synchronize_sched(void); | 177 | void synchronize_sched(void); |
| 178 | 178 | ||
| 179 | #ifdef CONFIG_PREEMPT_RCU | 179 | #ifdef CONFIG_PREEMPT_RCU |
| 180 | 180 | ||
| 181 | extern void __rcu_read_lock(void); | 181 | void __rcu_read_lock(void); |
| 182 | extern void __rcu_read_unlock(void); | 182 | void __rcu_read_unlock(void); |
| 183 | extern void rcu_read_unlock_special(struct task_struct *t); | 183 | void rcu_read_unlock_special(struct task_struct *t); |
| 184 | void synchronize_rcu(void); | 184 | void synchronize_rcu(void); |
| 185 | 185 | ||
| 186 | /* | 186 | /* |
| @@ -216,19 +216,19 @@ static inline int rcu_preempt_depth(void) | |||
| 216 | #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ | 216 | #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ |
| 217 | 217 | ||
| 218 | /* Internal to kernel */ | 218 | /* Internal to kernel */ |
| 219 | extern void rcu_init(void); | 219 | void rcu_init(void); |
| 220 | extern void rcu_sched_qs(int cpu); | 220 | void rcu_sched_qs(int cpu); |
| 221 | extern void rcu_bh_qs(int cpu); | 221 | void rcu_bh_qs(int cpu); |
| 222 | extern void rcu_check_callbacks(int cpu, int user); | 222 | void rcu_check_callbacks(int cpu, int user); |
| 223 | struct notifier_block; | 223 | struct notifier_block; |
| 224 | extern void rcu_idle_enter(void); | 224 | void rcu_idle_enter(void); |
| 225 | extern void rcu_idle_exit(void); | 225 | void rcu_idle_exit(void); |
| 226 | extern void rcu_irq_enter(void); | 226 | void rcu_irq_enter(void); |
| 227 | extern void rcu_irq_exit(void); | 227 | void rcu_irq_exit(void); |
| 228 | 228 | ||
| 229 | #ifdef CONFIG_RCU_USER_QS | 229 | #ifdef CONFIG_RCU_USER_QS |
| 230 | extern void rcu_user_enter(void); | 230 | void rcu_user_enter(void); |
| 231 | extern void rcu_user_exit(void); | 231 | void rcu_user_exit(void); |
| 232 | #else | 232 | #else |
| 233 | static inline void rcu_user_enter(void) { } | 233 | static inline void rcu_user_enter(void) { } |
| 234 | static inline void rcu_user_exit(void) { } | 234 | static inline void rcu_user_exit(void) { } |
| @@ -262,7 +262,7 @@ static inline void rcu_user_hooks_switch(struct task_struct *prev, | |||
| 262 | } while (0) | 262 | } while (0) |
| 263 | 263 | ||
| 264 | #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) | 264 | #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) |
| 265 | extern bool __rcu_is_watching(void); | 265 | bool __rcu_is_watching(void); |
| 266 | #endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */ | 266 | #endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */ |
| 267 | 267 | ||
| 268 | /* | 268 | /* |
| @@ -289,8 +289,8 @@ void wait_rcu_gp(call_rcu_func_t crf); | |||
| 289 | * initialization. | 289 | * initialization. |
| 290 | */ | 290 | */ |
| 291 | #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD | 291 | #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD |
| 292 | extern void init_rcu_head_on_stack(struct rcu_head *head); | 292 | void init_rcu_head_on_stack(struct rcu_head *head); |
| 293 | extern void destroy_rcu_head_on_stack(struct rcu_head *head); | 293 | void destroy_rcu_head_on_stack(struct rcu_head *head); |
| 294 | #else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ | 294 | #else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ |
| 295 | static inline void init_rcu_head_on_stack(struct rcu_head *head) | 295 | static inline void init_rcu_head_on_stack(struct rcu_head *head) |
| 296 | { | 296 | { |
| @@ -325,6 +325,7 @@ static inline void rcu_lock_release(struct lockdep_map *map) | |||
| 325 | extern struct lockdep_map rcu_lock_map; | 325 | extern struct lockdep_map rcu_lock_map; |
| 326 | extern struct lockdep_map rcu_bh_lock_map; | 326 | extern struct lockdep_map rcu_bh_lock_map; |
| 327 | extern struct lockdep_map rcu_sched_lock_map; | 327 | extern struct lockdep_map rcu_sched_lock_map; |
| 328 | extern struct lockdep_map rcu_callback_map; | ||
| 328 | extern int debug_lockdep_rcu_enabled(void); | 329 | extern int debug_lockdep_rcu_enabled(void); |
| 329 | 330 | ||
| 330 | /** | 331 | /** |
| @@ -362,7 +363,7 @@ static inline int rcu_read_lock_held(void) | |||
| 362 | * rcu_read_lock_bh_held() is defined out of line to avoid #include-file | 363 | * rcu_read_lock_bh_held() is defined out of line to avoid #include-file |
| 363 | * hell. | 364 | * hell. |
| 364 | */ | 365 | */ |
| 365 | extern int rcu_read_lock_bh_held(void); | 366 | int rcu_read_lock_bh_held(void); |
| 366 | 367 | ||
| 367 | /** | 368 | /** |
| 368 | * rcu_read_lock_sched_held() - might we be in RCU-sched read-side critical section? | 369 | * rcu_read_lock_sched_held() - might we be in RCU-sched read-side critical section? |
| @@ -448,7 +449,7 @@ static inline int rcu_read_lock_sched_held(void) | |||
| 448 | 449 | ||
| 449 | #ifdef CONFIG_PROVE_RCU | 450 | #ifdef CONFIG_PROVE_RCU |
| 450 | 451 | ||
| 451 | extern int rcu_my_thread_group_empty(void); | 452 | int rcu_my_thread_group_empty(void); |
| 452 | 453 | ||
| 453 | /** | 454 | /** |
| 454 | * rcu_lockdep_assert - emit lockdep splat if specified condition not met | 455 | * rcu_lockdep_assert - emit lockdep splat if specified condition not met |
| @@ -548,10 +549,48 @@ static inline void rcu_preempt_sleep_check(void) | |||
| 548 | smp_read_barrier_depends(); \ | 549 | smp_read_barrier_depends(); \ |
| 549 | (_________p1); \ | 550 | (_________p1); \ |
| 550 | }) | 551 | }) |
| 551 | #define __rcu_assign_pointer(p, v, space) \ | 552 | |
| 553 | /** | ||
| 554 | * RCU_INITIALIZER() - statically initialize an RCU-protected global variable | ||
| 555 | * @v: The value to statically initialize with. | ||
| 556 | */ | ||
| 557 | #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v) | ||
| 558 | |||
| 559 | /** | ||
| 560 | * rcu_assign_pointer() - assign to RCU-protected pointer | ||
| 561 | * @p: pointer to assign to | ||
| 562 | * @v: value to assign (publish) | ||
| 563 | * | ||
| 564 | * Assigns the specified value to the specified RCU-protected | ||
| 565 | * pointer, ensuring that any concurrent RCU readers will see | ||
| 566 | * any prior initialization. | ||
| 567 | * | ||
| 568 | * Inserts memory barriers on architectures that require them | ||
| 569 | * (which is most of them), and also prevents the compiler from | ||
| 570 | * reordering the code that initializes the structure after the pointer | ||
| 571 | * assignment. More importantly, this call documents which pointers | ||
| 572 | * will be dereferenced by RCU read-side code. | ||
| 573 | * | ||
| 574 | * In some special cases, you may use RCU_INIT_POINTER() instead | ||
| 575 | * of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due | ||
| 576 | * to the fact that it does not constrain either the CPU or the compiler. | ||
| 577 | * That said, using RCU_INIT_POINTER() when you should have used | ||
| 578 | * rcu_assign_pointer() is a very bad thing that results in | ||
| 579 | * impossible-to-diagnose memory corruption. So please be careful. | ||
| 580 | * See the RCU_INIT_POINTER() comment header for details. | ||
| 581 | * | ||
| 582 | * Note that rcu_assign_pointer() evaluates each of its arguments only | ||
| 583 | * once, appearances notwithstanding. One of the "extra" evaluations | ||
| 584 | * is in typeof() and the other visible only to sparse (__CHECKER__), | ||
| 585 | * neither of which actually execute the argument. As with most cpp | ||
| 586 | * macros, this execute-arguments-only-once property is important, so | ||
| 587 | * please be careful when making changes to rcu_assign_pointer() and the | ||
| 588 | * other macros that it invokes. | ||
| 589 | */ | ||
| 590 | #define rcu_assign_pointer(p, v) \ | ||
| 552 | do { \ | 591 | do { \ |
| 553 | smp_wmb(); \ | 592 | smp_wmb(); \ |
| 554 | (p) = (typeof(*v) __force space *)(v); \ | 593 | ACCESS_ONCE(p) = RCU_INITIALIZER(v); \ |
| 555 | } while (0) | 594 | } while (0) |
| 556 | 595 | ||
| 557 | 596 | ||
| @@ -890,32 +929,6 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
| 890 | } | 929 | } |
| 891 | 930 | ||
| 892 | /** | 931 | /** |
| 893 | * rcu_assign_pointer() - assign to RCU-protected pointer | ||
| 894 | * @p: pointer to assign to | ||
| 895 | * @v: value to assign (publish) | ||
| 896 | * | ||
| 897 | * Assigns the specified value to the specified RCU-protected | ||
| 898 | * pointer, ensuring that any concurrent RCU readers will see | ||
| 899 | * any prior initialization. | ||
| 900 | * | ||
| 901 | * Inserts memory barriers on architectures that require them | ||
| 902 | * (which is most of them), and also prevents the compiler from | ||
| 903 | * reordering the code that initializes the structure after the pointer | ||
| 904 | * assignment. More importantly, this call documents which pointers | ||
| 905 | * will be dereferenced by RCU read-side code. | ||
| 906 | * | ||
| 907 | * In some special cases, you may use RCU_INIT_POINTER() instead | ||
| 908 | * of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due | ||
| 909 | * to the fact that it does not constrain either the CPU or the compiler. | ||
| 910 | * That said, using RCU_INIT_POINTER() when you should have used | ||
| 911 | * rcu_assign_pointer() is a very bad thing that results in | ||
| 912 | * impossible-to-diagnose memory corruption. So please be careful. | ||
| 913 | * See the RCU_INIT_POINTER() comment header for details. | ||
| 914 | */ | ||
| 915 | #define rcu_assign_pointer(p, v) \ | ||
| 916 | __rcu_assign_pointer((p), (v), __rcu) | ||
| 917 | |||
| 918 | /** | ||
| 919 | * RCU_INIT_POINTER() - initialize an RCU protected pointer | 932 | * RCU_INIT_POINTER() - initialize an RCU protected pointer |
| 920 | * | 933 | * |
| 921 | * Initialize an RCU-protected pointer in special cases where readers | 934 | * Initialize an RCU-protected pointer in special cases where readers |
| @@ -949,7 +962,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
| 949 | */ | 962 | */ |
| 950 | #define RCU_INIT_POINTER(p, v) \ | 963 | #define RCU_INIT_POINTER(p, v) \ |
| 951 | do { \ | 964 | do { \ |
| 952 | p = (typeof(*v) __force __rcu *)(v); \ | 965 | p = RCU_INITIALIZER(v); \ |
| 953 | } while (0) | 966 | } while (0) |
| 954 | 967 | ||
| 955 | /** | 968 | /** |
| @@ -958,7 +971,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
| 958 | * GCC-style initialization for an RCU-protected pointer in a structure field. | 971 | * GCC-style initialization for an RCU-protected pointer in a structure field. |
| 959 | */ | 972 | */ |
| 960 | #define RCU_POINTER_INITIALIZER(p, v) \ | 973 | #define RCU_POINTER_INITIALIZER(p, v) \ |
| 961 | .p = (typeof(*v) __force __rcu *)(v) | 974 | .p = RCU_INITIALIZER(v) |
| 962 | 975 | ||
| 963 | /* | 976 | /* |
| 964 | * Does the specified offset indicate that the corresponding rcu_head | 977 | * Does the specified offset indicate that the corresponding rcu_head |
| @@ -1005,7 +1018,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
| 1005 | __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) | 1018 | __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) |
| 1006 | 1019 | ||
| 1007 | #ifdef CONFIG_RCU_NOCB_CPU | 1020 | #ifdef CONFIG_RCU_NOCB_CPU |
| 1008 | extern bool rcu_is_nocb_cpu(int cpu); | 1021 | bool rcu_is_nocb_cpu(int cpu); |
| 1009 | #else | 1022 | #else |
| 1010 | static inline bool rcu_is_nocb_cpu(int cpu) { return false; } | 1023 | static inline bool rcu_is_nocb_cpu(int cpu) { return false; } |
| 1011 | #endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ | 1024 | #endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ |
| @@ -1013,8 +1026,8 @@ static inline bool rcu_is_nocb_cpu(int cpu) { return false; } | |||
| 1013 | 1026 | ||
| 1014 | /* Only for use by adaptive-ticks code. */ | 1027 | /* Only for use by adaptive-ticks code. */ |
| 1015 | #ifdef CONFIG_NO_HZ_FULL_SYSIDLE | 1028 | #ifdef CONFIG_NO_HZ_FULL_SYSIDLE |
| 1016 | extern bool rcu_sys_is_idle(void); | 1029 | bool rcu_sys_is_idle(void); |
| 1017 | extern void rcu_sysidle_force_exit(void); | 1030 | void rcu_sysidle_force_exit(void); |
| 1018 | #else /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */ | 1031 | #else /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */ |
| 1019 | 1032 | ||
| 1020 | static inline bool rcu_sys_is_idle(void) | 1033 | static inline bool rcu_sys_is_idle(void) |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 09ebcbe9fd78..6f01771b571c 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
| @@ -125,7 +125,7 @@ static inline void exit_rcu(void) | |||
| 125 | 125 | ||
| 126 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 126 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 127 | extern int rcu_scheduler_active __read_mostly; | 127 | extern int rcu_scheduler_active __read_mostly; |
| 128 | extern void rcu_scheduler_starting(void); | 128 | void rcu_scheduler_starting(void); |
| 129 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | 129 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ |
| 130 | static inline void rcu_scheduler_starting(void) | 130 | static inline void rcu_scheduler_starting(void) |
| 131 | { | 131 | { |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 4b9c81548742..72137ee8c603 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
| @@ -30,9 +30,9 @@ | |||
| 30 | #ifndef __LINUX_RCUTREE_H | 30 | #ifndef __LINUX_RCUTREE_H |
| 31 | #define __LINUX_RCUTREE_H | 31 | #define __LINUX_RCUTREE_H |
| 32 | 32 | ||
| 33 | extern void rcu_note_context_switch(int cpu); | 33 | void rcu_note_context_switch(int cpu); |
| 34 | extern int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); | 34 | int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); |
| 35 | extern void rcu_cpu_stall_reset(void); | 35 | void rcu_cpu_stall_reset(void); |
| 36 | 36 | ||
| 37 | /* | 37 | /* |
| 38 | * Note a virtualization-based context switch. This is simply a | 38 | * Note a virtualization-based context switch. This is simply a |
| @@ -44,9 +44,9 @@ static inline void rcu_virt_note_context_switch(int cpu) | |||
| 44 | rcu_note_context_switch(cpu); | 44 | rcu_note_context_switch(cpu); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | extern void synchronize_rcu_bh(void); | 47 | void synchronize_rcu_bh(void); |
| 48 | extern void synchronize_sched_expedited(void); | 48 | void synchronize_sched_expedited(void); |
| 49 | extern void synchronize_rcu_expedited(void); | 49 | void synchronize_rcu_expedited(void); |
| 50 | 50 | ||
| 51 | void kfree_call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)); | 51 | void kfree_call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)); |
| 52 | 52 | ||
| @@ -71,25 +71,25 @@ static inline void synchronize_rcu_bh_expedited(void) | |||
| 71 | synchronize_sched_expedited(); | 71 | synchronize_sched_expedited(); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | extern void rcu_barrier(void); | 74 | void rcu_barrier(void); |
| 75 | extern void rcu_barrier_bh(void); | 75 | void rcu_barrier_bh(void); |
| 76 | extern void rcu_barrier_sched(void); | 76 | void rcu_barrier_sched(void); |
| 77 | 77 | ||
| 78 | extern unsigned long rcutorture_testseq; | 78 | extern unsigned long rcutorture_testseq; |
| 79 | extern unsigned long rcutorture_vernum; | 79 | extern unsigned long rcutorture_vernum; |
| 80 | extern long rcu_batches_completed(void); | 80 | long rcu_batches_completed(void); |
| 81 | extern long rcu_batches_completed_bh(void); | 81 | long rcu_batches_completed_bh(void); |
| 82 | extern long rcu_batches_completed_sched(void); | 82 | long rcu_batches_completed_sched(void); |
| 83 | 83 | ||
| 84 | extern void rcu_force_quiescent_state(void); | 84 | void rcu_force_quiescent_state(void); |
| 85 | extern void rcu_bh_force_quiescent_state(void); | 85 | void rcu_bh_force_quiescent_state(void); |
| 86 | extern void rcu_sched_force_quiescent_state(void); | 86 | void rcu_sched_force_quiescent_state(void); |
| 87 | 87 | ||
| 88 | extern void exit_rcu(void); | 88 | void exit_rcu(void); |
| 89 | 89 | ||
| 90 | extern void rcu_scheduler_starting(void); | 90 | void rcu_scheduler_starting(void); |
| 91 | extern int rcu_scheduler_active __read_mostly; | 91 | extern int rcu_scheduler_active __read_mostly; |
| 92 | 92 | ||
| 93 | extern bool rcu_is_watching(void); | 93 | bool rcu_is_watching(void); |
| 94 | 94 | ||
| 95 | #endif /* __LINUX_RCUTREE_H */ | 95 | #endif /* __LINUX_RCUTREE_H */ |
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 8e00f9f6f963..9e7db9e73cc1 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
| @@ -43,6 +43,7 @@ extern int unregister_reboot_notifier(struct notifier_block *); | |||
| 43 | * Architecture-specific implementations of sys_reboot commands. | 43 | * Architecture-specific implementations of sys_reboot commands. |
| 44 | */ | 44 | */ |
| 45 | 45 | ||
| 46 | extern void migrate_to_reboot_cpu(void); | ||
| 46 | extern void machine_restart(char *cmd); | 47 | extern void machine_restart(char *cmd); |
| 47 | extern void machine_halt(void); | 48 | extern void machine_halt(void); |
| 48 | extern void machine_power_off(void); | 49 | extern void machine_power_off(void); |
diff --git a/include/linux/reset-controller.h b/include/linux/reset-controller.h index 2f61311ae3e0..41a4695fde08 100644 --- a/include/linux/reset-controller.h +++ b/include/linux/reset-controller.h | |||
| @@ -21,6 +21,7 @@ struct reset_control_ops { | |||
| 21 | 21 | ||
| 22 | struct module; | 22 | struct module; |
| 23 | struct device_node; | 23 | struct device_node; |
| 24 | struct of_phandle_args; | ||
| 24 | 25 | ||
| 25 | /** | 26 | /** |
| 26 | * struct reset_controller_dev - reset controller entity that might | 27 | * struct reset_controller_dev - reset controller entity that might |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 6dacb93a6d94..1da693d51255 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
| @@ -184,13 +184,13 @@ static inline void page_dup_rmap(struct page *page) | |||
| 184 | int page_referenced(struct page *, int is_locked, | 184 | int page_referenced(struct page *, int is_locked, |
| 185 | struct mem_cgroup *memcg, unsigned long *vm_flags); | 185 | struct mem_cgroup *memcg, unsigned long *vm_flags); |
| 186 | int page_referenced_one(struct page *, struct vm_area_struct *, | 186 | int page_referenced_one(struct page *, struct vm_area_struct *, |
| 187 | unsigned long address, unsigned int *mapcount, unsigned long *vm_flags); | 187 | unsigned long address, void *arg); |
| 188 | 188 | ||
| 189 | #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) | 189 | #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) |
| 190 | 190 | ||
| 191 | int try_to_unmap(struct page *, enum ttu_flags flags); | 191 | int try_to_unmap(struct page *, enum ttu_flags flags); |
| 192 | int try_to_unmap_one(struct page *, struct vm_area_struct *, | 192 | int try_to_unmap_one(struct page *, struct vm_area_struct *, |
| 193 | unsigned long address, enum ttu_flags flags); | 193 | unsigned long address, void *arg); |
| 194 | 194 | ||
| 195 | /* | 195 | /* |
| 196 | * Called from mm/filemap_xip.c to unmap empty zero page | 196 | * Called from mm/filemap_xip.c to unmap empty zero page |
| @@ -236,10 +236,27 @@ void page_unlock_anon_vma_read(struct anon_vma *anon_vma); | |||
| 236 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); | 236 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); |
| 237 | 237 | ||
| 238 | /* | 238 | /* |
| 239 | * Called by migrate.c to remove migration ptes, but might be used more later. | 239 | * rmap_walk_control: To control rmap traversing for specific needs |
| 240 | * | ||
| 241 | * arg: passed to rmap_one() and invalid_vma() | ||
| 242 | * rmap_one: executed on each vma where page is mapped | ||
| 243 | * done: for checking traversing termination condition | ||
| 244 | * file_nonlinear: for handling file nonlinear mapping | ||
| 245 | * anon_lock: for getting anon_lock by optimized way rather than default | ||
| 246 | * invalid_vma: for skipping uninterested vma | ||
| 240 | */ | 247 | */ |
| 241 | int rmap_walk(struct page *page, int (*rmap_one)(struct page *, | 248 | struct rmap_walk_control { |
| 242 | struct vm_area_struct *, unsigned long, void *), void *arg); | 249 | void *arg; |
| 250 | int (*rmap_one)(struct page *page, struct vm_area_struct *vma, | ||
| 251 | unsigned long addr, void *arg); | ||
| 252 | int (*done)(struct page *page); | ||
| 253 | int (*file_nonlinear)(struct page *, struct address_space *, | ||
| 254 | struct vm_area_struct *vma); | ||
| 255 | struct anon_vma *(*anon_lock)(struct page *page); | ||
| 256 | bool (*invalid_vma)(struct vm_area_struct *vma, void *arg); | ||
| 257 | }; | ||
| 258 | |||
| 259 | int rmap_walk(struct page *page, struct rmap_walk_control *rwc); | ||
| 243 | 260 | ||
| 244 | #else /* !CONFIG_MMU */ | 261 | #else /* !CONFIG_MMU */ |
| 245 | 262 | ||
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h index de17134244f3..3aed8d737e1a 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | #define __LINUX_RT_MUTEX_H | 13 | #define __LINUX_RT_MUTEX_H |
| 14 | 14 | ||
| 15 | #include <linux/linkage.h> | 15 | #include <linux/linkage.h> |
| 16 | #include <linux/plist.h> | 16 | #include <linux/rbtree.h> |
| 17 | #include <linux/spinlock_types.h> | 17 | #include <linux/spinlock_types.h> |
| 18 | 18 | ||
| 19 | extern int max_lock_depth; /* for sysctl */ | 19 | extern int max_lock_depth; /* for sysctl */ |
| @@ -22,12 +22,14 @@ extern int max_lock_depth; /* for sysctl */ | |||
| 22 | * The rt_mutex structure | 22 | * The rt_mutex structure |
| 23 | * | 23 | * |
| 24 | * @wait_lock: spinlock to protect the structure | 24 | * @wait_lock: spinlock to protect the structure |
| 25 | * @wait_list: pilist head to enqueue waiters in priority order | 25 | * @waiters: rbtree root to enqueue waiters in priority order |
| 26 | * @waiters_leftmost: top waiter | ||
| 26 | * @owner: the mutex owner | 27 | * @owner: the mutex owner |
| 27 | */ | 28 | */ |
| 28 | struct rt_mutex { | 29 | struct rt_mutex { |
| 29 | raw_spinlock_t wait_lock; | 30 | raw_spinlock_t wait_lock; |
| 30 | struct plist_head wait_list; | 31 | struct rb_root waiters; |
| 32 | struct rb_node *waiters_leftmost; | ||
| 31 | struct task_struct *owner; | 33 | struct task_struct *owner; |
| 32 | #ifdef CONFIG_DEBUG_RT_MUTEXES | 34 | #ifdef CONFIG_DEBUG_RT_MUTEXES |
| 33 | int save_state; | 35 | int save_state; |
| @@ -66,7 +68,7 @@ struct hrtimer_sleeper; | |||
| 66 | 68 | ||
| 67 | #define __RT_MUTEX_INITIALIZER(mutexname) \ | 69 | #define __RT_MUTEX_INITIALIZER(mutexname) \ |
| 68 | { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ | 70 | { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ |
| 69 | , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list) \ | 71 | , .waiters = RB_ROOT \ |
| 70 | , .owner = NULL \ | 72 | , .owner = NULL \ |
| 71 | __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} | 73 | __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} |
| 72 | 74 | ||
| @@ -98,12 +100,4 @@ extern int rt_mutex_trylock(struct rt_mutex *lock); | |||
| 98 | 100 | ||
| 99 | extern void rt_mutex_unlock(struct rt_mutex *lock); | 101 | extern void rt_mutex_unlock(struct rt_mutex *lock); |
| 100 | 102 | ||
| 101 | #ifdef CONFIG_RT_MUTEXES | ||
| 102 | # define INIT_RT_MUTEXES(tsk) \ | ||
| 103 | .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters), \ | ||
| 104 | INIT_RT_MUTEX_DEBUG(tsk) | ||
| 105 | #else | ||
| 106 | # define INIT_RT_MUTEXES(tsk) | ||
| 107 | #endif | ||
| 108 | |||
| 109 | #endif | 103 | #endif |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 939428ad25ac..8e3e66ac0a52 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
| @@ -24,6 +24,11 @@ extern int rtnl_trylock(void); | |||
| 24 | extern int rtnl_is_locked(void); | 24 | extern int rtnl_is_locked(void); |
| 25 | #ifdef CONFIG_PROVE_LOCKING | 25 | #ifdef CONFIG_PROVE_LOCKING |
| 26 | extern int lockdep_rtnl_is_held(void); | 26 | extern int lockdep_rtnl_is_held(void); |
| 27 | #else | ||
| 28 | static inline int lockdep_rtnl_is_held(void) | ||
| 29 | { | ||
| 30 | return 1; | ||
| 31 | } | ||
| 27 | #endif /* #ifdef CONFIG_PROVE_LOCKING */ | 32 | #endif /* #ifdef CONFIG_PROVE_LOCKING */ |
| 28 | 33 | ||
| 29 | /** | 34 | /** |
diff --git a/include/linux/rwlock_api_smp.h b/include/linux/rwlock_api_smp.h index 9c9f0495d37c..5b9b84b20407 100644 --- a/include/linux/rwlock_api_smp.h +++ b/include/linux/rwlock_api_smp.h | |||
| @@ -172,8 +172,7 @@ static inline void __raw_read_lock_irq(rwlock_t *lock) | |||
| 172 | 172 | ||
| 173 | static inline void __raw_read_lock_bh(rwlock_t *lock) | 173 | static inline void __raw_read_lock_bh(rwlock_t *lock) |
| 174 | { | 174 | { |
| 175 | local_bh_disable(); | 175 | __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 176 | preempt_disable(); | ||
| 177 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | 176 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); |
| 178 | LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); | 177 | LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); |
| 179 | } | 178 | } |
| @@ -200,8 +199,7 @@ static inline void __raw_write_lock_irq(rwlock_t *lock) | |||
| 200 | 199 | ||
| 201 | static inline void __raw_write_lock_bh(rwlock_t *lock) | 200 | static inline void __raw_write_lock_bh(rwlock_t *lock) |
| 202 | { | 201 | { |
| 203 | local_bh_disable(); | 202 | __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 204 | preempt_disable(); | ||
| 205 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 203 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
| 206 | LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock); | 204 | LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock); |
| 207 | } | 205 | } |
| @@ -250,8 +248,7 @@ static inline void __raw_read_unlock_bh(rwlock_t *lock) | |||
| 250 | { | 248 | { |
| 251 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | 249 | rwlock_release(&lock->dep_map, 1, _RET_IP_); |
| 252 | do_raw_read_unlock(lock); | 250 | do_raw_read_unlock(lock); |
| 253 | preempt_enable_no_resched(); | 251 | __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 254 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 255 | } | 252 | } |
| 256 | 253 | ||
| 257 | static inline void __raw_write_unlock_irqrestore(rwlock_t *lock, | 254 | static inline void __raw_write_unlock_irqrestore(rwlock_t *lock, |
| @@ -275,8 +272,7 @@ static inline void __raw_write_unlock_bh(rwlock_t *lock) | |||
| 275 | { | 272 | { |
| 276 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | 273 | rwlock_release(&lock->dep_map, 1, _RET_IP_); |
| 277 | do_raw_write_unlock(lock); | 274 | do_raw_write_unlock(lock); |
| 278 | preempt_enable_no_resched(); | 275 | __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 279 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 280 | } | 276 | } |
| 281 | 277 | ||
| 282 | #endif /* __LINUX_RWLOCK_API_SMP_H */ | 278 | #endif /* __LINUX_RWLOCK_API_SMP_H */ |
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index adae88f5b0ab..a964f7285600 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
| @@ -345,6 +345,7 @@ struct sg_mapping_iter { | |||
| 345 | 345 | ||
| 346 | void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl, | 346 | void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl, |
| 347 | unsigned int nents, unsigned int flags); | 347 | unsigned int nents, unsigned int flags); |
| 348 | bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset); | ||
| 348 | bool sg_miter_next(struct sg_mapping_iter *miter); | 349 | bool sg_miter_next(struct sg_mapping_iter *miter); |
| 349 | void sg_miter_stop(struct sg_mapping_iter *miter); | 350 | void sg_miter_stop(struct sg_mapping_iter *miter); |
| 350 | 351 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 7e35d4b9e14a..68a0e84463a0 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -16,6 +16,7 @@ struct sched_param { | |||
| 16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
| 17 | #include <linux/timex.h> | 17 | #include <linux/timex.h> |
| 18 | #include <linux/jiffies.h> | 18 | #include <linux/jiffies.h> |
| 19 | #include <linux/plist.h> | ||
| 19 | #include <linux/rbtree.h> | 20 | #include <linux/rbtree.h> |
| 20 | #include <linux/thread_info.h> | 21 | #include <linux/thread_info.h> |
| 21 | #include <linux/cpumask.h> | 22 | #include <linux/cpumask.h> |
| @@ -56,6 +57,70 @@ struct sched_param { | |||
| 56 | 57 | ||
| 57 | #include <asm/processor.h> | 58 | #include <asm/processor.h> |
| 58 | 59 | ||
| 60 | #define SCHED_ATTR_SIZE_VER0 48 /* sizeof first published struct */ | ||
| 61 | |||
| 62 | /* | ||
| 63 | * Extended scheduling parameters data structure. | ||
| 64 | * | ||
| 65 | * This is needed because the original struct sched_param can not be | ||
| 66 | * altered without introducing ABI issues with legacy applications | ||
| 67 | * (e.g., in sched_getparam()). | ||
| 68 | * | ||
| 69 | * However, the possibility of specifying more than just a priority for | ||
| 70 | * the tasks may be useful for a wide variety of application fields, e.g., | ||
| 71 | * multimedia, streaming, automation and control, and many others. | ||
| 72 | * | ||
| 73 | * This variant (sched_attr) is meant at describing a so-called | ||
| 74 | * sporadic time-constrained task. In such model a task is specified by: | ||
| 75 | * - the activation period or minimum instance inter-arrival time; | ||
| 76 | * - the maximum (or average, depending on the actual scheduling | ||
| 77 | * discipline) computation time of all instances, a.k.a. runtime; | ||
| 78 | * - the deadline (relative to the actual activation time) of each | ||
| 79 | * instance. | ||
| 80 | * Very briefly, a periodic (sporadic) task asks for the execution of | ||
| 81 | * some specific computation --which is typically called an instance-- | ||
| 82 | * (at most) every period. Moreover, each instance typically lasts no more | ||
| 83 | * than the runtime and must be completed by time instant t equal to | ||
| 84 | * the instance activation time + the deadline. | ||
| 85 | * | ||
| 86 | * This is reflected by the actual fields of the sched_attr structure: | ||
| 87 | * | ||
| 88 | * @size size of the structure, for fwd/bwd compat. | ||
| 89 | * | ||
| 90 | * @sched_policy task's scheduling policy | ||
| 91 | * @sched_flags for customizing the scheduler behaviour | ||
| 92 | * @sched_nice task's nice value (SCHED_NORMAL/BATCH) | ||
| 93 | * @sched_priority task's static priority (SCHED_FIFO/RR) | ||
| 94 | * @sched_deadline representative of the task's deadline | ||
| 95 | * @sched_runtime representative of the task's runtime | ||
| 96 | * @sched_period representative of the task's period | ||
| 97 | * | ||
| 98 | * Given this task model, there are a multiplicity of scheduling algorithms | ||
| 99 | * and policies, that can be used to ensure all the tasks will make their | ||
| 100 | * timing constraints. | ||
| 101 | * | ||
| 102 | * As of now, the SCHED_DEADLINE policy (sched_dl scheduling class) is the | ||
| 103 | * only user of this new interface. More information about the algorithm | ||
| 104 | * available in the scheduling class file or in Documentation/. | ||
| 105 | */ | ||
| 106 | struct sched_attr { | ||
| 107 | u32 size; | ||
| 108 | |||
| 109 | u32 sched_policy; | ||
| 110 | u64 sched_flags; | ||
| 111 | |||
| 112 | /* SCHED_NORMAL, SCHED_BATCH */ | ||
| 113 | s32 sched_nice; | ||
| 114 | |||
| 115 | /* SCHED_FIFO, SCHED_RR */ | ||
| 116 | u32 sched_priority; | ||
| 117 | |||
| 118 | /* SCHED_DEADLINE */ | ||
| 119 | u64 sched_runtime; | ||
| 120 | u64 sched_deadline; | ||
| 121 | u64 sched_period; | ||
| 122 | }; | ||
| 123 | |||
| 59 | struct exec_domain; | 124 | struct exec_domain; |
| 60 | struct futex_pi_state; | 125 | struct futex_pi_state; |
| 61 | struct robust_list_head; | 126 | struct robust_list_head; |
| @@ -164,11 +229,10 @@ extern char ___assert_task_state[1 - 2*!!( | |||
| 164 | /* get_task_state() */ | 229 | /* get_task_state() */ |
| 165 | #define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \ | 230 | #define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \ |
| 166 | TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \ | 231 | TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \ |
| 167 | __TASK_TRACED) | 232 | __TASK_TRACED | EXIT_ZOMBIE | EXIT_DEAD) |
| 168 | 233 | ||
| 169 | #define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) | 234 | #define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) |
| 170 | #define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) | 235 | #define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) |
| 171 | #define task_is_dead(task) ((task)->exit_state != 0) | ||
| 172 | #define task_is_stopped_or_traced(task) \ | 236 | #define task_is_stopped_or_traced(task) \ |
| 173 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) | 237 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) |
| 174 | #define task_contributes_to_load(task) \ | 238 | #define task_contributes_to_load(task) \ |
| @@ -327,22 +391,33 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, | |||
| 327 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} | 391 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} |
| 328 | #endif | 392 | #endif |
| 329 | 393 | ||
| 330 | |||
| 331 | extern void set_dumpable(struct mm_struct *mm, int value); | ||
| 332 | extern int get_dumpable(struct mm_struct *mm); | ||
| 333 | |||
| 334 | #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ | 394 | #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ |
| 335 | #define SUID_DUMP_USER 1 /* Dump as user of process */ | 395 | #define SUID_DUMP_USER 1 /* Dump as user of process */ |
| 336 | #define SUID_DUMP_ROOT 2 /* Dump as root */ | 396 | #define SUID_DUMP_ROOT 2 /* Dump as root */ |
| 337 | 397 | ||
| 338 | /* mm flags */ | 398 | /* mm flags */ |
| 339 | /* dumpable bits */ | ||
| 340 | #define MMF_DUMPABLE 0 /* core dump is permitted */ | ||
| 341 | #define MMF_DUMP_SECURELY 1 /* core file is readable only by root */ | ||
| 342 | 399 | ||
| 400 | /* for SUID_DUMP_* above */ | ||
| 343 | #define MMF_DUMPABLE_BITS 2 | 401 | #define MMF_DUMPABLE_BITS 2 |
| 344 | #define MMF_DUMPABLE_MASK ((1 << MMF_DUMPABLE_BITS) - 1) | 402 | #define MMF_DUMPABLE_MASK ((1 << MMF_DUMPABLE_BITS) - 1) |
| 345 | 403 | ||
| 404 | extern void set_dumpable(struct mm_struct *mm, int value); | ||
| 405 | /* | ||
| 406 | * This returns the actual value of the suid_dumpable flag. For things | ||
| 407 | * that are using this for checking for privilege transitions, it must | ||
| 408 | * test against SUID_DUMP_USER rather than treating it as a boolean | ||
| 409 | * value. | ||
| 410 | */ | ||
| 411 | static inline int __get_dumpable(unsigned long mm_flags) | ||
| 412 | { | ||
| 413 | return mm_flags & MMF_DUMPABLE_MASK; | ||
| 414 | } | ||
| 415 | |||
| 416 | static inline int get_dumpable(struct mm_struct *mm) | ||
| 417 | { | ||
| 418 | return __get_dumpable(mm->flags); | ||
| 419 | } | ||
| 420 | |||
| 346 | /* coredump filter bits */ | 421 | /* coredump filter bits */ |
| 347 | #define MMF_DUMP_ANON_PRIVATE 2 | 422 | #define MMF_DUMP_ANON_PRIVATE 2 |
| 348 | #define MMF_DUMP_ANON_SHARED 3 | 423 | #define MMF_DUMP_ANON_SHARED 3 |
| @@ -440,8 +515,6 @@ struct task_cputime { | |||
| 440 | .sum_exec_runtime = 0, \ | 515 | .sum_exec_runtime = 0, \ |
| 441 | } | 516 | } |
| 442 | 517 | ||
| 443 | #define PREEMPT_ENABLED (PREEMPT_NEED_RESCHED) | ||
| 444 | |||
| 445 | #ifdef CONFIG_PREEMPT_COUNT | 518 | #ifdef CONFIG_PREEMPT_COUNT |
| 446 | #define PREEMPT_DISABLED (1 + PREEMPT_ENABLED) | 519 | #define PREEMPT_DISABLED (1 + PREEMPT_ENABLED) |
| 447 | #else | 520 | #else |
| @@ -487,6 +560,7 @@ struct signal_struct { | |||
| 487 | atomic_t sigcnt; | 560 | atomic_t sigcnt; |
| 488 | atomic_t live; | 561 | atomic_t live; |
| 489 | int nr_threads; | 562 | int nr_threads; |
| 563 | struct list_head thread_head; | ||
| 490 | 564 | ||
| 491 | wait_queue_head_t wait_chldexit; /* for wait4() */ | 565 | wait_queue_head_t wait_chldexit; /* for wait4() */ |
| 492 | 566 | ||
| @@ -831,8 +905,6 @@ struct sched_domain { | |||
| 831 | unsigned int balance_interval; /* initialise to 1. units in ms. */ | 905 | unsigned int balance_interval; /* initialise to 1. units in ms. */ |
| 832 | unsigned int nr_balance_failed; /* initialise to 0 */ | 906 | unsigned int nr_balance_failed; /* initialise to 0 */ |
| 833 | 907 | ||
| 834 | u64 last_update; | ||
| 835 | |||
| 836 | /* idle_balance() stats */ | 908 | /* idle_balance() stats */ |
| 837 | u64 max_newidle_lb_cost; | 909 | u64 max_newidle_lb_cost; |
| 838 | unsigned long next_decay_max_lb_cost; | 910 | unsigned long next_decay_max_lb_cost; |
| @@ -934,7 +1006,8 @@ struct pipe_inode_info; | |||
| 934 | struct uts_namespace; | 1006 | struct uts_namespace; |
| 935 | 1007 | ||
| 936 | struct load_weight { | 1008 | struct load_weight { |
| 937 | unsigned long weight, inv_weight; | 1009 | unsigned long weight; |
| 1010 | u32 inv_weight; | ||
| 938 | }; | 1011 | }; |
| 939 | 1012 | ||
| 940 | struct sched_avg { | 1013 | struct sched_avg { |
| @@ -1032,6 +1105,51 @@ struct sched_rt_entity { | |||
| 1032 | #endif | 1105 | #endif |
| 1033 | }; | 1106 | }; |
| 1034 | 1107 | ||
| 1108 | struct sched_dl_entity { | ||
| 1109 | struct rb_node rb_node; | ||
| 1110 | |||
| 1111 | /* | ||
| 1112 | * Original scheduling parameters. Copied here from sched_attr | ||
| 1113 | * during sched_setscheduler2(), they will remain the same until | ||
| 1114 | * the next sched_setscheduler2(). | ||
| 1115 | */ | ||
| 1116 | u64 dl_runtime; /* maximum runtime for each instance */ | ||
| 1117 | u64 dl_deadline; /* relative deadline of each instance */ | ||
| 1118 | u64 dl_period; /* separation of two instances (period) */ | ||
| 1119 | u64 dl_bw; /* dl_runtime / dl_deadline */ | ||
| 1120 | |||
| 1121 | /* | ||
| 1122 | * Actual scheduling parameters. Initialized with the values above, | ||
| 1123 | * they are continously updated during task execution. Note that | ||
| 1124 | * the remaining runtime could be < 0 in case we are in overrun. | ||
| 1125 | */ | ||
| 1126 | s64 runtime; /* remaining runtime for this instance */ | ||
| 1127 | u64 deadline; /* absolute deadline for this instance */ | ||
| 1128 | unsigned int flags; /* specifying the scheduler behaviour */ | ||
| 1129 | |||
| 1130 | /* | ||
| 1131 | * Some bool flags: | ||
| 1132 | * | ||
| 1133 | * @dl_throttled tells if we exhausted the runtime. If so, the | ||
| 1134 | * task has to wait for a replenishment to be performed at the | ||
| 1135 | * next firing of dl_timer. | ||
| 1136 | * | ||
| 1137 | * @dl_new tells if a new instance arrived. If so we must | ||
| 1138 | * start executing it with full runtime and reset its absolute | ||
| 1139 | * deadline; | ||
| 1140 | * | ||
| 1141 | * @dl_boosted tells if we are boosted due to DI. If so we are | ||
| 1142 | * outside bandwidth enforcement mechanism (but only until we | ||
| 1143 | * exit the critical section). | ||
| 1144 | */ | ||
| 1145 | int dl_throttled, dl_new, dl_boosted; | ||
| 1146 | |||
| 1147 | /* | ||
| 1148 | * Bandwidth enforcement timer. Each -deadline task has its | ||
| 1149 | * own bandwidth to be enforced, thus we need one timer per task. | ||
| 1150 | */ | ||
| 1151 | struct hrtimer dl_timer; | ||
| 1152 | }; | ||
| 1035 | 1153 | ||
| 1036 | struct rcu_node; | 1154 | struct rcu_node; |
| 1037 | 1155 | ||
| @@ -1068,6 +1186,7 @@ struct task_struct { | |||
| 1068 | #ifdef CONFIG_CGROUP_SCHED | 1186 | #ifdef CONFIG_CGROUP_SCHED |
| 1069 | struct task_group *sched_task_group; | 1187 | struct task_group *sched_task_group; |
| 1070 | #endif | 1188 | #endif |
| 1189 | struct sched_dl_entity dl; | ||
| 1071 | 1190 | ||
| 1072 | #ifdef CONFIG_PREEMPT_NOTIFIERS | 1191 | #ifdef CONFIG_PREEMPT_NOTIFIERS |
| 1073 | /* list of struct preempt_notifier: */ | 1192 | /* list of struct preempt_notifier: */ |
| @@ -1101,6 +1220,7 @@ struct task_struct { | |||
| 1101 | struct list_head tasks; | 1220 | struct list_head tasks; |
| 1102 | #ifdef CONFIG_SMP | 1221 | #ifdef CONFIG_SMP |
| 1103 | struct plist_node pushable_tasks; | 1222 | struct plist_node pushable_tasks; |
| 1223 | struct rb_node pushable_dl_tasks; | ||
| 1104 | #endif | 1224 | #endif |
| 1105 | 1225 | ||
| 1106 | struct mm_struct *mm, *active_mm; | 1226 | struct mm_struct *mm, *active_mm; |
| @@ -1119,7 +1239,6 @@ struct task_struct { | |||
| 1119 | /* Used for emulating ABI behavior of previous Linux versions */ | 1239 | /* Used for emulating ABI behavior of previous Linux versions */ |
| 1120 | unsigned int personality; | 1240 | unsigned int personality; |
| 1121 | 1241 | ||
| 1122 | unsigned did_exec:1; | ||
| 1123 | unsigned in_execve:1; /* Tell the LSMs that the process is doing an | 1242 | unsigned in_execve:1; /* Tell the LSMs that the process is doing an |
| 1124 | * execve */ | 1243 | * execve */ |
| 1125 | unsigned in_iowait:1; | 1244 | unsigned in_iowait:1; |
| @@ -1163,6 +1282,7 @@ struct task_struct { | |||
| 1163 | /* PID/PID hash table linkage. */ | 1282 | /* PID/PID hash table linkage. */ |
| 1164 | struct pid_link pids[PIDTYPE_MAX]; | 1283 | struct pid_link pids[PIDTYPE_MAX]; |
| 1165 | struct list_head thread_group; | 1284 | struct list_head thread_group; |
| 1285 | struct list_head thread_node; | ||
| 1166 | 1286 | ||
| 1167 | struct completion *vfork_done; /* for vfork() */ | 1287 | struct completion *vfork_done; /* for vfork() */ |
| 1168 | int __user *set_child_tid; /* CLONE_CHILD_SETTID */ | 1288 | int __user *set_child_tid; /* CLONE_CHILD_SETTID */ |
| @@ -1252,9 +1372,12 @@ struct task_struct { | |||
| 1252 | 1372 | ||
| 1253 | #ifdef CONFIG_RT_MUTEXES | 1373 | #ifdef CONFIG_RT_MUTEXES |
| 1254 | /* PI waiters blocked on a rt_mutex held by this task */ | 1374 | /* PI waiters blocked on a rt_mutex held by this task */ |
| 1255 | struct plist_head pi_waiters; | 1375 | struct rb_root pi_waiters; |
| 1376 | struct rb_node *pi_waiters_leftmost; | ||
| 1256 | /* Deadlock detection and priority inheritance handling */ | 1377 | /* Deadlock detection and priority inheritance handling */ |
| 1257 | struct rt_mutex_waiter *pi_blocked_on; | 1378 | struct rt_mutex_waiter *pi_blocked_on; |
| 1379 | /* Top pi_waiters task */ | ||
| 1380 | struct task_struct *pi_top_task; | ||
| 1258 | #endif | 1381 | #endif |
| 1259 | 1382 | ||
| 1260 | #ifdef CONFIG_DEBUG_MUTEXES | 1383 | #ifdef CONFIG_DEBUG_MUTEXES |
| @@ -1883,7 +2006,9 @@ static inline void sched_clock_idle_wakeup_event(u64 delta_ns) | |||
| 1883 | * but then during bootup it turns out that sched_clock() | 2006 | * but then during bootup it turns out that sched_clock() |
| 1884 | * is reliable after all: | 2007 | * is reliable after all: |
| 1885 | */ | 2008 | */ |
| 1886 | extern int sched_clock_stable; | 2009 | extern int sched_clock_stable(void); |
| 2010 | extern void set_sched_clock_stable(void); | ||
| 2011 | extern void clear_sched_clock_stable(void); | ||
| 1887 | 2012 | ||
| 1888 | extern void sched_clock_tick(void); | 2013 | extern void sched_clock_tick(void); |
| 1889 | extern void sched_clock_idle_sleep_event(void); | 2014 | extern void sched_clock_idle_sleep_event(void); |
| @@ -1962,6 +2087,8 @@ extern int sched_setscheduler(struct task_struct *, int, | |||
| 1962 | const struct sched_param *); | 2087 | const struct sched_param *); |
| 1963 | extern int sched_setscheduler_nocheck(struct task_struct *, int, | 2088 | extern int sched_setscheduler_nocheck(struct task_struct *, int, |
| 1964 | const struct sched_param *); | 2089 | const struct sched_param *); |
| 2090 | extern int sched_setattr(struct task_struct *, | ||
| 2091 | const struct sched_attr *); | ||
| 1965 | extern struct task_struct *idle_task(int cpu); | 2092 | extern struct task_struct *idle_task(int cpu); |
| 1966 | /** | 2093 | /** |
| 1967 | * is_idle_task - is the specified task an idle task? | 2094 | * is_idle_task - is the specified task an idle task? |
| @@ -2041,7 +2168,7 @@ extern void wake_up_new_task(struct task_struct *tsk); | |||
| 2041 | #else | 2168 | #else |
| 2042 | static inline void kick_process(struct task_struct *tsk) { } | 2169 | static inline void kick_process(struct task_struct *tsk) { } |
| 2043 | #endif | 2170 | #endif |
| 2044 | extern void sched_fork(unsigned long clone_flags, struct task_struct *p); | 2171 | extern int sched_fork(unsigned long clone_flags, struct task_struct *p); |
| 2045 | extern void sched_dead(struct task_struct *p); | 2172 | extern void sched_dead(struct task_struct *p); |
| 2046 | 2173 | ||
| 2047 | extern void proc_caches_init(void); | 2174 | extern void proc_caches_init(void); |
| @@ -2167,8 +2294,6 @@ extern struct mm_struct *get_task_mm(struct task_struct *task); | |||
| 2167 | extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode); | 2294 | extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode); |
| 2168 | /* Remove the current tasks stale references to the old mm_struct */ | 2295 | /* Remove the current tasks stale references to the old mm_struct */ |
| 2169 | extern void mm_release(struct task_struct *, struct mm_struct *); | 2296 | extern void mm_release(struct task_struct *, struct mm_struct *); |
| 2170 | /* Allocate a new mm structure and copy contents from tsk->mm */ | ||
| 2171 | extern struct mm_struct *dup_mm(struct task_struct *tsk); | ||
| 2172 | 2297 | ||
| 2173 | extern int copy_thread(unsigned long, unsigned long, unsigned long, | 2298 | extern int copy_thread(unsigned long, unsigned long, unsigned long, |
| 2174 | struct task_struct *); | 2299 | struct task_struct *); |
| @@ -2226,6 +2351,16 @@ extern bool current_is_single_threaded(void); | |||
| 2226 | #define while_each_thread(g, t) \ | 2351 | #define while_each_thread(g, t) \ |
| 2227 | while ((t = next_thread(t)) != g) | 2352 | while ((t = next_thread(t)) != g) |
| 2228 | 2353 | ||
| 2354 | #define __for_each_thread(signal, t) \ | ||
| 2355 | list_for_each_entry_rcu(t, &(signal)->thread_head, thread_node) | ||
| 2356 | |||
| 2357 | #define for_each_thread(p, t) \ | ||
| 2358 | __for_each_thread((p)->signal, t) | ||
| 2359 | |||
| 2360 | /* Careful: this is a double loop, 'break' won't work as expected. */ | ||
| 2361 | #define for_each_process_thread(p, t) \ | ||
| 2362 | for_each_process(p) for_each_thread(p, t) | ||
| 2363 | |||
| 2229 | static inline int get_nr_threads(struct task_struct *tsk) | 2364 | static inline int get_nr_threads(struct task_struct *tsk) |
| 2230 | { | 2365 | { |
| 2231 | return tsk->signal->nr_threads; | 2366 | return tsk->signal->nr_threads; |
| @@ -2630,6 +2765,21 @@ static inline bool __must_check current_clr_polling_and_test(void) | |||
| 2630 | } | 2765 | } |
| 2631 | #endif | 2766 | #endif |
| 2632 | 2767 | ||
| 2768 | static inline void current_clr_polling(void) | ||
| 2769 | { | ||
| 2770 | __current_clr_polling(); | ||
| 2771 | |||
| 2772 | /* | ||
| 2773 | * Ensure we check TIF_NEED_RESCHED after we clear the polling bit. | ||
| 2774 | * Once the bit is cleared, we'll get IPIs with every new | ||
| 2775 | * TIF_NEED_RESCHED and the IPI handler, scheduler_ipi(), will also | ||
| 2776 | * fold. | ||
| 2777 | */ | ||
| 2778 | smp_mb(); /* paired with resched_task() */ | ||
| 2779 | |||
| 2780 | preempt_fold_need_resched(); | ||
| 2781 | } | ||
| 2782 | |||
| 2633 | static __always_inline bool need_resched(void) | 2783 | static __always_inline bool need_resched(void) |
| 2634 | { | 2784 | { |
| 2635 | return unlikely(tif_need_resched()); | 2785 | return unlikely(tif_need_resched()); |
diff --git a/include/linux/sched/deadline.h b/include/linux/sched/deadline.h new file mode 100644 index 000000000000..9d303b8847df --- /dev/null +++ b/include/linux/sched/deadline.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | #ifndef _SCHED_DEADLINE_H | ||
| 2 | #define _SCHED_DEADLINE_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * SCHED_DEADLINE tasks has negative priorities, reflecting | ||
| 6 | * the fact that any of them has higher prio than RT and | ||
| 7 | * NORMAL/BATCH tasks. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #define MAX_DL_PRIO 0 | ||
| 11 | |||
| 12 | static inline int dl_prio(int prio) | ||
| 13 | { | ||
| 14 | if (unlikely(prio < MAX_DL_PRIO)) | ||
| 15 | return 1; | ||
| 16 | return 0; | ||
| 17 | } | ||
| 18 | |||
| 19 | static inline int dl_task(struct task_struct *p) | ||
| 20 | { | ||
| 21 | return dl_prio(p->prio); | ||
| 22 | } | ||
| 23 | |||
| 24 | #endif /* _SCHED_DEADLINE_H */ | ||
diff --git a/include/linux/sched/rt.h b/include/linux/sched/rt.h index 440434df3627..34e4ebea8fce 100644 --- a/include/linux/sched/rt.h +++ b/include/linux/sched/rt.h | |||
| @@ -35,6 +35,7 @@ static inline int rt_task(struct task_struct *p) | |||
| 35 | #ifdef CONFIG_RT_MUTEXES | 35 | #ifdef CONFIG_RT_MUTEXES |
| 36 | extern int rt_mutex_getprio(struct task_struct *p); | 36 | extern int rt_mutex_getprio(struct task_struct *p); |
| 37 | extern void rt_mutex_setprio(struct task_struct *p, int prio); | 37 | extern void rt_mutex_setprio(struct task_struct *p, int prio); |
| 38 | extern struct task_struct *rt_mutex_get_top_task(struct task_struct *task); | ||
| 38 | extern void rt_mutex_adjust_pi(struct task_struct *p); | 39 | extern void rt_mutex_adjust_pi(struct task_struct *p); |
| 39 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) | 40 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) |
| 40 | { | 41 | { |
| @@ -45,6 +46,10 @@ static inline int rt_mutex_getprio(struct task_struct *p) | |||
| 45 | { | 46 | { |
| 46 | return p->normal_prio; | 47 | return p->normal_prio; |
| 47 | } | 48 | } |
| 49 | static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *task) | ||
| 50 | { | ||
| 51 | return NULL; | ||
| 52 | } | ||
| 48 | # define rt_mutex_adjust_pi(p) do { } while (0) | 53 | # define rt_mutex_adjust_pi(p) do { } while (0) |
| 49 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) | 54 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) |
| 50 | { | 55 | { |
diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index 41467f8ff8ec..b13cf430764f 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h | |||
| @@ -48,7 +48,6 @@ extern unsigned int sysctl_numa_balancing_scan_delay; | |||
| 48 | extern unsigned int sysctl_numa_balancing_scan_period_min; | 48 | extern unsigned int sysctl_numa_balancing_scan_period_min; |
| 49 | extern unsigned int sysctl_numa_balancing_scan_period_max; | 49 | extern unsigned int sysctl_numa_balancing_scan_period_max; |
| 50 | extern unsigned int sysctl_numa_balancing_scan_size; | 50 | extern unsigned int sysctl_numa_balancing_scan_size; |
| 51 | extern unsigned int sysctl_numa_balancing_settle_count; | ||
| 52 | 51 | ||
| 53 | #ifdef CONFIG_SCHED_DEBUG | 52 | #ifdef CONFIG_SCHED_DEBUG |
| 54 | extern unsigned int sysctl_sched_migration_cost; | 53 | extern unsigned int sysctl_sched_migration_cost; |
| @@ -100,4 +99,8 @@ extern int sched_rt_handler(struct ctl_table *table, int write, | |||
| 100 | void __user *buffer, size_t *lenp, | 99 | void __user *buffer, size_t *lenp, |
| 101 | loff_t *ppos); | 100 | loff_t *ppos); |
| 102 | 101 | ||
| 102 | extern int sysctl_numa_balancing(struct ctl_table *table, int write, | ||
| 103 | void __user *buffer, size_t *lenp, | ||
| 104 | loff_t *ppos); | ||
| 105 | |||
| 103 | #endif /* _SCHED_SYSCTL_H */ | 106 | #endif /* _SCHED_SYSCTL_H */ |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index cf87a24c0f92..535f158977b9 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
| @@ -117,15 +117,15 @@ repeat: | |||
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | /** | 119 | /** |
| 120 | * read_seqcount_begin_no_lockdep - start seq-read critical section w/o lockdep | 120 | * raw_read_seqcount_begin - start seq-read critical section w/o lockdep |
| 121 | * @s: pointer to seqcount_t | 121 | * @s: pointer to seqcount_t |
| 122 | * Returns: count to be passed to read_seqcount_retry | 122 | * Returns: count to be passed to read_seqcount_retry |
| 123 | * | 123 | * |
| 124 | * read_seqcount_begin_no_lockdep opens a read critical section of the given | 124 | * raw_read_seqcount_begin opens a read critical section of the given |
| 125 | * seqcount, but without any lockdep checking. Validity of the critical | 125 | * seqcount, but without any lockdep checking. Validity of the critical |
| 126 | * section is tested by checking read_seqcount_retry function. | 126 | * section is tested by checking read_seqcount_retry function. |
| 127 | */ | 127 | */ |
| 128 | static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s) | 128 | static inline unsigned raw_read_seqcount_begin(const seqcount_t *s) |
| 129 | { | 129 | { |
| 130 | unsigned ret = __read_seqcount_begin(s); | 130 | unsigned ret = __read_seqcount_begin(s); |
| 131 | smp_rmb(); | 131 | smp_rmb(); |
| @@ -144,7 +144,7 @@ static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s) | |||
| 144 | static inline unsigned read_seqcount_begin(const seqcount_t *s) | 144 | static inline unsigned read_seqcount_begin(const seqcount_t *s) |
| 145 | { | 145 | { |
| 146 | seqcount_lockdep_reader_access(s); | 146 | seqcount_lockdep_reader_access(s); |
| 147 | return read_seqcount_begin_no_lockdep(s); | 147 | return raw_read_seqcount_begin(s); |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | /** | 150 | /** |
| @@ -206,14 +206,26 @@ static inline int read_seqcount_retry(const seqcount_t *s, unsigned start) | |||
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | 208 | ||
| 209 | |||
| 210 | static inline void raw_write_seqcount_begin(seqcount_t *s) | ||
| 211 | { | ||
| 212 | s->sequence++; | ||
| 213 | smp_wmb(); | ||
| 214 | } | ||
| 215 | |||
| 216 | static inline void raw_write_seqcount_end(seqcount_t *s) | ||
| 217 | { | ||
| 218 | smp_wmb(); | ||
| 219 | s->sequence++; | ||
| 220 | } | ||
| 221 | |||
| 209 | /* | 222 | /* |
| 210 | * Sequence counter only version assumes that callers are using their | 223 | * Sequence counter only version assumes that callers are using their |
| 211 | * own mutexing. | 224 | * own mutexing. |
| 212 | */ | 225 | */ |
| 213 | static inline void write_seqcount_begin_nested(seqcount_t *s, int subclass) | 226 | static inline void write_seqcount_begin_nested(seqcount_t *s, int subclass) |
| 214 | { | 227 | { |
| 215 | s->sequence++; | 228 | raw_write_seqcount_begin(s); |
| 216 | smp_wmb(); | ||
| 217 | seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_); | 229 | seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_); |
| 218 | } | 230 | } |
| 219 | 231 | ||
| @@ -225,8 +237,7 @@ static inline void write_seqcount_begin(seqcount_t *s) | |||
| 225 | static inline void write_seqcount_end(seqcount_t *s) | 237 | static inline void write_seqcount_end(seqcount_t *s) |
| 226 | { | 238 | { |
| 227 | seqcount_release(&s->dep_map, 1, _RET_IP_); | 239 | seqcount_release(&s->dep_map, 1, _RET_IP_); |
| 228 | smp_wmb(); | 240 | raw_write_seqcount_end(s); |
| 229 | s->sequence++; | ||
| 230 | } | 241 | } |
| 231 | 242 | ||
| 232 | /** | 243 | /** |
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index 50fe651da965..22b3640c9424 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
| @@ -10,15 +10,6 @@ | |||
| 10 | 10 | ||
| 11 | #define SCIx_NOT_SUPPORTED (-1) | 11 | #define SCIx_NOT_SUPPORTED (-1) |
| 12 | 12 | ||
| 13 | enum { | ||
| 14 | SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */ | ||
| 15 | SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */ | ||
| 16 | SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */ | ||
| 17 | SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */ | ||
| 18 | SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */ | ||
| 19 | SCBRR_ALGO_6, /* HSCIF variable sample rate algorithm */ | ||
| 20 | }; | ||
| 21 | |||
| 22 | #define SCSCR_TIE (1 << 7) | 13 | #define SCSCR_TIE (1 << 7) |
| 23 | #define SCSCR_RIE (1 << 6) | 14 | #define SCSCR_RIE (1 << 6) |
| 24 | #define SCSCR_TE (1 << 5) | 15 | #define SCSCR_TE (1 << 5) |
| @@ -59,28 +50,6 @@ enum { | |||
| 59 | /* HSSRR HSCIF */ | 50 | /* HSSRR HSCIF */ |
| 60 | #define HSCIF_SRE 0x8000 | 51 | #define HSCIF_SRE 0x8000 |
| 61 | 52 | ||
| 62 | /* Offsets into the sci_port->irqs array */ | ||
| 63 | enum { | ||
| 64 | SCIx_ERI_IRQ, | ||
| 65 | SCIx_RXI_IRQ, | ||
| 66 | SCIx_TXI_IRQ, | ||
| 67 | SCIx_BRI_IRQ, | ||
| 68 | SCIx_NR_IRQS, | ||
| 69 | |||
| 70 | SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */ | ||
| 71 | }; | ||
| 72 | |||
| 73 | /* Offsets into the sci_port->gpios array */ | ||
| 74 | enum { | ||
| 75 | SCIx_SCK, | ||
| 76 | SCIx_RXD, | ||
| 77 | SCIx_TXD, | ||
| 78 | SCIx_CTS, | ||
| 79 | SCIx_RTS, | ||
| 80 | |||
| 81 | SCIx_NR_FNS, | ||
| 82 | }; | ||
| 83 | |||
| 84 | enum { | 53 | enum { |
| 85 | SCIx_PROBE_REGTYPE, | 54 | SCIx_PROBE_REGTYPE, |
| 86 | 55 | ||
| @@ -99,19 +68,6 @@ enum { | |||
| 99 | SCIx_NR_REGTYPES, | 68 | SCIx_NR_REGTYPES, |
| 100 | }; | 69 | }; |
| 101 | 70 | ||
| 102 | #define SCIx_IRQ_MUXED(irq) \ | ||
| 103 | { \ | ||
| 104 | [SCIx_ERI_IRQ] = (irq), \ | ||
| 105 | [SCIx_RXI_IRQ] = (irq), \ | ||
| 106 | [SCIx_TXI_IRQ] = (irq), \ | ||
| 107 | [SCIx_BRI_IRQ] = (irq), \ | ||
| 108 | } | ||
| 109 | |||
| 110 | #define SCIx_IRQ_IS_MUXED(port) \ | ||
| 111 | ((port)->cfg->irqs[SCIx_ERI_IRQ] == \ | ||
| 112 | (port)->cfg->irqs[SCIx_RXI_IRQ]) || \ | ||
| 113 | ((port)->cfg->irqs[SCIx_ERI_IRQ] && \ | ||
| 114 | !(port)->cfg->irqs[SCIx_RXI_IRQ]) | ||
| 115 | /* | 71 | /* |
| 116 | * SCI register subset common for all port types. | 72 | * SCI register subset common for all port types. |
| 117 | * Not all registers will exist on all parts. | 73 | * Not all registers will exist on all parts. |
| @@ -140,22 +96,16 @@ struct plat_sci_port_ops { | |||
| 140 | * Platform device specific platform_data struct | 96 | * Platform device specific platform_data struct |
| 141 | */ | 97 | */ |
| 142 | struct plat_sci_port { | 98 | struct plat_sci_port { |
| 143 | unsigned long mapbase; /* resource base */ | ||
| 144 | unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */ | ||
| 145 | unsigned int gpios[SCIx_NR_FNS]; /* SCK, RXD, TXD, CTS, RTS */ | ||
| 146 | unsigned int type; /* SCI / SCIF / IRDA / HSCIF */ | 99 | unsigned int type; /* SCI / SCIF / IRDA / HSCIF */ |
| 147 | upf_t flags; /* UPF_* flags */ | 100 | upf_t flags; /* UPF_* flags */ |
| 148 | unsigned long capabilities; /* Port features/capabilities */ | 101 | unsigned long capabilities; /* Port features/capabilities */ |
| 149 | 102 | ||
| 150 | unsigned int scbrr_algo_id; /* SCBRR calculation algo */ | 103 | unsigned int sampling_rate; |
| 151 | unsigned int scscr; /* SCSCR initialization */ | 104 | unsigned int scscr; /* SCSCR initialization */ |
| 152 | 105 | ||
| 153 | /* | 106 | /* |
| 154 | * Platform overrides if necessary, defaults otherwise. | 107 | * Platform overrides if necessary, defaults otherwise. |
| 155 | */ | 108 | */ |
| 156 | int overrun_bit; | ||
| 157 | unsigned int error_mask; | ||
| 158 | |||
| 159 | int port_reg; | 109 | int port_reg; |
| 160 | unsigned char regshift; | 110 | unsigned char regshift; |
| 161 | unsigned char regtype; | 111 | unsigned char regtype; |
diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h index 2cfcb7944a49..4723bbfa1c26 100644 --- a/include/linux/sfi_acpi.h +++ b/include/linux/sfi_acpi.h | |||
| @@ -59,6 +59,9 @@ | |||
| 59 | #ifndef _LINUX_SFI_ACPI_H | 59 | #ifndef _LINUX_SFI_ACPI_H |
| 60 | #define _LINUX_SFI_ACPI_H | 60 | #define _LINUX_SFI_ACPI_H |
| 61 | 61 | ||
| 62 | #include <linux/acpi.h> | ||
| 63 | #include <linux/sfi.h> | ||
| 64 | |||
| 62 | #ifdef CONFIG_SFI | 65 | #ifdef CONFIG_SFI |
| 63 | #include <acpi/acpi.h> /* FIXME: inclusion should be removed */ | 66 | #include <acpi/acpi.h> /* FIXME: inclusion should be removed */ |
| 64 | 67 | ||
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 30aa0dc60d75..9d55438bc4ad 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
| @@ -47,6 +47,8 @@ extern int shmem_init(void); | |||
| 47 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); | 47 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); |
| 48 | extern struct file *shmem_file_setup(const char *name, | 48 | extern struct file *shmem_file_setup(const char *name, |
| 49 | loff_t size, unsigned long flags); | 49 | loff_t size, unsigned long flags); |
| 50 | extern struct file *shmem_kernel_file_setup(const char *name, loff_t size, | ||
| 51 | unsigned long flags); | ||
| 50 | extern int shmem_zero_setup(struct vm_area_struct *); | 52 | extern int shmem_zero_setup(struct vm_area_struct *); |
| 51 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); | 53 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); |
| 52 | extern void shmem_unlock_mapping(struct address_space *mapping); | 54 | extern void shmem_unlock_mapping(struct address_space *mapping); |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index bec1cc7d5e3c..6f69b3f914fb 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -1638,6 +1638,11 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset) | |||
| 1638 | skb->mac_header += offset; | 1638 | skb->mac_header += offset; |
| 1639 | } | 1639 | } |
| 1640 | 1640 | ||
| 1641 | static inline void skb_pop_mac_header(struct sk_buff *skb) | ||
| 1642 | { | ||
| 1643 | skb->mac_header = skb->network_header; | ||
| 1644 | } | ||
| 1645 | |||
| 1641 | static inline void skb_probe_transport_header(struct sk_buff *skb, | 1646 | static inline void skb_probe_transport_header(struct sk_buff *skb, |
| 1642 | const int offset_hint) | 1647 | const int offset_hint) |
| 1643 | { | 1648 | { |
| @@ -2263,6 +2268,24 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb, | |||
| 2263 | 2268 | ||
| 2264 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); | 2269 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); |
| 2265 | 2270 | ||
| 2271 | /** | ||
| 2272 | * pskb_trim_rcsum - trim received skb and update checksum | ||
| 2273 | * @skb: buffer to trim | ||
| 2274 | * @len: new length | ||
| 2275 | * | ||
| 2276 | * This is exactly the same as pskb_trim except that it ensures the | ||
| 2277 | * checksum of received packets are still valid after the operation. | ||
| 2278 | */ | ||
| 2279 | |||
| 2280 | static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | ||
| 2281 | { | ||
| 2282 | if (likely(len >= skb->len)) | ||
| 2283 | return 0; | ||
| 2284 | if (skb->ip_summed == CHECKSUM_COMPLETE) | ||
| 2285 | skb->ip_summed = CHECKSUM_NONE; | ||
| 2286 | return __pskb_trim(skb, len); | ||
| 2287 | } | ||
| 2288 | |||
| 2266 | #define skb_queue_walk(queue, skb) \ | 2289 | #define skb_queue_walk(queue, skb) \ |
| 2267 | for (skb = (queue)->next; \ | 2290 | for (skb = (queue)->next; \ |
| 2268 | skb != (struct sk_buff *)(queue); \ | 2291 | skb != (struct sk_buff *)(queue); \ |
| @@ -2360,27 +2383,6 @@ __wsum __skb_checksum(const struct sk_buff *skb, int offset, int len, | |||
| 2360 | __wsum skb_checksum(const struct sk_buff *skb, int offset, int len, | 2383 | __wsum skb_checksum(const struct sk_buff *skb, int offset, int len, |
| 2361 | __wsum csum); | 2384 | __wsum csum); |
| 2362 | 2385 | ||
| 2363 | /** | ||
| 2364 | * pskb_trim_rcsum - trim received skb and update checksum | ||
| 2365 | * @skb: buffer to trim | ||
| 2366 | * @len: new length | ||
| 2367 | * | ||
| 2368 | * This is exactly the same as pskb_trim except that it ensures the | ||
| 2369 | * checksum of received packets are still valid after the operation. | ||
| 2370 | */ | ||
| 2371 | |||
| 2372 | static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | ||
| 2373 | { | ||
| 2374 | if (likely(len >= skb->len)) | ||
| 2375 | return 0; | ||
| 2376 | if (skb->ip_summed == CHECKSUM_COMPLETE) { | ||
| 2377 | __wsum adj = skb_checksum(skb, len, skb->len - len, 0); | ||
| 2378 | |||
| 2379 | skb->csum = csum_sub(skb->csum, adj); | ||
| 2380 | } | ||
| 2381 | return __pskb_trim(skb, len); | ||
| 2382 | } | ||
| 2383 | |||
| 2384 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | 2386 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, |
| 2385 | int len, void *buffer) | 2387 | int len, void *buffer) |
| 2386 | { | 2388 | { |
| @@ -2529,6 +2531,10 @@ static inline void sw_tx_timestamp(struct sk_buff *skb) | |||
| 2529 | * Ethernet MAC Drivers should call this function in their hard_xmit() | 2531 | * Ethernet MAC Drivers should call this function in their hard_xmit() |
| 2530 | * function immediately before giving the sk_buff to the MAC hardware. | 2532 | * function immediately before giving the sk_buff to the MAC hardware. |
| 2531 | * | 2533 | * |
| 2534 | * Specifically, one should make absolutely sure that this function is | ||
| 2535 | * called before TX completion of this packet can trigger. Otherwise | ||
| 2536 | * the packet could potentially already be freed. | ||
| 2537 | * | ||
| 2532 | * @skb: A socket buffer. | 2538 | * @skb: A socket buffer. |
| 2533 | */ | 2539 | */ |
| 2534 | static inline void skb_tx_timestamp(struct sk_buff *skb) | 2540 | static inline void skb_tx_timestamp(struct sk_buff *skb) |
diff --git a/include/linux/slab.h b/include/linux/slab.h index c2bba248fa63..a060142aa5f5 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -388,10 +388,55 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags) | |||
| 388 | /** | 388 | /** |
| 389 | * kmalloc - allocate memory | 389 | * kmalloc - allocate memory |
| 390 | * @size: how many bytes of memory are required. | 390 | * @size: how many bytes of memory are required. |
| 391 | * @flags: the type of memory to allocate (see kcalloc). | 391 | * @flags: the type of memory to allocate. |
| 392 | * | 392 | * |
| 393 | * kmalloc is the normal method of allocating memory | 393 | * kmalloc is the normal method of allocating memory |
| 394 | * for objects smaller than page size in the kernel. | 394 | * for objects smaller than page size in the kernel. |
| 395 | * | ||
| 396 | * The @flags argument may be one of: | ||
| 397 | * | ||
| 398 | * %GFP_USER - Allocate memory on behalf of user. May sleep. | ||
| 399 | * | ||
| 400 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. | ||
| 401 | * | ||
| 402 | * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. | ||
| 403 | * For example, use this inside interrupt handlers. | ||
| 404 | * | ||
| 405 | * %GFP_HIGHUSER - Allocate pages from high memory. | ||
| 406 | * | ||
| 407 | * %GFP_NOIO - Do not do any I/O at all while trying to get memory. | ||
| 408 | * | ||
| 409 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. | ||
| 410 | * | ||
| 411 | * %GFP_NOWAIT - Allocation will not sleep. | ||
| 412 | * | ||
| 413 | * %GFP_THISNODE - Allocate node-local memory only. | ||
| 414 | * | ||
| 415 | * %GFP_DMA - Allocation suitable for DMA. | ||
| 416 | * Should only be used for kmalloc() caches. Otherwise, use a | ||
| 417 | * slab created with SLAB_DMA. | ||
| 418 | * | ||
| 419 | * Also it is possible to set different flags by OR'ing | ||
| 420 | * in one or more of the following additional @flags: | ||
| 421 | * | ||
| 422 | * %__GFP_COLD - Request cache-cold pages instead of | ||
| 423 | * trying to return cache-warm pages. | ||
| 424 | * | ||
| 425 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. | ||
| 426 | * | ||
| 427 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail | ||
| 428 | * (think twice before using). | ||
| 429 | * | ||
| 430 | * %__GFP_NORETRY - If memory is not immediately available, | ||
| 431 | * then give up at once. | ||
| 432 | * | ||
| 433 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. | ||
| 434 | * | ||
| 435 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. | ||
| 436 | * | ||
| 437 | * There are other flags available as well, but these are not intended | ||
| 438 | * for general use, and so are not documented here. For a full list of | ||
| 439 | * potential flags, always refer to linux/gfp.h. | ||
| 395 | */ | 440 | */ |
| 396 | static __always_inline void *kmalloc(size_t size, gfp_t flags) | 441 | static __always_inline void *kmalloc(size_t size, gfp_t flags) |
| 397 | { | 442 | { |
| @@ -468,7 +513,9 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
| 468 | * | 513 | * |
| 469 | * Both the root cache and the child caches will have it. For the root cache, | 514 | * Both the root cache and the child caches will have it. For the root cache, |
| 470 | * this will hold a dynamically allocated array large enough to hold | 515 | * this will hold a dynamically allocated array large enough to hold |
| 471 | * information about the currently limited memcgs in the system. | 516 | * information about the currently limited memcgs in the system. To allow the |
| 517 | * array to be accessed without taking any locks, on relocation we free the old | ||
| 518 | * version only after a grace period. | ||
| 472 | * | 519 | * |
| 473 | * Child caches will hold extra metadata needed for its operation. Fields are: | 520 | * Child caches will hold extra metadata needed for its operation. Fields are: |
| 474 | * | 521 | * |
| @@ -483,7 +530,10 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
| 483 | struct memcg_cache_params { | 530 | struct memcg_cache_params { |
| 484 | bool is_root_cache; | 531 | bool is_root_cache; |
| 485 | union { | 532 | union { |
| 486 | struct kmem_cache *memcg_caches[0]; | 533 | struct { |
| 534 | struct rcu_head rcu_head; | ||
| 535 | struct kmem_cache *memcg_caches[0]; | ||
| 536 | }; | ||
| 487 | struct { | 537 | struct { |
| 488 | struct mem_cgroup *memcg; | 538 | struct mem_cgroup *memcg; |
| 489 | struct list_head list; | 539 | struct list_head list; |
| @@ -502,61 +552,6 @@ int cache_show(struct kmem_cache *s, struct seq_file *m); | |||
| 502 | void print_slabinfo_header(struct seq_file *m); | 552 | void print_slabinfo_header(struct seq_file *m); |
| 503 | 553 | ||
| 504 | /** | 554 | /** |
| 505 | * kmalloc - allocate memory | ||
| 506 | * @size: how many bytes of memory are required. | ||
| 507 | * @flags: the type of memory to allocate. | ||
| 508 | * | ||
| 509 | * The @flags argument may be one of: | ||
| 510 | * | ||
| 511 | * %GFP_USER - Allocate memory on behalf of user. May sleep. | ||
| 512 | * | ||
| 513 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. | ||
| 514 | * | ||
| 515 | * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. | ||
| 516 | * For example, use this inside interrupt handlers. | ||
| 517 | * | ||
| 518 | * %GFP_HIGHUSER - Allocate pages from high memory. | ||
| 519 | * | ||
| 520 | * %GFP_NOIO - Do not do any I/O at all while trying to get memory. | ||
| 521 | * | ||
| 522 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. | ||
| 523 | * | ||
| 524 | * %GFP_NOWAIT - Allocation will not sleep. | ||
| 525 | * | ||
| 526 | * %GFP_THISNODE - Allocate node-local memory only. | ||
| 527 | * | ||
| 528 | * %GFP_DMA - Allocation suitable for DMA. | ||
| 529 | * Should only be used for kmalloc() caches. Otherwise, use a | ||
| 530 | * slab created with SLAB_DMA. | ||
| 531 | * | ||
| 532 | * Also it is possible to set different flags by OR'ing | ||
| 533 | * in one or more of the following additional @flags: | ||
| 534 | * | ||
| 535 | * %__GFP_COLD - Request cache-cold pages instead of | ||
| 536 | * trying to return cache-warm pages. | ||
| 537 | * | ||
| 538 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. | ||
| 539 | * | ||
| 540 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail | ||
| 541 | * (think twice before using). | ||
| 542 | * | ||
| 543 | * %__GFP_NORETRY - If memory is not immediately available, | ||
| 544 | * then give up at once. | ||
| 545 | * | ||
| 546 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. | ||
| 547 | * | ||
| 548 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. | ||
| 549 | * | ||
| 550 | * There are other flags available as well, but these are not intended | ||
| 551 | * for general use, and so are not documented here. For a full list of | ||
| 552 | * potential flags, always refer to linux/gfp.h. | ||
| 553 | * | ||
| 554 | * kmalloc is the normal method of allocating memory | ||
| 555 | * in the kernel. | ||
| 556 | */ | ||
| 557 | static __always_inline void *kmalloc(size_t size, gfp_t flags); | ||
| 558 | |||
| 559 | /** | ||
| 560 | * kmalloc_array - allocate memory for an array. | 555 | * kmalloc_array - allocate memory for an array. |
| 561 | * @n: number of elements. | 556 | * @n: number of elements. |
| 562 | * @size: element size. | 557 | * @size: element size. |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 09bfffb08a56..40fc39d22d53 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | struct kmem_cache { | 8 | struct kmem_cache { |
| 9 | /* 1) Cache tunables. Protected by cache_chain_mutex */ | 9 | /* 1) Cache tunables. Protected by slab_mutex */ |
| 10 | unsigned int batchcount; | 10 | unsigned int batchcount; |
| 11 | unsigned int limit; | 11 | unsigned int limit; |
| 12 | unsigned int shared; | 12 | unsigned int shared; |
diff --git a/include/linux/spi/74x164.h b/include/linux/spi/74x164.h deleted file mode 100644 index 0aa6acc73317..000000000000 --- a/include/linux/spi/74x164.h +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | #ifndef LINUX_SPI_74X164_H | ||
| 2 | #define LINUX_SPI_74X164_H | ||
| 3 | |||
| 4 | struct gen_74x164_chip_platform_data { | ||
| 5 | /* number assigned to the first GPIO */ | ||
| 6 | unsigned base; | ||
| 7 | }; | ||
| 8 | |||
| 9 | #endif | ||
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 75f34949d9ab..3f2867ff0ced 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
| @@ -130,6 +130,16 @@ do { \ | |||
| 130 | #define smp_mb__before_spinlock() smp_wmb() | 130 | #define smp_mb__before_spinlock() smp_wmb() |
| 131 | #endif | 131 | #endif |
| 132 | 132 | ||
| 133 | /* | ||
| 134 | * Place this after a lock-acquisition primitive to guarantee that | ||
| 135 | * an UNLOCK+LOCK pair act as a full barrier. This guarantee applies | ||
| 136 | * if the UNLOCK and LOCK are executed by the same CPU or if the | ||
| 137 | * UNLOCK and LOCK operate on the same lock variable. | ||
| 138 | */ | ||
| 139 | #ifndef smp_mb__after_unlock_lock | ||
| 140 | #define smp_mb__after_unlock_lock() do { } while (0) | ||
| 141 | #endif | ||
| 142 | |||
| 133 | /** | 143 | /** |
| 134 | * raw_spin_unlock_wait - wait until the spinlock gets unlocked | 144 | * raw_spin_unlock_wait - wait until the spinlock gets unlocked |
| 135 | * @lock: the spinlock in question. | 145 | * @lock: the spinlock in question. |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index bdb9993f0fda..42dfab89e740 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
| @@ -131,8 +131,7 @@ static inline void __raw_spin_lock_irq(raw_spinlock_t *lock) | |||
| 131 | 131 | ||
| 132 | static inline void __raw_spin_lock_bh(raw_spinlock_t *lock) | 132 | static inline void __raw_spin_lock_bh(raw_spinlock_t *lock) |
| 133 | { | 133 | { |
| 134 | local_bh_disable(); | 134 | __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 135 | preempt_disable(); | ||
| 136 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 135 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
| 137 | LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); | 136 | LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); |
| 138 | } | 137 | } |
| @@ -174,20 +173,17 @@ static inline void __raw_spin_unlock_bh(raw_spinlock_t *lock) | |||
| 174 | { | 173 | { |
| 175 | spin_release(&lock->dep_map, 1, _RET_IP_); | 174 | spin_release(&lock->dep_map, 1, _RET_IP_); |
| 176 | do_raw_spin_unlock(lock); | 175 | do_raw_spin_unlock(lock); |
| 177 | preempt_enable_no_resched(); | 176 | __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 178 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 179 | } | 177 | } |
| 180 | 178 | ||
| 181 | static inline int __raw_spin_trylock_bh(raw_spinlock_t *lock) | 179 | static inline int __raw_spin_trylock_bh(raw_spinlock_t *lock) |
| 182 | { | 180 | { |
| 183 | local_bh_disable(); | 181 | __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 184 | preempt_disable(); | ||
| 185 | if (do_raw_spin_trylock(lock)) { | 182 | if (do_raw_spin_trylock(lock)) { |
| 186 | spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); | 183 | spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); |
| 187 | return 1; | 184 | return 1; |
| 188 | } | 185 | } |
| 189 | preempt_enable_no_resched(); | 186 | __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 190 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 191 | return 0; | 187 | return 0; |
| 192 | } | 188 | } |
| 193 | 189 | ||
diff --git a/include/linux/spinlock_api_up.h b/include/linux/spinlock_api_up.h index af1f47229e70..d0d188861ad6 100644 --- a/include/linux/spinlock_api_up.h +++ b/include/linux/spinlock_api_up.h | |||
| @@ -24,11 +24,14 @@ | |||
| 24 | * flags straight, to suppress compiler warnings of unused lock | 24 | * flags straight, to suppress compiler warnings of unused lock |
| 25 | * variables, and to add the proper checker annotations: | 25 | * variables, and to add the proper checker annotations: |
| 26 | */ | 26 | */ |
| 27 | #define ___LOCK(lock) \ | ||
| 28 | do { __acquire(lock); (void)(lock); } while (0) | ||
| 29 | |||
| 27 | #define __LOCK(lock) \ | 30 | #define __LOCK(lock) \ |
| 28 | do { preempt_disable(); __acquire(lock); (void)(lock); } while (0) | 31 | do { preempt_disable(); ___LOCK(lock); } while (0) |
| 29 | 32 | ||
| 30 | #define __LOCK_BH(lock) \ | 33 | #define __LOCK_BH(lock) \ |
| 31 | do { local_bh_disable(); __LOCK(lock); } while (0) | 34 | do { __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_LOCK_OFFSET); ___LOCK(lock); } while (0) |
| 32 | 35 | ||
| 33 | #define __LOCK_IRQ(lock) \ | 36 | #define __LOCK_IRQ(lock) \ |
| 34 | do { local_irq_disable(); __LOCK(lock); } while (0) | 37 | do { local_irq_disable(); __LOCK(lock); } while (0) |
| @@ -36,12 +39,15 @@ | |||
| 36 | #define __LOCK_IRQSAVE(lock, flags) \ | 39 | #define __LOCK_IRQSAVE(lock, flags) \ |
| 37 | do { local_irq_save(flags); __LOCK(lock); } while (0) | 40 | do { local_irq_save(flags); __LOCK(lock); } while (0) |
| 38 | 41 | ||
| 42 | #define ___UNLOCK(lock) \ | ||
| 43 | do { __release(lock); (void)(lock); } while (0) | ||
| 44 | |||
| 39 | #define __UNLOCK(lock) \ | 45 | #define __UNLOCK(lock) \ |
| 40 | do { preempt_enable(); __release(lock); (void)(lock); } while (0) | 46 | do { preempt_enable(); ___UNLOCK(lock); } while (0) |
| 41 | 47 | ||
| 42 | #define __UNLOCK_BH(lock) \ | 48 | #define __UNLOCK_BH(lock) \ |
| 43 | do { preempt_enable_no_resched(); local_bh_enable(); \ | 49 | do { __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_LOCK_OFFSET); \ |
| 44 | __release(lock); (void)(lock); } while (0) | 50 | ___UNLOCK(lock); } while (0) |
| 45 | 51 | ||
| 46 | #define __UNLOCK_IRQ(lock) \ | 52 | #define __UNLOCK_IRQ(lock) \ |
| 47 | do { local_irq_enable(); __UNLOCK(lock); } while (0) | 53 | do { local_irq_enable(); __UNLOCK(lock); } while (0) |
diff --git a/include/linux/ssbi.h b/include/linux/ssbi.h index 44ef5da21470..bcbb642a7641 100644 --- a/include/linux/ssbi.h +++ b/include/linux/ssbi.h | |||
| @@ -17,22 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
| 19 | 19 | ||
| 20 | struct ssbi_slave_info { | 20 | int ssbi_write(struct device *dev, u16 addr, const u8 *buf, int len); |
| 21 | const char *name; | ||
| 22 | void *platform_data; | ||
| 23 | }; | ||
| 24 | |||
| 25 | enum ssbi_controller_type { | ||
| 26 | MSM_SBI_CTRL_SSBI = 0, | ||
| 27 | MSM_SBI_CTRL_SSBI2, | ||
| 28 | MSM_SBI_CTRL_PMIC_ARBITER, | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct ssbi_platform_data { | ||
| 32 | struct ssbi_slave_info slave; | ||
| 33 | enum ssbi_controller_type controller_type; | ||
| 34 | }; | ||
| 35 | |||
| 36 | int ssbi_write(struct device *dev, u16 addr, u8 *buf, int len); | ||
| 37 | int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len); | 21 | int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len); |
| 22 | |||
| 38 | #endif | 23 | #endif |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 94273bbe6050..40ed9e9a77e5 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -38,6 +38,7 @@ struct rlimit; | |||
| 38 | struct rlimit64; | 38 | struct rlimit64; |
| 39 | struct rusage; | 39 | struct rusage; |
| 40 | struct sched_param; | 40 | struct sched_param; |
| 41 | struct sched_attr; | ||
| 41 | struct sel_arg_struct; | 42 | struct sel_arg_struct; |
| 42 | struct semaphore; | 43 | struct semaphore; |
| 43 | struct sembuf; | 44 | struct sembuf; |
| @@ -279,9 +280,14 @@ asmlinkage long sys_sched_setscheduler(pid_t pid, int policy, | |||
| 279 | struct sched_param __user *param); | 280 | struct sched_param __user *param); |
| 280 | asmlinkage long sys_sched_setparam(pid_t pid, | 281 | asmlinkage long sys_sched_setparam(pid_t pid, |
| 281 | struct sched_param __user *param); | 282 | struct sched_param __user *param); |
| 283 | asmlinkage long sys_sched_setattr(pid_t pid, | ||
| 284 | struct sched_attr __user *attr); | ||
| 282 | asmlinkage long sys_sched_getscheduler(pid_t pid); | 285 | asmlinkage long sys_sched_getscheduler(pid_t pid); |
| 283 | asmlinkage long sys_sched_getparam(pid_t pid, | 286 | asmlinkage long sys_sched_getparam(pid_t pid, |
| 284 | struct sched_param __user *param); | 287 | struct sched_param __user *param); |
| 288 | asmlinkage long sys_sched_getattr(pid_t pid, | ||
| 289 | struct sched_attr __user *attr, | ||
| 290 | unsigned int size); | ||
| 285 | asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, | 291 | asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, |
| 286 | unsigned long __user *user_mask_ptr); | 292 | unsigned long __user *user_mask_ptr); |
| 287 | asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, | 293 | asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 6695040a0317..30b2ebee6439 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #ifndef _SYSFS_H_ | 12 | #ifndef _SYSFS_H_ |
| 13 | #define _SYSFS_H_ | 13 | #define _SYSFS_H_ |
| 14 | 14 | ||
| 15 | #include <linux/kernfs.h> | ||
| 15 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
| 16 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
| 17 | #include <linux/list.h> | 18 | #include <linux/list.h> |
| @@ -175,8 +176,6 @@ struct sysfs_ops { | |||
| 175 | ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t); | 176 | ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t); |
| 176 | }; | 177 | }; |
| 177 | 178 | ||
| 178 | struct sysfs_dirent; | ||
| 179 | |||
| 180 | #ifdef CONFIG_SYSFS | 179 | #ifdef CONFIG_SYSFS |
| 181 | 180 | ||
| 182 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), | 181 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), |
| @@ -244,12 +243,6 @@ void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name, | |||
| 244 | const char *link_name); | 243 | const char *link_name); |
| 245 | 244 | ||
| 246 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); | 245 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); |
| 247 | void sysfs_notify_dirent(struct sysfs_dirent *sd); | ||
| 248 | struct sysfs_dirent *sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, | ||
| 249 | const unsigned char *name, | ||
| 250 | const void *ns); | ||
| 251 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); | ||
| 252 | void sysfs_put(struct sysfs_dirent *sd); | ||
| 253 | 246 | ||
| 254 | int __must_check sysfs_init(void); | 247 | int __must_check sysfs_init(void); |
| 255 | 248 | ||
| @@ -419,22 +412,6 @@ static inline void sysfs_notify(struct kobject *kobj, const char *dir, | |||
| 419 | const char *attr) | 412 | const char *attr) |
| 420 | { | 413 | { |
| 421 | } | 414 | } |
| 422 | static inline void sysfs_notify_dirent(struct sysfs_dirent *sd) | ||
| 423 | { | ||
| 424 | } | ||
| 425 | static inline struct sysfs_dirent * | ||
| 426 | sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, const unsigned char *name, | ||
| 427 | const void *ns) | ||
| 428 | { | ||
| 429 | return NULL; | ||
| 430 | } | ||
| 431 | static inline struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd) | ||
| 432 | { | ||
| 433 | return NULL; | ||
| 434 | } | ||
| 435 | static inline void sysfs_put(struct sysfs_dirent *sd) | ||
| 436 | { | ||
| 437 | } | ||
| 438 | 415 | ||
| 439 | static inline int __must_check sysfs_init(void) | 416 | static inline int __must_check sysfs_init(void) |
| 440 | { | 417 | { |
| @@ -461,10 +438,26 @@ static inline int sysfs_rename_link(struct kobject *kobj, struct kobject *target | |||
| 461 | return sysfs_rename_link_ns(kobj, target, old_name, new_name, NULL); | 438 | return sysfs_rename_link_ns(kobj, target, old_name, new_name, NULL); |
| 462 | } | 439 | } |
| 463 | 440 | ||
| 464 | static inline struct sysfs_dirent * | 441 | static inline void sysfs_notify_dirent(struct kernfs_node *kn) |
| 465 | sysfs_get_dirent(struct sysfs_dirent *parent_sd, const unsigned char *name) | 442 | { |
| 443 | kernfs_notify(kn); | ||
| 444 | } | ||
| 445 | |||
| 446 | static inline struct kernfs_node *sysfs_get_dirent(struct kernfs_node *parent, | ||
| 447 | const unsigned char *name) | ||
| 448 | { | ||
| 449 | return kernfs_find_and_get(parent, name); | ||
| 450 | } | ||
| 451 | |||
| 452 | static inline struct kernfs_node *sysfs_get(struct kernfs_node *kn) | ||
| 453 | { | ||
| 454 | kernfs_get(kn); | ||
| 455 | return kn; | ||
| 456 | } | ||
| 457 | |||
| 458 | static inline void sysfs_put(struct kernfs_node *kn) | ||
| 466 | { | 459 | { |
| 467 | return sysfs_get_dirent_ns(parent_sd, name, NULL); | 460 | kernfs_put(kn); |
| 468 | } | 461 | } |
| 469 | 462 | ||
| 470 | #endif /* _SYSFS_H_ */ | 463 | #endif /* _SYSFS_H_ */ |
diff --git a/include/linux/tegra-powergate.h b/include/linux/tegra-powergate.h index c98cfa406952..46f0a07812b4 100644 --- a/include/linux/tegra-powergate.h +++ b/include/linux/tegra-powergate.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #define _MACH_TEGRA_POWERGATE_H_ | 19 | #define _MACH_TEGRA_POWERGATE_H_ |
| 20 | 20 | ||
| 21 | struct clk; | 21 | struct clk; |
| 22 | struct reset_control; | ||
| 22 | 23 | ||
| 23 | #define TEGRA_POWERGATE_CPU 0 | 24 | #define TEGRA_POWERGATE_CPU 0 |
| 24 | #define TEGRA_POWERGATE_3D 1 | 25 | #define TEGRA_POWERGATE_3D 1 |
| @@ -37,20 +38,97 @@ struct clk; | |||
| 37 | #define TEGRA_POWERGATE_CPU0 14 | 38 | #define TEGRA_POWERGATE_CPU0 14 |
| 38 | #define TEGRA_POWERGATE_C0NC 15 | 39 | #define TEGRA_POWERGATE_C0NC 15 |
| 39 | #define TEGRA_POWERGATE_C1NC 16 | 40 | #define TEGRA_POWERGATE_C1NC 16 |
| 41 | #define TEGRA_POWERGATE_SOR 17 | ||
| 40 | #define TEGRA_POWERGATE_DIS 18 | 42 | #define TEGRA_POWERGATE_DIS 18 |
| 41 | #define TEGRA_POWERGATE_DISB 19 | 43 | #define TEGRA_POWERGATE_DISB 19 |
| 42 | #define TEGRA_POWERGATE_XUSBA 20 | 44 | #define TEGRA_POWERGATE_XUSBA 20 |
| 43 | #define TEGRA_POWERGATE_XUSBB 21 | 45 | #define TEGRA_POWERGATE_XUSBB 21 |
| 44 | #define TEGRA_POWERGATE_XUSBC 22 | 46 | #define TEGRA_POWERGATE_XUSBC 22 |
| 47 | #define TEGRA_POWERGATE_VIC 23 | ||
| 48 | #define TEGRA_POWERGATE_IRAM 24 | ||
| 45 | 49 | ||
| 46 | #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D | 50 | #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D |
| 47 | 51 | ||
| 52 | #define TEGRA_IO_RAIL_CSIA 0 | ||
| 53 | #define TEGRA_IO_RAIL_CSIB 1 | ||
| 54 | #define TEGRA_IO_RAIL_DSI 2 | ||
| 55 | #define TEGRA_IO_RAIL_MIPI_BIAS 3 | ||
| 56 | #define TEGRA_IO_RAIL_PEX_BIAS 4 | ||
| 57 | #define TEGRA_IO_RAIL_PEX_CLK1 5 | ||
| 58 | #define TEGRA_IO_RAIL_PEX_CLK2 6 | ||
| 59 | #define TEGRA_IO_RAIL_USB0 9 | ||
| 60 | #define TEGRA_IO_RAIL_USB1 10 | ||
| 61 | #define TEGRA_IO_RAIL_USB2 11 | ||
| 62 | #define TEGRA_IO_RAIL_USB_BIAS 12 | ||
| 63 | #define TEGRA_IO_RAIL_NAND 13 | ||
| 64 | #define TEGRA_IO_RAIL_UART 14 | ||
| 65 | #define TEGRA_IO_RAIL_BB 15 | ||
| 66 | #define TEGRA_IO_RAIL_AUDIO 17 | ||
| 67 | #define TEGRA_IO_RAIL_HSIC 19 | ||
| 68 | #define TEGRA_IO_RAIL_COMP 22 | ||
| 69 | #define TEGRA_IO_RAIL_HDMI 28 | ||
| 70 | #define TEGRA_IO_RAIL_PEX_CNTRL 32 | ||
| 71 | #define TEGRA_IO_RAIL_SDMMC1 33 | ||
| 72 | #define TEGRA_IO_RAIL_SDMMC3 34 | ||
| 73 | #define TEGRA_IO_RAIL_SDMMC4 35 | ||
| 74 | #define TEGRA_IO_RAIL_CAM 36 | ||
| 75 | #define TEGRA_IO_RAIL_RES 37 | ||
| 76 | #define TEGRA_IO_RAIL_HV 38 | ||
| 77 | #define TEGRA_IO_RAIL_DSIB 39 | ||
| 78 | #define TEGRA_IO_RAIL_DSIC 40 | ||
| 79 | #define TEGRA_IO_RAIL_DSID 41 | ||
| 80 | #define TEGRA_IO_RAIL_CSIE 44 | ||
| 81 | #define TEGRA_IO_RAIL_LVDS 57 | ||
| 82 | #define TEGRA_IO_RAIL_SYS_DDC 58 | ||
| 83 | |||
| 84 | #ifdef CONFIG_ARCH_TEGRA | ||
| 48 | int tegra_powergate_is_powered(int id); | 85 | int tegra_powergate_is_powered(int id); |
| 49 | int tegra_powergate_power_on(int id); | 86 | int tegra_powergate_power_on(int id); |
| 50 | int tegra_powergate_power_off(int id); | 87 | int tegra_powergate_power_off(int id); |
| 51 | int tegra_powergate_remove_clamping(int id); | 88 | int tegra_powergate_remove_clamping(int id); |
| 52 | 89 | ||
| 53 | /* Must be called with clk disabled, and returns with clk enabled */ | 90 | /* Must be called with clk disabled, and returns with clk enabled */ |
| 54 | int tegra_powergate_sequence_power_up(int id, struct clk *clk); | 91 | int tegra_powergate_sequence_power_up(int id, struct clk *clk, |
| 92 | struct reset_control *rst); | ||
| 93 | |||
| 94 | int tegra_io_rail_power_on(int id); | ||
| 95 | int tegra_io_rail_power_off(int id); | ||
| 96 | #else | ||
| 97 | static inline int tegra_powergate_is_powered(int id) | ||
| 98 | { | ||
| 99 | return -ENOSYS; | ||
| 100 | } | ||
| 101 | |||
| 102 | static inline int tegra_powergate_power_on(int id) | ||
| 103 | { | ||
| 104 | return -ENOSYS; | ||
| 105 | } | ||
| 106 | |||
| 107 | static inline int tegra_powergate_power_off(int id) | ||
| 108 | { | ||
| 109 | return -ENOSYS; | ||
| 110 | } | ||
| 111 | |||
| 112 | static inline int tegra_powergate_remove_clamping(int id) | ||
| 113 | { | ||
| 114 | return -ENOSYS; | ||
| 115 | } | ||
| 116 | |||
| 117 | static inline int tegra_powergate_sequence_power_up(int id, struct clk *clk, | ||
| 118 | struct reset_control *rst) | ||
| 119 | { | ||
| 120 | return -ENOSYS; | ||
| 121 | } | ||
| 122 | |||
| 123 | static inline int tegra_io_rail_power_on(int id) | ||
| 124 | { | ||
| 125 | return -ENOSYS; | ||
| 126 | } | ||
| 127 | |||
| 128 | static inline int tegra_io_rail_power_off(int id) | ||
| 129 | { | ||
| 130 | return -ENOSYS; | ||
| 131 | } | ||
| 132 | #endif | ||
| 55 | 133 | ||
| 56 | #endif /* _MACH_TEGRA_POWERGATE_H_ */ | 134 | #endif /* _MACH_TEGRA_POWERGATE_H_ */ |
diff --git a/include/linux/tick.h b/include/linux/tick.h index 5128d33bbb39..0175d8663b6c 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
| @@ -104,7 +104,7 @@ extern struct cpumask *tick_get_broadcast_oneshot_mask(void); | |||
| 104 | extern void tick_clock_notify(void); | 104 | extern void tick_clock_notify(void); |
| 105 | extern int tick_check_oneshot_change(int allow_nohz); | 105 | extern int tick_check_oneshot_change(int allow_nohz); |
| 106 | extern struct tick_sched *tick_get_tick_sched(int cpu); | 106 | extern struct tick_sched *tick_get_tick_sched(int cpu); |
| 107 | extern void tick_check_idle(int cpu); | 107 | extern void tick_check_idle(void); |
| 108 | extern int tick_oneshot_mode_active(void); | 108 | extern int tick_oneshot_mode_active(void); |
| 109 | # ifndef arch_needs_cpu | 109 | # ifndef arch_needs_cpu |
| 110 | # define arch_needs_cpu(cpu) (0) | 110 | # define arch_needs_cpu(cpu) (0) |
| @@ -112,7 +112,7 @@ extern int tick_oneshot_mode_active(void); | |||
| 112 | # else | 112 | # else |
| 113 | static inline void tick_clock_notify(void) { } | 113 | static inline void tick_clock_notify(void) { } |
| 114 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | 114 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } |
| 115 | static inline void tick_check_idle(int cpu) { } | 115 | static inline void tick_check_idle(void) { } |
| 116 | static inline int tick_oneshot_mode_active(void) { return 0; } | 116 | static inline int tick_oneshot_mode_active(void) { return 0; } |
| 117 | # endif | 117 | # endif |
| 118 | 118 | ||
| @@ -121,7 +121,7 @@ static inline void tick_init(void) { } | |||
| 121 | static inline void tick_cancel_sched_timer(int cpu) { } | 121 | static inline void tick_cancel_sched_timer(int cpu) { } |
| 122 | static inline void tick_clock_notify(void) { } | 122 | static inline void tick_clock_notify(void) { } |
| 123 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | 123 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } |
| 124 | static inline void tick_check_idle(int cpu) { } | 124 | static inline void tick_check_idle(void) { } |
| 125 | static inline int tick_oneshot_mode_active(void) { return 0; } | 125 | static inline int tick_oneshot_mode_active(void) { return 0; } |
| 126 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ | 126 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ |
| 127 | 127 | ||
| @@ -165,7 +165,7 @@ extern cpumask_var_t tick_nohz_full_mask; | |||
| 165 | 165 | ||
| 166 | static inline bool tick_nohz_full_enabled(void) | 166 | static inline bool tick_nohz_full_enabled(void) |
| 167 | { | 167 | { |
| 168 | if (!static_key_false(&context_tracking_enabled)) | 168 | if (!context_tracking_is_enabled()) |
| 169 | return false; | 169 | return false; |
| 170 | 170 | ||
| 171 | return tick_nohz_full_running; | 171 | return tick_nohz_full_running; |
diff --git a/include/linux/tpm.h b/include/linux/tpm.h index 9a9051bb1a03..fff1d0976f80 100644 --- a/include/linux/tpm.h +++ b/include/linux/tpm.h | |||
| @@ -29,6 +29,18 @@ | |||
| 29 | */ | 29 | */ |
| 30 | #define TPM_ANY_NUM 0xFFFF | 30 | #define TPM_ANY_NUM 0xFFFF |
| 31 | 31 | ||
| 32 | struct tpm_chip; | ||
| 33 | |||
| 34 | struct tpm_class_ops { | ||
| 35 | const u8 req_complete_mask; | ||
| 36 | const u8 req_complete_val; | ||
| 37 | bool (*req_canceled)(struct tpm_chip *chip, u8 status); | ||
| 38 | int (*recv) (struct tpm_chip *chip, u8 *buf, size_t len); | ||
| 39 | int (*send) (struct tpm_chip *chip, u8 *buf, size_t len); | ||
| 40 | void (*cancel) (struct tpm_chip *chip); | ||
| 41 | u8 (*status) (struct tpm_chip *chip); | ||
| 42 | }; | ||
| 43 | |||
| 32 | #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) | 44 | #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) |
| 33 | 45 | ||
| 34 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); | 46 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index ebeab360d851..accc497f8d72 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
| @@ -267,6 +267,8 @@ static inline void tracepoint_synchronize_unregister(void) | |||
| 267 | 267 | ||
| 268 | #define TRACE_EVENT_FLAGS(event, flag) | 268 | #define TRACE_EVENT_FLAGS(event, flag) |
| 269 | 269 | ||
| 270 | #define TRACE_EVENT_PERF_PERM(event, expr...) | ||
| 271 | |||
| 270 | #endif /* DECLARE_TRACE */ | 272 | #endif /* DECLARE_TRACE */ |
| 271 | 273 | ||
| 272 | #ifndef TRACE_EVENT | 274 | #ifndef TRACE_EVENT |
| @@ -274,7 +276,7 @@ static inline void tracepoint_synchronize_unregister(void) | |||
| 274 | * For use with the TRACE_EVENT macro: | 276 | * For use with the TRACE_EVENT macro: |
| 275 | * | 277 | * |
| 276 | * We define a tracepoint, its arguments, its printk format | 278 | * We define a tracepoint, its arguments, its printk format |
| 277 | * and its 'fast binay record' layout. | 279 | * and its 'fast binary record' layout. |
| 278 | * | 280 | * |
| 279 | * Firstly, name your tracepoint via TRACE_EVENT(name : the | 281 | * Firstly, name your tracepoint via TRACE_EVENT(name : the |
| 280 | * 'subsystem_event' notation is fine. | 282 | * 'subsystem_event' notation is fine. |
| @@ -399,4 +401,6 @@ static inline void tracepoint_synchronize_unregister(void) | |||
| 399 | 401 | ||
| 400 | #define TRACE_EVENT_FLAGS(event, flag) | 402 | #define TRACE_EVENT_FLAGS(event, flag) |
| 401 | 403 | ||
| 404 | #define TRACE_EVENT_PERF_PERM(event, expr...) | ||
| 405 | |||
| 402 | #endif /* ifdef TRACE_EVENT (see note above) */ | 406 | #endif /* ifdef TRACE_EVENT (see note above) */ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 97d660ed70c1..90b4fdc8a61f 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -39,10 +39,14 @@ struct tty_buffer { | |||
| 39 | int size; | 39 | int size; |
| 40 | int commit; | 40 | int commit; |
| 41 | int read; | 41 | int read; |
| 42 | int flags; | ||
| 42 | /* Data points here */ | 43 | /* Data points here */ |
| 43 | unsigned long data[0]; | 44 | unsigned long data[0]; |
| 44 | }; | 45 | }; |
| 45 | 46 | ||
| 47 | /* Values for .flags field of tty_buffer */ | ||
| 48 | #define TTYB_NORMAL 1 /* buffer has no flags buffer */ | ||
| 49 | |||
| 46 | static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs) | 50 | static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs) |
| 47 | { | 51 | { |
| 48 | return ((unsigned char *)b->data) + ofs; | 52 | return ((unsigned char *)b->data) + ofs; |
| @@ -60,7 +64,8 @@ struct tty_bufhead { | |||
| 60 | atomic_t priority; | 64 | atomic_t priority; |
| 61 | struct tty_buffer sentinel; | 65 | struct tty_buffer sentinel; |
| 62 | struct llist_head free; /* Free queue head */ | 66 | struct llist_head free; /* Free queue head */ |
| 63 | atomic_t memory_used; /* In-use buffers excluding free list */ | 67 | atomic_t mem_used; /* In-use buffers excluding free list */ |
| 68 | int mem_limit; | ||
| 64 | struct tty_buffer *tail; /* Active buffer */ | 69 | struct tty_buffer *tail; /* Active buffer */ |
| 65 | }; | 70 | }; |
| 66 | /* | 71 | /* |
| @@ -137,6 +142,7 @@ struct tty_bufhead { | |||
| 137 | #define C_CLOCAL(tty) _C_FLAG((tty), CLOCAL) | 142 | #define C_CLOCAL(tty) _C_FLAG((tty), CLOCAL) |
| 138 | #define C_CIBAUD(tty) _C_FLAG((tty), CIBAUD) | 143 | #define C_CIBAUD(tty) _C_FLAG((tty), CIBAUD) |
| 139 | #define C_CRTSCTS(tty) _C_FLAG((tty), CRTSCTS) | 144 | #define C_CRTSCTS(tty) _C_FLAG((tty), CRTSCTS) |
| 145 | #define C_CMSPAR(tty) _C_FLAG((tty), CMSPAR) | ||
| 140 | 146 | ||
| 141 | #define L_ISIG(tty) _L_FLAG((tty), ISIG) | 147 | #define L_ISIG(tty) _L_FLAG((tty), ISIG) |
| 142 | #define L_ICANON(tty) _L_FLAG((tty), ICANON) | 148 | #define L_ICANON(tty) _L_FLAG((tty), ICANON) |
| @@ -422,7 +428,6 @@ extern int is_ignored(int sig); | |||
| 422 | extern int tty_signal(int sig, struct tty_struct *tty); | 428 | extern int tty_signal(int sig, struct tty_struct *tty); |
| 423 | extern void tty_hangup(struct tty_struct *tty); | 429 | extern void tty_hangup(struct tty_struct *tty); |
| 424 | extern void tty_vhangup(struct tty_struct *tty); | 430 | extern void tty_vhangup(struct tty_struct *tty); |
| 425 | extern void tty_vhangup_locked(struct tty_struct *tty); | ||
| 426 | extern void tty_unhangup(struct file *filp); | 431 | extern void tty_unhangup(struct file *filp); |
| 427 | extern int tty_hung_up_p(struct file *filp); | 432 | extern int tty_hung_up_p(struct file *filp); |
| 428 | extern void do_SAK(struct tty_struct *tty); | 433 | extern void do_SAK(struct tty_struct *tty); |
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index 21ddd7d9ea1f..c28dd523f96e 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef _LINUX_TTY_FLIP_H | 1 | #ifndef _LINUX_TTY_FLIP_H |
| 2 | #define _LINUX_TTY_FLIP_H | 2 | #define _LINUX_TTY_FLIP_H |
| 3 | 3 | ||
| 4 | extern int tty_buffer_set_limit(struct tty_port *port, int limit); | ||
| 4 | extern int tty_buffer_space_avail(struct tty_port *port); | 5 | extern int tty_buffer_space_avail(struct tty_port *port); |
| 5 | extern int tty_buffer_request_room(struct tty_port *port, size_t size); | 6 | extern int tty_buffer_request_room(struct tty_port *port, size_t size); |
| 6 | extern int tty_insert_flip_string_flags(struct tty_port *port, | 7 | extern int tty_insert_flip_string_flags(struct tty_port *port, |
| @@ -9,8 +10,6 @@ extern int tty_insert_flip_string_fixed_flag(struct tty_port *port, | |||
| 9 | const unsigned char *chars, char flag, size_t size); | 10 | const unsigned char *chars, char flag, size_t size); |
| 10 | extern int tty_prepare_flip_string(struct tty_port *port, | 11 | extern int tty_prepare_flip_string(struct tty_port *port, |
| 11 | unsigned char **chars, size_t size); | 12 | unsigned char **chars, size_t size); |
| 12 | extern int tty_prepare_flip_string_flags(struct tty_port *port, | ||
| 13 | unsigned char **chars, char **flags, size_t size); | ||
| 14 | extern void tty_flip_buffer_push(struct tty_port *port); | 13 | extern void tty_flip_buffer_push(struct tty_port *port); |
| 15 | void tty_schedule_flip(struct tty_port *port); | 14 | void tty_schedule_flip(struct tty_port *port); |
| 16 | 15 | ||
| @@ -18,8 +17,12 @@ static inline int tty_insert_flip_char(struct tty_port *port, | |||
| 18 | unsigned char ch, char flag) | 17 | unsigned char ch, char flag) |
| 19 | { | 18 | { |
| 20 | struct tty_buffer *tb = port->buf.tail; | 19 | struct tty_buffer *tb = port->buf.tail; |
| 21 | if (tb && tb->used < tb->size) { | 20 | int change; |
| 22 | *flag_buf_ptr(tb, tb->used) = flag; | 21 | |
| 22 | change = (tb->flags & TTYB_NORMAL) && (flag != TTY_NORMAL); | ||
| 23 | if (!change && tb->used < tb->size) { | ||
| 24 | if (~tb->flags & TTYB_NORMAL) | ||
| 25 | *flag_buf_ptr(tb, tb->used) = flag; | ||
| 23 | *char_buf_ptr(tb, tb->used++) = ch; | 26 | *char_buf_ptr(tb, tb->used++) = ch; |
| 24 | return 1; | 27 | return 1; |
| 25 | } | 28 | } |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index f15c898ff462..b8347c207cb8 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
| @@ -84,7 +84,8 @@ | |||
| 84 | * processing. <cp> is a pointer to the buffer of input | 84 | * processing. <cp> is a pointer to the buffer of input |
| 85 | * character received by the device. <fp> is a pointer to a | 85 | * character received by the device. <fp> is a pointer to a |
| 86 | * pointer of flag bytes which indicate whether a character was | 86 | * pointer of flag bytes which indicate whether a character was |
| 87 | * received with a parity error, etc. | 87 | * received with a parity error, etc. <fp> may be NULL to indicate |
| 88 | * all data received is TTY_NORMAL. | ||
| 88 | * | 89 | * |
| 89 | * void (*write_wakeup)(struct tty_struct *); | 90 | * void (*write_wakeup)(struct tty_struct *); |
| 90 | * | 91 | * |
| @@ -118,7 +119,8 @@ | |||
| 118 | * processing. <cp> is a pointer to the buffer of input | 119 | * processing. <cp> is a pointer to the buffer of input |
| 119 | * character received by the device. <fp> is a pointer to a | 120 | * character received by the device. <fp> is a pointer to a |
| 120 | * pointer of flag bytes which indicate whether a character was | 121 | * pointer of flag bytes which indicate whether a character was |
| 121 | * received with a parity error, etc. | 122 | * received with a parity error, etc. <fp> may be NULL to indicate |
| 123 | * all data received is TTY_NORMAL. | ||
| 122 | * If assigned, prefer this function for automatic flow control. | 124 | * If assigned, prefer this function for automatic flow control. |
| 123 | */ | 125 | */ |
| 124 | 126 | ||
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 9d8cf056e661..ecd3319dac33 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h | |||
| @@ -25,13 +25,16 @@ static inline void pagefault_disable(void) | |||
| 25 | 25 | ||
| 26 | static inline void pagefault_enable(void) | 26 | static inline void pagefault_enable(void) |
| 27 | { | 27 | { |
| 28 | #ifndef CONFIG_PREEMPT | ||
| 28 | /* | 29 | /* |
| 29 | * make sure to issue those last loads/stores before enabling | 30 | * make sure to issue those last loads/stores before enabling |
| 30 | * the pagefault handler again. | 31 | * the pagefault handler again. |
| 31 | */ | 32 | */ |
| 32 | barrier(); | 33 | barrier(); |
| 33 | preempt_count_dec(); | 34 | preempt_count_dec(); |
| 34 | preempt_check_resched(); | 35 | #else |
| 36 | preempt_enable(); | ||
| 37 | #endif | ||
| 35 | } | 38 | } |
| 36 | 39 | ||
| 37 | #ifndef ARCH_HAS_NOCACHE_UACCESS | 40 | #ifndef ARCH_HAS_NOCACHE_UACCESS |
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index 319eae70fe84..e32251e00e62 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h | |||
| @@ -26,16 +26,13 @@ | |||
| 26 | 26 | ||
| 27 | #include <linux/errno.h> | 27 | #include <linux/errno.h> |
| 28 | #include <linux/rbtree.h> | 28 | #include <linux/rbtree.h> |
| 29 | #include <linux/types.h> | ||
| 29 | 30 | ||
| 30 | struct vm_area_struct; | 31 | struct vm_area_struct; |
| 31 | struct mm_struct; | 32 | struct mm_struct; |
| 32 | struct inode; | 33 | struct inode; |
| 33 | struct notifier_block; | 34 | struct notifier_block; |
| 34 | 35 | ||
| 35 | #ifdef CONFIG_ARCH_SUPPORTS_UPROBES | ||
| 36 | # include <asm/uprobes.h> | ||
| 37 | #endif | ||
| 38 | |||
| 39 | #define UPROBE_HANDLER_REMOVE 1 | 36 | #define UPROBE_HANDLER_REMOVE 1 |
| 40 | #define UPROBE_HANDLER_MASK 1 | 37 | #define UPROBE_HANDLER_MASK 1 |
| 41 | 38 | ||
| @@ -60,6 +57,8 @@ struct uprobe_consumer { | |||
| 60 | }; | 57 | }; |
| 61 | 58 | ||
| 62 | #ifdef CONFIG_UPROBES | 59 | #ifdef CONFIG_UPROBES |
| 60 | #include <asm/uprobes.h> | ||
| 61 | |||
| 63 | enum uprobe_task_state { | 62 | enum uprobe_task_state { |
| 64 | UTASK_RUNNING, | 63 | UTASK_RUNNING, |
| 65 | UTASK_SSTEP, | 64 | UTASK_SSTEP, |
| @@ -72,35 +71,28 @@ enum uprobe_task_state { | |||
| 72 | */ | 71 | */ |
| 73 | struct uprobe_task { | 72 | struct uprobe_task { |
| 74 | enum uprobe_task_state state; | 73 | enum uprobe_task_state state; |
| 75 | struct arch_uprobe_task autask; | ||
| 76 | 74 | ||
| 77 | struct return_instance *return_instances; | 75 | union { |
| 78 | unsigned int depth; | 76 | struct { |
| 79 | struct uprobe *active_uprobe; | 77 | struct arch_uprobe_task autask; |
| 78 | unsigned long vaddr; | ||
| 79 | }; | ||
| 80 | 80 | ||
| 81 | struct { | ||
| 82 | struct callback_head dup_xol_work; | ||
| 83 | unsigned long dup_xol_addr; | ||
| 84 | }; | ||
| 85 | }; | ||
| 86 | |||
| 87 | struct uprobe *active_uprobe; | ||
| 81 | unsigned long xol_vaddr; | 88 | unsigned long xol_vaddr; |
| 82 | unsigned long vaddr; | ||
| 83 | }; | ||
| 84 | 89 | ||
| 85 | /* | 90 | struct return_instance *return_instances; |
| 86 | * On a breakpoint hit, thread contests for a slot. It frees the | 91 | unsigned int depth; |
| 87 | * slot after singlestep. Currently a fixed number of slots are | ||
| 88 | * allocated. | ||
| 89 | */ | ||
| 90 | struct xol_area { | ||
| 91 | wait_queue_head_t wq; /* if all slots are busy */ | ||
| 92 | atomic_t slot_count; /* number of in-use slots */ | ||
| 93 | unsigned long *bitmap; /* 0 = free slot */ | ||
| 94 | struct page *page; | ||
| 95 | |||
| 96 | /* | ||
| 97 | * We keep the vma's vm_start rather than a pointer to the vma | ||
| 98 | * itself. The probed process or a naughty kernel module could make | ||
| 99 | * the vma go away, and we must handle that reasonably gracefully. | ||
| 100 | */ | ||
| 101 | unsigned long vaddr; /* Page(s) of instruction slots */ | ||
| 102 | }; | 92 | }; |
| 103 | 93 | ||
| 94 | struct xol_area; | ||
| 95 | |||
| 104 | struct uprobes_state { | 96 | struct uprobes_state { |
| 105 | struct xol_area *xol_area; | 97 | struct xol_area *xol_area; |
| 106 | }; | 98 | }; |
| @@ -109,6 +101,7 @@ extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsign | |||
| 109 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); | 101 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); |
| 110 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); | 102 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); |
| 111 | extern bool __weak is_trap_insn(uprobe_opcode_t *insn); | 103 | extern bool __weak is_trap_insn(uprobe_opcode_t *insn); |
| 104 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); | ||
| 112 | extern int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t); | 105 | extern int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t); |
| 113 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); | 106 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
| 114 | extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); | 107 | extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); |
| @@ -120,7 +113,6 @@ extern void uprobe_end_dup_mmap(void); | |||
| 120 | extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); | 113 | extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); |
| 121 | extern void uprobe_free_utask(struct task_struct *t); | 114 | extern void uprobe_free_utask(struct task_struct *t); |
| 122 | extern void uprobe_copy_process(struct task_struct *t, unsigned long flags); | 115 | extern void uprobe_copy_process(struct task_struct *t, unsigned long flags); |
| 123 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); | ||
| 124 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); | 116 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); |
| 125 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); | 117 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); |
| 126 | extern void uprobe_notify_resume(struct pt_regs *regs); | 118 | extern void uprobe_notify_resume(struct pt_regs *regs); |
| @@ -176,10 +168,6 @@ static inline bool uprobe_deny_signal(void) | |||
| 176 | { | 168 | { |
| 177 | return false; | 169 | return false; |
| 178 | } | 170 | } |
| 179 | static inline unsigned long uprobe_get_swbp_addr(struct pt_regs *regs) | ||
| 180 | { | ||
| 181 | return 0; | ||
| 182 | } | ||
| 183 | static inline void uprobe_free_utask(struct task_struct *t) | 171 | static inline void uprobe_free_utask(struct task_struct *t) |
| 184 | { | 172 | { |
| 185 | } | 173 | } |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 7454865ad148..c716da18c668 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -965,6 +965,7 @@ struct usb_dynid { | |||
| 965 | }; | 965 | }; |
| 966 | 966 | ||
| 967 | extern ssize_t usb_store_new_id(struct usb_dynids *dynids, | 967 | extern ssize_t usb_store_new_id(struct usb_dynids *dynids, |
| 968 | const struct usb_device_id *id_table, | ||
| 968 | struct device_driver *driver, | 969 | struct device_driver *driver, |
| 969 | const char *buf, size_t count); | 970 | const char *buf, size_t count); |
| 970 | 971 | ||
| @@ -1264,6 +1265,8 @@ typedef void (*usb_complete_t)(struct urb *); | |||
| 1264 | * @sg: scatter gather buffer list, the buffer size of each element in | 1265 | * @sg: scatter gather buffer list, the buffer size of each element in |
| 1265 | * the list (except the last) must be divisible by the endpoint's | 1266 | * the list (except the last) must be divisible by the endpoint's |
| 1266 | * max packet size if no_sg_constraint isn't set in 'struct usb_bus' | 1267 | * max packet size if no_sg_constraint isn't set in 'struct usb_bus' |
| 1268 | * (FIXME: scatter-gather under xHCI is broken for periodic transfers. | ||
| 1269 | * Do not use urb->sg for interrupt endpoints for now, only bulk.) | ||
| 1267 | * @num_mapped_sgs: (internal) number of mapped sg entries | 1270 | * @num_mapped_sgs: (internal) number of mapped sg entries |
| 1268 | * @num_sgs: number of entries in the sg list | 1271 | * @num_sgs: number of entries in the sg list |
| 1269 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may | 1272 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may |
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index 7d399671a566..708bd119627f 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h | |||
| @@ -24,6 +24,7 @@ struct ci_hdrc_platform_data { | |||
| 24 | * but otg is not supported (no register otgsc). | 24 | * but otg is not supported (no register otgsc). |
| 25 | */ | 25 | */ |
| 26 | #define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4) | 26 | #define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4) |
| 27 | #define CI_HDRC_IMX28_WRITE_FIX BIT(5) | ||
| 27 | enum usb_dr_mode dr_mode; | 28 | enum usb_dr_mode dr_mode; |
| 28 | #define CI_HDRC_CONTROLLER_RESET_EVENT 0 | 29 | #define CI_HDRC_CONTROLLER_RESET_EVENT 0 |
| 29 | #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 | 30 | #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 5e61589fc166..dba63f53906c 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
| @@ -468,6 +468,8 @@ struct usb_function_instance { | |||
| 468 | struct config_group group; | 468 | struct config_group group; |
| 469 | struct list_head cfs_list; | 469 | struct list_head cfs_list; |
| 470 | struct usb_function_driver *fd; | 470 | struct usb_function_driver *fd; |
| 471 | int (*set_inst_name)(struct usb_function_instance *inst, | ||
| 472 | const char *name); | ||
| 471 | void (*free_func_inst)(struct usb_function_instance *inst); | 473 | void (*free_func_inst)(struct usb_function_instance *inst); |
| 472 | }; | 474 | }; |
| 473 | 475 | ||
diff --git a/include/linux/usb/functionfs.h b/include/linux/usb/functionfs.h index 65d0a88dbc67..71190663f1ee 100644 --- a/include/linux/usb/functionfs.h +++ b/include/linux/usb/functionfs.h | |||
| @@ -3,34 +3,4 @@ | |||
| 3 | 3 | ||
| 4 | #include <uapi/linux/usb/functionfs.h> | 4 | #include <uapi/linux/usb/functionfs.h> |
| 5 | 5 | ||
| 6 | |||
| 7 | struct ffs_data; | ||
| 8 | struct usb_composite_dev; | ||
| 9 | struct usb_configuration; | ||
| 10 | |||
| 11 | |||
| 12 | static int functionfs_init(void) __attribute__((warn_unused_result)); | ||
| 13 | static void functionfs_cleanup(void); | ||
| 14 | |||
| 15 | static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev) | ||
| 16 | __attribute__((warn_unused_result, nonnull)); | ||
| 17 | static void functionfs_unbind(struct ffs_data *ffs) | ||
| 18 | __attribute__((nonnull)); | ||
| 19 | |||
| 20 | static int functionfs_bind_config(struct usb_composite_dev *cdev, | ||
| 21 | struct usb_configuration *c, | ||
| 22 | struct ffs_data *ffs) | ||
| 23 | __attribute__((warn_unused_result, nonnull)); | ||
| 24 | |||
| 25 | |||
| 26 | static int functionfs_ready_callback(struct ffs_data *ffs) | ||
| 27 | __attribute__((warn_unused_result, nonnull)); | ||
| 28 | static void functionfs_closed_callback(struct ffs_data *ffs) | ||
| 29 | __attribute__((nonnull)); | ||
| 30 | static void *functionfs_acquire_dev_callback(const char *dev_name) | ||
| 31 | __attribute__((warn_unused_result, nonnull)); | ||
| 32 | static void functionfs_release_dev_callback(struct ffs_data *ffs_data) | ||
| 33 | __attribute__((nonnull)); | ||
| 34 | |||
| 35 | |||
| 36 | #endif | 6 | #endif |
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 942ef5e053bf..c3a61853cd13 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
| @@ -148,6 +148,9 @@ struct usb_ep_ops { | |||
| 148 | * @maxpacket:The maximum packet size used on this endpoint. The initial | 148 | * @maxpacket:The maximum packet size used on this endpoint. The initial |
| 149 | * value can sometimes be reduced (hardware allowing), according to | 149 | * value can sometimes be reduced (hardware allowing), according to |
| 150 | * the endpoint descriptor used to configure the endpoint. | 150 | * the endpoint descriptor used to configure the endpoint. |
| 151 | * @maxpacket_limit:The maximum packet size value which can be handled by this | ||
| 152 | * endpoint. It's set once by UDC driver when endpoint is initialized, and | ||
| 153 | * should not be changed. Should not be confused with maxpacket. | ||
| 151 | * @max_streams: The maximum number of streams supported | 154 | * @max_streams: The maximum number of streams supported |
| 152 | * by this EP (0 - 16, actual number is 2^n) | 155 | * by this EP (0 - 16, actual number is 2^n) |
| 153 | * @mult: multiplier, 'mult' value for SS Isoc EPs | 156 | * @mult: multiplier, 'mult' value for SS Isoc EPs |
| @@ -171,6 +174,7 @@ struct usb_ep { | |||
| 171 | const struct usb_ep_ops *ops; | 174 | const struct usb_ep_ops *ops; |
| 172 | struct list_head ep_list; | 175 | struct list_head ep_list; |
| 173 | unsigned maxpacket:16; | 176 | unsigned maxpacket:16; |
| 177 | unsigned maxpacket_limit:16; | ||
| 174 | unsigned max_streams:16; | 178 | unsigned max_streams:16; |
| 175 | unsigned mult:2; | 179 | unsigned mult:2; |
| 176 | unsigned maxburst:5; | 180 | unsigned maxburst:5; |
| @@ -182,6 +186,21 @@ struct usb_ep { | |||
| 182 | /*-------------------------------------------------------------------------*/ | 186 | /*-------------------------------------------------------------------------*/ |
| 183 | 187 | ||
| 184 | /** | 188 | /** |
| 189 | * usb_ep_set_maxpacket_limit - set maximum packet size limit for endpoint | ||
| 190 | * @ep:the endpoint being configured | ||
| 191 | * @maxpacket_limit:value of maximum packet size limit | ||
| 192 | * | ||
| 193 | * This function shoud be used only in UDC drivers to initialize endpoint | ||
| 194 | * (usually in probe function). | ||
| 195 | */ | ||
| 196 | static inline void usb_ep_set_maxpacket_limit(struct usb_ep *ep, | ||
| 197 | unsigned maxpacket_limit) | ||
| 198 | { | ||
| 199 | ep->maxpacket_limit = maxpacket_limit; | ||
| 200 | ep->maxpacket = maxpacket_limit; | ||
| 201 | } | ||
| 202 | |||
| 203 | /** | ||
| 185 | * usb_ep_enable - configure endpoint, making it usable | 204 | * usb_ep_enable - configure endpoint, making it usable |
| 186 | * @ep:the endpoint being configured. may not be the endpoint named "ep0". | 205 | * @ep:the endpoint being configured. may not be the endpoint named "ep0". |
| 187 | * drivers discover endpoints through the ep_list of a usb_gadget. | 206 | * drivers discover endpoints through the ep_list of a usb_gadget. |
| @@ -485,6 +504,11 @@ struct usb_gadget_ops { | |||
| 485 | * @max_speed: Maximal speed the UDC can handle. UDC must support this | 504 | * @max_speed: Maximal speed the UDC can handle. UDC must support this |
| 486 | * and all slower speeds. | 505 | * and all slower speeds. |
| 487 | * @state: the state we are now (attached, suspended, configured, etc) | 506 | * @state: the state we are now (attached, suspended, configured, etc) |
| 507 | * @name: Identifies the controller hardware type. Used in diagnostics | ||
| 508 | * and sometimes configuration. | ||
| 509 | * @dev: Driver model state for this abstract device. | ||
| 510 | * @out_epnum: last used out ep number | ||
| 511 | * @in_epnum: last used in ep number | ||
| 488 | * @sg_supported: true if we can handle scatter-gather | 512 | * @sg_supported: true if we can handle scatter-gather |
| 489 | * @is_otg: True if the USB device port uses a Mini-AB jack, so that the | 513 | * @is_otg: True if the USB device port uses a Mini-AB jack, so that the |
| 490 | * gadget driver must provide a USB OTG descriptor. | 514 | * gadget driver must provide a USB OTG descriptor. |
| @@ -497,11 +521,8 @@ struct usb_gadget_ops { | |||
| 497 | * only supports HNP on a different root port. | 521 | * only supports HNP on a different root port. |
| 498 | * @b_hnp_enable: OTG device feature flag, indicating that the A-Host | 522 | * @b_hnp_enable: OTG device feature flag, indicating that the A-Host |
| 499 | * enabled HNP support. | 523 | * enabled HNP support. |
| 500 | * @name: Identifies the controller hardware type. Used in diagnostics | 524 | * @quirk_ep_out_aligned_size: epout requires buffer size to be aligned to |
| 501 | * and sometimes configuration. | 525 | * MaxPacketSize. |
| 502 | * @dev: Driver model state for this abstract device. | ||
| 503 | * @out_epnum: last used out ep number | ||
| 504 | * @in_epnum: last used in ep number | ||
| 505 | * | 526 | * |
| 506 | * Gadgets have a mostly-portable "gadget driver" implementing device | 527 | * Gadgets have a mostly-portable "gadget driver" implementing device |
| 507 | * functions, handling all usb configurations and interfaces. Gadget | 528 | * functions, handling all usb configurations and interfaces. Gadget |
| @@ -530,16 +551,18 @@ struct usb_gadget { | |||
| 530 | enum usb_device_speed speed; | 551 | enum usb_device_speed speed; |
| 531 | enum usb_device_speed max_speed; | 552 | enum usb_device_speed max_speed; |
| 532 | enum usb_device_state state; | 553 | enum usb_device_state state; |
| 554 | const char *name; | ||
| 555 | struct device dev; | ||
| 556 | unsigned out_epnum; | ||
| 557 | unsigned in_epnum; | ||
| 558 | |||
| 533 | unsigned sg_supported:1; | 559 | unsigned sg_supported:1; |
| 534 | unsigned is_otg:1; | 560 | unsigned is_otg:1; |
| 535 | unsigned is_a_peripheral:1; | 561 | unsigned is_a_peripheral:1; |
| 536 | unsigned b_hnp_enable:1; | 562 | unsigned b_hnp_enable:1; |
| 537 | unsigned a_hnp_support:1; | 563 | unsigned a_hnp_support:1; |
| 538 | unsigned a_alt_hnp_support:1; | 564 | unsigned a_alt_hnp_support:1; |
| 539 | const char *name; | 565 | unsigned quirk_ep_out_aligned_size:1; |
| 540 | struct device dev; | ||
| 541 | unsigned out_epnum; | ||
| 542 | unsigned in_epnum; | ||
| 543 | }; | 566 | }; |
| 544 | #define work_to_gadget(w) (container_of((w), struct usb_gadget, work)) | 567 | #define work_to_gadget(w) (container_of((w), struct usb_gadget, work)) |
| 545 | 568 | ||
| @@ -558,6 +581,23 @@ static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev) | |||
| 558 | 581 | ||
| 559 | 582 | ||
| 560 | /** | 583 | /** |
| 584 | * usb_ep_align_maybe - returns @len aligned to ep's maxpacketsize if gadget | ||
| 585 | * requires quirk_ep_out_aligned_size, otherwise reguens len. | ||
| 586 | * @g: controller to check for quirk | ||
| 587 | * @ep: the endpoint whose maxpacketsize is used to align @len | ||
| 588 | * @len: buffer size's length to align to @ep's maxpacketsize | ||
| 589 | * | ||
| 590 | * This helper is used in case it's required for any reason to check and maybe | ||
| 591 | * align buffer's size to an ep's maxpacketsize. | ||
| 592 | */ | ||
| 593 | static inline size_t | ||
| 594 | usb_ep_align_maybe(struct usb_gadget *g, struct usb_ep *ep, size_t len) | ||
| 595 | { | ||
| 596 | return !g->quirk_ep_out_aligned_size ? len : | ||
| 597 | round_up(len, (size_t)ep->desc->wMaxPacketSize); | ||
| 598 | } | ||
| 599 | |||
| 600 | /** | ||
| 561 | * gadget_is_dualspeed - return true iff the hardware handles high speed | 601 | * gadget_is_dualspeed - return true iff the hardware handles high speed |
| 562 | * @g: controller that might support both high and full speeds | 602 | * @g: controller that might support both high and full speeds |
| 563 | */ | 603 | */ |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index b8aba196f7f1..efe8d8a7c7ad 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
| @@ -134,6 +134,7 @@ struct usb_hcd { | |||
| 134 | unsigned rh_registered:1;/* is root hub registered? */ | 134 | unsigned rh_registered:1;/* is root hub registered? */ |
| 135 | unsigned rh_pollable:1; /* may we poll the root hub? */ | 135 | unsigned rh_pollable:1; /* may we poll the root hub? */ |
| 136 | unsigned msix_enabled:1; /* driver has MSI-X enabled? */ | 136 | unsigned msix_enabled:1; /* driver has MSI-X enabled? */ |
| 137 | unsigned remove_phy:1; /* auto-remove USB phy */ | ||
| 137 | 138 | ||
| 138 | /* The next flag is a stopgap, to be removed when all the HCDs | 139 | /* The next flag is a stopgap, to be removed when all the HCDs |
| 139 | * support the new root-hub polling mechanism. */ | 140 | * support the new root-hub polling mechanism. */ |
| @@ -352,6 +353,8 @@ struct hc_driver { | |||
| 352 | void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); | 353 | void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); |
| 353 | /* Returns the hardware-chosen device address */ | 354 | /* Returns the hardware-chosen device address */ |
| 354 | int (*address_device)(struct usb_hcd *, struct usb_device *udev); | 355 | int (*address_device)(struct usb_hcd *, struct usb_device *udev); |
| 356 | /* prepares the hardware to send commands to the device */ | ||
| 357 | int (*enable_device)(struct usb_hcd *, struct usb_device *udev); | ||
| 355 | /* Notifies the HCD after a hub descriptor is fetched. | 358 | /* Notifies the HCD after a hub descriptor is fetched. |
| 356 | * Will block. | 359 | * Will block. |
| 357 | */ | 360 | */ |
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h index 22a396c13f3a..32754835a39b 100644 --- a/include/linux/usb/msm_hsusb.h +++ b/include/linux/usb/msm_hsusb.h | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
| 22 | #include <linux/usb/otg.h> | 22 | #include <linux/usb/otg.h> |
| 23 | #include <linux/clk.h> | ||
| 23 | 24 | ||
| 24 | /** | 25 | /** |
| 25 | * Supported USB modes | 26 | * Supported USB modes |
| @@ -135,6 +136,8 @@ struct msm_otg_platform_data { | |||
| 135 | enum msm_usb_phy_type phy_type; | 136 | enum msm_usb_phy_type phy_type; |
| 136 | void (*setup_gpio)(enum usb_otg_state state); | 137 | void (*setup_gpio)(enum usb_otg_state state); |
| 137 | char *pclk_src_name; | 138 | char *pclk_src_name; |
| 139 | int (*link_clk_reset)(struct clk *link_clk, bool assert); | ||
| 140 | int (*phy_clk_reset)(struct clk *phy_clk); | ||
| 138 | }; | 141 | }; |
| 139 | 142 | ||
| 140 | /** | 143 | /** |
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index eb505250940a..a4ee1b582183 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h | |||
| @@ -76,6 +76,9 @@ struct musb_hdrc_config { | |||
| 76 | unsigned dma:1 __deprecated; /* supports DMA */ | 76 | unsigned dma:1 __deprecated; /* supports DMA */ |
| 77 | unsigned vendor_req:1 __deprecated; /* vendor registers required */ | 77 | unsigned vendor_req:1 __deprecated; /* vendor registers required */ |
| 78 | 78 | ||
| 79 | /* need to explicitly de-assert the port reset after resume? */ | ||
| 80 | unsigned host_port_deassert_reset_at_resume:1; | ||
| 81 | |||
| 79 | u8 num_eps; /* number of endpoints _with_ ep0 */ | 82 | u8 num_eps; /* number of endpoints _with_ ep0 */ |
| 80 | u8 dma_channels __deprecated; /* number of dma channels */ | 83 | u8 dma_channels __deprecated; /* number of dma channels */ |
| 81 | u8 dyn_fifo_size; /* dynamic size in bytes */ | 84 | u8 dyn_fifo_size; /* dynamic size in bytes */ |
diff --git a/include/linux/usb/omap_control_usb.h b/include/linux/usb/omap_control_usb.h index 596b01918813..69ae383ee3cc 100644 --- a/include/linux/usb/omap_control_usb.h +++ b/include/linux/usb/omap_control_usb.h | |||
| @@ -24,6 +24,7 @@ enum omap_control_usb_type { | |||
| 24 | OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ | 24 | OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ |
| 25 | OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ | 25 | OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ |
| 26 | OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ | 26 | OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ |
| 27 | OMAP_CTRL_TYPE_AM437USB2, /* USB2 PHY, power e.g. AM437x */ | ||
| 27 | }; | 28 | }; |
| 28 | 29 | ||
| 29 | struct omap_control_usb { | 30 | struct omap_control_usb { |
| @@ -64,6 +65,11 @@ enum omap_control_usb_mode { | |||
| 64 | 65 | ||
| 65 | #define OMAP_CTRL_USB2_PHY_PD BIT(28) | 66 | #define OMAP_CTRL_USB2_PHY_PD BIT(28) |
| 66 | 67 | ||
| 68 | #define AM437X_CTRL_USB2_PHY_PD BIT(0) | ||
| 69 | #define AM437X_CTRL_USB2_OTG_PD BIT(1) | ||
| 70 | #define AM437X_CTRL_USB2_OTGVDET_EN BIT(19) | ||
| 71 | #define AM437X_CTRL_USB2_OTGSESSEND_EN BIT(20) | ||
| 72 | |||
| 67 | #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) | 73 | #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) |
| 68 | extern void omap_control_usb_phy_power(struct device *dev, int on); | 74 | extern void omap_control_usb_phy_power(struct device *dev, int on); |
| 69 | extern void omap_control_usb_set_mode(struct device *dev, | 75 | extern void omap_control_usb_set_mode(struct device *dev, |
diff --git a/include/linux/usb/otg-fsm.h b/include/linux/usb/otg-fsm.h new file mode 100644 index 000000000000..b6ba1bfb86f2 --- /dev/null +++ b/include/linux/usb/otg-fsm.h | |||
| @@ -0,0 +1,244 @@ | |||
| 1 | /* Copyright (C) 2007,2008 Freescale Semiconductor, Inc. | ||
| 2 | * | ||
| 3 | * This program is free software; you can redistribute it and/or modify it | ||
| 4 | * under the terms of the GNU General Public License as published by the | ||
| 5 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 6 | * option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, but | ||
| 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 11 | * General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License along | ||
| 14 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 15 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef __LINUX_USB_OTG_FSM_H | ||
| 19 | #define __LINUX_USB_OTG_FSM_H | ||
| 20 | |||
| 21 | #include <linux/mutex.h> | ||
| 22 | #include <linux/errno.h> | ||
| 23 | |||
| 24 | #undef VERBOSE | ||
| 25 | |||
| 26 | #ifdef VERBOSE | ||
| 27 | #define VDBG(fmt, args...) pr_debug("[%s] " fmt , \ | ||
| 28 | __func__, ## args) | ||
| 29 | #else | ||
| 30 | #define VDBG(stuff...) do {} while (0) | ||
| 31 | #endif | ||
| 32 | |||
| 33 | #ifdef VERBOSE | ||
| 34 | #define MPC_LOC printk("Current Location [%s]:[%d]\n", __FILE__, __LINE__) | ||
| 35 | #else | ||
| 36 | #define MPC_LOC do {} while (0) | ||
| 37 | #endif | ||
| 38 | |||
| 39 | #define PROTO_UNDEF (0) | ||
| 40 | #define PROTO_HOST (1) | ||
| 41 | #define PROTO_GADGET (2) | ||
| 42 | |||
| 43 | enum otg_fsm_timer { | ||
| 44 | /* Standard OTG timers */ | ||
| 45 | A_WAIT_VRISE, | ||
| 46 | A_WAIT_VFALL, | ||
| 47 | A_WAIT_BCON, | ||
| 48 | A_AIDL_BDIS, | ||
| 49 | B_ASE0_BRST, | ||
| 50 | A_BIDL_ADIS, | ||
| 51 | |||
| 52 | /* Auxiliary timers */ | ||
| 53 | B_SE0_SRP, | ||
| 54 | B_SRP_FAIL, | ||
| 55 | A_WAIT_ENUM, | ||
| 56 | |||
| 57 | NUM_OTG_FSM_TIMERS, | ||
| 58 | }; | ||
| 59 | |||
| 60 | /* OTG state machine according to the OTG spec */ | ||
| 61 | struct otg_fsm { | ||
| 62 | /* Input */ | ||
| 63 | int id; | ||
| 64 | int adp_change; | ||
| 65 | int power_up; | ||
| 66 | int test_device; | ||
| 67 | int a_bus_drop; | ||
| 68 | int a_bus_req; | ||
| 69 | int a_srp_det; | ||
| 70 | int a_vbus_vld; | ||
| 71 | int b_conn; | ||
| 72 | int a_bus_resume; | ||
| 73 | int a_bus_suspend; | ||
| 74 | int a_conn; | ||
| 75 | int b_bus_req; | ||
| 76 | int b_se0_srp; | ||
| 77 | int b_ssend_srp; | ||
| 78 | int b_sess_vld; | ||
| 79 | /* Auxilary inputs */ | ||
| 80 | int a_sess_vld; | ||
| 81 | int b_bus_resume; | ||
| 82 | int b_bus_suspend; | ||
| 83 | |||
| 84 | /* Output */ | ||
| 85 | int data_pulse; | ||
| 86 | int drv_vbus; | ||
| 87 | int loc_conn; | ||
| 88 | int loc_sof; | ||
| 89 | int adp_prb; | ||
| 90 | int adp_sns; | ||
| 91 | |||
| 92 | /* Internal variables */ | ||
| 93 | int a_set_b_hnp_en; | ||
| 94 | int b_srp_done; | ||
| 95 | int b_hnp_enable; | ||
| 96 | int a_clr_err; | ||
| 97 | |||
| 98 | /* Informative variables */ | ||
| 99 | int a_bus_drop_inf; | ||
| 100 | int a_bus_req_inf; | ||
| 101 | int a_clr_err_inf; | ||
| 102 | int b_bus_req_inf; | ||
| 103 | /* Auxilary informative variables */ | ||
| 104 | int a_suspend_req_inf; | ||
| 105 | |||
| 106 | /* Timeout indicator for timers */ | ||
| 107 | int a_wait_vrise_tmout; | ||
| 108 | int a_wait_vfall_tmout; | ||
| 109 | int a_wait_bcon_tmout; | ||
| 110 | int a_aidl_bdis_tmout; | ||
| 111 | int b_ase0_brst_tmout; | ||
| 112 | int a_bidl_adis_tmout; | ||
| 113 | |||
| 114 | struct otg_fsm_ops *ops; | ||
| 115 | struct usb_otg *otg; | ||
| 116 | |||
| 117 | /* Current usb protocol used: 0:undefine; 1:host; 2:client */ | ||
| 118 | int protocol; | ||
| 119 | struct mutex lock; | ||
| 120 | }; | ||
| 121 | |||
| 122 | struct otg_fsm_ops { | ||
| 123 | void (*chrg_vbus)(struct otg_fsm *fsm, int on); | ||
| 124 | void (*drv_vbus)(struct otg_fsm *fsm, int on); | ||
| 125 | void (*loc_conn)(struct otg_fsm *fsm, int on); | ||
| 126 | void (*loc_sof)(struct otg_fsm *fsm, int on); | ||
| 127 | void (*start_pulse)(struct otg_fsm *fsm); | ||
| 128 | void (*start_adp_prb)(struct otg_fsm *fsm); | ||
| 129 | void (*start_adp_sns)(struct otg_fsm *fsm); | ||
| 130 | void (*add_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer); | ||
| 131 | void (*del_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer); | ||
| 132 | int (*start_host)(struct otg_fsm *fsm, int on); | ||
| 133 | int (*start_gadget)(struct otg_fsm *fsm, int on); | ||
| 134 | }; | ||
| 135 | |||
| 136 | |||
| 137 | static inline int otg_chrg_vbus(struct otg_fsm *fsm, int on) | ||
| 138 | { | ||
| 139 | if (!fsm->ops->chrg_vbus) | ||
| 140 | return -EOPNOTSUPP; | ||
| 141 | fsm->ops->chrg_vbus(fsm, on); | ||
| 142 | return 0; | ||
| 143 | } | ||
| 144 | |||
| 145 | static inline int otg_drv_vbus(struct otg_fsm *fsm, int on) | ||
| 146 | { | ||
| 147 | if (!fsm->ops->drv_vbus) | ||
| 148 | return -EOPNOTSUPP; | ||
| 149 | if (fsm->drv_vbus != on) { | ||
| 150 | fsm->drv_vbus = on; | ||
| 151 | fsm->ops->drv_vbus(fsm, on); | ||
| 152 | } | ||
| 153 | return 0; | ||
| 154 | } | ||
| 155 | |||
| 156 | static inline int otg_loc_conn(struct otg_fsm *fsm, int on) | ||
| 157 | { | ||
| 158 | if (!fsm->ops->loc_conn) | ||
| 159 | return -EOPNOTSUPP; | ||
| 160 | if (fsm->loc_conn != on) { | ||
| 161 | fsm->loc_conn = on; | ||
| 162 | fsm->ops->loc_conn(fsm, on); | ||
| 163 | } | ||
| 164 | return 0; | ||
| 165 | } | ||
| 166 | |||
| 167 | static inline int otg_loc_sof(struct otg_fsm *fsm, int on) | ||
| 168 | { | ||
| 169 | if (!fsm->ops->loc_sof) | ||
| 170 | return -EOPNOTSUPP; | ||
| 171 | if (fsm->loc_sof != on) { | ||
| 172 | fsm->loc_sof = on; | ||
| 173 | fsm->ops->loc_sof(fsm, on); | ||
| 174 | } | ||
| 175 | return 0; | ||
| 176 | } | ||
| 177 | |||
| 178 | static inline int otg_start_pulse(struct otg_fsm *fsm) | ||
| 179 | { | ||
| 180 | if (!fsm->ops->start_pulse) | ||
| 181 | return -EOPNOTSUPP; | ||
| 182 | if (!fsm->data_pulse) { | ||
| 183 | fsm->data_pulse = 1; | ||
| 184 | fsm->ops->start_pulse(fsm); | ||
| 185 | } | ||
| 186 | return 0; | ||
| 187 | } | ||
| 188 | |||
| 189 | static inline int otg_start_adp_prb(struct otg_fsm *fsm) | ||
| 190 | { | ||
| 191 | if (!fsm->ops->start_adp_prb) | ||
| 192 | return -EOPNOTSUPP; | ||
| 193 | if (!fsm->adp_prb) { | ||
| 194 | fsm->adp_sns = 0; | ||
| 195 | fsm->adp_prb = 1; | ||
| 196 | fsm->ops->start_adp_prb(fsm); | ||
| 197 | } | ||
| 198 | return 0; | ||
| 199 | } | ||
| 200 | |||
| 201 | static inline int otg_start_adp_sns(struct otg_fsm *fsm) | ||
| 202 | { | ||
| 203 | if (!fsm->ops->start_adp_sns) | ||
| 204 | return -EOPNOTSUPP; | ||
| 205 | if (!fsm->adp_sns) { | ||
| 206 | fsm->adp_sns = 1; | ||
| 207 | fsm->ops->start_adp_sns(fsm); | ||
| 208 | } | ||
| 209 | return 0; | ||
| 210 | } | ||
| 211 | |||
| 212 | static inline int otg_add_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer) | ||
| 213 | { | ||
| 214 | if (!fsm->ops->add_timer) | ||
| 215 | return -EOPNOTSUPP; | ||
| 216 | fsm->ops->add_timer(fsm, timer); | ||
| 217 | return 0; | ||
| 218 | } | ||
| 219 | |||
| 220 | static inline int otg_del_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer) | ||
| 221 | { | ||
| 222 | if (!fsm->ops->del_timer) | ||
| 223 | return -EOPNOTSUPP; | ||
| 224 | fsm->ops->del_timer(fsm, timer); | ||
| 225 | return 0; | ||
| 226 | } | ||
| 227 | |||
| 228 | static inline int otg_start_host(struct otg_fsm *fsm, int on) | ||
| 229 | { | ||
| 230 | if (!fsm->ops->start_host) | ||
| 231 | return -EOPNOTSUPP; | ||
| 232 | return fsm->ops->start_host(fsm, on); | ||
| 233 | } | ||
| 234 | |||
| 235 | static inline int otg_start_gadget(struct otg_fsm *fsm, int on) | ||
| 236 | { | ||
| 237 | if (!fsm->ops->start_gadget) | ||
| 238 | return -EOPNOTSUPP; | ||
| 239 | return fsm->ops->start_gadget(fsm, on); | ||
| 240 | } | ||
| 241 | |||
| 242 | int otg_statemachine(struct otg_fsm *fsm); | ||
| 243 | |||
| 244 | #endif /* __LINUX_USB_OTG_FSM_H */ | ||
diff --git a/include/linux/usb/wusb.h b/include/linux/usb/wusb.h index 0c4d4ca370ec..eeb28329fa3c 100644 --- a/include/linux/usb/wusb.h +++ b/include/linux/usb/wusb.h | |||
| @@ -271,6 +271,8 @@ static inline u8 wusb_key_index(int index, int type, int originator) | |||
| 271 | #define WUSB_KEY_INDEX_TYPE_GTK 2 | 271 | #define WUSB_KEY_INDEX_TYPE_GTK 2 |
| 272 | #define WUSB_KEY_INDEX_ORIGINATOR_HOST 0 | 272 | #define WUSB_KEY_INDEX_ORIGINATOR_HOST 0 |
| 273 | #define WUSB_KEY_INDEX_ORIGINATOR_DEVICE 1 | 273 | #define WUSB_KEY_INDEX_ORIGINATOR_DEVICE 1 |
| 274 | /* bits 0-3 used for the key index. */ | ||
| 275 | #define WUSB_KEY_INDEX_MAX 15 | ||
| 274 | 276 | ||
| 275 | /* A CCM Nonce, defined in WUSB1.0[6.4.1] */ | 277 | /* A CCM Nonce, defined in WUSB1.0[6.4.1] */ |
| 276 | struct aes_ccm_nonce { | 278 | struct aes_ccm_nonce { |
diff --git a/include/linux/uwb/umc.h b/include/linux/uwb/umc.h index 891d1d5f3947..ba82f03d8287 100644 --- a/include/linux/uwb/umc.h +++ b/include/linux/uwb/umc.h | |||
| @@ -143,7 +143,7 @@ int umc_match_pci_id(struct umc_driver *umc_drv, struct umc_dev *umc); | |||
| 143 | static inline struct pci_dev *umc_parent_pci_dev(struct umc_dev *umc_dev) | 143 | static inline struct pci_dev *umc_parent_pci_dev(struct umc_dev *umc_dev) |
| 144 | { | 144 | { |
| 145 | struct pci_dev *pci_dev = NULL; | 145 | struct pci_dev *pci_dev = NULL; |
| 146 | if (umc_dev->dev.parent->bus == &pci_bus_type) | 146 | if (dev_is_pci(umc_dev->dev.parent)) |
| 147 | pci_dev = to_pci_dev(umc_dev->dev.parent); | 147 | pci_dev = to_pci_dev(umc_dev->dev.parent); |
| 148 | return pci_dev; | 148 | return pci_dev; |
| 149 | } | 149 | } |
diff --git a/include/linux/vme.h b/include/linux/vme.h index c9d65bf14cec..8cd6f19ca518 100644 --- a/include/linux/vme.h +++ b/include/linux/vme.h | |||
| @@ -164,7 +164,8 @@ int vme_lm_attach(struct vme_resource *, int, void (*callback)(int)); | |||
| 164 | int vme_lm_detach(struct vme_resource *, int); | 164 | int vme_lm_detach(struct vme_resource *, int); |
| 165 | void vme_lm_free(struct vme_resource *); | 165 | void vme_lm_free(struct vme_resource *); |
| 166 | 166 | ||
| 167 | int vme_slot_get(struct vme_dev *); | 167 | int vme_slot_num(struct vme_dev *); |
| 168 | int vme_bus_num(struct vme_dev *); | ||
| 168 | 169 | ||
| 169 | int vme_register_driver(struct vme_driver *, unsigned int); | 170 | int vme_register_driver(struct vme_driver *, unsigned int); |
| 170 | void vme_unregister_driver(struct vme_driver *); | 171 | void vme_unregister_driver(struct vme_driver *); |
diff --git a/include/linux/vmpressure.h b/include/linux/vmpressure.h index 3f3788d49362..3e4535876d37 100644 --- a/include/linux/vmpressure.h +++ b/include/linux/vmpressure.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <linux/gfp.h> | 7 | #include <linux/gfp.h> |
| 8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
| 9 | #include <linux/cgroup.h> | 9 | #include <linux/cgroup.h> |
| 10 | #include <linux/eventfd.h> | ||
| 10 | 11 | ||
| 11 | struct vmpressure { | 12 | struct vmpressure { |
| 12 | unsigned long scanned; | 13 | unsigned long scanned; |
| @@ -33,13 +34,10 @@ extern void vmpressure_init(struct vmpressure *vmpr); | |||
| 33 | extern void vmpressure_cleanup(struct vmpressure *vmpr); | 34 | extern void vmpressure_cleanup(struct vmpressure *vmpr); |
| 34 | extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg); | 35 | extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg); |
| 35 | extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr); | 36 | extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr); |
| 36 | extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css); | 37 | extern int vmpressure_register_event(struct mem_cgroup *memcg, |
| 37 | extern int vmpressure_register_event(struct cgroup_subsys_state *css, | ||
| 38 | struct cftype *cft, | ||
| 39 | struct eventfd_ctx *eventfd, | 38 | struct eventfd_ctx *eventfd, |
| 40 | const char *args); | 39 | const char *args); |
| 41 | extern void vmpressure_unregister_event(struct cgroup_subsys_state *css, | 40 | extern void vmpressure_unregister_event(struct mem_cgroup *memcg, |
| 42 | struct cftype *cft, | ||
| 43 | struct eventfd_ctx *eventfd); | 41 | struct eventfd_ctx *eventfd); |
| 44 | #else | 42 | #else |
| 45 | static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, | 43 | static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, |
diff --git a/include/linux/vtime.h b/include/linux/vtime.h index f5b72b364bda..c5165fd256f9 100644 --- a/include/linux/vtime.h +++ b/include/linux/vtime.h | |||
| @@ -19,8 +19,8 @@ static inline bool vtime_accounting_enabled(void) { return true; } | |||
| 19 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN | 19 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN |
| 20 | static inline bool vtime_accounting_enabled(void) | 20 | static inline bool vtime_accounting_enabled(void) |
| 21 | { | 21 | { |
| 22 | if (static_key_false(&context_tracking_enabled)) { | 22 | if (context_tracking_is_enabled()) { |
| 23 | if (context_tracking_active()) | 23 | if (context_tracking_cpu_is_enabled()) |
| 24 | return true; | 24 | return true; |
| 25 | } | 25 | } |
| 26 | 26 | ||
diff --git a/include/linux/w1-gpio.h b/include/linux/w1-gpio.h index 065e3ae79ab0..d58594a32324 100644 --- a/include/linux/w1-gpio.h +++ b/include/linux/w1-gpio.h | |||
| @@ -20,6 +20,7 @@ struct w1_gpio_platform_data { | |||
| 20 | unsigned int is_open_drain:1; | 20 | unsigned int is_open_drain:1; |
| 21 | void (*enable_external_pullup)(int enable); | 21 | void (*enable_external_pullup)(int enable); |
| 22 | unsigned int ext_pullup_enable_pin; | 22 | unsigned int ext_pullup_enable_pin; |
| 23 | unsigned int pullup_duration; | ||
| 23 | }; | 24 | }; |
| 24 | 25 | ||
| 25 | #endif /* _LINUX_W1_GPIO_H */ | 26 | #endif /* _LINUX_W1_GPIO_H */ |
diff --git a/include/linux/wait.h b/include/linux/wait.h index eaa00b10abaa..559044c79232 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
| @@ -286,8 +286,8 @@ do { \ | |||
| 286 | * wait_event_cmd - sleep until a condition gets true | 286 | * wait_event_cmd - sleep until a condition gets true |
| 287 | * @wq: the waitqueue to wait on | 287 | * @wq: the waitqueue to wait on |
| 288 | * @condition: a C expression for the event to wait for | 288 | * @condition: a C expression for the event to wait for |
| 289 | * cmd1: the command will be executed before sleep | 289 | * @cmd1: the command will be executed before sleep |
| 290 | * cmd2: the command will be executed after sleep | 290 | * @cmd2: the command will be executed after sleep |
| 291 | * | 291 | * |
| 292 | * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the | 292 | * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the |
| 293 | * @condition evaluates to true. The @condition is checked each time | 293 | * @condition evaluates to true. The @condition is checked each time |
diff --git a/include/linux/zorro.h b/include/linux/zorro.h index dff42025649b..63fbba0740c2 100644 --- a/include/linux/zorro.h +++ b/include/linux/zorro.h | |||
| @@ -11,107 +11,10 @@ | |||
| 11 | #ifndef _LINUX_ZORRO_H | 11 | #ifndef _LINUX_ZORRO_H |
| 12 | #define _LINUX_ZORRO_H | 12 | #define _LINUX_ZORRO_H |
| 13 | 13 | ||
| 14 | #include <linux/device.h> | ||
| 15 | |||
| 16 | |||
| 17 | /* | ||
| 18 | * Each Zorro board has a 32-bit ID of the form | ||
| 19 | * | ||
| 20 | * mmmmmmmmmmmmmmmmppppppppeeeeeeee | ||
| 21 | * | ||
| 22 | * with | ||
| 23 | * | ||
| 24 | * mmmmmmmmmmmmmmmm 16-bit Manufacturer ID (assigned by CBM (sigh)) | ||
| 25 | * pppppppp 8-bit Product ID (assigned by manufacturer) | ||
| 26 | * eeeeeeee 8-bit Extended Product ID (currently only used | ||
| 27 | * for some GVP boards) | ||
| 28 | */ | ||
| 29 | |||
| 30 | |||
| 31 | #define ZORRO_MANUF(id) ((id) >> 16) | ||
| 32 | #define ZORRO_PROD(id) (((id) >> 8) & 0xff) | ||
| 33 | #define ZORRO_EPC(id) ((id) & 0xff) | ||
| 34 | |||
| 35 | #define ZORRO_ID(manuf, prod, epc) \ | ||
| 36 | ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc)) | ||
| 37 | |||
| 38 | typedef __u32 zorro_id; | ||
| 39 | |||
| 40 | |||
| 41 | /* Include the ID list */ | ||
| 42 | #include <linux/zorro_ids.h> | ||
| 43 | |||
| 44 | 14 | ||
| 45 | /* | 15 | #include <uapi/linux/zorro.h> |
| 46 | * GVP identifies most of its products through the 'extended product code' | ||
| 47 | * (epc). The epc has to be ANDed with the GVP_PRODMASK before the | ||
| 48 | * identification. | ||
| 49 | */ | ||
| 50 | |||
| 51 | #define GVP_PRODMASK (0xf8) | ||
| 52 | #define GVP_SCSICLKMASK (0x01) | ||
| 53 | |||
| 54 | enum GVP_flags { | ||
| 55 | GVP_IO = 0x01, | ||
| 56 | GVP_ACCEL = 0x02, | ||
| 57 | GVP_SCSI = 0x04, | ||
| 58 | GVP_24BITDMA = 0x08, | ||
| 59 | GVP_25BITDMA = 0x10, | ||
| 60 | GVP_NOBANK = 0x20, | ||
| 61 | GVP_14MHZ = 0x40, | ||
| 62 | }; | ||
| 63 | |||
| 64 | |||
| 65 | struct Node { | ||
| 66 | struct Node *ln_Succ; /* Pointer to next (successor) */ | ||
| 67 | struct Node *ln_Pred; /* Pointer to previous (predecessor) */ | ||
| 68 | __u8 ln_Type; | ||
| 69 | __s8 ln_Pri; /* Priority, for sorting */ | ||
| 70 | __s8 *ln_Name; /* ID string, null terminated */ | ||
| 71 | } __attribute__ ((packed)); | ||
| 72 | |||
| 73 | struct ExpansionRom { | ||
| 74 | /* -First 16 bytes of the expansion ROM */ | ||
| 75 | __u8 er_Type; /* Board type, size and flags */ | ||
| 76 | __u8 er_Product; /* Product number, assigned by manufacturer */ | ||
| 77 | __u8 er_Flags; /* Flags */ | ||
| 78 | __u8 er_Reserved03; /* Must be zero ($ff inverted) */ | ||
| 79 | __u16 er_Manufacturer; /* Unique ID, ASSIGNED BY COMMODORE-AMIGA! */ | ||
| 80 | __u32 er_SerialNumber; /* Available for use by manufacturer */ | ||
| 81 | __u16 er_InitDiagVec; /* Offset to optional "DiagArea" structure */ | ||
| 82 | __u8 er_Reserved0c; | ||
| 83 | __u8 er_Reserved0d; | ||
| 84 | __u8 er_Reserved0e; | ||
| 85 | __u8 er_Reserved0f; | ||
| 86 | } __attribute__ ((packed)); | ||
| 87 | |||
| 88 | /* er_Type board type bits */ | ||
| 89 | #define ERT_TYPEMASK 0xc0 | ||
| 90 | #define ERT_ZORROII 0xc0 | ||
| 91 | #define ERT_ZORROIII 0x80 | ||
| 92 | |||
| 93 | /* other bits defined in er_Type */ | ||
| 94 | #define ERTB_MEMLIST 5 /* Link RAM into free memory list */ | ||
| 95 | #define ERTF_MEMLIST (1<<5) | ||
| 96 | |||
| 97 | struct ConfigDev { | ||
| 98 | struct Node cd_Node; | ||
| 99 | __u8 cd_Flags; /* (read/write) */ | ||
| 100 | __u8 cd_Pad; /* reserved */ | ||
| 101 | struct ExpansionRom cd_Rom; /* copy of board's expansion ROM */ | ||
| 102 | void *cd_BoardAddr; /* where in memory the board was placed */ | ||
| 103 | __u32 cd_BoardSize; /* size of board in bytes */ | ||
| 104 | __u16 cd_SlotAddr; /* which slot number (PRIVATE) */ | ||
| 105 | __u16 cd_SlotSize; /* number of slots (PRIVATE) */ | ||
| 106 | void *cd_Driver; /* pointer to node of driver */ | ||
| 107 | struct ConfigDev *cd_NextCD; /* linked list of drivers to config */ | ||
| 108 | __u32 cd_Unused[4]; /* for whatever the driver wants */ | ||
| 109 | } __attribute__ ((packed)); | ||
| 110 | |||
| 111 | #define ZORRO_NUM_AUTO 16 | ||
| 112 | |||
| 113 | #ifdef __KERNEL__ | ||
| 114 | 16 | ||
| 17 | #include <linux/device.h> | ||
| 115 | #include <linux/init.h> | 18 | #include <linux/init.h> |
| 116 | #include <linux/ioport.h> | 19 | #include <linux/ioport.h> |
| 117 | #include <linux/mod_devicetable.h> | 20 | #include <linux/mod_devicetable.h> |
| @@ -175,7 +78,23 @@ static inline struct zorro_driver *zorro_dev_driver(const struct zorro_dev *z) | |||
| 175 | 78 | ||
| 176 | 79 | ||
| 177 | extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */ | 80 | extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */ |
| 178 | extern struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO]; | 81 | extern struct zorro_dev *zorro_autocon; |
| 82 | |||
| 83 | |||
| 84 | /* | ||
| 85 | * Minimal information about a Zorro device, passed from bootinfo | ||
| 86 | * Only available temporarily, i.e. until initmem has been freed! | ||
| 87 | */ | ||
| 88 | |||
| 89 | struct zorro_dev_init { | ||
| 90 | struct ExpansionRom rom; | ||
| 91 | u16 slotaddr; | ||
| 92 | u16 slotsize; | ||
| 93 | u32 boardaddr; | ||
| 94 | u32 boardsize; | ||
| 95 | }; | ||
| 96 | |||
| 97 | extern struct zorro_dev_init zorro_autocon_init[ZORRO_NUM_AUTO] __initdata; | ||
| 179 | 98 | ||
| 180 | 99 | ||
| 181 | /* | 100 | /* |
| @@ -229,6 +148,4 @@ extern DECLARE_BITMAP(zorro_unused_z2ram, 128); | |||
| 229 | #define Z2RAM_CHUNKSHIFT (16) | 148 | #define Z2RAM_CHUNKSHIFT (16) |
| 230 | 149 | ||
| 231 | 150 | ||
| 232 | #endif /* __KERNEL__ */ | ||
| 233 | |||
| 234 | #endif /* _LINUX_ZORRO_H */ | 151 | #endif /* _LINUX_ZORRO_H */ |
diff --git a/include/linux/zorro_ids.h b/include/linux/zorro_ids.h deleted file mode 100644 index 74bc53bcfdcf..000000000000 --- a/include/linux/zorro_ids.h +++ /dev/null | |||
| @@ -1,552 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Zorro board IDs | ||
| 3 | * | ||
| 4 | * Please keep sorted. | ||
| 5 | */ | ||
| 6 | |||
| 7 | |||
| 8 | #define ZORRO_MANUF_PACIFIC_PERIPHERALS 0x00D3 | ||
| 9 | #define ZORRO_PROD_PACIFIC_PERIPHERALS_SE_2000_A500 ZORRO_ID(PACIFIC_PERIPHERALS, 0x00, 0) | ||
| 10 | #define ZORRO_PROD_PACIFIC_PERIPHERALS_SCSI ZORRO_ID(PACIFIC_PERIPHERALS, 0x0A, 0) | ||
| 11 | |||
| 12 | #define ZORRO_MANUF_MACROSYSTEMS_USA_2 0x0100 | ||
| 13 | #define ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE ZORRO_ID(MACROSYSTEMS_USA_2, 0x13, 0) | ||
| 14 | |||
| 15 | #define ZORRO_MANUF_KUPKE_1 0x00DD | ||
| 16 | #define ZORRO_PROD_KUPKE_GOLEM_RAM_BOX_2MB ZORRO_ID(KUPKE_1, 0x00, 0) | ||
| 17 | |||
| 18 | #define ZORRO_MANUF_MEMPHIS 0x0100 | ||
| 19 | #define ZORRO_PROD_MEMPHIS_STORMBRINGER ZORRO_ID(MEMPHIS, 0x00, 0) | ||
| 20 | |||
| 21 | #define ZORRO_MANUF_3_STATE 0x0200 | ||
| 22 | #define ZORRO_PROD_3_STATE_MEGAMIX_2000 ZORRO_ID(3_STATE, 0x02, 0) | ||
| 23 | |||
| 24 | #define ZORRO_MANUF_COMMODORE_BRAUNSCHWEIG 0x0201 | ||
| 25 | #define ZORRO_PROD_CBM_A2088_A2286 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x01, 0) | ||
| 26 | #define ZORRO_PROD_CBM_A2286 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x02, 0) | ||
| 27 | #define ZORRO_PROD_CBM_A4091_1 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x54, 0) | ||
| 28 | #define ZORRO_PROD_CBM_A2386SX_1 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x67, 0) | ||
| 29 | |||
| 30 | #define ZORRO_MANUF_COMMODORE_WEST_CHESTER_1 0x0202 | ||
| 31 | #define ZORRO_PROD_CBM_A2090A ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x01, 0) | ||
| 32 | #define ZORRO_PROD_CBM_A590_A2091_1 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x02, 0) | ||
| 33 | #define ZORRO_PROD_CBM_A590_A2091_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x03, 0) | ||
| 34 | #define ZORRO_PROD_CBM_A2090B ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x04, 0) | ||
| 35 | #define ZORRO_PROD_CBM_A2060 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x09, 0) | ||
| 36 | #define ZORRO_PROD_CBM_A590_A2052_A2058_A2091 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x0A, 0) | ||
| 37 | #define ZORRO_PROD_CBM_A560_RAM ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x20, 0) | ||
| 38 | #define ZORRO_PROD_CBM_A2232_PROTOTYPE ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x45, 0) | ||
| 39 | #define ZORRO_PROD_CBM_A2232 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x46, 0) | ||
| 40 | #define ZORRO_PROD_CBM_A2620 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x50, 0) | ||
| 41 | #define ZORRO_PROD_CBM_A2630 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x51, 0) | ||
| 42 | #define ZORRO_PROD_CBM_A4091_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x54, 0) | ||
| 43 | #define ZORRO_PROD_CBM_A2065_1 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x5A, 0) | ||
| 44 | #define ZORRO_PROD_CBM_ROMULATOR ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x60, 0) | ||
| 45 | #define ZORRO_PROD_CBM_A3000_TEST_FIXTURE ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x61, 0) | ||
| 46 | #define ZORRO_PROD_CBM_A2386SX_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x67, 0) | ||
| 47 | #define ZORRO_PROD_CBM_A2065_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x70, 0) | ||
| 48 | |||
| 49 | #define ZORRO_MANUF_COMMODORE_WEST_CHESTER_2 0x0203 | ||
| 50 | #define ZORRO_PROD_CBM_A2090A_CM ZORRO_ID(COMMODORE_WEST_CHESTER_2, 0x03, 0) | ||
| 51 | |||
| 52 | #define ZORRO_MANUF_PROGRESSIVE_PERIPHERALS_AND_SYSTEMS_2 0x02F4 | ||
| 53 | #define ZORRO_PROD_PPS_EXP8000 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS_2, 0x02, 0) | ||
| 54 | |||
| 55 | #define ZORRO_MANUF_KOLFF_COMPUTER_SUPPLIES 0x02FF | ||
| 56 | #define ZORRO_PROD_KCS_POWER_PC_BOARD ZORRO_ID(KOLFF_COMPUTER_SUPPLIES, 0x00, 0) | ||
| 57 | |||
| 58 | #define ZORRO_MANUF_CARDCO_1 0x03EC | ||
| 59 | #define ZORRO_PROD_CARDCO_KRONOS_2000_1 ZORRO_ID(CARDCO_1, 0x04, 0) | ||
| 60 | #define ZORRO_PROD_CARDCO_A1000_1 ZORRO_ID(CARDCO_1, 0x0C, 0) | ||
| 61 | #define ZORRO_PROD_CARDCO_ESCORT ZORRO_ID(CARDCO_1, 0x0E, 0) | ||
| 62 | #define ZORRO_PROD_CARDCO_A2410 ZORRO_ID(CARDCO_1, 0xF5, 0) | ||
| 63 | |||
| 64 | #define ZORRO_MANUF_A_SQUARED 0x03ED | ||
| 65 | #define ZORRO_PROD_A_SQUARED_LIVE_2000 ZORRO_ID(A_SQUARED, 0x01, 0) | ||
| 66 | |||
| 67 | #define ZORRO_MANUF_COMSPEC_COMMUNICATIONS 0x03EE | ||
| 68 | #define ZORRO_PROD_COMSPEC_COMMUNICATIONS_AX2000 ZORRO_ID(COMSPEC_COMMUNICATIONS, 0x01, 0) | ||
| 69 | |||
| 70 | #define ZORRO_MANUF_ANAKIN_RESEARCH 0x03F1 | ||
| 71 | #define ZORRO_PROD_ANAKIN_RESEARCH_EASYL ZORRO_ID(ANAKIN_RESEARCH, 0x01, 0) | ||
| 72 | |||
| 73 | #define ZORRO_MANUF_MICROBOTICS 0x03F2 | ||
| 74 | #define ZORRO_PROD_MICROBOTICS_STARBOARD_II ZORRO_ID(MICROBOTICS, 0x00, 0) | ||
| 75 | #define ZORRO_PROD_MICROBOTICS_STARDRIVE ZORRO_ID(MICROBOTICS, 0x02, 0) | ||
| 76 | #define ZORRO_PROD_MICROBOTICS_8_UP_A ZORRO_ID(MICROBOTICS, 0x03, 0) | ||
| 77 | #define ZORRO_PROD_MICROBOTICS_8_UP_Z ZORRO_ID(MICROBOTICS, 0x04, 0) | ||
| 78 | #define ZORRO_PROD_MICROBOTICS_DELTA_RAM ZORRO_ID(MICROBOTICS, 0x20, 0) | ||
| 79 | #define ZORRO_PROD_MICROBOTICS_8_STAR_RAM ZORRO_ID(MICROBOTICS, 0x40, 0) | ||
| 80 | #define ZORRO_PROD_MICROBOTICS_8_STAR ZORRO_ID(MICROBOTICS, 0x41, 0) | ||
| 81 | #define ZORRO_PROD_MICROBOTICS_VXL_RAM_32 ZORRO_ID(MICROBOTICS, 0x44, 0) | ||
| 82 | #define ZORRO_PROD_MICROBOTICS_VXL_68030 ZORRO_ID(MICROBOTICS, 0x45, 0) | ||
| 83 | #define ZORRO_PROD_MICROBOTICS_DELTA ZORRO_ID(MICROBOTICS, 0x60, 0) | ||
| 84 | #define ZORRO_PROD_MICROBOTICS_MBX_1200_1200Z_RAM ZORRO_ID(MICROBOTICS, 0x81, 0) | ||
| 85 | #define ZORRO_PROD_MICROBOTICS_HARDFRAME_2000_1 ZORRO_ID(MICROBOTICS, 0x96, 0) | ||
| 86 | #define ZORRO_PROD_MICROBOTICS_HARDFRAME_2000_2 ZORRO_ID(MICROBOTICS, 0x9E, 0) | ||
| 87 | #define ZORRO_PROD_MICROBOTICS_MBX_1200_1200Z ZORRO_ID(MICROBOTICS, 0xC1, 0) | ||
| 88 | |||
| 89 | #define ZORRO_MANUF_ACCESS_ASSOCIATES_ALEGRA 0x03F4 | ||
| 90 | |||
| 91 | #define ZORRO_MANUF_EXPANSION_TECHNOLOGIES 0x03F6 | ||
| 92 | |||
| 93 | #define ZORRO_MANUF_ASDG 0x03FF | ||
| 94 | #define ZORRO_PROD_ASDG_MEMORY_1 ZORRO_ID(ASDG, 0x01, 0) | ||
| 95 | #define ZORRO_PROD_ASDG_MEMORY_2 ZORRO_ID(ASDG, 0x02, 0) | ||
| 96 | #define ZORRO_PROD_ASDG_EB920_LAN_ROVER ZORRO_ID(ASDG, 0xFE, 0) | ||
| 97 | #define ZORRO_PROD_ASDG_GPIB_DUALIEEE488_TWIN_X ZORRO_ID(ASDG, 0xFF, 0) | ||
| 98 | |||
| 99 | #define ZORRO_MANUF_IMTRONICS_1 0x0404 | ||
| 100 | #define ZORRO_PROD_IMTRONICS_HURRICANE_2800_1 ZORRO_ID(IMTRONICS_1, 0x39, 0) | ||
| 101 | #define ZORRO_PROD_IMTRONICS_HURRICANE_2800_2 ZORRO_ID(IMTRONICS_1, 0x57, 0) | ||
| 102 | |||
| 103 | #define ZORRO_MANUF_CBM_UNIVERSITY_OF_LOWELL 0x0406 | ||
| 104 | #define ZORRO_PROD_CBM_A2410 ZORRO_ID(CBM_UNIVERSITY_OF_LOWELL, 0x00, 0) | ||
| 105 | |||
| 106 | #define ZORRO_MANUF_AMERISTAR 0x041D | ||
| 107 | #define ZORRO_PROD_AMERISTAR_A2065 ZORRO_ID(AMERISTAR, 0x01, 0) | ||
| 108 | #define ZORRO_PROD_AMERISTAR_A560 ZORRO_ID(AMERISTAR, 0x09, 0) | ||
| 109 | #define ZORRO_PROD_AMERISTAR_A4066 ZORRO_ID(AMERISTAR, 0x0A, 0) | ||
| 110 | |||
| 111 | #define ZORRO_MANUF_SUPRA 0x0420 | ||
| 112 | #define ZORRO_PROD_SUPRA_SUPRADRIVE_4x4 ZORRO_ID(SUPRA, 0x01, 0) | ||
| 113 | #define ZORRO_PROD_SUPRA_1000_RAM ZORRO_ID(SUPRA, 0x02, 0) | ||
| 114 | #define ZORRO_PROD_SUPRA_2000_DMA ZORRO_ID(SUPRA, 0x03, 0) | ||
| 115 | #define ZORRO_PROD_SUPRA_500 ZORRO_ID(SUPRA, 0x05, 0) | ||
| 116 | #define ZORRO_PROD_SUPRA_500_SCSI ZORRO_ID(SUPRA, 0x08, 0) | ||
| 117 | #define ZORRO_PROD_SUPRA_500XP_2000_RAM ZORRO_ID(SUPRA, 0x09, 0) | ||
| 118 | #define ZORRO_PROD_SUPRA_500RX_2000_RAM ZORRO_ID(SUPRA, 0x0A, 0) | ||
| 119 | #define ZORRO_PROD_SUPRA_2400ZI ZORRO_ID(SUPRA, 0x0B, 0) | ||
| 120 | #define ZORRO_PROD_SUPRA_500XP_SUPRADRIVE_WORDSYNC ZORRO_ID(SUPRA, 0x0C, 0) | ||
| 121 | #define ZORRO_PROD_SUPRA_SUPRADRIVE_WORDSYNC_II ZORRO_ID(SUPRA, 0x0D, 0) | ||
| 122 | #define ZORRO_PROD_SUPRA_2400ZIPLUS ZORRO_ID(SUPRA, 0x10, 0) | ||
| 123 | |||
| 124 | #define ZORRO_MANUF_COMPUTER_SYSTEMS_ASSOCIATES 0x0422 | ||
| 125 | #define ZORRO_PROD_CSA_MAGNUM ZORRO_ID(COMPUTER_SYSTEMS_ASSOCIATES, 0x11, 0) | ||
| 126 | #define ZORRO_PROD_CSA_12_GAUGE ZORRO_ID(COMPUTER_SYSTEMS_ASSOCIATES, 0x15, 0) | ||
| 127 | |||
| 128 | #define ZORRO_MANUF_MARC_MICHAEL_GROTH 0x0439 | ||
| 129 | |||
| 130 | #define ZORRO_MANUF_M_TECH 0x0502 | ||
| 131 | #define ZORRO_PROD_MTEC_AT500_1 ZORRO_ID(M_TECH, 0x03, 0) | ||
| 132 | |||
| 133 | #define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_1 0x06E1 | ||
| 134 | #define ZORRO_PROD_GVP_IMPACT_SERIES_I ZORRO_ID(GREAT_VALLEY_PRODUCTS_1, 0x08, 0) | ||
| 135 | |||
| 136 | #define ZORRO_MANUF_BYTEBOX 0x07DA | ||
| 137 | #define ZORRO_PROD_BYTEBOX_A500 ZORRO_ID(BYTEBOX, 0x00, 0) | ||
| 138 | |||
| 139 | #define ZORRO_MANUF_DKB_POWER_COMPUTING 0x07DC | ||
| 140 | #define ZORRO_PROD_DKB_POWER_COMPUTING_SECUREKEY ZORRO_ID(DKB_POWER_COMPUTING, 0x09, 0) | ||
| 141 | #define ZORRO_PROD_DKB_POWER_COMPUTING_DKM_3128 ZORRO_ID(DKB_POWER_COMPUTING, 0x0E, 0) | ||
| 142 | #define ZORRO_PROD_DKB_POWER_COMPUTING_RAPID_FIRE ZORRO_ID(DKB_POWER_COMPUTING, 0x0F, 0) | ||
| 143 | #define ZORRO_PROD_DKB_POWER_COMPUTING_DKM_1202 ZORRO_ID(DKB_POWER_COMPUTING, 0x10, 0) | ||
| 144 | #define ZORRO_PROD_DKB_POWER_COMPUTING_COBRA_VIPER_II_68EC030 ZORRO_ID(DKB_POWER_COMPUTING, 0x12, 0) | ||
| 145 | #define ZORRO_PROD_DKB_POWER_COMPUTING_WILDFIRE_060_1 ZORRO_ID(DKB_POWER_COMPUTING, 0x17, 0) | ||
| 146 | #define ZORRO_PROD_DKB_POWER_COMPUTING_WILDFIRE_060_2 ZORRO_ID(DKB_POWER_COMPUTING, 0xFF, 0) | ||
| 147 | |||
| 148 | #define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_2 0x07E1 | ||
| 149 | #define ZORRO_PROD_GVP_IMPACT_SERIES_I_4K ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x01, 0) | ||
| 150 | #define ZORRO_PROD_GVP_IMPACT_SERIES_I_16K_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x02, 0) | ||
| 151 | #define ZORRO_PROD_GVP_IMPACT_SERIES_I_16K_3 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x03, 0) | ||
| 152 | #define ZORRO_PROD_GVP_IMPACT_3001_IDE_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x08, 0) | ||
| 153 | #define ZORRO_PROD_GVP_IMPACT_3001_RAM ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x09, 0) | ||
| 154 | #define ZORRO_PROD_GVP_IMPACT_SERIES_II_RAM_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0A, 0) | ||
| 155 | #define ZORRO_PROD_GVP_EPC_BASE ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0) | ||
| 156 | #define ZORRO_PROD_GVP_GFORCE_040_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x20) | ||
| 157 | #define ZORRO_PROD_GVP_GFORCE_040_SCSI_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x30) | ||
| 158 | #define ZORRO_PROD_GVP_A1291 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x40) | ||
| 159 | #define ZORRO_PROD_GVP_COMBO_030_R4 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x60) | ||
| 160 | #define ZORRO_PROD_GVP_COMBO_030_R4_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x70) | ||
| 161 | #define ZORRO_PROD_GVP_PHONEPAK ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x78) | ||
| 162 | #define ZORRO_PROD_GVP_IO_EXTENDER ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x98) | ||
| 163 | #define ZORRO_PROD_GVP_GFORCE_030 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xa0) | ||
| 164 | #define ZORRO_PROD_GVP_GFORCE_030_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xb0) | ||
| 165 | #define ZORRO_PROD_GVP_A530 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xc0) | ||
| 166 | #define ZORRO_PROD_GVP_A530_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xd0) | ||
| 167 | #define ZORRO_PROD_GVP_COMBO_030_R3 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xe0) | ||
| 168 | #define ZORRO_PROD_GVP_COMBO_030_R3_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xf0) | ||
| 169 | #define ZORRO_PROD_GVP_SERIES_II ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xf8) | ||
| 170 | #define ZORRO_PROD_GVP_IMPACT_3001_IDE_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0D, 0) | ||
| 171 | /*#define ZORRO_PROD_GVP_A2000_030 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0D, 0)*/ | ||
| 172 | /*#define ZORRO_PROD_GVP_GFORCE_040_SCSI_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0D, 0)*/ | ||
| 173 | #define ZORRO_PROD_GVP_GFORCE_040_060 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x16, 0) | ||
| 174 | #define ZORRO_PROD_GVP_IMPACT_VISION_24 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x20, 0) | ||
| 175 | #define ZORRO_PROD_GVP_GFORCE_040_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0xFF, 0) | ||
| 176 | |||
| 177 | #define ZORRO_MANUF_CALIFORNIA_ACCESS_SYNERGY 0x07E5 | ||
| 178 | #define ZORRO_PROD_CALIFORNIA_ACCESS_SYNERGY_MALIBU ZORRO_ID(CALIFORNIA_ACCESS_SYNERGY, 0x01, 0) | ||
| 179 | |||
| 180 | #define ZORRO_MANUF_XETEC 0x07E6 | ||
| 181 | #define ZORRO_PROD_XETEC_FASTCARD ZORRO_ID(XETEC, 0x01, 0) | ||
| 182 | #define ZORRO_PROD_XETEC_FASTCARD_RAM ZORRO_ID(XETEC, 0x02, 0) | ||
| 183 | #define ZORRO_PROD_XETEC_FASTCARD_PLUS ZORRO_ID(XETEC, 0x03, 0) | ||
| 184 | |||
| 185 | #define ZORRO_MANUF_PROGRESSIVE_PERIPHERALS_AND_SYSTEMS 0x07EA | ||
| 186 | #define ZORRO_PROD_PPS_MERCURY ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x00, 0) | ||
| 187 | #define ZORRO_PROD_PPS_A3000_68040 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x01, 0) | ||
| 188 | #define ZORRO_PROD_PPS_A2000_68040 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x69, 0) | ||
| 189 | #define ZORRO_PROD_PPS_ZEUS ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x96, 0) | ||
| 190 | #define ZORRO_PROD_PPS_A500_68040 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0xBB, 0) | ||
| 191 | |||
| 192 | #define ZORRO_MANUF_XEBEC 0x07EC | ||
| 193 | |||
| 194 | #define ZORRO_MANUF_SPIRIT_TECHNOLOGY 0x07F2 | ||
| 195 | #define ZORRO_PROD_SPIRIT_TECHNOLOGY_INSIDER_IN1000 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x01, 0) | ||
| 196 | #define ZORRO_PROD_SPIRIT_TECHNOLOGY_INSIDER_IN500 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x02, 0) | ||
| 197 | #define ZORRO_PROD_SPIRIT_TECHNOLOGY_SIN500 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x03, 0) | ||
| 198 | #define ZORRO_PROD_SPIRIT_TECHNOLOGY_HDA_506 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x04, 0) | ||
| 199 | #define ZORRO_PROD_SPIRIT_TECHNOLOGY_AX_S ZORRO_ID(SPIRIT_TECHNOLOGY, 0x05, 0) | ||
| 200 | #define ZORRO_PROD_SPIRIT_TECHNOLOGY_OCTABYTE ZORRO_ID(SPIRIT_TECHNOLOGY, 0x06, 0) | ||
| 201 | #define ZORRO_PROD_SPIRIT_TECHNOLOGY_INMATE ZORRO_ID(SPIRIT_TECHNOLOGY, 0x08, 0) | ||
| 202 | |||
| 203 | #define ZORRO_MANUF_SPIRIT_TECHNOLOGY_2 0x07F3 | ||
| 204 | |||
| 205 | #define ZORRO_MANUF_BSC_ALFADATA_1 0x07FE | ||
| 206 | #define ZORRO_PROD_BSC_ALF_3_1 ZORRO_ID(BSC_ALFADATA_1, 0x03, 0) | ||
| 207 | |||
| 208 | #define ZORRO_MANUF_BSC_ALFADATA_2 0x0801 | ||
| 209 | #define ZORRO_PROD_BSC_ALF_2_1 ZORRO_ID(BSC_ALFADATA_2, 0x01, 0) | ||
| 210 | #define ZORRO_PROD_BSC_ALF_2_2 ZORRO_ID(BSC_ALFADATA_2, 0x02, 0) | ||
| 211 | #define ZORRO_PROD_BSC_ALF_3_2 ZORRO_ID(BSC_ALFADATA_2, 0x03, 0) | ||
| 212 | |||
| 213 | #define ZORRO_MANUF_CARDCO_2 0x0802 | ||
| 214 | #define ZORRO_PROD_CARDCO_KRONOS_2000_2 ZORRO_ID(CARDCO_2, 0x04, 0) | ||
| 215 | #define ZORRO_PROD_CARDCO_A1000_2 ZORRO_ID(CARDCO_2, 0x0C, 0) | ||
| 216 | |||
| 217 | #define ZORRO_MANUF_JOCHHEIM 0x0804 | ||
| 218 | #define ZORRO_PROD_JOCHHEIM_RAM ZORRO_ID(JOCHHEIM, 0x01, 0) | ||
| 219 | |||
| 220 | #define ZORRO_MANUF_CHECKPOINT_TECHNOLOGIES 0x0807 | ||
| 221 | #define ZORRO_PROD_CHECKPOINT_TECHNOLOGIES_SERIAL_SOLUTION ZORRO_ID(CHECKPOINT_TECHNOLOGIES, 0x00, 0) | ||
| 222 | |||
| 223 | #define ZORRO_MANUF_EDOTRONIK 0x0810 | ||
| 224 | #define ZORRO_PROD_EDOTRONIK_IEEE_488 ZORRO_ID(EDOTRONIK, 0x01, 0) | ||
| 225 | #define ZORRO_PROD_EDOTRONIK_8032 ZORRO_ID(EDOTRONIK, 0x02, 0) | ||
| 226 | #define ZORRO_PROD_EDOTRONIK_MULTISERIAL ZORRO_ID(EDOTRONIK, 0x03, 0) | ||
| 227 | #define ZORRO_PROD_EDOTRONIK_VIDEODIGITIZER ZORRO_ID(EDOTRONIK, 0x04, 0) | ||
| 228 | #define ZORRO_PROD_EDOTRONIK_PARALLEL_IO ZORRO_ID(EDOTRONIK, 0x05, 0) | ||
| 229 | #define ZORRO_PROD_EDOTRONIK_PIC_PROTOYPING ZORRO_ID(EDOTRONIK, 0x06, 0) | ||
| 230 | #define ZORRO_PROD_EDOTRONIK_ADC ZORRO_ID(EDOTRONIK, 0x07, 0) | ||
| 231 | #define ZORRO_PROD_EDOTRONIK_VME ZORRO_ID(EDOTRONIK, 0x08, 0) | ||
| 232 | #define ZORRO_PROD_EDOTRONIK_DSP96000 ZORRO_ID(EDOTRONIK, 0x09, 0) | ||
| 233 | |||
| 234 | #define ZORRO_MANUF_NES_INC 0x0813 | ||
| 235 | #define ZORRO_PROD_NES_INC_RAM ZORRO_ID(NES_INC, 0x00, 0) | ||
| 236 | |||
| 237 | #define ZORRO_MANUF_ICD 0x0817 | ||
| 238 | #define ZORRO_PROD_ICD_ADVANTAGE_2000_SCSI ZORRO_ID(ICD, 0x01, 0) | ||
| 239 | #define ZORRO_PROD_ICD_ADVANTAGE_IDE ZORRO_ID(ICD, 0x03, 0) | ||
| 240 | #define ZORRO_PROD_ICD_ADVANTAGE_2080_RAM ZORRO_ID(ICD, 0x04, 0) | ||
| 241 | |||
| 242 | #define ZORRO_MANUF_KUPKE_2 0x0819 | ||
| 243 | #define ZORRO_PROD_KUPKE_OMTI ZORRO_ID(KUPKE_2, 0x01, 0) | ||
| 244 | #define ZORRO_PROD_KUPKE_SCSI_II ZORRO_ID(KUPKE_2, 0x02, 0) | ||
| 245 | #define ZORRO_PROD_KUPKE_GOLEM_BOX ZORRO_ID(KUPKE_2, 0x03, 0) | ||
| 246 | #define ZORRO_PROD_KUPKE_030_882 ZORRO_ID(KUPKE_2, 0x04, 0) | ||
| 247 | #define ZORRO_PROD_KUPKE_SCSI_AT ZORRO_ID(KUPKE_2, 0x05, 0) | ||
| 248 | |||
| 249 | #define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_3 0x081D | ||
| 250 | #define ZORRO_PROD_GVP_A2000_RAM8 ZORRO_ID(GREAT_VALLEY_PRODUCTS_3, 0x09, 0) | ||
| 251 | #define ZORRO_PROD_GVP_IMPACT_SERIES_II_RAM_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_3, 0x0A, 0) | ||
| 252 | |||
| 253 | #define ZORRO_MANUF_INTERWORKS_NETWORK 0x081E | ||
| 254 | |||
| 255 | #define ZORRO_MANUF_HARDITAL_SYNTHESIS 0x0820 | ||
| 256 | #define ZORRO_PROD_HARDITAL_SYNTHESIS_TQM_68030_68882 ZORRO_ID(HARDITAL_SYNTHESIS, 0x14, 0) | ||
| 257 | |||
| 258 | #define ZORRO_MANUF_APPLIED_ENGINEERING 0x0828 | ||
| 259 | #define ZORRO_PROD_APPLIED_ENGINEERING_DL2000 ZORRO_ID(APPLIED_ENGINEERING, 0x10, 0) | ||
| 260 | #define ZORRO_PROD_APPLIED_ENGINEERING_RAM_WORKS ZORRO_ID(APPLIED_ENGINEERING, 0xE0, 0) | ||
| 261 | |||
| 262 | #define ZORRO_MANUF_BSC_ALFADATA_3 0x082C | ||
| 263 | #define ZORRO_PROD_BSC_OKTAGON_2008 ZORRO_ID(BSC_ALFADATA_3, 0x05, 0) | ||
| 264 | #define ZORRO_PROD_BSC_TANDEM_AT_2008_508 ZORRO_ID(BSC_ALFADATA_3, 0x06, 0) | ||
| 265 | #define ZORRO_PROD_BSC_ALFA_RAM_1200 ZORRO_ID(BSC_ALFADATA_3, 0x07, 0) | ||
| 266 | #define ZORRO_PROD_BSC_OKTAGON_2008_RAM ZORRO_ID(BSC_ALFADATA_3, 0x08, 0) | ||
| 267 | #define ZORRO_PROD_BSC_MULTIFACE_I ZORRO_ID(BSC_ALFADATA_3, 0x10, 0) | ||
| 268 | #define ZORRO_PROD_BSC_MULTIFACE_II ZORRO_ID(BSC_ALFADATA_3, 0x11, 0) | ||
| 269 | #define ZORRO_PROD_BSC_MULTIFACE_III ZORRO_ID(BSC_ALFADATA_3, 0x12, 0) | ||
| 270 | #define ZORRO_PROD_BSC_FRAMEMASTER_II ZORRO_ID(BSC_ALFADATA_3, 0x20, 0) | ||
| 271 | #define ZORRO_PROD_BSC_GRAFFITI_RAM ZORRO_ID(BSC_ALFADATA_3, 0x21, 0) | ||
| 272 | #define ZORRO_PROD_BSC_GRAFFITI_REG ZORRO_ID(BSC_ALFADATA_3, 0x22, 0) | ||
| 273 | #define ZORRO_PROD_BSC_ISDN_MASTERCARD ZORRO_ID(BSC_ALFADATA_3, 0x40, 0) | ||
| 274 | #define ZORRO_PROD_BSC_ISDN_MASTERCARD_II ZORRO_ID(BSC_ALFADATA_3, 0x41, 0) | ||
| 275 | |||
| 276 | #define ZORRO_MANUF_PHOENIX 0x0835 | ||
| 277 | #define ZORRO_PROD_PHOENIX_ST506 ZORRO_ID(PHOENIX, 0x21, 0) | ||
| 278 | #define ZORRO_PROD_PHOENIX_SCSI ZORRO_ID(PHOENIX, 0x22, 0) | ||
| 279 | #define ZORRO_PROD_PHOENIX_RAM ZORRO_ID(PHOENIX, 0xBE, 0) | ||
| 280 | |||
| 281 | #define ZORRO_MANUF_ADVANCED_STORAGE_SYSTEMS 0x0836 | ||
| 282 | #define ZORRO_PROD_ADVANCED_STORAGE_SYSTEMS_NEXUS ZORRO_ID(ADVANCED_STORAGE_SYSTEMS, 0x01, 0) | ||
| 283 | #define ZORRO_PROD_ADVANCED_STORAGE_SYSTEMS_NEXUS_RAM ZORRO_ID(ADVANCED_STORAGE_SYSTEMS, 0x08, 0) | ||
| 284 | |||
| 285 | #define ZORRO_MANUF_IMPULSE 0x0838 | ||
| 286 | #define ZORRO_PROD_IMPULSE_FIRECRACKER_24 ZORRO_ID(IMPULSE, 0x00, 0) | ||
| 287 | |||
| 288 | #define ZORRO_MANUF_IVS 0x0840 | ||
| 289 | #define ZORRO_PROD_IVS_GRANDSLAM_PIC_2 ZORRO_ID(IVS, 0x02, 0) | ||
| 290 | #define ZORRO_PROD_IVS_GRANDSLAM_PIC_1 ZORRO_ID(IVS, 0x04, 0) | ||
| 291 | #define ZORRO_PROD_IVS_OVERDRIVE ZORRO_ID(IVS, 0x10, 0) | ||
| 292 | #define ZORRO_PROD_IVS_TRUMPCARD_CLASSIC ZORRO_ID(IVS, 0x30, 0) | ||
| 293 | #define ZORRO_PROD_IVS_TRUMPCARD_PRO_GRANDSLAM ZORRO_ID(IVS, 0x34, 0) | ||
| 294 | #define ZORRO_PROD_IVS_META_4 ZORRO_ID(IVS, 0x40, 0) | ||
| 295 | #define ZORRO_PROD_IVS_WAVETOOLS ZORRO_ID(IVS, 0xBF, 0) | ||
| 296 | #define ZORRO_PROD_IVS_VECTOR_1 ZORRO_ID(IVS, 0xF3, 0) | ||
| 297 | #define ZORRO_PROD_IVS_VECTOR_2 ZORRO_ID(IVS, 0xF4, 0) | ||
| 298 | |||
| 299 | #define ZORRO_MANUF_VECTOR_1 0x0841 | ||
| 300 | #define ZORRO_PROD_VECTOR_CONNECTION_1 ZORRO_ID(VECTOR_1, 0xE3, 0) | ||
| 301 | |||
| 302 | #define ZORRO_MANUF_XPERT_PRODEV 0x0845 | ||
| 303 | #define ZORRO_PROD_XPERT_PRODEV_VISIONA_RAM ZORRO_ID(XPERT_PRODEV, 0x01, 0) | ||
| 304 | #define ZORRO_PROD_XPERT_PRODEV_VISIONA_REG ZORRO_ID(XPERT_PRODEV, 0x02, 0) | ||
| 305 | #define ZORRO_PROD_XPERT_PRODEV_MERLIN_RAM ZORRO_ID(XPERT_PRODEV, 0x03, 0) | ||
| 306 | #define ZORRO_PROD_XPERT_PRODEV_MERLIN_REG_1 ZORRO_ID(XPERT_PRODEV, 0x04, 0) | ||
| 307 | #define ZORRO_PROD_XPERT_PRODEV_MERLIN_REG_2 ZORRO_ID(XPERT_PRODEV, 0xC9, 0) | ||
| 308 | |||
| 309 | #define ZORRO_MANUF_HYDRA_SYSTEMS 0x0849 | ||
| 310 | #define ZORRO_PROD_HYDRA_SYSTEMS_AMIGANET ZORRO_ID(HYDRA_SYSTEMS, 0x01, 0) | ||
| 311 | |||
| 312 | #define ZORRO_MANUF_SUNRIZE_INDUSTRIES 0x084F | ||
| 313 | #define ZORRO_PROD_SUNRIZE_INDUSTRIES_AD1012 ZORRO_ID(SUNRIZE_INDUSTRIES, 0x01, 0) | ||
| 314 | #define ZORRO_PROD_SUNRIZE_INDUSTRIES_AD516 ZORRO_ID(SUNRIZE_INDUSTRIES, 0x02, 0) | ||
| 315 | #define ZORRO_PROD_SUNRIZE_INDUSTRIES_DD512 ZORRO_ID(SUNRIZE_INDUSTRIES, 0x03, 0) | ||
| 316 | |||
| 317 | #define ZORRO_MANUF_TRICERATOPS 0x0850 | ||
| 318 | #define ZORRO_PROD_TRICERATOPS_MULTI_IO ZORRO_ID(TRICERATOPS, 0x01, 0) | ||
| 319 | |||
| 320 | #define ZORRO_MANUF_APPLIED_MAGIC 0x0851 | ||
| 321 | #define ZORRO_PROD_APPLIED_MAGIC_DMI_RESOLVER ZORRO_ID(APPLIED_MAGIC, 0x01, 0) | ||
| 322 | #define ZORRO_PROD_APPLIED_MAGIC_DIGITAL_BROADCASTER ZORRO_ID(APPLIED_MAGIC, 0x06, 0) | ||
| 323 | |||
| 324 | #define ZORRO_MANUF_GFX_BASE 0x085E | ||
| 325 | #define ZORRO_PROD_GFX_BASE_GDA_1_VRAM ZORRO_ID(GFX_BASE, 0x00, 0) | ||
| 326 | #define ZORRO_PROD_GFX_BASE_GDA_1 ZORRO_ID(GFX_BASE, 0x01, 0) | ||
| 327 | |||
| 328 | #define ZORRO_MANUF_ROCTEC 0x0860 | ||
| 329 | #define ZORRO_PROD_ROCTEC_RH_800C ZORRO_ID(ROCTEC, 0x01, 0) | ||
| 330 | #define ZORRO_PROD_ROCTEC_RH_800C_RAM ZORRO_ID(ROCTEC, 0x01, 0) | ||
| 331 | |||
| 332 | #define ZORRO_MANUF_KATO 0x0861 | ||
| 333 | #define ZORRO_PROD_KATO_MELODY ZORRO_ID(KATO, 0x80, 0) | ||
| 334 | /* ID clash!! */ | ||
| 335 | #define ZORRO_MANUF_HELFRICH_1 0x0861 | ||
| 336 | #define ZORRO_PROD_HELFRICH_RAINBOW_II ZORRO_ID(HELFRICH_1, 0x20, 0) | ||
| 337 | #define ZORRO_PROD_HELFRICH_RAINBOW_III ZORRO_ID(HELFRICH_1, 0x21, 0) | ||
| 338 | |||
| 339 | #define ZORRO_MANUF_ATLANTIS 0x0862 | ||
| 340 | |||
| 341 | #define ZORRO_MANUF_PROTAR 0x0864 | ||
| 342 | |||
| 343 | #define ZORRO_MANUF_ACS 0x0865 | ||
| 344 | |||
| 345 | #define ZORRO_MANUF_SOFTWARE_RESULTS_ENTERPRISES 0x0866 | ||
| 346 | #define ZORRO_PROD_SOFTWARE_RESULTS_ENTERPRISES_GOLDEN_GATE_2_BUS_PLUS ZORRO_ID(SOFTWARE_RESULTS_ENTERPRISES, 0x01, 0) | ||
| 347 | |||
| 348 | #define ZORRO_MANUF_MASOBOSHI 0x086D | ||
| 349 | #define ZORRO_PROD_MASOBOSHI_MASTER_CARD_SC201 ZORRO_ID(MASOBOSHI, 0x03, 0) | ||
| 350 | #define ZORRO_PROD_MASOBOSHI_MASTER_CARD_MC702 ZORRO_ID(MASOBOSHI, 0x04, 0) | ||
| 351 | #define ZORRO_PROD_MASOBOSHI_MVD_819 ZORRO_ID(MASOBOSHI, 0x07, 0) | ||
| 352 | |||
| 353 | #define ZORRO_MANUF_MAINHATTAN_DATA 0x086F | ||
| 354 | #define ZORRO_PROD_MAINHATTAN_DATA_IDE ZORRO_ID(MAINHATTAN_DATA, 0x01, 0) | ||
| 355 | |||
| 356 | #define ZORRO_MANUF_VILLAGE_TRONIC 0x0877 | ||
| 357 | #define ZORRO_PROD_VILLAGE_TRONIC_DOMINO_RAM ZORRO_ID(VILLAGE_TRONIC, 0x01, 0) | ||
| 358 | #define ZORRO_PROD_VILLAGE_TRONIC_DOMINO_REG ZORRO_ID(VILLAGE_TRONIC, 0x02, 0) | ||
| 359 | #define ZORRO_PROD_VILLAGE_TRONIC_DOMINO_16M_PROTOTYPE ZORRO_ID(VILLAGE_TRONIC, 0x03, 0) | ||
| 360 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM ZORRO_ID(VILLAGE_TRONIC, 0x0B, 0) | ||
| 361 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_REG ZORRO_ID(VILLAGE_TRONIC, 0x0C, 0) | ||
| 362 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_SEGMENTED_MODE ZORRO_ID(VILLAGE_TRONIC, 0x0D, 0) | ||
| 363 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM1 ZORRO_ID(VILLAGE_TRONIC, 0x15, 0) | ||
| 364 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM2 ZORRO_ID(VILLAGE_TRONIC, 0x16, 0) | ||
| 365 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_REG ZORRO_ID(VILLAGE_TRONIC, 0x17, 0) | ||
| 366 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3 ZORRO_ID(VILLAGE_TRONIC, 0x18, 0) | ||
| 367 | #define ZORRO_PROD_VILLAGE_TRONIC_ARIADNE ZORRO_ID(VILLAGE_TRONIC, 0xC9, 0) | ||
| 368 | #define ZORRO_PROD_VILLAGE_TRONIC_ARIADNE2 ZORRO_ID(VILLAGE_TRONIC, 0xCA, 0) | ||
| 369 | |||
| 370 | #define ZORRO_MANUF_UTILITIES_UNLIMITED 0x087B | ||
| 371 | #define ZORRO_PROD_UTILITIES_UNLIMITED_EMPLANT_DELUXE ZORRO_ID(UTILITIES_UNLIMITED, 0x15, 0) | ||
| 372 | #define ZORRO_PROD_UTILITIES_UNLIMITED_EMPLANT_DELUXE2 ZORRO_ID(UTILITIES_UNLIMITED, 0x20, 0) | ||
| 373 | |||
| 374 | #define ZORRO_MANUF_AMITRIX 0x0880 | ||
| 375 | #define ZORRO_PROD_AMITRIX_MULTI_IO ZORRO_ID(AMITRIX, 0x01, 0) | ||
| 376 | #define ZORRO_PROD_AMITRIX_CD_RAM ZORRO_ID(AMITRIX, 0x02, 0) | ||
| 377 | |||
| 378 | #define ZORRO_MANUF_ARMAX 0x0885 | ||
| 379 | #define ZORRO_PROD_ARMAX_OMNIBUS ZORRO_ID(ARMAX, 0x00, 0) | ||
| 380 | |||
| 381 | #define ZORRO_MANUF_ZEUS 0x088D | ||
| 382 | #define ZORRO_PROD_ZEUS_SPIDER ZORRO_ID(ZEUS, 0x04, 0) | ||
| 383 | |||
| 384 | #define ZORRO_MANUF_NEWTEK 0x088F | ||
| 385 | #define ZORRO_PROD_NEWTEK_VIDEOTOASTER ZORRO_ID(NEWTEK, 0x00, 0) | ||
| 386 | |||
| 387 | #define ZORRO_MANUF_M_TECH_GERMANY 0x0890 | ||
| 388 | #define ZORRO_PROD_MTEC_AT500_2 ZORRO_ID(M_TECH_GERMANY, 0x01, 0) | ||
| 389 | #define ZORRO_PROD_MTEC_68030 ZORRO_ID(M_TECH_GERMANY, 0x03, 0) | ||
| 390 | #define ZORRO_PROD_MTEC_68020I ZORRO_ID(M_TECH_GERMANY, 0x06, 0) | ||
| 391 | #define ZORRO_PROD_MTEC_A1200_T68030_RTC ZORRO_ID(M_TECH_GERMANY, 0x20, 0) | ||
| 392 | #define ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530 ZORRO_ID(M_TECH_GERMANY, 0x21, 0) | ||
| 393 | #define ZORRO_PROD_MTEC_8_MB_RAM ZORRO_ID(M_TECH_GERMANY, 0x22, 0) | ||
| 394 | #define ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530_SCSI_IDE ZORRO_ID(M_TECH_GERMANY, 0x24, 0) | ||
| 395 | |||
| 396 | #define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_4 0x0891 | ||
| 397 | #define ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_RAM ZORRO_ID(GREAT_VALLEY_PRODUCTS_4, 0x01, 0) | ||
| 398 | #define ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_REG ZORRO_ID(GREAT_VALLEY_PRODUCTS_4, 0x02, 0) | ||
| 399 | |||
| 400 | #define ZORRO_MANUF_APOLLO_1 0x0892 | ||
| 401 | #define ZORRO_PROD_APOLLO_A1200 ZORRO_ID(APOLLO_1, 0x01, 0) | ||
| 402 | |||
| 403 | #define ZORRO_MANUF_HELFRICH_2 0x0893 | ||
| 404 | #define ZORRO_PROD_HELFRICH_PICCOLO_RAM ZORRO_ID(HELFRICH_2, 0x05, 0) | ||
| 405 | #define ZORRO_PROD_HELFRICH_PICCOLO_REG ZORRO_ID(HELFRICH_2, 0x06, 0) | ||
| 406 | #define ZORRO_PROD_HELFRICH_PEGGY_PLUS_MPEG ZORRO_ID(HELFRICH_2, 0x07, 0) | ||
| 407 | #define ZORRO_PROD_HELFRICH_VIDEOCRUNCHER ZORRO_ID(HELFRICH_2, 0x08, 0) | ||
| 408 | #define ZORRO_PROD_HELFRICH_SD64_RAM ZORRO_ID(HELFRICH_2, 0x0A, 0) | ||
| 409 | #define ZORRO_PROD_HELFRICH_SD64_REG ZORRO_ID(HELFRICH_2, 0x0B, 0) | ||
| 410 | |||
| 411 | #define ZORRO_MANUF_MACROSYSTEMS_USA 0x089B | ||
| 412 | #define ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE_40xx ZORRO_ID(MACROSYSTEMS_USA, 0x13, 0) | ||
| 413 | |||
| 414 | #define ZORRO_MANUF_ELBOX_COMPUTER 0x089E | ||
| 415 | #define ZORRO_PROD_ELBOX_COMPUTER_1200_4 ZORRO_ID(ELBOX_COMPUTER, 0x06, 0) | ||
| 416 | |||
| 417 | #define ZORRO_MANUF_HARMS_PROFESSIONAL 0x0A00 | ||
| 418 | #define ZORRO_PROD_HARMS_PROFESSIONAL_030_PLUS ZORRO_ID(HARMS_PROFESSIONAL, 0x10, 0) | ||
| 419 | #define ZORRO_PROD_HARMS_PROFESSIONAL_3500 ZORRO_ID(HARMS_PROFESSIONAL, 0xD0, 0) | ||
| 420 | |||
| 421 | #define ZORRO_MANUF_MICRONIK 0x0A50 | ||
| 422 | #define ZORRO_PROD_MICRONIK_RCA_120 ZORRO_ID(MICRONIK, 0x0A, 0) | ||
| 423 | |||
| 424 | #define ZORRO_MANUF_MICRONIK2 0x0F0F | ||
| 425 | #define ZORRO_PROD_MICRONIK2_Z3I ZORRO_ID(MICRONIK2, 0x01, 0) | ||
| 426 | |||
| 427 | #define ZORRO_MANUF_MEGAMICRO 0x1000 | ||
| 428 | #define ZORRO_PROD_MEGAMICRO_SCRAM_500 ZORRO_ID(MEGAMICRO, 0x03, 0) | ||
| 429 | #define ZORRO_PROD_MEGAMICRO_SCRAM_500_RAM ZORRO_ID(MEGAMICRO, 0x04, 0) | ||
| 430 | |||
| 431 | #define ZORRO_MANUF_IMTRONICS_2 0x1028 | ||
| 432 | #define ZORRO_PROD_IMTRONICS_HURRICANE_2800_3 ZORRO_ID(IMTRONICS_2, 0x39, 0) | ||
| 433 | #define ZORRO_PROD_IMTRONICS_HURRICANE_2800_4 ZORRO_ID(IMTRONICS_2, 0x57, 0) | ||
| 434 | |||
| 435 | /* unofficial ID */ | ||
| 436 | #define ZORRO_MANUF_INDIVIDUAL_COMPUTERS 0x1212 | ||
| 437 | #define ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA ZORRO_ID(INDIVIDUAL_COMPUTERS, 0x00, 0) | ||
| 438 | #define ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF ZORRO_ID(INDIVIDUAL_COMPUTERS, 0x17, 0) | ||
| 439 | #define ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL ZORRO_ID(INDIVIDUAL_COMPUTERS, 0x2A, 0) | ||
| 440 | |||
| 441 | #define ZORRO_MANUF_KUPKE_3 0x1248 | ||
| 442 | #define ZORRO_PROD_KUPKE_GOLEM_HD_3000 ZORRO_ID(KUPKE_3, 0x01, 0) | ||
| 443 | |||
| 444 | #define ZORRO_MANUF_ITH 0x1388 | ||
| 445 | #define ZORRO_PROD_ITH_ISDN_MASTER_II ZORRO_ID(ITH, 0x01, 0) | ||
| 446 | |||
| 447 | #define ZORRO_MANUF_VMC 0x1389 | ||
| 448 | #define ZORRO_PROD_VMC_ISDN_BLASTER_Z2 ZORRO_ID(VMC, 0x01, 0) | ||
| 449 | #define ZORRO_PROD_VMC_HYPERCOM_4 ZORRO_ID(VMC, 0x02, 0) | ||
| 450 | |||
| 451 | #define ZORRO_MANUF_INFORMATION 0x157C | ||
| 452 | #define ZORRO_PROD_INFORMATION_ISDN_ENGINE_I ZORRO_ID(INFORMATION, 0x64, 0) | ||
| 453 | |||
| 454 | #define ZORRO_MANUF_VORTEX 0x2017 | ||
| 455 | #define ZORRO_PROD_VORTEX_GOLDEN_GATE_80386SX ZORRO_ID(VORTEX, 0x07, 0) | ||
| 456 | #define ZORRO_PROD_VORTEX_GOLDEN_GATE_RAM ZORRO_ID(VORTEX, 0x08, 0) | ||
| 457 | #define ZORRO_PROD_VORTEX_GOLDEN_GATE_80486 ZORRO_ID(VORTEX, 0x09, 0) | ||
| 458 | |||
| 459 | #define ZORRO_MANUF_EXPANSION_SYSTEMS 0x2062 | ||
| 460 | #define ZORRO_PROD_EXPANSION_SYSTEMS_DATAFLYER_4000SX ZORRO_ID(EXPANSION_SYSTEMS, 0x01, 0) | ||
| 461 | #define ZORRO_PROD_EXPANSION_SYSTEMS_DATAFLYER_4000SX_RAM ZORRO_ID(EXPANSION_SYSTEMS, 0x02, 0) | ||
| 462 | |||
| 463 | #define ZORRO_MANUF_READYSOFT 0x2100 | ||
| 464 | #define ZORRO_PROD_READYSOFT_AMAX_II_IV ZORRO_ID(READYSOFT, 0x01, 0) | ||
| 465 | |||
| 466 | #define ZORRO_MANUF_PHASE5 0x2140 | ||
| 467 | #define ZORRO_PROD_PHASE5_BLIZZARD_RAM ZORRO_ID(PHASE5, 0x01, 0) | ||
| 468 | #define ZORRO_PROD_PHASE5_BLIZZARD ZORRO_ID(PHASE5, 0x02, 0) | ||
| 469 | #define ZORRO_PROD_PHASE5_BLIZZARD_1220_IV ZORRO_ID(PHASE5, 0x06, 0) | ||
| 470 | #define ZORRO_PROD_PHASE5_FASTLANE_Z3_RAM ZORRO_ID(PHASE5, 0x0A, 0) | ||
| 471 | #define ZORRO_PROD_PHASE5_BLIZZARD_1230_II_FASTLANE_Z3_CYBERSCSI_CYBERSTORM060 ZORRO_ID(PHASE5, 0x0B, 0) | ||
| 472 | #define ZORRO_PROD_PHASE5_BLIZZARD_1220_CYBERSTORM ZORRO_ID(PHASE5, 0x0C, 0) | ||
| 473 | #define ZORRO_PROD_PHASE5_BLIZZARD_1230 ZORRO_ID(PHASE5, 0x0D, 0) | ||
| 474 | #define ZORRO_PROD_PHASE5_BLIZZARD_1230_IV_1260 ZORRO_ID(PHASE5, 0x11, 0) | ||
| 475 | #define ZORRO_PROD_PHASE5_BLIZZARD_2060 ZORRO_ID(PHASE5, 0x18, 0) | ||
| 476 | #define ZORRO_PROD_PHASE5_CYBERSTORM_MK_II ZORRO_ID(PHASE5, 0x19, 0) | ||
| 477 | #define ZORRO_PROD_PHASE5_CYBERVISION64 ZORRO_ID(PHASE5, 0x22, 0) | ||
| 478 | #define ZORRO_PROD_PHASE5_CYBERVISION64_3D_PROTOTYPE ZORRO_ID(PHASE5, 0x32, 0) | ||
| 479 | #define ZORRO_PROD_PHASE5_CYBERVISION64_3D ZORRO_ID(PHASE5, 0x43, 0) | ||
| 480 | #define ZORRO_PROD_PHASE5_CYBERSTORM_MK_III ZORRO_ID(PHASE5, 0x64, 0) | ||
| 481 | #define ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS ZORRO_ID(PHASE5, 0x6e, 0) | ||
| 482 | |||
| 483 | #define ZORRO_MANUF_DPS 0x2169 | ||
| 484 | #define ZORRO_PROD_DPS_PERSONAL_ANIMATION_RECORDER ZORRO_ID(DPS, 0x01, 0) | ||
| 485 | |||
| 486 | #define ZORRO_MANUF_APOLLO_2 0x2200 | ||
| 487 | #define ZORRO_PROD_APOLLO_A620_68020_1 ZORRO_ID(APOLLO_2, 0x00, 0) | ||
| 488 | #define ZORRO_PROD_APOLLO_A620_68020_2 ZORRO_ID(APOLLO_2, 0x01, 0) | ||
| 489 | |||
| 490 | #define ZORRO_MANUF_APOLLO_3 0x2222 | ||
| 491 | #define ZORRO_PROD_APOLLO_AT_APOLLO ZORRO_ID(APOLLO_3, 0x22, 0) | ||
| 492 | #define ZORRO_PROD_APOLLO_1230_1240_1260_2030_4040_4060 ZORRO_ID(APOLLO_3, 0x23, 0) | ||
| 493 | |||
| 494 | #define ZORRO_MANUF_PETSOFF_LP 0x38A5 | ||
| 495 | #define ZORRO_PROD_PETSOFF_LP_DELFINA ZORRO_ID(PETSOFF_LP, 0x00, 0) | ||
| 496 | #define ZORRO_PROD_PETSOFF_LP_DELFINA_LITE ZORRO_ID(PETSOFF_LP, 0x01, 0) | ||
| 497 | |||
| 498 | #define ZORRO_MANUF_UWE_GERLACH 0x3FF7 | ||
| 499 | #define ZORRO_PROD_UWE_GERLACH_RAM_ROM ZORRO_ID(UWE_GERLACH, 0xd4, 0) | ||
| 500 | |||
| 501 | #define ZORRO_MANUF_ACT 0x4231 | ||
| 502 | #define ZORRO_PROD_ACT_PRELUDE ZORRO_ID(ACT, 0x01, 0) | ||
| 503 | |||
| 504 | #define ZORRO_MANUF_MACROSYSTEMS_GERMANY 0x4754 | ||
| 505 | #define ZORRO_PROD_MACROSYSTEMS_MAESTRO ZORRO_ID(MACROSYSTEMS_GERMANY, 0x03, 0) | ||
| 506 | #define ZORRO_PROD_MACROSYSTEMS_VLAB ZORRO_ID(MACROSYSTEMS_GERMANY, 0x04, 0) | ||
| 507 | #define ZORRO_PROD_MACROSYSTEMS_MAESTRO_PRO ZORRO_ID(MACROSYSTEMS_GERMANY, 0x05, 0) | ||
| 508 | #define ZORRO_PROD_MACROSYSTEMS_RETINA ZORRO_ID(MACROSYSTEMS_GERMANY, 0x06, 0) | ||
| 509 | #define ZORRO_PROD_MACROSYSTEMS_MULTI_EVOLUTION ZORRO_ID(MACROSYSTEMS_GERMANY, 0x08, 0) | ||
| 510 | #define ZORRO_PROD_MACROSYSTEMS_TOCCATA ZORRO_ID(MACROSYSTEMS_GERMANY, 0x0C, 0) | ||
| 511 | #define ZORRO_PROD_MACROSYSTEMS_RETINA_Z3 ZORRO_ID(MACROSYSTEMS_GERMANY, 0x10, 0) | ||
| 512 | #define ZORRO_PROD_MACROSYSTEMS_VLAB_MOTION ZORRO_ID(MACROSYSTEMS_GERMANY, 0x12, 0) | ||
| 513 | #define ZORRO_PROD_MACROSYSTEMS_ALTAIS ZORRO_ID(MACROSYSTEMS_GERMANY, 0x13, 0) | ||
| 514 | #define ZORRO_PROD_MACROSYSTEMS_FALCON_040 ZORRO_ID(MACROSYSTEMS_GERMANY, 0xFD, 0) | ||
| 515 | |||
| 516 | #define ZORRO_MANUF_COMBITEC 0x6766 | ||
| 517 | |||
| 518 | #define ZORRO_MANUF_SKI_PERIPHERALS 0x8000 | ||
| 519 | #define ZORRO_PROD_SKI_PERIPHERALS_MAST_FIREBALL ZORRO_ID(SKI_PERIPHERALS, 0x08, 0) | ||
| 520 | #define ZORRO_PROD_SKI_PERIPHERALS_SCSI_DUAL_SERIAL ZORRO_ID(SKI_PERIPHERALS, 0x80, 0) | ||
| 521 | |||
| 522 | #define ZORRO_MANUF_REIS_WARE_2 0xA9AD | ||
| 523 | #define ZORRO_PROD_REIS_WARE_SCAN_KING ZORRO_ID(REIS_WARE_2, 0x11, 0) | ||
| 524 | |||
| 525 | #define ZORRO_MANUF_CAMERON 0xAA01 | ||
| 526 | #define ZORRO_PROD_CAMERON_PERSONAL_A4 ZORRO_ID(CAMERON, 0x10, 0) | ||
| 527 | |||
| 528 | #define ZORRO_MANUF_REIS_WARE 0xAA11 | ||
| 529 | #define ZORRO_PROD_REIS_WARE_HANDYSCANNER ZORRO_ID(REIS_WARE, 0x11, 0) | ||
| 530 | |||
| 531 | #define ZORRO_MANUF_PHOENIX_2 0xB5A8 | ||
| 532 | #define ZORRO_PROD_PHOENIX_ST506_2 ZORRO_ID(PHOENIX_2, 0x21, 0) | ||
| 533 | #define ZORRO_PROD_PHOENIX_SCSI_2 ZORRO_ID(PHOENIX_2, 0x22, 0) | ||
| 534 | #define ZORRO_PROD_PHOENIX_RAM_2 ZORRO_ID(PHOENIX_2, 0xBE, 0) | ||
| 535 | |||
| 536 | #define ZORRO_MANUF_COMBITEC_2 0xC008 | ||
| 537 | #define ZORRO_PROD_COMBITEC_HD ZORRO_ID(COMBITEC_2, 0x2A, 0) | ||
| 538 | #define ZORRO_PROD_COMBITEC_SRAM ZORRO_ID(COMBITEC_2, 0x2B, 0) | ||
| 539 | |||
| 540 | |||
| 541 | /* | ||
| 542 | * Test and illegal Manufacturer IDs. | ||
| 543 | */ | ||
| 544 | |||
| 545 | #define ZORRO_MANUF_HACKER 0x07DB | ||
| 546 | #define ZORRO_PROD_GENERAL_PROTOTYPE ZORRO_ID(HACKER, 0x00, 0) | ||
| 547 | #define ZORRO_PROD_HACKER_SCSI ZORRO_ID(HACKER, 0x01, 0) | ||
| 548 | #define ZORRO_PROD_RESOURCE_MANAGEMENT_FORCE_QUICKNET_QN2000 ZORRO_ID(HACKER, 0x02, 0) | ||
| 549 | #define ZORRO_PROD_VECTOR_CONNECTION_2 ZORRO_ID(HACKER, 0xE0, 0) | ||
| 550 | #define ZORRO_PROD_VECTOR_CONNECTION_3 ZORRO_ID(HACKER, 0xE1, 0) | ||
| 551 | #define ZORRO_PROD_VECTOR_CONNECTION_4 ZORRO_ID(HACKER, 0xE2, 0) | ||
| 552 | #define ZORRO_PROD_VECTOR_CONNECTION_5 ZORRO_ID(HACKER, 0xE3, 0) | ||
