diff options
Diffstat (limited to 'include')
54 files changed, 1921 insertions, 678 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 7bf83ddf82e0..baacd98e7cc6 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
| @@ -373,7 +373,7 @@ struct acpi_pci_root { | |||
| 373 | struct acpi_pci_id id; | 373 | struct acpi_pci_id id; |
| 374 | struct pci_bus *bus; | 374 | struct pci_bus *bus; |
| 375 | u16 segment; | 375 | u16 segment; |
| 376 | u8 bus_nr; | 376 | struct resource secondary; /* downstream bus range */ |
| 377 | 377 | ||
| 378 | u32 osc_support_set; /* _OSC state of support bits */ | 378 | u32 osc_support_set; /* _OSC state of support bits */ |
| 379 | u32 osc_control_set; /* _OSC state of control bits */ | 379 | u32 osc_control_set; /* _OSC state of control bits */ |
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 4f7b44866b76..23d78b4d088b 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
| @@ -104,8 +104,7 @@ int acpi_pci_bind_root(struct acpi_device *device); | |||
| 104 | 104 | ||
| 105 | /* Arch-defined function to add a bus to the system */ | 105 | /* Arch-defined function to add a bus to the system */ |
| 106 | 106 | ||
| 107 | struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain, | 107 | struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root); |
| 108 | int bus); | ||
| 109 | void pci_acpi_crs_quirks(void); | 108 | void pci_acpi_crs_quirks(void); |
| 110 | 109 | ||
| 111 | /* -------------------------------------------------------------------------- | 110 | /* -------------------------------------------------------------------------- |
diff --git a/include/acpi/acpi_hest.h b/include/acpi/acpi_hest.h deleted file mode 100644 index 63194d03cb2d..000000000000 --- a/include/acpi/acpi_hest.h +++ /dev/null | |||
| @@ -1,12 +0,0 @@ | |||
| 1 | #ifndef __ACPI_HEST_H | ||
| 2 | #define __ACPI_HEST_H | ||
| 3 | |||
| 4 | #include <linux/pci.h> | ||
| 5 | |||
| 6 | #ifdef CONFIG_ACPI | ||
| 7 | extern int acpi_hest_firmware_first_pci(struct pci_dev *pci); | ||
| 8 | #else | ||
| 9 | static inline int acpi_hest_firmware_first_pci(struct pci_dev *pci) { return 0; } | ||
| 10 | #endif | ||
| 11 | |||
| 12 | #endif | ||
diff --git a/include/acpi/apei.h b/include/acpi/apei.h new file mode 100644 index 000000000000..b3365025ff8d --- /dev/null +++ b/include/acpi/apei.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * apei.h - ACPI Platform Error Interface | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef ACPI_APEI_H | ||
| 6 | #define ACPI_APEI_H | ||
| 7 | |||
| 8 | #include <linux/acpi.h> | ||
| 9 | #include <linux/cper.h> | ||
| 10 | #include <asm/ioctls.h> | ||
| 11 | |||
| 12 | #define APEI_ERST_INVALID_RECORD_ID 0xffffffffffffffffULL | ||
| 13 | |||
| 14 | #define APEI_ERST_CLEAR_RECORD _IOW('E', 1, u64) | ||
| 15 | #define APEI_ERST_GET_RECORD_COUNT _IOR('E', 2, u32) | ||
| 16 | |||
| 17 | #ifdef __KERNEL__ | ||
| 18 | |||
| 19 | extern int hest_disable; | ||
| 20 | extern int erst_disable; | ||
| 21 | |||
| 22 | typedef int (*apei_hest_func_t)(struct acpi_hest_header *hest_hdr, void *data); | ||
| 23 | int apei_hest_parse(apei_hest_func_t func, void *data); | ||
| 24 | |||
| 25 | int erst_write(const struct cper_record_header *record); | ||
| 26 | ssize_t erst_get_record_count(void); | ||
| 27 | int erst_get_next_record_id(u64 *record_id); | ||
| 28 | ssize_t erst_read(u64 record_id, struct cper_record_header *record, | ||
| 29 | size_t buflen); | ||
| 30 | ssize_t erst_read_next(struct cper_record_header *record, size_t buflen); | ||
| 31 | int erst_clear(u64 record_id); | ||
| 32 | |||
| 33 | #endif | ||
| 34 | #endif | ||
diff --git a/include/acpi/atomicio.h b/include/acpi/atomicio.h new file mode 100644 index 000000000000..8b9fb4b0b9ce --- /dev/null +++ b/include/acpi/atomicio.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef ACPI_ATOMIC_IO_H | ||
| 2 | #define ACPI_ATOMIC_IO_H | ||
| 3 | |||
| 4 | int acpi_pre_map_gar(struct acpi_generic_address *reg); | ||
| 5 | int acpi_post_unmap_gar(struct acpi_generic_address *reg); | ||
| 6 | |||
| 7 | int acpi_atomic_read(u64 *val, struct acpi_generic_address *reg); | ||
| 8 | int acpi_atomic_write(u64 val, struct acpi_generic_address *reg); | ||
| 9 | |||
| 10 | #endif | ||
diff --git a/include/acpi/hed.h b/include/acpi/hed.h new file mode 100644 index 000000000000..46e1249b70cc --- /dev/null +++ b/include/acpi/hed.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | /* | ||
| 2 | * hed.h - ACPI Hardware Error Device | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009, Intel Corp. | ||
| 5 | * Author: Huang Ying <ying.huang@intel.com> | ||
| 6 | * | ||
| 7 | * This file is released under the GPLv2. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef ACPI_HED_H | ||
| 11 | #define ACPI_HED_H | ||
| 12 | |||
| 13 | #include <linux/notifier.h> | ||
| 14 | |||
| 15 | int register_acpi_hed_notifier(struct notifier_block *nb); | ||
| 16 | void unregister_acpi_hed_notifier(struct notifier_block *nb); | ||
| 17 | |||
| 18 | #endif | ||
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 86825ddbe14e..da565a48240e 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
| @@ -52,17 +52,6 @@ struct acpi_power_register { | |||
| 52 | u64 address; | 52 | u64 address; |
| 53 | } __attribute__ ((packed)); | 53 | } __attribute__ ((packed)); |
| 54 | 54 | ||
| 55 | struct acpi_processor_cx_policy { | ||
| 56 | u32 count; | ||
| 57 | struct acpi_processor_cx *state; | ||
| 58 | struct { | ||
| 59 | u32 time; | ||
| 60 | u32 ticks; | ||
| 61 | u32 count; | ||
| 62 | u32 bm; | ||
| 63 | } threshold; | ||
| 64 | }; | ||
| 65 | |||
| 66 | struct acpi_processor_cx { | 55 | struct acpi_processor_cx { |
| 67 | u8 valid; | 56 | u8 valid; |
| 68 | u8 type; | 57 | u8 type; |
| @@ -74,8 +63,6 @@ struct acpi_processor_cx { | |||
| 74 | u32 power; | 63 | u32 power; |
| 75 | u32 usage; | 64 | u32 usage; |
| 76 | u64 time; | 65 | u64 time; |
| 77 | struct acpi_processor_cx_policy promotion; | ||
| 78 | struct acpi_processor_cx_policy demotion; | ||
| 79 | char desc[ACPI_CX_DESC_LEN]; | 66 | char desc[ACPI_CX_DESC_LEN]; |
| 80 | }; | 67 | }; |
| 81 | 68 | ||
diff --git a/include/acpi/video.h b/include/acpi/video.h index cf7be3dd157b..551793c9b6e8 100644 --- a/include/acpi/video.h +++ b/include/acpi/video.h | |||
| @@ -1,12 +1,28 @@ | |||
| 1 | #ifndef __ACPI_VIDEO_H | 1 | #ifndef __ACPI_VIDEO_H |
| 2 | #define __ACPI_VIDEO_H | 2 | #define __ACPI_VIDEO_H |
| 3 | 3 | ||
| 4 | #define ACPI_VIDEO_DISPLAY_CRT 1 | ||
| 5 | #define ACPI_VIDEO_DISPLAY_TV 2 | ||
| 6 | #define ACPI_VIDEO_DISPLAY_DVI 3 | ||
| 7 | #define ACPI_VIDEO_DISPLAY_LCD 4 | ||
| 8 | |||
| 9 | #define ACPI_VIDEO_DISPLAY_LEGACY_MONITOR 0x0100 | ||
| 10 | #define ACPI_VIDEO_DISPLAY_LEGACY_PANEL 0x0110 | ||
| 11 | #define ACPI_VIDEO_DISPLAY_LEGACY_TV 0x0200 | ||
| 12 | |||
| 4 | #if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE) | 13 | #if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE) |
| 5 | extern int acpi_video_register(void); | 14 | extern int acpi_video_register(void); |
| 6 | extern void acpi_video_unregister(void); | 15 | extern void acpi_video_unregister(void); |
| 16 | extern int acpi_video_get_edid(struct acpi_device *device, int type, | ||
| 17 | int device_id, void **edid); | ||
| 7 | #else | 18 | #else |
| 8 | static inline int acpi_video_register(void) { return 0; } | 19 | static inline int acpi_video_register(void) { return 0; } |
| 9 | static inline void acpi_video_unregister(void) { return; } | 20 | static inline void acpi_video_unregister(void) { return; } |
| 21 | static inline int acpi_video_get_edid(struct acpi_device *device, int type, | ||
| 22 | int device_id, void **edid) | ||
| 23 | { | ||
| 24 | return -ENODEV; | ||
| 25 | } | ||
| 10 | #endif | 26 | #endif |
| 11 | 27 | ||
| 12 | #endif | 28 | #endif |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 3da73f5f0ae9..224a38c960d4 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -248,11 +248,12 @@ int acpi_check_region(resource_size_t start, resource_size_t n, | |||
| 248 | int acpi_check_mem_region(resource_size_t start, resource_size_t n, | 248 | int acpi_check_mem_region(resource_size_t start, resource_size_t n, |
| 249 | const char *name); | 249 | const char *name); |
| 250 | 250 | ||
| 251 | int acpi_resources_are_enforced(void); | ||
| 252 | |||
| 251 | #ifdef CONFIG_PM_SLEEP | 253 | #ifdef CONFIG_PM_SLEEP |
| 252 | void __init acpi_no_s4_hw_signature(void); | 254 | void __init acpi_no_s4_hw_signature(void); |
| 253 | void __init acpi_old_suspend_ordering(void); | 255 | void __init acpi_old_suspend_ordering(void); |
| 254 | void __init acpi_s4_no_nvs(void); | 256 | void __init acpi_s4_no_nvs(void); |
| 255 | void __init acpi_set_sci_en_on_resume(void); | ||
| 256 | #endif /* CONFIG_PM_SLEEP */ | 257 | #endif /* CONFIG_PM_SLEEP */ |
| 257 | 258 | ||
| 258 | struct acpi_osc_context { | 259 | struct acpi_osc_context { |
diff --git a/include/linux/amba/pl330.h b/include/linux/amba/pl330.h new file mode 100644 index 000000000000..cbee7de7dd36 --- /dev/null +++ b/include/linux/amba/pl330.h | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | /* linux/include/linux/amba/pl330.h | ||
| 2 | * | ||
| 3 | * Copyright (C) 2010 Samsung Electronics Co. Ltd. | ||
| 4 | * Jaswinder Singh <jassi.brar@samsung.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 __AMBA_PL330_H_ | ||
| 13 | #define __AMBA_PL330_H_ | ||
| 14 | |||
| 15 | #include <asm/hardware/pl330.h> | ||
| 16 | |||
| 17 | struct dma_pl330_peri { | ||
| 18 | /* | ||
| 19 | * Peri_Req i/f of the DMAC that is | ||
| 20 | * peripheral could be reached from. | ||
| 21 | */ | ||
| 22 | u8 peri_id; /* {0, 31} */ | ||
| 23 | enum pl330_reqtype rqtype; | ||
| 24 | |||
| 25 | /* For M->D and D->M Channels */ | ||
| 26 | int burst_sz; /* in power of 2 */ | ||
| 27 | dma_addr_t fifo_addr; | ||
| 28 | }; | ||
| 29 | |||
| 30 | struct dma_pl330_platdata { | ||
| 31 | /* | ||
| 32 | * Number of valid peripherals connected to DMAC. | ||
| 33 | * This may be different from the value read from | ||
| 34 | * CR0, as the PL330 implementation might have 'holes' | ||
| 35 | * in the peri list or the peri could also be reached | ||
| 36 | * from another DMAC which the platform prefers. | ||
| 37 | */ | ||
| 38 | u8 nr_valid_peri; | ||
| 39 | /* Array of valid peripherals */ | ||
| 40 | struct dma_pl330_peri *peri; | ||
| 41 | /* Bytes to allocate for MC buffer */ | ||
| 42 | unsigned mcbuf_sz; | ||
| 43 | }; | ||
| 44 | |||
| 45 | #endif /* __AMBA_PL330_H_ */ | ||
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 6fb2720882fc..daf8c480c786 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
| @@ -141,7 +141,6 @@ extern int bitmap_find_free_region(unsigned long *bitmap, int bits, int order); | |||
| 141 | extern void bitmap_release_region(unsigned long *bitmap, int pos, int order); | 141 | extern void bitmap_release_region(unsigned long *bitmap, int pos, int order); |
| 142 | extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order); | 142 | extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order); |
| 143 | extern void bitmap_copy_le(void *dst, const unsigned long *src, int nbits); | 143 | extern void bitmap_copy_le(void *dst, const unsigned long *src, int nbits); |
| 144 | extern int bitmap_ord_to_pos(const unsigned long *bitmap, int n, int bits); | ||
| 145 | 144 | ||
| 146 | #define BITMAP_LAST_WORD_MASK(nbits) \ | 145 | #define BITMAP_LAST_WORD_MASK(nbits) \ |
| 147 | ( \ | 146 | ( \ |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 16ed0284d780..1b9ba193b789 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
| @@ -203,6 +203,9 @@ int block_write_full_page_endio(struct page *page, get_block_t *get_block, | |||
| 203 | int block_read_full_page(struct page*, get_block_t*); | 203 | int block_read_full_page(struct page*, get_block_t*); |
| 204 | int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc, | 204 | int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc, |
| 205 | unsigned long from); | 205 | unsigned long from); |
| 206 | int block_write_begin_newtrunc(struct file *, struct address_space *, | ||
| 207 | loff_t, unsigned, unsigned, | ||
| 208 | struct page **, void **, get_block_t*); | ||
| 206 | int block_write_begin(struct file *, struct address_space *, | 209 | int block_write_begin(struct file *, struct address_space *, |
| 207 | loff_t, unsigned, unsigned, | 210 | loff_t, unsigned, unsigned, |
| 208 | struct page **, void **, get_block_t*); | 211 | struct page **, void **, get_block_t*); |
| @@ -214,6 +217,9 @@ int generic_write_end(struct file *, struct address_space *, | |||
| 214 | struct page *, void *); | 217 | struct page *, void *); |
| 215 | void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); | 218 | void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); |
| 216 | int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); | 219 | int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); |
| 220 | int cont_write_begin_newtrunc(struct file *, struct address_space *, loff_t, | ||
| 221 | unsigned, unsigned, struct page **, void **, | ||
| 222 | get_block_t *, loff_t *); | ||
| 217 | int cont_write_begin(struct file *, struct address_space *, loff_t, | 223 | int cont_write_begin(struct file *, struct address_space *, loff_t, |
| 218 | unsigned, unsigned, struct page **, void **, | 224 | unsigned, unsigned, struct page **, void **, |
| 219 | get_block_t *, loff_t *); | 225 | get_block_t *, loff_t *); |
| @@ -224,7 +230,10 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, | |||
| 224 | void block_sync_page(struct page *); | 230 | void block_sync_page(struct page *); |
| 225 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); | 231 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); |
| 226 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); | 232 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); |
| 227 | int file_fsync(struct file *, struct dentry *, int); | 233 | int file_fsync(struct file *, int); |
| 234 | int nobh_write_begin_newtrunc(struct file *, struct address_space *, | ||
| 235 | loff_t, unsigned, unsigned, | ||
| 236 | struct page **, void **, get_block_t*); | ||
| 228 | int nobh_write_begin(struct file *, struct address_space *, | 237 | int nobh_write_begin(struct file *, struct address_space *, |
| 229 | loff_t, unsigned, unsigned, | 238 | loff_t, unsigned, unsigned, |
| 230 | struct page **, void **, get_block_t*); | 239 | struct page **, void **, get_block_t*); |
diff --git a/include/linux/completion.h b/include/linux/completion.h index 4a6b604ef7e4..51e3145196f6 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
| @@ -83,6 +83,8 @@ extern unsigned long wait_for_completion_timeout(struct completion *x, | |||
| 83 | unsigned long timeout); | 83 | unsigned long timeout); |
| 84 | extern unsigned long wait_for_completion_interruptible_timeout( | 84 | extern unsigned long wait_for_completion_interruptible_timeout( |
| 85 | struct completion *x, unsigned long timeout); | 85 | struct completion *x, unsigned long timeout); |
| 86 | extern unsigned long wait_for_completion_killable_timeout( | ||
| 87 | struct completion *x, unsigned long timeout); | ||
| 86 | extern bool try_wait_for_completion(struct completion *x); | 88 | extern bool try_wait_for_completion(struct completion *x); |
| 87 | extern bool completion_done(struct completion *x); | 89 | extern bool completion_done(struct completion *x); |
| 88 | 90 | ||
diff --git a/include/linux/cper.h b/include/linux/cper.h new file mode 100644 index 000000000000..4b38f905b705 --- /dev/null +++ b/include/linux/cper.h | |||
| @@ -0,0 +1,314 @@ | |||
| 1 | /* | ||
| 2 | * UEFI Common Platform Error Record | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010, Intel Corp. | ||
| 5 | * Author: Huang Ying <ying.huang@intel.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU General Public License version | ||
| 9 | * 2 as published by the Free Software Foundation. | ||
| 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 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef LINUX_CPER_H | ||
| 22 | #define LINUX_CPER_H | ||
| 23 | |||
| 24 | #include <linux/uuid.h> | ||
| 25 | |||
| 26 | /* CPER record signature and the size */ | ||
| 27 | #define CPER_SIG_RECORD "CPER" | ||
| 28 | #define CPER_SIG_SIZE 4 | ||
| 29 | /* Used in signature_end field in struct cper_record_header */ | ||
| 30 | #define CPER_SIG_END 0xffffffff | ||
| 31 | |||
| 32 | /* | ||
| 33 | * CPER record header revision, used in revision field in struct | ||
| 34 | * cper_record_header | ||
| 35 | */ | ||
| 36 | #define CPER_RECORD_REV 0x0100 | ||
| 37 | |||
| 38 | /* | ||
| 39 | * Severity difinition for error_severity in struct cper_record_header | ||
| 40 | * and section_severity in struct cper_section_descriptor | ||
| 41 | */ | ||
| 42 | #define CPER_SER_RECOVERABLE 0x0 | ||
| 43 | #define CPER_SER_FATAL 0x1 | ||
| 44 | #define CPER_SER_CORRECTED 0x2 | ||
| 45 | #define CPER_SER_INFORMATIONAL 0x3 | ||
| 46 | |||
| 47 | /* | ||
| 48 | * Validation bits difinition for validation_bits in struct | ||
| 49 | * cper_record_header. If set, corresponding fields in struct | ||
| 50 | * cper_record_header contain valid information. | ||
| 51 | * | ||
| 52 | * corresponds platform_id | ||
| 53 | */ | ||
| 54 | #define CPER_VALID_PLATFORM_ID 0x0001 | ||
| 55 | /* corresponds timestamp */ | ||
| 56 | #define CPER_VALID_TIMESTAMP 0x0002 | ||
| 57 | /* corresponds partition_id */ | ||
| 58 | #define CPER_VALID_PARTITION_ID 0x0004 | ||
| 59 | |||
| 60 | /* | ||
| 61 | * Notification type used to generate error record, used in | ||
| 62 | * notification_type in struct cper_record_header | ||
| 63 | * | ||
| 64 | * Corrected Machine Check | ||
| 65 | */ | ||
| 66 | #define CPER_NOTIFY_CMC \ | ||
| 67 | UUID_LE(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4, \ | ||
| 68 | 0xEB, 0xD4, 0xF8, 0x90) | ||
| 69 | /* Corrected Platform Error */ | ||
| 70 | #define CPER_NOTIFY_CPE \ | ||
| 71 | UUID_LE(0x4E292F96, 0xD843, 0x4a55, 0xA8, 0xC2, 0xD4, 0x81, \ | ||
| 72 | 0xF2, 0x7E, 0xBE, 0xEE) | ||
| 73 | /* Machine Check Exception */ | ||
| 74 | #define CPER_NOTIFY_MCE \ | ||
| 75 | UUID_LE(0xE8F56FFE, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB, \ | ||
| 76 | 0xE1, 0x49, 0x13, 0xBB) | ||
| 77 | /* PCI Express Error */ | ||
| 78 | #define CPER_NOTIFY_PCIE \ | ||
| 79 | UUID_LE(0xCF93C01F, 0x1A16, 0x4dfc, 0xB8, 0xBC, 0x9C, 0x4D, \ | ||
| 80 | 0xAF, 0x67, 0xC1, 0x04) | ||
| 81 | /* INIT Record (for IPF) */ | ||
| 82 | #define CPER_NOTIFY_INIT \ | ||
| 83 | UUID_LE(0xCC5263E8, 0x9308, 0x454a, 0x89, 0xD0, 0x34, 0x0B, \ | ||
| 84 | 0xD3, 0x9B, 0xC9, 0x8E) | ||
| 85 | /* Non-Maskable Interrupt */ | ||
| 86 | #define CPER_NOTIFY_NMI \ | ||
| 87 | UUID_LE(0x5BAD89FF, 0xB7E6, 0x42c9, 0x81, 0x4A, 0xCF, 0x24, \ | ||
| 88 | 0x85, 0xD6, 0xE9, 0x8A) | ||
| 89 | /* BOOT Error Record */ | ||
| 90 | #define CPER_NOTIFY_BOOT \ | ||
| 91 | UUID_LE(0x3D61A466, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62, \ | ||
| 92 | 0xD4, 0x64, 0xB3, 0x8F) | ||
| 93 | /* DMA Remapping Error */ | ||
| 94 | #define CPER_NOTIFY_DMAR \ | ||
| 95 | UUID_LE(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E, \ | ||
| 96 | 0x72, 0x2D, 0xEB, 0x41) | ||
| 97 | |||
| 98 | /* | ||
| 99 | * Flags bits definitions for flags in struct cper_record_header | ||
| 100 | * If set, the error has been recovered | ||
| 101 | */ | ||
| 102 | #define CPER_HW_ERROR_FLAGS_RECOVERED 0x1 | ||
| 103 | /* If set, the error is for previous boot */ | ||
| 104 | #define CPER_HW_ERROR_FLAGS_PREVERR 0x2 | ||
| 105 | /* If set, the error is injected for testing */ | ||
| 106 | #define CPER_HW_ERROR_FLAGS_SIMULATED 0x4 | ||
| 107 | |||
| 108 | /* | ||
| 109 | * CPER section header revision, used in revision field in struct | ||
| 110 | * cper_section_descriptor | ||
| 111 | */ | ||
| 112 | #define CPER_SEC_REV 0x0100 | ||
| 113 | |||
| 114 | /* | ||
| 115 | * Validation bits difinition for validation_bits in struct | ||
| 116 | * cper_section_descriptor. If set, corresponding fields in struct | ||
| 117 | * cper_section_descriptor contain valid information. | ||
| 118 | * | ||
| 119 | * corresponds fru_id | ||
| 120 | */ | ||
| 121 | #define CPER_SEC_VALID_FRU_ID 0x1 | ||
| 122 | /* corresponds fru_text */ | ||
| 123 | #define CPER_SEC_VALID_FRU_TEXT 0x2 | ||
| 124 | |||
| 125 | /* | ||
| 126 | * Flags bits definitions for flags in struct cper_section_descriptor | ||
| 127 | * | ||
| 128 | * If set, the section is associated with the error condition | ||
| 129 | * directly, and should be focused on | ||
| 130 | */ | ||
| 131 | #define CPER_SEC_PRIMARY 0x0001 | ||
| 132 | /* | ||
| 133 | * If set, the error was not contained within the processor or memory | ||
| 134 | * hierarchy and the error may have propagated to persistent storage | ||
| 135 | * or network | ||
| 136 | */ | ||
| 137 | #define CPER_SEC_CONTAINMENT_WARNING 0x0002 | ||
| 138 | /* If set, the component must be re-initialized or re-enabled prior to use */ | ||
| 139 | #define CPER_SEC_RESET 0x0004 | ||
| 140 | /* If set, Linux may choose to discontinue use of the resource */ | ||
| 141 | #define CPER_SEC_ERROR_THRESHOLD_EXCEEDED 0x0008 | ||
| 142 | /* | ||
| 143 | * If set, resource could not be queried for error information due to | ||
| 144 | * conflicts with other system software or resources. Some fields of | ||
| 145 | * the section will be invalid | ||
| 146 | */ | ||
| 147 | #define CPER_SEC_RESOURCE_NOT_ACCESSIBLE 0x0010 | ||
| 148 | /* | ||
| 149 | * If set, action has been taken to ensure error containment (such as | ||
| 150 | * poisoning data), but the error has not been fully corrected and the | ||
| 151 | * data has not been consumed. Linux may choose to take further | ||
| 152 | * corrective action before the data is consumed | ||
| 153 | */ | ||
| 154 | #define CPER_SEC_LATENT_ERROR 0x0020 | ||
| 155 | |||
| 156 | /* | ||
| 157 | * Section type definitions, used in section_type field in struct | ||
| 158 | * cper_section_descriptor | ||
| 159 | * | ||
| 160 | * Processor Generic | ||
| 161 | */ | ||
| 162 | #define CPER_SEC_PROC_GENERIC \ | ||
| 163 | UUID_LE(0x9876CCAD, 0x47B4, 0x4bdb, 0xB6, 0x5E, 0x16, 0xF1, \ | ||
| 164 | 0x93, 0xC4, 0xF3, 0xDB) | ||
| 165 | /* Processor Specific: X86/X86_64 */ | ||
| 166 | #define CPER_SEC_PROC_IA \ | ||
| 167 | UUID_LE(0xDC3EA0B0, 0xA144, 0x4797, 0xB9, 0x5B, 0x53, 0xFA, \ | ||
| 168 | 0x24, 0x2B, 0x6E, 0x1D) | ||
| 169 | /* Processor Specific: IA64 */ | ||
| 170 | #define CPER_SEC_PROC_IPF \ | ||
| 171 | UUID_LE(0xE429FAF1, 0x3CB7, 0x11D4, 0x0B, 0xCA, 0x07, 0x00, \ | ||
| 172 | 0x80, 0xC7, 0x3C, 0x88, 0x81) | ||
| 173 | /* Platform Memory */ | ||
| 174 | #define CPER_SEC_PLATFORM_MEM \ | ||
| 175 | UUID_LE(0xA5BC1114, 0x6F64, 0x4EDE, 0xB8, 0x63, 0x3E, 0x83, \ | ||
| 176 | 0xED, 0x7C, 0x83, 0xB1) | ||
| 177 | #define CPER_SEC_PCIE \ | ||
| 178 | UUID_LE(0xD995E954, 0xBBC1, 0x430F, 0xAD, 0x91, 0xB4, 0x4D, \ | ||
| 179 | 0xCB, 0x3C, 0x6F, 0x35) | ||
| 180 | /* Firmware Error Record Reference */ | ||
| 181 | #define CPER_SEC_FW_ERR_REC_REF \ | ||
| 182 | UUID_LE(0x81212A96, 0x09ED, 0x4996, 0x94, 0x71, 0x8D, 0x72, \ | ||
| 183 | 0x9C, 0x8E, 0x69, 0xED) | ||
| 184 | /* PCI/PCI-X Bus */ | ||
| 185 | #define CPER_SEC_PCI_X_BUS \ | ||
| 186 | UUID_LE(0xC5753963, 0x3B84, 0x4095, 0xBF, 0x78, 0xED, 0xDA, \ | ||
| 187 | 0xD3, 0xF9, 0xC9, 0xDD) | ||
| 188 | /* PCI Component/Device */ | ||
| 189 | #define CPER_SEC_PCI_DEV \ | ||
| 190 | UUID_LE(0xEB5E4685, 0xCA66, 0x4769, 0xB6, 0xA2, 0x26, 0x06, \ | ||
| 191 | 0x8B, 0x00, 0x13, 0x26) | ||
| 192 | #define CPER_SEC_DMAR_GENERIC \ | ||
| 193 | UUID_LE(0x5B51FEF7, 0xC79D, 0x4434, 0x8F, 0x1B, 0xAA, 0x62, \ | ||
| 194 | 0xDE, 0x3E, 0x2C, 0x64) | ||
| 195 | /* Intel VT for Directed I/O specific DMAr */ | ||
| 196 | #define CPER_SEC_DMAR_VT \ | ||
| 197 | UUID_LE(0x71761D37, 0x32B2, 0x45cd, 0xA7, 0xD0, 0xB0, 0xFE, \ | ||
| 198 | 0xDD, 0x93, 0xE8, 0xCF) | ||
| 199 | /* IOMMU specific DMAr */ | ||
| 200 | #define CPER_SEC_DMAR_IOMMU \ | ||
| 201 | UUID_LE(0x036F84E1, 0x7F37, 0x428c, 0xA7, 0x9E, 0x57, 0x5F, \ | ||
| 202 | 0xDF, 0xAA, 0x84, 0xEC) | ||
| 203 | |||
| 204 | /* | ||
| 205 | * All tables and structs must be byte-packed to match CPER | ||
| 206 | * specification, since the tables are provided by the system BIOS | ||
| 207 | */ | ||
| 208 | #pragma pack(1) | ||
| 209 | |||
| 210 | struct cper_record_header { | ||
| 211 | char signature[CPER_SIG_SIZE]; /* must be CPER_SIG_RECORD */ | ||
| 212 | __u16 revision; /* must be CPER_RECORD_REV */ | ||
| 213 | __u32 signature_end; /* must be CPER_SIG_END */ | ||
| 214 | __u16 section_count; | ||
| 215 | __u32 error_severity; | ||
| 216 | __u32 validation_bits; | ||
| 217 | __u32 record_length; | ||
| 218 | __u64 timestamp; | ||
| 219 | uuid_le platform_id; | ||
| 220 | uuid_le partition_id; | ||
| 221 | uuid_le creator_id; | ||
| 222 | uuid_le notification_type; | ||
| 223 | __u64 record_id; | ||
| 224 | __u32 flags; | ||
| 225 | __u64 persistence_information; | ||
| 226 | __u8 reserved[12]; /* must be zero */ | ||
| 227 | }; | ||
| 228 | |||
| 229 | struct cper_section_descriptor { | ||
| 230 | __u32 section_offset; /* Offset in bytes of the | ||
| 231 | * section body from the base | ||
| 232 | * of the record header */ | ||
| 233 | __u32 section_length; | ||
| 234 | __u16 revision; /* must be CPER_RECORD_REV */ | ||
| 235 | __u8 validation_bits; | ||
| 236 | __u8 reserved; /* must be zero */ | ||
| 237 | __u32 flags; | ||
| 238 | uuid_le section_type; | ||
| 239 | uuid_le fru_id; | ||
| 240 | __u32 section_severity; | ||
| 241 | __u8 fru_text[20]; | ||
| 242 | }; | ||
| 243 | |||
| 244 | /* Generic Processor Error Section */ | ||
| 245 | struct cper_sec_proc_generic { | ||
| 246 | __u64 validation_bits; | ||
| 247 | __u8 proc_type; | ||
| 248 | __u8 proc_isa; | ||
| 249 | __u8 proc_error_type; | ||
| 250 | __u8 operation; | ||
| 251 | __u8 flags; | ||
| 252 | __u8 level; | ||
| 253 | __u16 reserved; | ||
| 254 | __u64 cpu_version; | ||
| 255 | char cpu_brand[128]; | ||
| 256 | __u64 proc_id; | ||
| 257 | __u64 target_addr; | ||
| 258 | __u64 requestor_id; | ||
| 259 | __u64 responder_id; | ||
| 260 | __u64 ip; | ||
| 261 | }; | ||
| 262 | |||
| 263 | /* IA32/X64 Processor Error Section */ | ||
| 264 | struct cper_sec_proc_ia { | ||
| 265 | __u64 validation_bits; | ||
| 266 | __u8 lapic_id; | ||
| 267 | __u8 cpuid[48]; | ||
| 268 | }; | ||
| 269 | |||
| 270 | /* IA32/X64 Processor Error Infomation Structure */ | ||
| 271 | struct cper_ia_err_info { | ||
| 272 | uuid_le err_type; | ||
| 273 | __u64 validation_bits; | ||
| 274 | __u64 check_info; | ||
| 275 | __u64 target_id; | ||
| 276 | __u64 requestor_id; | ||
| 277 | __u64 responder_id; | ||
| 278 | __u64 ip; | ||
| 279 | }; | ||
| 280 | |||
| 281 | /* IA32/X64 Processor Context Information Structure */ | ||
| 282 | struct cper_ia_proc_ctx { | ||
| 283 | __u16 reg_ctx_type; | ||
| 284 | __u16 reg_arr_size; | ||
| 285 | __u32 msr_addr; | ||
| 286 | __u64 mm_reg_addr; | ||
| 287 | }; | ||
| 288 | |||
| 289 | /* Memory Error Section */ | ||
| 290 | struct cper_sec_mem_err { | ||
| 291 | __u64 validation_bits; | ||
| 292 | __u64 error_status; | ||
| 293 | __u64 physical_addr; | ||
| 294 | __u64 physical_addr_mask; | ||
| 295 | __u16 node; | ||
| 296 | __u16 card; | ||
| 297 | __u16 module; | ||
| 298 | __u16 bank; | ||
| 299 | __u16 device; | ||
| 300 | __u16 row; | ||
| 301 | __u16 column; | ||
| 302 | __u16 bit_pos; | ||
| 303 | __u64 requestor_id; | ||
| 304 | __u64 responder_id; | ||
| 305 | __u64 target_id; | ||
| 306 | __u8 error_type; | ||
| 307 | }; | ||
| 308 | |||
| 309 | /* Reset to default packing */ | ||
| 310 | #pragma pack() | ||
| 311 | |||
| 312 | u64 cper_next_record_id(void); | ||
| 313 | |||
| 314 | #endif | ||
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index dcf77fa826b5..55215cce5005 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
| @@ -125,6 +125,7 @@ struct cpuidle_driver { | |||
| 125 | #ifdef CONFIG_CPU_IDLE | 125 | #ifdef CONFIG_CPU_IDLE |
| 126 | 126 | ||
| 127 | extern int cpuidle_register_driver(struct cpuidle_driver *drv); | 127 | extern int cpuidle_register_driver(struct cpuidle_driver *drv); |
| 128 | struct cpuidle_driver *cpuidle_get_driver(void); | ||
| 128 | extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); | 129 | extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); |
| 129 | extern int cpuidle_register_device(struct cpuidle_device *dev); | 130 | extern int cpuidle_register_device(struct cpuidle_device *dev); |
| 130 | extern void cpuidle_unregister_device(struct cpuidle_device *dev); | 131 | extern void cpuidle_unregister_device(struct cpuidle_device *dev); |
| @@ -137,16 +138,17 @@ extern void cpuidle_disable_device(struct cpuidle_device *dev); | |||
| 137 | #else | 138 | #else |
| 138 | 139 | ||
| 139 | static inline int cpuidle_register_driver(struct cpuidle_driver *drv) | 140 | static inline int cpuidle_register_driver(struct cpuidle_driver *drv) |
| 140 | {return 0;} | 141 | {return -ENODEV; } |
| 142 | static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; } | ||
| 141 | static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { } | 143 | static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { } |
| 142 | static inline int cpuidle_register_device(struct cpuidle_device *dev) | 144 | static inline int cpuidle_register_device(struct cpuidle_device *dev) |
| 143 | {return 0;} | 145 | {return -ENODEV; } |
| 144 | static inline void cpuidle_unregister_device(struct cpuidle_device *dev) { } | 146 | static inline void cpuidle_unregister_device(struct cpuidle_device *dev) { } |
| 145 | 147 | ||
| 146 | static inline void cpuidle_pause_and_lock(void) { } | 148 | static inline void cpuidle_pause_and_lock(void) { } |
| 147 | static inline void cpuidle_resume_and_unlock(void) { } | 149 | static inline void cpuidle_resume_and_unlock(void) { } |
| 148 | static inline int cpuidle_enable_device(struct cpuidle_device *dev) | 150 | static inline int cpuidle_enable_device(struct cpuidle_device *dev) |
| 149 | {return 0;} | 151 | {return -ENODEV; } |
| 150 | static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } | 152 | static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } |
| 151 | 153 | ||
| 152 | #endif | 154 | #endif |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index fc1b930f246c..e7d9b20ddc5b 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
| @@ -63,6 +63,8 @@ struct dentry *debugfs_create_x16(const char *name, mode_t mode, | |||
| 63 | struct dentry *parent, u16 *value); | 63 | struct dentry *parent, u16 *value); |
| 64 | struct dentry *debugfs_create_x32(const char *name, mode_t mode, | 64 | struct dentry *debugfs_create_x32(const char *name, mode_t mode, |
| 65 | struct dentry *parent, u32 *value); | 65 | struct dentry *parent, u32 *value); |
| 66 | struct dentry *debugfs_create_x64(const char *name, mode_t mode, | ||
| 67 | struct dentry *parent, u64 *value); | ||
| 66 | struct dentry *debugfs_create_size_t(const char *name, mode_t mode, | 68 | struct dentry *debugfs_create_size_t(const char *name, mode_t mode, |
| 67 | struct dentry *parent, size_t *value); | 69 | struct dentry *parent, size_t *value); |
| 68 | struct dentry *debugfs_create_bool(const char *name, mode_t mode, | 70 | struct dentry *debugfs_create_bool(const char *name, mode_t mode, |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 5f494b465097..7fc62d4550b2 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
| @@ -868,7 +868,7 @@ extern int ext3_htree_store_dirent(struct file *dir_file, __u32 hash, | |||
| 868 | extern void ext3_htree_free_dir_info(struct dir_private_info *p); | 868 | extern void ext3_htree_free_dir_info(struct dir_private_info *p); |
| 869 | 869 | ||
| 870 | /* fsync.c */ | 870 | /* fsync.c */ |
| 871 | extern int ext3_sync_file (struct file *, struct dentry *, int); | 871 | extern int ext3_sync_file(struct file *, int); |
| 872 | 872 | ||
| 873 | /* hash.c */ | 873 | /* hash.c */ |
| 874 | extern int ext3fs_dirhash(const char *name, int len, struct | 874 | extern int ext3fs_dirhash(const char *name, int len, struct |
diff --git a/include/linux/fb.h b/include/linux/fb.h index f3793ebc241c..907ace3a64c8 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/i2c.h> | 5 | #include <linux/i2c.h> |
| 6 | 6 | ||
| 7 | struct dentry; | ||
| 8 | |||
| 9 | /* Definitions of frame buffers */ | 7 | /* Definitions of frame buffers */ |
| 10 | 8 | ||
| 11 | #define FB_MAX 32 /* sufficient for now */ | 9 | #define FB_MAX 32 /* sufficient for now */ |
| @@ -1017,8 +1015,7 @@ extern void fb_deferred_io_open(struct fb_info *info, | |||
| 1017 | struct inode *inode, | 1015 | struct inode *inode, |
| 1018 | struct file *file); | 1016 | struct file *file); |
| 1019 | extern void fb_deferred_io_cleanup(struct fb_info *info); | 1017 | extern void fb_deferred_io_cleanup(struct fb_info *info); |
| 1020 | extern int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, | 1018 | extern int fb_deferred_io_fsync(struct file *file, int datasync); |
| 1021 | int datasync); | ||
| 1022 | 1019 | ||
| 1023 | static inline bool fb_be_math(struct fb_info *info) | 1020 | static inline bool fb_be_math(struct fb_info *info) |
| 1024 | { | 1021 | { |
diff --git a/include/linux/file.h b/include/linux/file.h index 5555508fd517..b1e12970f617 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | 11 | ||
| 12 | struct file; | 12 | struct file; |
| 13 | 13 | ||
| 14 | extern void __fput(struct file *); | ||
| 15 | extern void fput(struct file *); | 14 | extern void fput(struct file *); |
| 16 | extern void drop_file_write_access(struct file *file); | 15 | extern void drop_file_write_access(struct file *file); |
| 17 | 16 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 85e823adcd4a..3428393942a6 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -954,6 +954,7 @@ extern spinlock_t files_lock; | |||
| 954 | #define file_list_unlock() spin_unlock(&files_lock); | 954 | #define file_list_unlock() spin_unlock(&files_lock); |
| 955 | 955 | ||
| 956 | #define get_file(x) atomic_long_inc(&(x)->f_count) | 956 | #define get_file(x) atomic_long_inc(&(x)->f_count) |
| 957 | #define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) | ||
| 957 | #define file_count(x) atomic_long_read(&(x)->f_count) | 958 | #define file_count(x) atomic_long_read(&(x)->f_count) |
| 958 | 959 | ||
| 959 | #ifdef CONFIG_DEBUG_WRITECOUNT | 960 | #ifdef CONFIG_DEBUG_WRITECOUNT |
| @@ -1497,7 +1498,7 @@ struct file_operations { | |||
| 1497 | int (*open) (struct inode *, struct file *); | 1498 | int (*open) (struct inode *, struct file *); |
| 1498 | int (*flush) (struct file *, fl_owner_t id); | 1499 | int (*flush) (struct file *, fl_owner_t id); |
| 1499 | int (*release) (struct inode *, struct file *); | 1500 | int (*release) (struct inode *, struct file *); |
| 1500 | int (*fsync) (struct file *, struct dentry *, int datasync); | 1501 | int (*fsync) (struct file *, int datasync); |
| 1501 | int (*aio_fsync) (struct kiocb *, int datasync); | 1502 | int (*aio_fsync) (struct kiocb *, int datasync); |
| 1502 | int (*fasync) (int, struct file *, int); | 1503 | int (*fasync) (int, struct file *, int); |
| 1503 | int (*lock) (struct file *, int, struct file_lock *); | 1504 | int (*lock) (struct file *, int, struct file_lock *); |
| @@ -2212,7 +2213,7 @@ extern int generic_segment_checks(const struct iovec *iov, | |||
| 2212 | /* fs/block_dev.c */ | 2213 | /* fs/block_dev.c */ |
| 2213 | extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, | 2214 | extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, |
| 2214 | unsigned long nr_segs, loff_t pos); | 2215 | unsigned long nr_segs, loff_t pos); |
| 2215 | extern int blkdev_fsync(struct file *filp, struct dentry *dentry, int datasync); | 2216 | extern int blkdev_fsync(struct file *filp, int datasync); |
| 2216 | 2217 | ||
| 2217 | /* fs/splice.c */ | 2218 | /* fs/splice.c */ |
| 2218 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, | 2219 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, |
| @@ -2256,6 +2257,10 @@ typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode, | |||
| 2256 | loff_t file_offset); | 2257 | loff_t file_offset); |
| 2257 | void dio_end_io(struct bio *bio, int error); | 2258 | void dio_end_io(struct bio *bio, int error); |
| 2258 | 2259 | ||
| 2260 | ssize_t __blockdev_direct_IO_newtrunc(int rw, struct kiocb *iocb, struct inode *inode, | ||
| 2261 | struct block_device *bdev, const struct iovec *iov, loff_t offset, | ||
| 2262 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, | ||
| 2263 | dio_submit_t submit_io, int lock_type); | ||
| 2259 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | 2264 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, |
| 2260 | struct block_device *bdev, const struct iovec *iov, loff_t offset, | 2265 | struct block_device *bdev, const struct iovec *iov, loff_t offset, |
| 2261 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, | 2266 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, |
| @@ -2269,6 +2274,24 @@ enum { | |||
| 2269 | DIO_SKIP_HOLES = 0x02, | 2274 | DIO_SKIP_HOLES = 0x02, |
| 2270 | }; | 2275 | }; |
| 2271 | 2276 | ||
| 2277 | static inline ssize_t blockdev_direct_IO_newtrunc(int rw, struct kiocb *iocb, | ||
| 2278 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | ||
| 2279 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | ||
| 2280 | dio_iodone_t end_io) | ||
| 2281 | { | ||
| 2282 | return __blockdev_direct_IO_newtrunc(rw, iocb, inode, bdev, iov, offset, | ||
| 2283 | nr_segs, get_block, end_io, NULL, | ||
| 2284 | DIO_LOCKING | DIO_SKIP_HOLES); | ||
| 2285 | } | ||
| 2286 | |||
| 2287 | static inline ssize_t blockdev_direct_IO_no_locking_newtrunc(int rw, struct kiocb *iocb, | ||
| 2288 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | ||
| 2289 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | ||
| 2290 | dio_iodone_t end_io) | ||
| 2291 | { | ||
| 2292 | return __blockdev_direct_IO_newtrunc(rw, iocb, inode, bdev, iov, offset, | ||
| 2293 | nr_segs, get_block, end_io, NULL, 0); | ||
| 2294 | } | ||
| 2272 | static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, | 2295 | static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, |
| 2273 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | 2296 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, |
| 2274 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | 2297 | loff_t offset, unsigned long nr_segs, get_block_t get_block, |
| @@ -2341,13 +2364,15 @@ extern int dcache_dir_open(struct inode *, struct file *); | |||
| 2341 | extern int dcache_dir_close(struct inode *, struct file *); | 2364 | extern int dcache_dir_close(struct inode *, struct file *); |
| 2342 | extern loff_t dcache_dir_lseek(struct file *, loff_t, int); | 2365 | extern loff_t dcache_dir_lseek(struct file *, loff_t, int); |
| 2343 | extern int dcache_readdir(struct file *, void *, filldir_t); | 2366 | extern int dcache_readdir(struct file *, void *, filldir_t); |
| 2367 | extern int simple_setattr(struct dentry *, struct iattr *); | ||
| 2344 | extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 2368 | extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
| 2345 | extern int simple_statfs(struct dentry *, struct kstatfs *); | 2369 | extern int simple_statfs(struct dentry *, struct kstatfs *); |
| 2346 | extern int simple_link(struct dentry *, struct inode *, struct dentry *); | 2370 | extern int simple_link(struct dentry *, struct inode *, struct dentry *); |
| 2347 | extern int simple_unlink(struct inode *, struct dentry *); | 2371 | extern int simple_unlink(struct inode *, struct dentry *); |
| 2348 | extern int simple_rmdir(struct inode *, struct dentry *); | 2372 | extern int simple_rmdir(struct inode *, struct dentry *); |
| 2349 | extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); | 2373 | extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); |
| 2350 | extern int simple_sync_file(struct file *, struct dentry *, int); | 2374 | extern int simple_setsize(struct inode *, loff_t); |
| 2375 | extern int noop_fsync(struct file *, int); | ||
| 2351 | extern int simple_empty(struct dentry *); | 2376 | extern int simple_empty(struct dentry *); |
| 2352 | extern int simple_readpage(struct file *file, struct page *page); | 2377 | extern int simple_readpage(struct file *file, struct page *page); |
| 2353 | extern int simple_write_begin(struct file *file, struct address_space *mapping, | 2378 | extern int simple_write_begin(struct file *file, struct address_space *mapping, |
| @@ -2372,7 +2397,7 @@ extern ssize_t simple_read_from_buffer(void __user *to, size_t count, | |||
| 2372 | extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos, | 2397 | extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos, |
| 2373 | const void __user *from, size_t count); | 2398 | const void __user *from, size_t count); |
| 2374 | 2399 | ||
| 2375 | extern int simple_fsync(struct file *, struct dentry *, int); | 2400 | extern int generic_file_fsync(struct file *, int); |
| 2376 | 2401 | ||
| 2377 | #ifdef CONFIG_MIGRATION | 2402 | #ifdef CONFIG_MIGRATION |
| 2378 | extern int buffer_migrate_page(struct address_space *, | 2403 | extern int buffer_migrate_page(struct address_space *, |
| @@ -2383,7 +2408,8 @@ extern int buffer_migrate_page(struct address_space *, | |||
| 2383 | 2408 | ||
| 2384 | extern int inode_change_ok(const struct inode *, struct iattr *); | 2409 | extern int inode_change_ok(const struct inode *, struct iattr *); |
| 2385 | extern int inode_newsize_ok(const struct inode *, loff_t offset); | 2410 | extern int inode_newsize_ok(const struct inode *, loff_t offset); |
| 2386 | extern int __must_check inode_setattr(struct inode *, struct iattr *); | 2411 | extern int __must_check inode_setattr(struct inode *, const struct iattr *); |
| 2412 | extern void generic_setattr(struct inode *inode, const struct iattr *attr); | ||
| 2387 | 2413 | ||
| 2388 | extern void file_update_time(struct file *file); | 2414 | extern void file_update_time(struct file *file); |
| 2389 | 2415 | ||
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index c082f223e2fe..3167f2df4126 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -73,18 +73,25 @@ struct trace_iterator { | |||
| 73 | }; | 73 | }; |
| 74 | 74 | ||
| 75 | 75 | ||
| 76 | struct trace_event; | ||
| 77 | |||
| 76 | typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter, | 78 | typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter, |
| 77 | int flags); | 79 | int flags, struct trace_event *event); |
| 78 | struct trace_event { | 80 | |
| 79 | struct hlist_node node; | 81 | struct trace_event_functions { |
| 80 | struct list_head list; | ||
| 81 | int type; | ||
| 82 | trace_print_func trace; | 82 | trace_print_func trace; |
| 83 | trace_print_func raw; | 83 | trace_print_func raw; |
| 84 | trace_print_func hex; | 84 | trace_print_func hex; |
| 85 | trace_print_func binary; | 85 | trace_print_func binary; |
| 86 | }; | 86 | }; |
| 87 | 87 | ||
| 88 | struct trace_event { | ||
| 89 | struct hlist_node node; | ||
| 90 | struct list_head list; | ||
| 91 | int type; | ||
| 92 | struct trace_event_functions *funcs; | ||
| 93 | }; | ||
| 94 | |||
| 88 | extern int register_ftrace_event(struct trace_event *event); | 95 | extern int register_ftrace_event(struct trace_event *event); |
| 89 | extern int unregister_ftrace_event(struct trace_event *event); | 96 | extern int unregister_ftrace_event(struct trace_event *event); |
| 90 | 97 | ||
| @@ -116,28 +123,70 @@ void tracing_record_cmdline(struct task_struct *tsk); | |||
| 116 | 123 | ||
| 117 | struct event_filter; | 124 | struct event_filter; |
| 118 | 125 | ||
| 126 | enum trace_reg { | ||
| 127 | TRACE_REG_REGISTER, | ||
| 128 | TRACE_REG_UNREGISTER, | ||
| 129 | TRACE_REG_PERF_REGISTER, | ||
| 130 | TRACE_REG_PERF_UNREGISTER, | ||
| 131 | }; | ||
| 132 | |||
| 133 | struct ftrace_event_call; | ||
| 134 | |||
| 135 | struct ftrace_event_class { | ||
| 136 | char *system; | ||
| 137 | void *probe; | ||
| 138 | #ifdef CONFIG_PERF_EVENTS | ||
| 139 | void *perf_probe; | ||
| 140 | #endif | ||
| 141 | int (*reg)(struct ftrace_event_call *event, | ||
| 142 | enum trace_reg type); | ||
| 143 | int (*define_fields)(struct ftrace_event_call *); | ||
| 144 | struct list_head *(*get_fields)(struct ftrace_event_call *); | ||
| 145 | struct list_head fields; | ||
| 146 | int (*raw_init)(struct ftrace_event_call *); | ||
| 147 | }; | ||
| 148 | |||
| 149 | enum { | ||
| 150 | TRACE_EVENT_FL_ENABLED_BIT, | ||
| 151 | TRACE_EVENT_FL_FILTERED_BIT, | ||
| 152 | }; | ||
| 153 | |||
| 154 | enum { | ||
| 155 | TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT), | ||
| 156 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), | ||
| 157 | }; | ||
| 158 | |||
| 119 | struct ftrace_event_call { | 159 | struct ftrace_event_call { |
| 120 | struct list_head list; | 160 | struct list_head list; |
| 161 | struct ftrace_event_class *class; | ||
| 121 | char *name; | 162 | char *name; |
| 122 | char *system; | ||
| 123 | struct dentry *dir; | 163 | struct dentry *dir; |
| 124 | struct trace_event *event; | 164 | struct trace_event event; |
| 125 | int enabled; | ||
| 126 | int (*regfunc)(struct ftrace_event_call *); | ||
| 127 | void (*unregfunc)(struct ftrace_event_call *); | ||
| 128 | int id; | ||
| 129 | const char *print_fmt; | 165 | const char *print_fmt; |
| 130 | int (*raw_init)(struct ftrace_event_call *); | ||
| 131 | int (*define_fields)(struct ftrace_event_call *); | ||
| 132 | struct list_head fields; | ||
| 133 | int filter_active; | ||
| 134 | struct event_filter *filter; | 166 | struct event_filter *filter; |
| 135 | void *mod; | 167 | void *mod; |
| 136 | void *data; | 168 | void *data; |
| 137 | 169 | ||
| 170 | /* | ||
| 171 | * 32 bit flags: | ||
| 172 | * bit 1: enabled | ||
| 173 | * bit 2: filter_active | ||
| 174 | * | ||
| 175 | * Changes to flags must hold the event_mutex. | ||
| 176 | * | ||
| 177 | * Note: Reads of flags do not hold the event_mutex since | ||
| 178 | * they occur in critical sections. But the way flags | ||
| 179 | * is currently used, these changes do no affect the code | ||
| 180 | * except that when a change is made, it may have a slight | ||
| 181 | * delay in propagating the changes to other CPUs due to | ||
| 182 | * caching and such. | ||
| 183 | */ | ||
| 184 | unsigned int flags; | ||
| 185 | |||
| 186 | #ifdef CONFIG_PERF_EVENTS | ||
| 138 | int perf_refcount; | 187 | int perf_refcount; |
| 139 | int (*perf_event_enable)(struct ftrace_event_call *); | 188 | struct hlist_head *perf_events; |
| 140 | void (*perf_event_disable)(struct ftrace_event_call *); | 189 | #endif |
| 141 | }; | 190 | }; |
| 142 | 191 | ||
| 143 | #define PERF_MAX_TRACE_SIZE 2048 | 192 | #define PERF_MAX_TRACE_SIZE 2048 |
| @@ -194,24 +243,22 @@ struct perf_event; | |||
| 194 | 243 | ||
| 195 | DECLARE_PER_CPU(struct pt_regs, perf_trace_regs); | 244 | DECLARE_PER_CPU(struct pt_regs, perf_trace_regs); |
| 196 | 245 | ||
| 197 | extern int perf_trace_enable(int event_id); | 246 | extern int perf_trace_init(struct perf_event *event); |
| 198 | extern void perf_trace_disable(int event_id); | 247 | extern void perf_trace_destroy(struct perf_event *event); |
| 199 | extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, | 248 | extern int perf_trace_enable(struct perf_event *event); |
| 249 | extern void perf_trace_disable(struct perf_event *event); | ||
| 250 | extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, | ||
| 200 | char *filter_str); | 251 | char *filter_str); |
| 201 | extern void ftrace_profile_free_filter(struct perf_event *event); | 252 | extern void ftrace_profile_free_filter(struct perf_event *event); |
| 202 | extern void * | 253 | extern void *perf_trace_buf_prepare(int size, unsigned short type, |
| 203 | perf_trace_buf_prepare(int size, unsigned short type, int *rctxp, | 254 | struct pt_regs *regs, int *rctxp); |
| 204 | unsigned long *irq_flags); | ||
| 205 | 255 | ||
| 206 | static inline void | 256 | static inline void |
| 207 | perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, | 257 | perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, |
| 208 | u64 count, unsigned long irq_flags, struct pt_regs *regs) | 258 | u64 count, struct pt_regs *regs, void *head) |
| 209 | { | 259 | { |
| 210 | struct trace_entry *entry = raw_data; | 260 | perf_tp_event(addr, count, raw_data, size, regs, head); |
| 211 | |||
| 212 | perf_tp_event(entry->type, addr, count, raw_data, size, regs); | ||
| 213 | perf_swevent_put_recursion_context(rctx); | 261 | perf_swevent_put_recursion_context(rctx); |
| 214 | local_irq_restore(irq_flags); | ||
| 215 | } | 262 | } |
| 216 | #endif | 263 | #endif |
| 217 | 264 | ||
diff --git a/include/linux/i2c/adp8860.h b/include/linux/i2c/adp8860.h new file mode 100644 index 000000000000..0b4d39855c91 --- /dev/null +++ b/include/linux/i2c/adp8860.h | |||
| @@ -0,0 +1,154 @@ | |||
| 1 | /* | ||
| 2 | * Definitions and platform data for Analog Devices | ||
| 3 | * Backlight drivers ADP8860 | ||
| 4 | * | ||
| 5 | * Copyright 2009-2010 Analog Devices Inc. | ||
| 6 | * | ||
| 7 | * Licensed under the GPL-2 or later. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef __LINUX_I2C_ADP8860_H | ||
| 11 | #define __LINUX_I2C_ADP8860_H | ||
| 12 | |||
| 13 | #include <linux/leds.h> | ||
| 14 | #include <linux/types.h> | ||
| 15 | |||
| 16 | #define ID_ADP8860 8860 | ||
| 17 | |||
| 18 | #define ADP8860_MAX_BRIGHTNESS 0x7F | ||
| 19 | #define FLAG_OFFT_SHIFT 8 | ||
| 20 | |||
| 21 | /* | ||
| 22 | * LEDs subdevice platform data | ||
| 23 | */ | ||
| 24 | |||
| 25 | #define ADP8860_LED_DIS_BLINK (0 << FLAG_OFFT_SHIFT) | ||
| 26 | #define ADP8860_LED_OFFT_600ms (1 << FLAG_OFFT_SHIFT) | ||
| 27 | #define ADP8860_LED_OFFT_1200ms (2 << FLAG_OFFT_SHIFT) | ||
| 28 | #define ADP8860_LED_OFFT_1800ms (3 << FLAG_OFFT_SHIFT) | ||
| 29 | |||
| 30 | #define ADP8860_LED_ONT_200ms 0 | ||
| 31 | #define ADP8860_LED_ONT_600ms 1 | ||
| 32 | #define ADP8860_LED_ONT_800ms 2 | ||
| 33 | #define ADP8860_LED_ONT_1200ms 3 | ||
| 34 | |||
| 35 | #define ADP8860_LED_D7 (7) | ||
| 36 | #define ADP8860_LED_D6 (6) | ||
| 37 | #define ADP8860_LED_D5 (5) | ||
| 38 | #define ADP8860_LED_D4 (4) | ||
| 39 | #define ADP8860_LED_D3 (3) | ||
| 40 | #define ADP8860_LED_D2 (2) | ||
| 41 | #define ADP8860_LED_D1 (1) | ||
| 42 | |||
| 43 | /* | ||
| 44 | * Backlight subdevice platform data | ||
| 45 | */ | ||
| 46 | |||
| 47 | #define ADP8860_BL_D7 (1 << 6) | ||
| 48 | #define ADP8860_BL_D6 (1 << 5) | ||
| 49 | #define ADP8860_BL_D5 (1 << 4) | ||
| 50 | #define ADP8860_BL_D4 (1 << 3) | ||
| 51 | #define ADP8860_BL_D3 (1 << 2) | ||
| 52 | #define ADP8860_BL_D2 (1 << 1) | ||
| 53 | #define ADP8860_BL_D1 (1 << 0) | ||
| 54 | |||
| 55 | #define ADP8860_FADE_T_DIS 0 /* Fade Timer Disabled */ | ||
| 56 | #define ADP8860_FADE_T_300ms 1 /* 0.3 Sec */ | ||
| 57 | #define ADP8860_FADE_T_600ms 2 | ||
| 58 | #define ADP8860_FADE_T_900ms 3 | ||
| 59 | #define ADP8860_FADE_T_1200ms 4 | ||
| 60 | #define ADP8860_FADE_T_1500ms 5 | ||
| 61 | #define ADP8860_FADE_T_1800ms 6 | ||
| 62 | #define ADP8860_FADE_T_2100ms 7 | ||
| 63 | #define ADP8860_FADE_T_2400ms 8 | ||
| 64 | #define ADP8860_FADE_T_2700ms 9 | ||
| 65 | #define ADP8860_FADE_T_3000ms 10 | ||
| 66 | #define ADP8860_FADE_T_3500ms 11 | ||
| 67 | #define ADP8860_FADE_T_4000ms 12 | ||
| 68 | #define ADP8860_FADE_T_4500ms 13 | ||
| 69 | #define ADP8860_FADE_T_5000ms 14 | ||
| 70 | #define ADP8860_FADE_T_5500ms 15 /* 5.5 Sec */ | ||
| 71 | |||
| 72 | #define ADP8860_FADE_LAW_LINEAR 0 | ||
| 73 | #define ADP8860_FADE_LAW_SQUARE 1 | ||
| 74 | #define ADP8860_FADE_LAW_CUBIC1 2 | ||
| 75 | #define ADP8860_FADE_LAW_CUBIC2 3 | ||
| 76 | |||
| 77 | #define ADP8860_BL_AMBL_FILT_80ms 0 /* Light sensor filter time */ | ||
| 78 | #define ADP8860_BL_AMBL_FILT_160ms 1 | ||
| 79 | #define ADP8860_BL_AMBL_FILT_320ms 2 | ||
| 80 | #define ADP8860_BL_AMBL_FILT_640ms 3 | ||
| 81 | #define ADP8860_BL_AMBL_FILT_1280ms 4 | ||
| 82 | #define ADP8860_BL_AMBL_FILT_2560ms 5 | ||
| 83 | #define ADP8860_BL_AMBL_FILT_5120ms 6 | ||
| 84 | #define ADP8860_BL_AMBL_FILT_10240ms 7 /* 10.24 sec */ | ||
| 85 | |||
| 86 | /* | ||
| 87 | * Blacklight current 0..30mA | ||
| 88 | */ | ||
| 89 | #define ADP8860_BL_CUR_mA(I) ((I * 127) / 30) | ||
| 90 | |||
| 91 | /* | ||
| 92 | * L2 comparator current 0..1106uA | ||
| 93 | */ | ||
| 94 | #define ADP8860_L2_COMP_CURR_uA(I) ((I * 255) / 1106) | ||
| 95 | |||
| 96 | /* | ||
| 97 | * L3 comparator current 0..138uA | ||
| 98 | */ | ||
| 99 | #define ADP8860_L3_COMP_CURR_uA(I) ((I * 255) / 138) | ||
| 100 | |||
| 101 | struct adp8860_backlight_platform_data { | ||
| 102 | u8 bl_led_assign; /* 1 = Backlight 0 = Individual LED */ | ||
| 103 | |||
| 104 | u8 bl_fade_in; /* Backlight Fade-In Timer */ | ||
| 105 | u8 bl_fade_out; /* Backlight Fade-Out Timer */ | ||
| 106 | u8 bl_fade_law; /* fade-on/fade-off transfer characteristic */ | ||
| 107 | |||
| 108 | u8 en_ambl_sens; /* 1 = enable ambient light sensor */ | ||
| 109 | u8 abml_filt; /* Light sensor filter time */ | ||
| 110 | |||
| 111 | u8 l1_daylight_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 112 | u8 l1_daylight_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 113 | u8 l2_office_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 114 | u8 l2_office_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 115 | u8 l3_dark_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 116 | u8 l3_dark_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 117 | |||
| 118 | u8 l2_trip; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */ | ||
| 119 | u8 l2_hyst; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */ | ||
| 120 | u8 l3_trip; /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */ | ||
| 121 | u8 l3_hyst; /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */ | ||
| 122 | |||
| 123 | /** | ||
| 124 | * Independent Current Sinks / LEDS | ||
| 125 | * Sinks not assigned to the Backlight can be exposed to | ||
| 126 | * user space using the LEDS CLASS interface | ||
| 127 | */ | ||
| 128 | |||
| 129 | int num_leds; | ||
| 130 | struct led_info *leds; | ||
| 131 | u8 led_fade_in; /* LED Fade-In Timer */ | ||
| 132 | u8 led_fade_out; /* LED Fade-Out Timer */ | ||
| 133 | u8 led_fade_law; /* fade-on/fade-off transfer characteristic */ | ||
| 134 | u8 led_on_time; | ||
| 135 | |||
| 136 | /** | ||
| 137 | * Gain down disable. Setting this option does not allow the | ||
| 138 | * charge pump to switch to lower gains. NOT AVAILABLE on ADP8860 | ||
| 139 | * 1 = the charge pump doesn't switch down in gain until all LEDs are 0. | ||
| 140 | * The charge pump switches up in gain as needed. This feature is | ||
| 141 | * useful if the ADP8863 charge pump is used to drive an external load. | ||
| 142 | * This feature must be used when utilizing small fly capacitors | ||
| 143 | * (0402 or smaller). | ||
| 144 | * 0 = the charge pump automatically switches up and down in gain. | ||
| 145 | * This provides optimal efficiency, but is not suitable for driving | ||
| 146 | * loads that are not connected through the ADP8863 diode drivers. | ||
| 147 | * Additionally, the charge pump fly capacitors should be low ESR | ||
| 148 | * and sized 0603 or greater. | ||
| 149 | */ | ||
| 150 | |||
| 151 | u8 gdwn_dis; | ||
| 152 | }; | ||
| 153 | |||
| 154 | #endif /* __LINUX_I2C_ADP8860_H */ | ||
diff --git a/include/linux/input/tps6507x-ts.h b/include/linux/input/tps6507x-ts.h new file mode 100644 index 000000000000..ab1440313924 --- /dev/null +++ b/include/linux/input/tps6507x-ts.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* linux/i2c/tps6507x-ts.h | ||
| 2 | * | ||
| 3 | * Functions to access TPS65070 touch screen chip. | ||
| 4 | * | ||
| 5 | * Copyright (c) 2009 RidgeRun (todd.fischer@ridgerun.com) | ||
| 6 | * | ||
| 7 | * | ||
| 8 | * For licencing details see kernel-base/COPYING | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __LINUX_I2C_TPS6507X_TS_H | ||
| 12 | #define __LINUX_I2C_TPS6507X_TS_H | ||
| 13 | |||
| 14 | /* Board specific touch screen initial values */ | ||
| 15 | struct touchscreen_init_data { | ||
| 16 | int poll_period; /* ms */ | ||
| 17 | int vref; /* non-zero to leave vref on */ | ||
| 18 | __u16 min_pressure; /* min reading to be treated as a touch */ | ||
| 19 | __u16 vendor; | ||
| 20 | __u16 product; | ||
| 21 | __u16 version; | ||
| 22 | }; | ||
| 23 | |||
| 24 | #endif /* __LINUX_I2C_TPS6507X_TS_H */ | ||
diff --git a/include/linux/lcd.h b/include/linux/lcd.h index c67fecafff90..8877123f2d6e 100644 --- a/include/linux/lcd.h +++ b/include/linux/lcd.h | |||
| @@ -69,6 +69,29 @@ struct lcd_device { | |||
| 69 | struct device dev; | 69 | struct device dev; |
| 70 | }; | 70 | }; |
| 71 | 71 | ||
| 72 | struct lcd_platform_data { | ||
| 73 | /* reset lcd panel device. */ | ||
| 74 | int (*reset)(struct lcd_device *ld); | ||
| 75 | /* on or off to lcd panel. if 'enable' is 0 then | ||
| 76 | lcd power off and 1, lcd power on. */ | ||
| 77 | int (*power_on)(struct lcd_device *ld, int enable); | ||
| 78 | |||
| 79 | /* it indicates whether lcd panel was enabled | ||
| 80 | from bootloader or not. */ | ||
| 81 | int lcd_enabled; | ||
| 82 | /* it means delay for stable time when it becomes low to high | ||
| 83 | or high to low that is dependent on whether reset gpio is | ||
| 84 | low active or high active. */ | ||
| 85 | unsigned int reset_delay; | ||
| 86 | /* stable time needing to become lcd power on. */ | ||
| 87 | unsigned int power_on_delay; | ||
| 88 | /* stable time needing to become lcd power off. */ | ||
| 89 | unsigned int power_off_delay; | ||
| 90 | |||
| 91 | /* it could be used for any purpose. */ | ||
| 92 | void *pdata; | ||
| 93 | }; | ||
| 94 | |||
| 72 | static inline void lcd_set_power(struct lcd_device *ld, int power) | 95 | static inline void lcd_set_power(struct lcd_device *ld, int power) |
| 73 | { | 96 | { |
| 74 | mutex_lock(&ld->update_lock); | 97 | mutex_lock(&ld->update_lock); |
diff --git a/include/linux/leds.h b/include/linux/leds.h index d8bf9665e70c..ba6986a11663 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
| @@ -149,14 +149,18 @@ struct gpio_led { | |||
| 149 | unsigned default_state : 2; | 149 | unsigned default_state : 2; |
| 150 | /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */ | 150 | /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */ |
| 151 | }; | 151 | }; |
| 152 | #define LEDS_GPIO_DEFSTATE_OFF 0 | 152 | #define LEDS_GPIO_DEFSTATE_OFF 0 |
| 153 | #define LEDS_GPIO_DEFSTATE_ON 1 | 153 | #define LEDS_GPIO_DEFSTATE_ON 1 |
| 154 | #define LEDS_GPIO_DEFSTATE_KEEP 2 | 154 | #define LEDS_GPIO_DEFSTATE_KEEP 2 |
| 155 | 155 | ||
| 156 | struct gpio_led_platform_data { | 156 | struct gpio_led_platform_data { |
| 157 | int num_leds; | 157 | int num_leds; |
| 158 | struct gpio_led *leds; | 158 | struct gpio_led *leds; |
| 159 | int (*gpio_blink_set)(unsigned gpio, | 159 | |
| 160 | #define GPIO_LED_NO_BLINK_LOW 0 /* No blink GPIO state low */ | ||
| 161 | #define GPIO_LED_NO_BLINK_HIGH 1 /* No blink GPIO state high */ | ||
| 162 | #define GPIO_LED_BLINK 2 /* Plase, blink */ | ||
| 163 | int (*gpio_blink_set)(unsigned gpio, int state, | ||
| 160 | unsigned long *delay_on, | 164 | unsigned long *delay_on, |
| 161 | unsigned long *delay_off); | 165 | unsigned long *delay_off); |
| 162 | }; | 166 | }; |
diff --git a/include/linux/libata.h b/include/linux/libata.h index ee84e7e12039..3bad2701bfa6 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -386,6 +386,7 @@ enum { | |||
| 386 | ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */ | 386 | ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */ |
| 387 | ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */ | 387 | ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */ |
| 388 | ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */ | 388 | ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */ |
| 389 | ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ | ||
| 389 | 390 | ||
| 390 | /* DMA mask for user DMA control: User visible values; DO NOT | 391 | /* DMA mask for user DMA control: User visible values; DO NOT |
| 391 | renumber */ | 392 | renumber */ |
| @@ -513,7 +514,9 @@ struct ata_ioports { | |||
| 513 | void __iomem *command_addr; | 514 | void __iomem *command_addr; |
| 514 | void __iomem *altstatus_addr; | 515 | void __iomem *altstatus_addr; |
| 515 | void __iomem *ctl_addr; | 516 | void __iomem *ctl_addr; |
| 517 | #ifdef CONFIG_ATA_BMDMA | ||
| 516 | void __iomem *bmdma_addr; | 518 | void __iomem *bmdma_addr; |
| 519 | #endif /* CONFIG_ATA_BMDMA */ | ||
| 517 | void __iomem *scr_addr; | 520 | void __iomem *scr_addr; |
| 518 | }; | 521 | }; |
| 519 | #endif /* CONFIG_ATA_SFF */ | 522 | #endif /* CONFIG_ATA_SFF */ |
| @@ -721,8 +724,10 @@ struct ata_port { | |||
| 721 | u8 ctl; /* cache of ATA control register */ | 724 | u8 ctl; /* cache of ATA control register */ |
| 722 | u8 last_ctl; /* Cache last written value */ | 725 | u8 last_ctl; /* Cache last written value */ |
| 723 | struct delayed_work sff_pio_task; | 726 | struct delayed_work sff_pio_task; |
| 727 | #ifdef CONFIG_ATA_BMDMA | ||
| 724 | struct ata_bmdma_prd *bmdma_prd; /* BMDMA SG list */ | 728 | struct ata_bmdma_prd *bmdma_prd; /* BMDMA SG list */ |
| 725 | dma_addr_t bmdma_prd_dma; /* and its DMA mapping */ | 729 | dma_addr_t bmdma_prd_dma; /* and its DMA mapping */ |
| 730 | #endif /* CONFIG_ATA_BMDMA */ | ||
| 726 | #endif /* CONFIG_ATA_SFF */ | 731 | #endif /* CONFIG_ATA_SFF */ |
| 727 | 732 | ||
| 728 | unsigned int pio_mask; | 733 | unsigned int pio_mask; |
| @@ -856,10 +861,12 @@ struct ata_port_operations { | |||
| 856 | void (*sff_irq_clear)(struct ata_port *); | 861 | void (*sff_irq_clear)(struct ata_port *); |
| 857 | void (*sff_drain_fifo)(struct ata_queued_cmd *qc); | 862 | void (*sff_drain_fifo)(struct ata_queued_cmd *qc); |
| 858 | 863 | ||
| 864 | #ifdef CONFIG_ATA_BMDMA | ||
| 859 | void (*bmdma_setup)(struct ata_queued_cmd *qc); | 865 | void (*bmdma_setup)(struct ata_queued_cmd *qc); |
| 860 | void (*bmdma_start)(struct ata_queued_cmd *qc); | 866 | void (*bmdma_start)(struct ata_queued_cmd *qc); |
| 861 | void (*bmdma_stop)(struct ata_queued_cmd *qc); | 867 | void (*bmdma_stop)(struct ata_queued_cmd *qc); |
| 862 | u8 (*bmdma_status)(struct ata_port *ap); | 868 | u8 (*bmdma_status)(struct ata_port *ap); |
| 869 | #endif /* CONFIG_ATA_BMDMA */ | ||
| 863 | #endif /* CONFIG_ATA_SFF */ | 870 | #endif /* CONFIG_ATA_SFF */ |
| 864 | 871 | ||
| 865 | ssize_t (*em_show)(struct ata_port *ap, char *buf); | 872 | ssize_t (*em_show)(struct ata_port *ap, char *buf); |
| @@ -1555,7 +1562,6 @@ extern void sata_pmp_error_handler(struct ata_port *ap); | |||
| 1555 | #ifdef CONFIG_ATA_SFF | 1562 | #ifdef CONFIG_ATA_SFF |
| 1556 | 1563 | ||
| 1557 | extern const struct ata_port_operations ata_sff_port_ops; | 1564 | extern const struct ata_port_operations ata_sff_port_ops; |
| 1558 | extern const struct ata_port_operations ata_bmdma_port_ops; | ||
| 1559 | extern const struct ata_port_operations ata_bmdma32_port_ops; | 1565 | extern const struct ata_port_operations ata_bmdma32_port_ops; |
| 1560 | 1566 | ||
| 1561 | /* PIO only, sg_tablesize and dma_boundary limits can be removed */ | 1567 | /* PIO only, sg_tablesize and dma_boundary limits can be removed */ |
| @@ -1564,11 +1570,6 @@ extern const struct ata_port_operations ata_bmdma32_port_ops; | |||
| 1564 | .sg_tablesize = LIBATA_MAX_PRD, \ | 1570 | .sg_tablesize = LIBATA_MAX_PRD, \ |
| 1565 | .dma_boundary = ATA_DMA_BOUNDARY | 1571 | .dma_boundary = ATA_DMA_BOUNDARY |
| 1566 | 1572 | ||
| 1567 | #define ATA_BMDMA_SHT(drv_name) \ | ||
| 1568 | ATA_BASE_SHT(drv_name), \ | ||
| 1569 | .sg_tablesize = LIBATA_MAX_PRD, \ | ||
| 1570 | .dma_boundary = ATA_DMA_BOUNDARY | ||
| 1571 | |||
| 1572 | extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device); | 1573 | extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device); |
| 1573 | extern u8 ata_sff_check_status(struct ata_port *ap); | 1574 | extern u8 ata_sff_check_status(struct ata_port *ap); |
| 1574 | extern void ata_sff_pause(struct ata_port *ap); | 1575 | extern void ata_sff_pause(struct ata_port *ap); |
| @@ -1593,7 +1594,7 @@ extern int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc, | |||
| 1593 | extern void ata_sff_queue_pio_task(struct ata_port *ap, unsigned long delay); | 1594 | extern void ata_sff_queue_pio_task(struct ata_port *ap, unsigned long delay); |
| 1594 | extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc); | 1595 | extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc); |
| 1595 | extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc); | 1596 | extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc); |
| 1596 | extern unsigned int ata_sff_host_intr(struct ata_port *ap, | 1597 | extern unsigned int ata_sff_port_intr(struct ata_port *ap, |
| 1597 | struct ata_queued_cmd *qc); | 1598 | struct ata_queued_cmd *qc); |
| 1598 | extern irqreturn_t ata_sff_interrupt(int irq, void *dev_instance); | 1599 | extern irqreturn_t ata_sff_interrupt(int irq, void *dev_instance); |
| 1599 | extern void ata_sff_lost_interrupt(struct ata_port *ap); | 1600 | extern void ata_sff_lost_interrupt(struct ata_port *ap); |
| @@ -1625,11 +1626,24 @@ extern int ata_pci_sff_init_one(struct pci_dev *pdev, | |||
| 1625 | struct scsi_host_template *sht, void *host_priv, int hflags); | 1626 | struct scsi_host_template *sht, void *host_priv, int hflags); |
| 1626 | #endif /* CONFIG_PCI */ | 1627 | #endif /* CONFIG_PCI */ |
| 1627 | 1628 | ||
| 1629 | #ifdef CONFIG_ATA_BMDMA | ||
| 1630 | |||
| 1631 | extern const struct ata_port_operations ata_bmdma_port_ops; | ||
| 1632 | |||
| 1633 | #define ATA_BMDMA_SHT(drv_name) \ | ||
| 1634 | ATA_BASE_SHT(drv_name), \ | ||
| 1635 | .sg_tablesize = LIBATA_MAX_PRD, \ | ||
| 1636 | .dma_boundary = ATA_DMA_BOUNDARY | ||
| 1637 | |||
| 1628 | extern void ata_bmdma_qc_prep(struct ata_queued_cmd *qc); | 1638 | extern void ata_bmdma_qc_prep(struct ata_queued_cmd *qc); |
| 1629 | extern unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc); | 1639 | extern unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc); |
| 1630 | extern void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc); | 1640 | extern void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc); |
| 1641 | extern unsigned int ata_bmdma_port_intr(struct ata_port *ap, | ||
| 1642 | struct ata_queued_cmd *qc); | ||
| 1643 | extern irqreturn_t ata_bmdma_interrupt(int irq, void *dev_instance); | ||
| 1631 | extern void ata_bmdma_error_handler(struct ata_port *ap); | 1644 | extern void ata_bmdma_error_handler(struct ata_port *ap); |
| 1632 | extern void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc); | 1645 | extern void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc); |
| 1646 | extern void ata_bmdma_irq_clear(struct ata_port *ap); | ||
| 1633 | extern void ata_bmdma_setup(struct ata_queued_cmd *qc); | 1647 | extern void ata_bmdma_setup(struct ata_queued_cmd *qc); |
| 1634 | extern void ata_bmdma_start(struct ata_queued_cmd *qc); | 1648 | extern void ata_bmdma_start(struct ata_queued_cmd *qc); |
| 1635 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); | 1649 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); |
| @@ -1640,7 +1654,15 @@ extern int ata_bmdma_port_start32(struct ata_port *ap); | |||
| 1640 | #ifdef CONFIG_PCI | 1654 | #ifdef CONFIG_PCI |
| 1641 | extern int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev); | 1655 | extern int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev); |
| 1642 | extern void ata_pci_bmdma_init(struct ata_host *host); | 1656 | extern void ata_pci_bmdma_init(struct ata_host *host); |
| 1657 | extern int ata_pci_bmdma_prepare_host(struct pci_dev *pdev, | ||
| 1658 | const struct ata_port_info * const * ppi, | ||
| 1659 | struct ata_host **r_host); | ||
| 1660 | extern int ata_pci_bmdma_init_one(struct pci_dev *pdev, | ||
| 1661 | const struct ata_port_info * const * ppi, | ||
| 1662 | struct scsi_host_template *sht, | ||
| 1663 | void *host_priv, int hflags); | ||
| 1643 | #endif /* CONFIG_PCI */ | 1664 | #endif /* CONFIG_PCI */ |
| 1665 | #endif /* CONFIG_ATA_BMDMA */ | ||
| 1644 | 1666 | ||
| 1645 | /** | 1667 | /** |
| 1646 | * ata_sff_busy_wait - Wait for a port status register | 1668 | * ata_sff_busy_wait - Wait for a port status register |
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h index e3c4ff8c3e38..bfd23bef7363 100644 --- a/include/linux/mfd/88pm860x.h +++ b/include/linux/mfd/88pm860x.h | |||
| @@ -370,7 +370,7 @@ extern int pm860x_set_bits(struct i2c_client *, int, unsigned char, | |||
| 370 | unsigned char); | 370 | unsigned char); |
| 371 | 371 | ||
| 372 | extern int pm860x_device_init(struct pm860x_chip *chip, | 372 | extern int pm860x_device_init(struct pm860x_chip *chip, |
| 373 | struct pm860x_platform_data *pdata); | 373 | struct pm860x_platform_data *pdata) __devinit ; |
| 374 | extern void pm860x_device_exit(struct pm860x_chip *chip); | 374 | extern void pm860x_device_exit(struct pm860x_chip *chip) __devexit ; |
| 375 | 375 | ||
| 376 | #endif /* __LINUX_MFD_88PM860X_H */ | 376 | #endif /* __LINUX_MFD_88PM860X_H */ |
diff --git a/include/linux/mfd/ab4500.h b/include/linux/mfd/ab4500.h deleted file mode 100644 index a42a7033ae53..000000000000 --- a/include/linux/mfd/ab4500.h +++ /dev/null | |||
| @@ -1,262 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2009 ST-Ericsson | ||
| 3 | * | ||
| 4 | * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2, as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * AB4500 device core funtions, for client access | ||
| 11 | */ | ||
| 12 | #ifndef MFD_AB4500_H | ||
| 13 | #define MFD_AB4500_H | ||
| 14 | |||
| 15 | #include <linux/device.h> | ||
| 16 | |||
| 17 | /* | ||
| 18 | * AB4500 bank addresses | ||
| 19 | */ | ||
| 20 | #define AB4500_SYS_CTRL1_BLOCK 0x1 | ||
| 21 | #define AB4500_SYS_CTRL2_BLOCK 0x2 | ||
| 22 | #define AB4500_REGU_CTRL1 0x3 | ||
| 23 | #define AB4500_REGU_CTRL2 0x4 | ||
| 24 | #define AB4500_USB 0x5 | ||
| 25 | #define AB4500_TVOUT 0x6 | ||
| 26 | #define AB4500_DBI 0x7 | ||
| 27 | #define AB4500_ECI_AV_ACC 0x8 | ||
| 28 | #define AB4500_RESERVED 0x9 | ||
| 29 | #define AB4500_GPADC 0xA | ||
| 30 | #define AB4500_CHARGER 0xB | ||
| 31 | #define AB4500_GAS_GAUGE 0xC | ||
| 32 | #define AB4500_AUDIO 0xD | ||
| 33 | #define AB4500_INTERRUPT 0xE | ||
| 34 | #define AB4500_RTC 0xF | ||
| 35 | #define AB4500_MISC 0x10 | ||
| 36 | #define AB4500_DEBUG 0x12 | ||
| 37 | #define AB4500_PROD_TEST 0x13 | ||
| 38 | #define AB4500_OTP_EMUL 0x15 | ||
| 39 | |||
| 40 | /* | ||
| 41 | * System control 1 register offsets. | ||
| 42 | * Bank = 0x01 | ||
| 43 | */ | ||
| 44 | #define AB4500_TURNON_STAT_REG 0x0100 | ||
| 45 | #define AB4500_RESET_STAT_REG 0x0101 | ||
| 46 | #define AB4500_PONKEY1_PRESS_STAT_REG 0x0102 | ||
| 47 | |||
| 48 | #define AB4500_FSM_STAT1_REG 0x0140 | ||
| 49 | #define AB4500_FSM_STAT2_REG 0x0141 | ||
| 50 | #define AB4500_SYSCLK_REQ_STAT_REG 0x0142 | ||
| 51 | #define AB4500_USB_STAT1_REG 0x0143 | ||
| 52 | #define AB4500_USB_STAT2_REG 0x0144 | ||
| 53 | #define AB4500_STATUS_SPARE1_REG 0x0145 | ||
| 54 | #define AB4500_STATUS_SPARE2_REG 0x0146 | ||
| 55 | |||
| 56 | #define AB4500_CTRL1_REG 0x0180 | ||
| 57 | #define AB4500_CTRL2_REG 0x0181 | ||
| 58 | |||
| 59 | /* | ||
| 60 | * System control 2 register offsets. | ||
| 61 | * bank = 0x02 | ||
| 62 | */ | ||
| 63 | #define AB4500_CTRL3_REG 0x0200 | ||
| 64 | #define AB4500_MAIN_WDOG_CTRL_REG 0x0201 | ||
| 65 | #define AB4500_MAIN_WDOG_TIMER_REG 0x0202 | ||
| 66 | #define AB4500_LOW_BAT_REG 0x0203 | ||
| 67 | #define AB4500_BATT_OK_REG 0x0204 | ||
| 68 | #define AB4500_SYSCLK_TIMER_REG 0x0205 | ||
| 69 | #define AB4500_SMPSCLK_CTRL_REG 0x0206 | ||
| 70 | #define AB4500_SMPSCLK_SEL1_REG 0x0207 | ||
| 71 | #define AB4500_SMPSCLK_SEL2_REG 0x0208 | ||
| 72 | #define AB4500_SMPSCLK_SEL3_REG 0x0209 | ||
| 73 | #define AB4500_SYSULPCLK_CONF_REG 0x020A | ||
| 74 | #define AB4500_SYSULPCLK_CTRL1_REG 0x020B | ||
| 75 | #define AB4500_SYSCLK_CTRL_REG 0x020C | ||
| 76 | #define AB4500_SYSCLK_REQ1_VALID_REG 0x020D | ||
| 77 | #define AB4500_SYSCLK_REQ_VALID_REG 0x020E | ||
| 78 | #define AB4500_SYSCTRL_SPARE_REG 0x020F | ||
| 79 | #define AB4500_PAD_CONF_REG 0x0210 | ||
| 80 | |||
| 81 | /* | ||
| 82 | * Regu control1 register offsets | ||
| 83 | * Bank = 0x03 | ||
| 84 | */ | ||
| 85 | #define AB4500_REGU_SERIAL_CTRL1_REG 0x0300 | ||
| 86 | #define AB4500_REGU_SERIAL_CTRL2_REG 0x0301 | ||
| 87 | #define AB4500_REGU_SERIAL_CTRL3_REG 0x0302 | ||
| 88 | #define AB4500_REGU_REQ_CTRL1_REG 0x0303 | ||
| 89 | #define AB4500_REGU_REQ_CTRL2_REG 0x0304 | ||
| 90 | #define AB4500_REGU_REQ_CTRL3_REG 0x0305 | ||
| 91 | #define AB4500_REGU_REQ_CTRL4_REG 0x0306 | ||
| 92 | #define AB4500_REGU_MISC1_REG 0x0380 | ||
| 93 | #define AB4500_REGU_OTGSUPPLY_CTRL_REG 0x0381 | ||
| 94 | #define AB4500_REGU_VUSB_CTRL_REG 0x0382 | ||
| 95 | #define AB4500_REGU_VAUDIO_SUPPLY_REG 0x0383 | ||
| 96 | #define AB4500_REGU_CTRL1_SPARE_REG 0x0384 | ||
| 97 | |||
| 98 | /* | ||
| 99 | * Regu control2 Vmod register offsets | ||
| 100 | */ | ||
| 101 | #define AB4500_REGU_VMOD_REGU_REG 0x0440 | ||
| 102 | #define AB4500_REGU_VMOD_SEL1_REG 0x0441 | ||
| 103 | #define AB4500_REGU_VMOD_SEL2_REG 0x0442 | ||
| 104 | #define AB4500_REGU_CTRL_DISCH_REG 0x0443 | ||
| 105 | #define AB4500_REGU_CTRL_DISCH2_REG 0x0444 | ||
| 106 | |||
| 107 | /* | ||
| 108 | * USB/ULPI register offsets | ||
| 109 | * Bank : 0x5 | ||
| 110 | */ | ||
| 111 | #define AB4500_USB_LINE_STAT_REG 0x0580 | ||
| 112 | #define AB4500_USB_LINE_CTRL1_REG 0x0581 | ||
| 113 | #define AB4500_USB_LINE_CTRL2_REG 0x0582 | ||
| 114 | #define AB4500_USB_LINE_CTRL3_REG 0x0583 | ||
| 115 | #define AB4500_USB_LINE_CTRL4_REG 0x0584 | ||
| 116 | #define AB4500_USB_LINE_CTRL5_REG 0x0585 | ||
| 117 | #define AB4500_USB_OTG_CTRL_REG 0x0587 | ||
| 118 | #define AB4500_USB_OTG_STAT_REG 0x0588 | ||
| 119 | #define AB4500_USB_OTG_STAT_REG 0x0588 | ||
| 120 | #define AB4500_USB_CTRL_SPARE_REG 0x0589 | ||
| 121 | #define AB4500_USB_PHY_CTRL_REG 0x058A | ||
| 122 | |||
| 123 | /* | ||
| 124 | * TVOUT / CTRL register offsets | ||
| 125 | * Bank : 0x06 | ||
| 126 | */ | ||
| 127 | #define AB4500_TVOUT_CTRL_REG 0x0680 | ||
| 128 | |||
| 129 | /* | ||
| 130 | * DBI register offsets | ||
| 131 | * Bank : 0x07 | ||
| 132 | */ | ||
| 133 | #define AB4500_DBI_REG1_REG 0x0700 | ||
| 134 | #define AB4500_DBI_REG2_REG 0x0701 | ||
| 135 | |||
| 136 | /* | ||
| 137 | * ECI regsiter offsets | ||
| 138 | * Bank : 0x08 | ||
| 139 | */ | ||
| 140 | #define AB4500_ECI_CTRL_REG 0x0800 | ||
| 141 | #define AB4500_ECI_HOOKLEVEL_REG 0x0801 | ||
| 142 | #define AB4500_ECI_DATAOUT_REG 0x0802 | ||
| 143 | #define AB4500_ECI_DATAIN_REG 0x0803 | ||
| 144 | |||
| 145 | /* | ||
| 146 | * AV Connector register offsets | ||
| 147 | * Bank : 0x08 | ||
| 148 | */ | ||
| 149 | #define AB4500_AV_CONN_REG 0x0840 | ||
| 150 | |||
| 151 | /* | ||
| 152 | * Accessory detection register offsets | ||
| 153 | * Bank : 0x08 | ||
| 154 | */ | ||
| 155 | #define AB4500_ACC_DET_DB1_REG 0x0880 | ||
| 156 | #define AB4500_ACC_DET_DB2_REG 0x0881 | ||
| 157 | |||
| 158 | /* | ||
| 159 | * GPADC register offsets | ||
| 160 | * Bank : 0x0A | ||
| 161 | */ | ||
| 162 | #define AB4500_GPADC_CTRL1_REG 0x0A00 | ||
| 163 | #define AB4500_GPADC_CTRL2_REG 0x0A01 | ||
| 164 | #define AB4500_GPADC_CTRL3_REG 0x0A02 | ||
| 165 | #define AB4500_GPADC_AUTO_TIMER_REG 0x0A03 | ||
| 166 | #define AB4500_GPADC_STAT_REG 0x0A04 | ||
| 167 | #define AB4500_GPADC_MANDATAL_REG 0x0A05 | ||
| 168 | #define AB4500_GPADC_MANDATAH_REG 0x0A06 | ||
| 169 | #define AB4500_GPADC_AUTODATAL_REG 0x0A07 | ||
| 170 | #define AB4500_GPADC_AUTODATAH_REG 0x0A08 | ||
| 171 | #define AB4500_GPADC_MUX_CTRL_REG 0x0A09 | ||
| 172 | |||
| 173 | /* | ||
| 174 | * Charger / status register offfsets | ||
| 175 | * Bank : 0x0B | ||
| 176 | */ | ||
| 177 | #define AB4500_CH_STATUS1_REG 0x0B00 | ||
| 178 | #define AB4500_CH_STATUS2_REG 0x0B01 | ||
| 179 | #define AB4500_CH_USBCH_STAT1_REG 0x0B02 | ||
| 180 | #define AB4500_CH_USBCH_STAT2_REG 0x0B03 | ||
| 181 | #define AB4500_CH_FSM_STAT_REG 0x0B04 | ||
| 182 | #define AB4500_CH_STAT_REG 0x0B05 | ||
| 183 | |||
| 184 | /* | ||
| 185 | * Charger / control register offfsets | ||
| 186 | * Bank : 0x0B | ||
| 187 | */ | ||
| 188 | #define AB4500_CH_VOLT_LVL_REG 0x0B40 | ||
| 189 | |||
| 190 | /* | ||
| 191 | * Charger / main control register offfsets | ||
| 192 | * Bank : 0x0B | ||
| 193 | */ | ||
| 194 | #define AB4500_MCH_CTRL1 0x0B80 | ||
| 195 | #define AB4500_MCH_CTRL2 0x0B81 | ||
| 196 | #define AB4500_MCH_IPT_CURLVL_REG 0x0B82 | ||
| 197 | #define AB4500_CH_WD_REG 0x0B83 | ||
| 198 | |||
| 199 | /* | ||
| 200 | * Charger / USB control register offsets | ||
| 201 | * Bank : 0x0B | ||
| 202 | */ | ||
| 203 | #define AB4500_USBCH_CTRL1_REG 0x0BC0 | ||
| 204 | #define AB4500_USBCH_CTRL2_REG 0x0BC1 | ||
| 205 | #define AB4500_USBCH_IPT_CRNTLVL_REG 0x0BC2 | ||
| 206 | |||
| 207 | /* | ||
| 208 | * RTC bank register offsets | ||
| 209 | * Bank : 0xF | ||
| 210 | */ | ||
| 211 | #define AB4500_RTC_SOFF_STAT_REG 0x0F00 | ||
| 212 | #define AB4500_RTC_CC_CONF_REG 0x0F01 | ||
| 213 | #define AB4500_RTC_READ_REQ_REG 0x0F02 | ||
| 214 | #define AB4500_RTC_WATCH_TSECMID_REG 0x0F03 | ||
| 215 | #define AB4500_RTC_WATCH_TSECHI_REG 0x0F04 | ||
| 216 | #define AB4500_RTC_WATCH_TMIN_LOW_REG 0x0F05 | ||
| 217 | #define AB4500_RTC_WATCH_TMIN_MID_REG 0x0F06 | ||
| 218 | #define AB4500_RTC_WATCH_TMIN_HI_REG 0x0F07 | ||
| 219 | #define AB4500_RTC_ALRM_MIN_LOW_REG 0x0F08 | ||
| 220 | #define AB4500_RTC_ALRM_MIN_MID_REG 0x0F09 | ||
| 221 | #define AB4500_RTC_ALRM_MIN_HI_REG 0x0F0A | ||
| 222 | #define AB4500_RTC_STAT_REG 0x0F0B | ||
| 223 | #define AB4500_RTC_BKUP_CHG_REG 0x0F0C | ||
| 224 | #define AB4500_RTC_FORCE_BKUP_REG 0x0F0D | ||
| 225 | #define AB4500_RTC_CALIB_REG 0x0F0E | ||
| 226 | #define AB4500_RTC_SWITCH_STAT_REG 0x0F0F | ||
| 227 | |||
| 228 | /* | ||
| 229 | * PWM Out generators | ||
| 230 | * Bank: 0x10 | ||
| 231 | */ | ||
| 232 | #define AB4500_PWM_OUT_CTRL1_REG 0x1060 | ||
| 233 | #define AB4500_PWM_OUT_CTRL2_REG 0x1061 | ||
| 234 | #define AB4500_PWM_OUT_CTRL3_REG 0x1062 | ||
| 235 | #define AB4500_PWM_OUT_CTRL4_REG 0x1063 | ||
| 236 | #define AB4500_PWM_OUT_CTRL5_REG 0x1064 | ||
| 237 | #define AB4500_PWM_OUT_CTRL6_REG 0x1065 | ||
| 238 | #define AB4500_PWM_OUT_CTRL7_REG 0x1066 | ||
| 239 | |||
| 240 | #define AB4500_I2C_PAD_CTRL_REG 0x1067 | ||
| 241 | #define AB4500_REV_REG 0x1080 | ||
| 242 | |||
| 243 | /** | ||
| 244 | * struct ab4500 | ||
| 245 | * @spi: spi device structure | ||
| 246 | * @tx_buf: transmit buffer | ||
| 247 | * @rx_buf: receive buffer | ||
| 248 | * @lock: sync primitive | ||
| 249 | */ | ||
| 250 | struct ab4500 { | ||
| 251 | struct spi_device *spi; | ||
| 252 | unsigned long tx_buf[4]; | ||
| 253 | unsigned long rx_buf[4]; | ||
| 254 | struct mutex lock; | ||
| 255 | }; | ||
| 256 | |||
| 257 | int ab4500_write(struct ab4500 *ab4500, unsigned char block, | ||
| 258 | unsigned long addr, unsigned char data); | ||
| 259 | int ab4500_read(struct ab4500 *ab4500, unsigned char block, | ||
| 260 | unsigned long addr); | ||
| 261 | |||
| 262 | #endif /* MFD_AB4500_H */ | ||
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h new file mode 100644 index 000000000000..b63ff3ba3351 --- /dev/null +++ b/include/linux/mfd/ab8500.h | |||
| @@ -0,0 +1,128 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson SA 2010 | ||
| 3 | * | ||
| 4 | * License Terms: GNU General Public License v2 | ||
| 5 | * Author: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> | ||
| 6 | */ | ||
| 7 | #ifndef MFD_AB8500_H | ||
| 8 | #define MFD_AB8500_H | ||
| 9 | |||
| 10 | #include <linux/device.h> | ||
| 11 | |||
| 12 | /* | ||
| 13 | * Interrupts | ||
| 14 | */ | ||
| 15 | |||
| 16 | #define AB8500_INT_MAIN_EXT_CH_NOT_OK 0 | ||
| 17 | #define AB8500_INT_UN_PLUG_TV_DET 1 | ||
| 18 | #define AB8500_INT_PLUG_TV_DET 2 | ||
| 19 | #define AB8500_INT_TEMP_WARM 3 | ||
| 20 | #define AB8500_INT_PON_KEY2DB_F 4 | ||
| 21 | #define AB8500_INT_PON_KEY2DB_R 5 | ||
| 22 | #define AB8500_INT_PON_KEY1DB_F 6 | ||
| 23 | #define AB8500_INT_PON_KEY1DB_R 7 | ||
| 24 | #define AB8500_INT_BATT_OVV 8 | ||
| 25 | #define AB8500_INT_MAIN_CH_UNPLUG_DET 10 | ||
| 26 | #define AB8500_INT_MAIN_CH_PLUG_DET 11 | ||
| 27 | #define AB8500_INT_USB_ID_DET_F 12 | ||
| 28 | #define AB8500_INT_USB_ID_DET_R 13 | ||
| 29 | #define AB8500_INT_VBUS_DET_F 14 | ||
| 30 | #define AB8500_INT_VBUS_DET_R 15 | ||
| 31 | #define AB8500_INT_VBUS_CH_DROP_END 16 | ||
| 32 | #define AB8500_INT_RTC_60S 17 | ||
| 33 | #define AB8500_INT_RTC_ALARM 18 | ||
| 34 | #define AB8500_INT_BAT_CTRL_INDB 20 | ||
| 35 | #define AB8500_INT_CH_WD_EXP 21 | ||
| 36 | #define AB8500_INT_VBUS_OVV 22 | ||
| 37 | #define AB8500_INT_MAIN_CH_DROP_END 23 | ||
| 38 | #define AB8500_INT_CCN_CONV_ACC 24 | ||
| 39 | #define AB8500_INT_INT_AUD 25 | ||
| 40 | #define AB8500_INT_CCEOC 26 | ||
| 41 | #define AB8500_INT_CC_INT_CALIB 27 | ||
| 42 | #define AB8500_INT_LOW_BAT_F 28 | ||
| 43 | #define AB8500_INT_LOW_BAT_R 29 | ||
| 44 | #define AB8500_INT_BUP_CHG_NOT_OK 30 | ||
| 45 | #define AB8500_INT_BUP_CHG_OK 31 | ||
| 46 | #define AB8500_INT_GP_HW_ADC_CONV_END 32 | ||
| 47 | #define AB8500_INT_ACC_DETECT_1DB_F 33 | ||
| 48 | #define AB8500_INT_ACC_DETECT_1DB_R 34 | ||
| 49 | #define AB8500_INT_ACC_DETECT_22DB_F 35 | ||
| 50 | #define AB8500_INT_ACC_DETECT_22DB_R 36 | ||
| 51 | #define AB8500_INT_ACC_DETECT_21DB_F 37 | ||
| 52 | #define AB8500_INT_ACC_DETECT_21DB_R 38 | ||
| 53 | #define AB8500_INT_GP_SW_ADC_CONV_END 39 | ||
| 54 | #define AB8500_INT_BTEMP_LOW 72 | ||
| 55 | #define AB8500_INT_BTEMP_LOW_MEDIUM 73 | ||
| 56 | #define AB8500_INT_BTEMP_MEDIUM_HIGH 74 | ||
| 57 | #define AB8500_INT_BTEMP_HIGH 75 | ||
| 58 | #define AB8500_INT_USB_CHARGER_NOT_OK 81 | ||
| 59 | #define AB8500_INT_ID_WAKEUP_R 82 | ||
| 60 | #define AB8500_INT_ID_DET_R1R 84 | ||
| 61 | #define AB8500_INT_ID_DET_R2R 85 | ||
| 62 | #define AB8500_INT_ID_DET_R3R 86 | ||
| 63 | #define AB8500_INT_ID_DET_R4R 87 | ||
| 64 | #define AB8500_INT_ID_WAKEUP_F 88 | ||
| 65 | #define AB8500_INT_ID_DET_R1F 90 | ||
| 66 | #define AB8500_INT_ID_DET_R2F 91 | ||
| 67 | #define AB8500_INT_ID_DET_R3F 92 | ||
| 68 | #define AB8500_INT_ID_DET_R4F 93 | ||
| 69 | #define AB8500_INT_USB_CHG_DET_DONE 94 | ||
| 70 | #define AB8500_INT_USB_CH_TH_PROT_F 96 | ||
| 71 | #define AB8500_INT_USB_CH_TH_PROP_R 97 | ||
| 72 | #define AB8500_INT_MAIN_CH_TH_PROP_F 98 | ||
| 73 | #define AB8500_INT_MAIN_CH_TH_PROT_R 99 | ||
| 74 | #define AB8500_INT_USB_CHARGER_NOT_OKF 103 | ||
| 75 | |||
| 76 | #define AB8500_NR_IRQS 104 | ||
| 77 | #define AB8500_NUM_IRQ_REGS 13 | ||
| 78 | |||
| 79 | /** | ||
| 80 | * struct ab8500 - ab8500 internal structure | ||
| 81 | * @dev: parent device | ||
| 82 | * @lock: read/write operations lock | ||
| 83 | * @irq_lock: genirq bus lock | ||
| 84 | * @revision: chip revision | ||
| 85 | * @irq: irq line | ||
| 86 | * @write: register write | ||
| 87 | * @read: register read | ||
| 88 | * @rx_buf: rx buf for SPI | ||
| 89 | * @tx_buf: tx buf for SPI | ||
| 90 | * @mask: cache of IRQ regs for bus lock | ||
| 91 | * @oldmask: cache of previous IRQ regs for bus lock | ||
| 92 | */ | ||
| 93 | struct ab8500 { | ||
| 94 | struct device *dev; | ||
| 95 | struct mutex lock; | ||
| 96 | struct mutex irq_lock; | ||
| 97 | int revision; | ||
| 98 | int irq_base; | ||
| 99 | int irq; | ||
| 100 | |||
| 101 | int (*write) (struct ab8500 *a8500, u16 addr, u8 data); | ||
| 102 | int (*read) (struct ab8500 *a8500, u16 addr); | ||
| 103 | |||
| 104 | unsigned long tx_buf[4]; | ||
| 105 | unsigned long rx_buf[4]; | ||
| 106 | |||
| 107 | u8 mask[AB8500_NUM_IRQ_REGS]; | ||
| 108 | u8 oldmask[AB8500_NUM_IRQ_REGS]; | ||
| 109 | }; | ||
| 110 | |||
| 111 | /** | ||
| 112 | * struct ab8500_platform_data - AB8500 platform data | ||
| 113 | * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used | ||
| 114 | * @init: board-specific initialization after detection of ab8500 | ||
| 115 | */ | ||
| 116 | struct ab8500_platform_data { | ||
| 117 | int irq_base; | ||
| 118 | void (*init) (struct ab8500 *); | ||
| 119 | }; | ||
| 120 | |||
| 121 | extern int ab8500_write(struct ab8500 *a8500, u16 addr, u8 data); | ||
| 122 | extern int ab8500_read(struct ab8500 *a8500, u16 addr); | ||
| 123 | extern int ab8500_set_bits(struct ab8500 *a8500, u16 addr, u8 mask, u8 data); | ||
| 124 | |||
| 125 | extern int __devinit ab8500_init(struct ab8500 *ab8500); | ||
| 126 | extern int __devexit ab8500_exit(struct ab8500 *ab8500); | ||
| 127 | |||
| 128 | #endif /* MFD_AB8500_H */ | ||
diff --git a/include/linux/mfd/ab3100.h b/include/linux/mfd/abx500.h index 9a881c305a50..390726fcbcb1 100644 --- a/include/linux/mfd/ab3100.h +++ b/include/linux/mfd/abx500.h | |||
| @@ -3,17 +3,37 @@ | |||
| 3 | * License terms: GNU General Public License (GPL) version 2 | 3 | * License terms: GNU General Public License (GPL) version 2 |
| 4 | * AB3100 core access functions | 4 | * AB3100 core access functions |
| 5 | * Author: Linus Walleij <linus.walleij@stericsson.com> | 5 | * Author: Linus Walleij <linus.walleij@stericsson.com> |
| 6 | * | ||
| 7 | * ABX500 core access functions. | ||
| 8 | * The abx500 interface is used for the Analog Baseband chip | ||
| 9 | * ab3100, ab3550, ab5500 and possibly comming. It is not used for | ||
| 10 | * ab4500 and ab8500 since they are another family of chip. | ||
| 11 | * | ||
| 12 | * Author: Mattias Wallin <mattias.wallin@stericsson.com> | ||
| 13 | * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> | ||
| 14 | * Author: Bengt Jonsson <bengt.g.jonsson@stericsson.com> | ||
| 15 | * Author: Rickard Andersson <rickard.andersson@stericsson.com> | ||
| 6 | */ | 16 | */ |
| 7 | 17 | ||
| 8 | #include <linux/device.h> | 18 | #include <linux/device.h> |
| 9 | #include <linux/regulator/machine.h> | 19 | #include <linux/regulator/machine.h> |
| 10 | 20 | ||
| 11 | #ifndef MFD_AB3100_H | 21 | #ifndef MFD_ABX500_H |
| 12 | #define MFD_AB3100_H | 22 | #define MFD_ABX500_H |
| 13 | 23 | ||
| 14 | #define ABUNKNOWN 0 | 24 | #define AB3100_P1A 0xc0 |
| 15 | #define AB3000 1 | 25 | #define AB3100_P1B 0xc1 |
| 16 | #define AB3100 2 | 26 | #define AB3100_P1C 0xc2 |
| 27 | #define AB3100_P1D 0xc3 | ||
| 28 | #define AB3100_P1E 0xc4 | ||
| 29 | #define AB3100_P1F 0xc5 | ||
| 30 | #define AB3100_P1G 0xc6 | ||
| 31 | #define AB3100_R2A 0xc7 | ||
| 32 | #define AB3100_R2B 0xc8 | ||
| 33 | #define AB3550_P1A 0x10 | ||
| 34 | #define AB5500_1_0 0x20 | ||
| 35 | #define AB5500_2_0 0x21 | ||
| 36 | #define AB5500_2_1 0x22 | ||
| 17 | 37 | ||
| 18 | /* | 38 | /* |
| 19 | * AB3100, EVENTA1, A2 and A3 event register flags | 39 | * AB3100, EVENTA1, A2 and A3 event register flags |
| @@ -89,7 +109,7 @@ struct ab3100 { | |||
| 89 | char chip_name[32]; | 109 | char chip_name[32]; |
| 90 | u8 chip_id; | 110 | u8 chip_id; |
| 91 | struct blocking_notifier_head event_subscribers; | 111 | struct blocking_notifier_head event_subscribers; |
| 92 | u32 startup_events; | 112 | u8 startup_events[3]; |
| 93 | bool startup_events_read; | 113 | bool startup_events_read; |
| 94 | }; | 114 | }; |
| 95 | 115 | ||
| @@ -112,18 +132,102 @@ struct ab3100_platform_data { | |||
| 112 | int external_voltage; | 132 | int external_voltage; |
| 113 | }; | 133 | }; |
| 114 | 134 | ||
| 115 | int ab3100_set_register_interruptible(struct ab3100 *ab3100, u8 reg, u8 regval); | ||
| 116 | int ab3100_get_register_interruptible(struct ab3100 *ab3100, u8 reg, u8 *regval); | ||
| 117 | int ab3100_get_register_page_interruptible(struct ab3100 *ab3100, | ||
| 118 | u8 first_reg, u8 *regvals, u8 numregs); | ||
| 119 | int ab3100_mask_and_set_register_interruptible(struct ab3100 *ab3100, | ||
| 120 | u8 reg, u8 andmask, u8 ormask); | ||
| 121 | u8 ab3100_get_chip_type(struct ab3100 *ab3100); | ||
| 122 | int ab3100_event_register(struct ab3100 *ab3100, | 135 | int ab3100_event_register(struct ab3100 *ab3100, |
| 123 | struct notifier_block *nb); | 136 | struct notifier_block *nb); |
| 124 | int ab3100_event_unregister(struct ab3100 *ab3100, | 137 | int ab3100_event_unregister(struct ab3100 *ab3100, |
| 125 | struct notifier_block *nb); | 138 | struct notifier_block *nb); |
| 126 | int ab3100_event_registers_startup_state_get(struct ab3100 *ab3100, | ||
| 127 | u32 *fatevent); | ||
| 128 | 139 | ||
| 140 | /* AB3550, STR register flags */ | ||
| 141 | #define AB3550_STR_ONSWA (0x01) | ||
| 142 | #define AB3550_STR_ONSWB (0x02) | ||
| 143 | #define AB3550_STR_ONSWC (0x04) | ||
| 144 | #define AB3550_STR_DCIO (0x08) | ||
| 145 | #define AB3550_STR_BOOT_MODE (0x10) | ||
| 146 | #define AB3550_STR_SIM_OFF (0x20) | ||
| 147 | #define AB3550_STR_BATT_REMOVAL (0x40) | ||
| 148 | #define AB3550_STR_VBUS (0x80) | ||
| 149 | |||
| 150 | /* Interrupt mask registers */ | ||
| 151 | #define AB3550_IMR1 0x29 | ||
| 152 | #define AB3550_IMR2 0x2a | ||
| 153 | #define AB3550_IMR3 0x2b | ||
| 154 | #define AB3550_IMR4 0x2c | ||
| 155 | #define AB3550_IMR5 0x2d | ||
| 156 | |||
| 157 | enum ab3550_devid { | ||
| 158 | AB3550_DEVID_ADC, | ||
| 159 | AB3550_DEVID_DAC, | ||
| 160 | AB3550_DEVID_LEDS, | ||
| 161 | AB3550_DEVID_POWER, | ||
| 162 | AB3550_DEVID_REGULATORS, | ||
| 163 | AB3550_DEVID_SIM, | ||
| 164 | AB3550_DEVID_UART, | ||
| 165 | AB3550_DEVID_RTC, | ||
| 166 | AB3550_DEVID_CHARGER, | ||
| 167 | AB3550_DEVID_FUELGAUGE, | ||
| 168 | AB3550_DEVID_VIBRATOR, | ||
| 169 | AB3550_DEVID_CODEC, | ||
| 170 | AB3550_NUM_DEVICES, | ||
| 171 | }; | ||
| 172 | |||
| 173 | /** | ||
| 174 | * struct abx500_init_setting | ||
| 175 | * Initial value of the registers for driver to use during setup. | ||
| 176 | */ | ||
| 177 | struct abx500_init_settings { | ||
| 178 | u8 bank; | ||
| 179 | u8 reg; | ||
| 180 | u8 setting; | ||
| 181 | }; | ||
| 182 | |||
| 183 | /** | ||
| 184 | * struct ab3550_platform_data | ||
| 185 | * Data supplied to initialize board connections to the AB3550 | ||
| 186 | */ | ||
| 187 | struct ab3550_platform_data { | ||
| 188 | struct {unsigned int base; unsigned int count; } irq; | ||
| 189 | void *dev_data[AB3550_NUM_DEVICES]; | ||
| 190 | size_t dev_data_sz[AB3550_NUM_DEVICES]; | ||
| 191 | struct abx500_init_settings *init_settings; | ||
| 192 | unsigned int init_settings_sz; | ||
| 193 | }; | ||
| 194 | |||
| 195 | int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg, | ||
| 196 | u8 value); | ||
| 197 | int abx500_get_register_interruptible(struct device *dev, u8 bank, u8 reg, | ||
| 198 | u8 *value); | ||
| 199 | int abx500_get_register_page_interruptible(struct device *dev, u8 bank, | ||
| 200 | u8 first_reg, u8 *regvals, u8 numregs); | ||
| 201 | int abx500_set_register_page_interruptible(struct device *dev, u8 bank, | ||
| 202 | u8 first_reg, u8 *regvals, u8 numregs); | ||
| 203 | /** | ||
| 204 | * abx500_mask_and_set_register_inerruptible() - Modifies selected bits of a | ||
| 205 | * target register | ||
| 206 | * | ||
| 207 | * @dev: The AB sub device. | ||
| 208 | * @bank: The i2c bank number. | ||
| 209 | * @bitmask: The bit mask to use. | ||
| 210 | * @bitvalues: The new bit values. | ||
| 211 | * | ||
| 212 | * Updates the value of an AB register: | ||
| 213 | * value -> ((value & ~bitmask) | (bitvalues & bitmask)) | ||
| 214 | */ | ||
| 215 | int abx500_mask_and_set_register_interruptible(struct device *dev, u8 bank, | ||
| 216 | u8 reg, u8 bitmask, u8 bitvalues); | ||
| 217 | int abx500_get_chip_id(struct device *dev); | ||
| 218 | int abx500_event_registers_startup_state_get(struct device *dev, u8 *event); | ||
| 219 | int abx500_startup_irq_enabled(struct device *dev, unsigned int irq); | ||
| 220 | |||
| 221 | struct abx500_ops { | ||
| 222 | int (*get_chip_id) (struct device *); | ||
| 223 | int (*get_register) (struct device *, u8, u8, u8 *); | ||
| 224 | int (*set_register) (struct device *, u8, u8, u8); | ||
| 225 | int (*get_register_page) (struct device *, u8, u8, u8 *, u8); | ||
| 226 | int (*set_register_page) (struct device *, u8, u8, u8 *, u8); | ||
| 227 | int (*mask_and_set_register) (struct device *, u8, u8, u8, u8); | ||
| 228 | int (*event_registers_startup_state_get) (struct device *, u8 *); | ||
| 229 | int (*startup_irq_enabled) (struct device *, unsigned int); | ||
| 230 | }; | ||
| 231 | |||
| 232 | int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops); | ||
| 129 | #endif | 233 | #endif |
diff --git a/include/linux/mfd/janz.h b/include/linux/mfd/janz.h new file mode 100644 index 000000000000..e9994c469803 --- /dev/null +++ b/include/linux/mfd/janz.h | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | /* | ||
| 2 | * Common Definitions for Janz MODULbus devices | ||
| 3 | * | ||
| 4 | * Copyright (c) 2010 Ira W. Snyder <iws@ovro.caltech.edu> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms of the GNU General Public License as published by the | ||
| 8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 9 | * option) any later version. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef JANZ_H | ||
| 13 | #define JANZ_H | ||
| 14 | |||
| 15 | struct janz_platform_data { | ||
| 16 | /* MODULbus Module Number */ | ||
| 17 | unsigned int modno; | ||
| 18 | }; | ||
| 19 | |||
| 20 | /* PLX bridge chip onboard registers */ | ||
| 21 | struct janz_cmodio_onboard_regs { | ||
| 22 | u8 unused1; | ||
| 23 | |||
| 24 | /* | ||
| 25 | * Read access: interrupt status | ||
| 26 | * Write access: interrupt disable | ||
| 27 | */ | ||
| 28 | u8 int_disable; | ||
| 29 | u8 unused2; | ||
| 30 | |||
| 31 | /* | ||
| 32 | * Read access: MODULbus number (hex switch) | ||
| 33 | * Write access: interrupt enable | ||
| 34 | */ | ||
| 35 | u8 int_enable; | ||
| 36 | u8 unused3; | ||
| 37 | |||
| 38 | /* write-only */ | ||
| 39 | u8 reset_assert; | ||
| 40 | u8 unused4; | ||
| 41 | |||
| 42 | /* write-only */ | ||
| 43 | u8 reset_deassert; | ||
| 44 | u8 unused5; | ||
| 45 | |||
| 46 | /* read-write access to serial EEPROM */ | ||
| 47 | u8 eep; | ||
| 48 | u8 unused6; | ||
| 49 | |||
| 50 | /* write-only access to EEPROM chip select */ | ||
| 51 | u8 enid; | ||
| 52 | }; | ||
| 53 | |||
| 54 | #endif /* JANZ_H */ | ||
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h index 8895d9d8879c..4a894f688549 100644 --- a/include/linux/mfd/mc13783.h +++ b/include/linux/mfd/mc13783.h | |||
| @@ -64,6 +64,70 @@ static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq) | |||
| 64 | MC13783_ADC0_TSMOD1 | \ | 64 | MC13783_ADC0_TSMOD1 | \ |
| 65 | MC13783_ADC0_TSMOD2) | 65 | MC13783_ADC0_TSMOD2) |
| 66 | 66 | ||
| 67 | struct mc13783_led_platform_data { | ||
| 68 | #define MC13783_LED_MD 0 | ||
| 69 | #define MC13783_LED_AD 1 | ||
| 70 | #define MC13783_LED_KP 2 | ||
| 71 | #define MC13783_LED_R1 3 | ||
| 72 | #define MC13783_LED_G1 4 | ||
| 73 | #define MC13783_LED_B1 5 | ||
| 74 | #define MC13783_LED_R2 6 | ||
| 75 | #define MC13783_LED_G2 7 | ||
| 76 | #define MC13783_LED_B2 8 | ||
| 77 | #define MC13783_LED_R3 9 | ||
| 78 | #define MC13783_LED_G3 10 | ||
| 79 | #define MC13783_LED_B3 11 | ||
| 80 | #define MC13783_LED_MAX MC13783_LED_B3 | ||
| 81 | int id; | ||
| 82 | const char *name; | ||
| 83 | const char *default_trigger; | ||
| 84 | |||
| 85 | /* Three or two bits current selection depending on the led */ | ||
| 86 | char max_current; | ||
| 87 | }; | ||
| 88 | |||
| 89 | struct mc13783_leds_platform_data { | ||
| 90 | int num_leds; | ||
| 91 | struct mc13783_led_platform_data *led; | ||
| 92 | |||
| 93 | #define MC13783_LED_TRIODE_MD (1 << 0) | ||
| 94 | #define MC13783_LED_TRIODE_AD (1 << 1) | ||
| 95 | #define MC13783_LED_TRIODE_KP (1 << 2) | ||
| 96 | #define MC13783_LED_BOOST_EN (1 << 3) | ||
| 97 | #define MC13783_LED_TC1HALF (1 << 4) | ||
| 98 | #define MC13783_LED_SLEWLIMTC (1 << 5) | ||
| 99 | #define MC13783_LED_SLEWLIMBL (1 << 6) | ||
| 100 | #define MC13783_LED_TRIODE_TC1 (1 << 7) | ||
| 101 | #define MC13783_LED_TRIODE_TC2 (1 << 8) | ||
| 102 | #define MC13783_LED_TRIODE_TC3 (1 << 9) | ||
| 103 | int flags; | ||
| 104 | |||
| 105 | #define MC13783_LED_AB_DISABLED 0 | ||
| 106 | #define MC13783_LED_AB_MD1 1 | ||
| 107 | #define MC13783_LED_AB_MD12 2 | ||
| 108 | #define MC13783_LED_AB_MD123 3 | ||
| 109 | #define MC13783_LED_AB_MD1234 4 | ||
| 110 | #define MC13783_LED_AB_MD1234_AD1 5 | ||
| 111 | #define MC13783_LED_AB_MD1234_AD12 6 | ||
| 112 | #define MC13783_LED_AB_MD1_AD 7 | ||
| 113 | char abmode; | ||
| 114 | |||
| 115 | #define MC13783_LED_ABREF_200MV 0 | ||
| 116 | #define MC13783_LED_ABREF_400MV 1 | ||
| 117 | #define MC13783_LED_ABREF_600MV 2 | ||
| 118 | #define MC13783_LED_ABREF_800MV 3 | ||
| 119 | char abref; | ||
| 120 | |||
| 121 | #define MC13783_LED_PERIOD_10MS 0 | ||
| 122 | #define MC13783_LED_PERIOD_100MS 1 | ||
| 123 | #define MC13783_LED_PERIOD_500MS 2 | ||
| 124 | #define MC13783_LED_PERIOD_2S 3 | ||
| 125 | char bl_period; | ||
| 126 | char tc1_period; | ||
| 127 | char tc2_period; | ||
| 128 | char tc3_period; | ||
| 129 | }; | ||
| 130 | |||
| 67 | /* to be cleaned up */ | 131 | /* to be cleaned up */ |
| 68 | struct regulator_init_data; | 132 | struct regulator_init_data; |
| 69 | 133 | ||
| @@ -80,12 +144,14 @@ struct mc13783_regulator_platform_data { | |||
| 80 | struct mc13783_platform_data { | 144 | struct mc13783_platform_data { |
| 81 | int num_regulators; | 145 | int num_regulators; |
| 82 | struct mc13783_regulator_init_data *regulators; | 146 | struct mc13783_regulator_init_data *regulators; |
| 147 | struct mc13783_leds_platform_data *leds; | ||
| 83 | 148 | ||
| 84 | #define MC13783_USE_TOUCHSCREEN (1 << 0) | 149 | #define MC13783_USE_TOUCHSCREEN (1 << 0) |
| 85 | #define MC13783_USE_CODEC (1 << 1) | 150 | #define MC13783_USE_CODEC (1 << 1) |
| 86 | #define MC13783_USE_ADC (1 << 2) | 151 | #define MC13783_USE_ADC (1 << 2) |
| 87 | #define MC13783_USE_RTC (1 << 3) | 152 | #define MC13783_USE_RTC (1 << 3) |
| 88 | #define MC13783_USE_REGULATOR (1 << 4) | 153 | #define MC13783_USE_REGULATOR (1 << 4) |
| 154 | #define MC13783_USE_LED (1 << 5) | ||
| 89 | unsigned int flags; | 155 | unsigned int flags; |
| 90 | }; | 156 | }; |
| 91 | 157 | ||
diff --git a/include/linux/mfd/pcf50633/backlight.h b/include/linux/mfd/pcf50633/backlight.h new file mode 100644 index 000000000000..83747e217b27 --- /dev/null +++ b/include/linux/mfd/pcf50633/backlight.h | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de> | ||
| 3 | * PCF50633 backlight device driver | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License as published by the | ||
| 7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 8 | * option) any later version. | ||
| 9 | * | ||
| 10 | * You should have received a copy of the GNU General Public License along | ||
| 11 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 12 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 13 | * | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef __LINUX_MFD_PCF50633_BACKLIGHT | ||
| 17 | #define __LINUX_MFD_PCF50633_BACKLIGHT | ||
| 18 | |||
| 19 | /* | ||
| 20 | * @default_brightness: Backlight brightness is initialized to this value | ||
| 21 | * | ||
| 22 | * Brightness to be used after the driver has been probed. | ||
| 23 | * Valid range 0-63. | ||
| 24 | * | ||
| 25 | * @default_brightness_limit: The actual brightness is limited by this value | ||
| 26 | * | ||
| 27 | * Brightness limit to be used after the driver has been probed. This is useful | ||
| 28 | * when it is not known how much power is available for the backlight during | ||
| 29 | * probe. | ||
| 30 | * Valid range 0-63. Can be changed later with pcf50633_bl_set_brightness_limit. | ||
| 31 | * | ||
| 32 | * @ramp_time: Display ramp time when changing brightness | ||
| 33 | * | ||
| 34 | * When changing the backlights brightness the change is not instant, instead | ||
| 35 | * it fades smooth from one state to another. This value specifies how long | ||
| 36 | * the fade should take. The lower the value the higher the fade time. | ||
| 37 | * Valid range 0-255 | ||
| 38 | */ | ||
| 39 | struct pcf50633_bl_platform_data { | ||
| 40 | unsigned int default_brightness; | ||
| 41 | unsigned int default_brightness_limit; | ||
| 42 | uint8_t ramp_time; | ||
| 43 | }; | ||
| 44 | |||
| 45 | |||
| 46 | struct pcf50633; | ||
| 47 | |||
| 48 | int pcf50633_bl_set_brightness_limit(struct pcf50633 *pcf, unsigned int limit); | ||
| 49 | |||
| 50 | #endif | ||
| 51 | |||
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h index 3398bd9aab11..ad411a78870c 100644 --- a/include/linux/mfd/pcf50633/core.h +++ b/include/linux/mfd/pcf50633/core.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/regulator/driver.h> | 18 | #include <linux/regulator/driver.h> |
| 19 | #include <linux/regulator/machine.h> | 19 | #include <linux/regulator/machine.h> |
| 20 | #include <linux/power_supply.h> | 20 | #include <linux/power_supply.h> |
| 21 | #include <linux/mfd/pcf50633/backlight.h> | ||
| 21 | 22 | ||
| 22 | struct pcf50633; | 23 | struct pcf50633; |
| 23 | 24 | ||
| @@ -43,6 +44,8 @@ struct pcf50633_platform_data { | |||
| 43 | void (*force_shutdown)(struct pcf50633 *); | 44 | void (*force_shutdown)(struct pcf50633 *); |
| 44 | 45 | ||
| 45 | u8 resumers[5]; | 46 | u8 resumers[5]; |
| 47 | |||
| 48 | struct pcf50633_bl_platform_data *backlight_data; | ||
| 46 | }; | 49 | }; |
| 47 | 50 | ||
| 48 | struct pcf50633_irq { | 51 | struct pcf50633_irq { |
| @@ -152,6 +155,7 @@ struct pcf50633 { | |||
| 152 | struct platform_device *mbc_pdev; | 155 | struct platform_device *mbc_pdev; |
| 153 | struct platform_device *adc_pdev; | 156 | struct platform_device *adc_pdev; |
| 154 | struct platform_device *input_pdev; | 157 | struct platform_device *input_pdev; |
| 158 | struct platform_device *bl_pdev; | ||
| 155 | struct platform_device *regulator_pdev[PCF50633_NUM_REGULATORS]; | 159 | struct platform_device *regulator_pdev[PCF50633_NUM_REGULATORS]; |
| 156 | }; | 160 | }; |
| 157 | 161 | ||
diff --git a/include/linux/mfd/rdc321x.h b/include/linux/mfd/rdc321x.h new file mode 100644 index 000000000000..4bdf19c8eedf --- /dev/null +++ b/include/linux/mfd/rdc321x.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #ifndef __RDC321X_MFD_H | ||
| 2 | #define __RDC321X_MFD_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/pci.h> | ||
| 6 | |||
| 7 | /* Offsets to be accessed in the southbridge PCI | ||
| 8 | * device configuration register */ | ||
| 9 | #define RDC321X_WDT_CTRL 0x44 | ||
| 10 | #define RDC321X_GPIO_CTRL_REG1 0x48 | ||
| 11 | #define RDC321X_GPIO_DATA_REG1 0x4c | ||
| 12 | #define RDC321X_GPIO_CTRL_REG2 0x84 | ||
| 13 | #define RDC321X_GPIO_DATA_REG2 0x88 | ||
| 14 | |||
| 15 | #define RDC321X_MAX_GPIO 58 | ||
| 16 | |||
| 17 | struct rdc321x_gpio_pdata { | ||
| 18 | struct pci_dev *sb_pdev; | ||
| 19 | unsigned max_gpios; | ||
| 20 | }; | ||
| 21 | |||
| 22 | struct rdc321x_wdt_pdata { | ||
| 23 | struct pci_dev *sb_pdev; | ||
| 24 | }; | ||
| 25 | |||
| 26 | #endif /* __RDC321X_MFD_H */ | ||
diff --git a/include/linux/mfd/tc35892.h b/include/linux/mfd/tc35892.h new file mode 100644 index 000000000000..e47f770d3068 --- /dev/null +++ b/include/linux/mfd/tc35892.h | |||
| @@ -0,0 +1,132 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson SA 2010 | ||
| 3 | * | ||
| 4 | * License Terms: GNU General Public License, version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __LINUX_MFD_TC35892_H | ||
| 8 | #define __LINUX_MFD_TC35892_H | ||
| 9 | |||
| 10 | #include <linux/device.h> | ||
| 11 | |||
| 12 | #define TC35892_RSTCTRL_IRQRST (1 << 4) | ||
| 13 | #define TC35892_RSTCTRL_TIMRST (1 << 3) | ||
| 14 | #define TC35892_RSTCTRL_ROTRST (1 << 2) | ||
| 15 | #define TC35892_RSTCTRL_KBDRST (1 << 1) | ||
| 16 | #define TC35892_RSTCTRL_GPIRST (1 << 0) | ||
| 17 | |||
| 18 | #define TC35892_IRQST 0x91 | ||
| 19 | |||
| 20 | #define TC35892_MANFCODE_MAGIC 0x03 | ||
| 21 | #define TC35892_MANFCODE 0x80 | ||
| 22 | #define TC35892_VERSION 0x81 | ||
| 23 | #define TC35892_IOCFG 0xA7 | ||
| 24 | |||
| 25 | #define TC35892_CLKMODE 0x88 | ||
| 26 | #define TC35892_CLKCFG 0x89 | ||
| 27 | #define TC35892_CLKEN 0x8A | ||
| 28 | |||
| 29 | #define TC35892_RSTCTRL 0x82 | ||
| 30 | #define TC35892_EXTRSTN 0x83 | ||
| 31 | #define TC35892_RSTINTCLR 0x84 | ||
| 32 | |||
| 33 | #define TC35892_GPIOIS0 0xC9 | ||
| 34 | #define TC35892_GPIOIS1 0xCA | ||
| 35 | #define TC35892_GPIOIS2 0xCB | ||
| 36 | #define TC35892_GPIOIBE0 0xCC | ||
| 37 | #define TC35892_GPIOIBE1 0xCD | ||
| 38 | #define TC35892_GPIOIBE2 0xCE | ||
| 39 | #define TC35892_GPIOIEV0 0xCF | ||
| 40 | #define TC35892_GPIOIEV1 0xD0 | ||
| 41 | #define TC35892_GPIOIEV2 0xD1 | ||
| 42 | #define TC35892_GPIOIE0 0xD2 | ||
| 43 | #define TC35892_GPIOIE1 0xD3 | ||
| 44 | #define TC35892_GPIOIE2 0xD4 | ||
| 45 | #define TC35892_GPIORIS0 0xD6 | ||
| 46 | #define TC35892_GPIORIS1 0xD7 | ||
| 47 | #define TC35892_GPIORIS2 0xD8 | ||
| 48 | #define TC35892_GPIOMIS0 0xD9 | ||
| 49 | #define TC35892_GPIOMIS1 0xDA | ||
| 50 | #define TC35892_GPIOMIS2 0xDB | ||
| 51 | #define TC35892_GPIOIC0 0xDC | ||
| 52 | #define TC35892_GPIOIC1 0xDD | ||
| 53 | #define TC35892_GPIOIC2 0xDE | ||
| 54 | |||
| 55 | #define TC35892_GPIODATA0 0xC0 | ||
| 56 | #define TC35892_GPIOMASK0 0xc1 | ||
| 57 | #define TC35892_GPIODATA1 0xC2 | ||
| 58 | #define TC35892_GPIOMASK1 0xc3 | ||
| 59 | #define TC35892_GPIODATA2 0xC4 | ||
| 60 | #define TC35892_GPIOMASK2 0xC5 | ||
| 61 | |||
| 62 | #define TC35892_GPIODIR0 0xC6 | ||
| 63 | #define TC35892_GPIODIR1 0xC7 | ||
| 64 | #define TC35892_GPIODIR2 0xC8 | ||
| 65 | |||
| 66 | #define TC35892_GPIOSYNC0 0xE6 | ||
| 67 | #define TC35892_GPIOSYNC1 0xE7 | ||
| 68 | #define TC35892_GPIOSYNC2 0xE8 | ||
| 69 | |||
| 70 | #define TC35892_GPIOWAKE0 0xE9 | ||
| 71 | #define TC35892_GPIOWAKE1 0xEA | ||
| 72 | #define TC35892_GPIOWAKE2 0xEB | ||
| 73 | |||
| 74 | #define TC35892_GPIOODM0 0xE0 | ||
| 75 | #define TC35892_GPIOODE0 0xE1 | ||
| 76 | #define TC35892_GPIOODM1 0xE2 | ||
| 77 | #define TC35892_GPIOODE1 0xE3 | ||
| 78 | #define TC35892_GPIOODM2 0xE4 | ||
| 79 | #define TC35892_GPIOODE2 0xE5 | ||
| 80 | |||
| 81 | #define TC35892_INT_GPIIRQ 0 | ||
| 82 | #define TC35892_INT_TI0IRQ 1 | ||
| 83 | #define TC35892_INT_TI1IRQ 2 | ||
| 84 | #define TC35892_INT_TI2IRQ 3 | ||
| 85 | #define TC35892_INT_ROTIRQ 5 | ||
| 86 | #define TC35892_INT_KBDIRQ 6 | ||
| 87 | #define TC35892_INT_PORIRQ 7 | ||
| 88 | |||
| 89 | #define TC35892_NR_INTERNAL_IRQS 8 | ||
| 90 | #define TC35892_INT_GPIO(x) (TC35892_NR_INTERNAL_IRQS + (x)) | ||
| 91 | |||
| 92 | struct tc35892 { | ||
| 93 | struct mutex lock; | ||
| 94 | struct device *dev; | ||
| 95 | struct i2c_client *i2c; | ||
| 96 | |||
| 97 | int irq_base; | ||
| 98 | int num_gpio; | ||
| 99 | struct tc35892_platform_data *pdata; | ||
| 100 | }; | ||
| 101 | |||
| 102 | extern int tc35892_reg_write(struct tc35892 *tc35892, u8 reg, u8 data); | ||
| 103 | extern int tc35892_reg_read(struct tc35892 *tc35892, u8 reg); | ||
| 104 | extern int tc35892_block_read(struct tc35892 *tc35892, u8 reg, u8 length, | ||
| 105 | u8 *values); | ||
| 106 | extern int tc35892_block_write(struct tc35892 *tc35892, u8 reg, u8 length, | ||
| 107 | const u8 *values); | ||
| 108 | extern int tc35892_set_bits(struct tc35892 *tc35892, u8 reg, u8 mask, u8 val); | ||
| 109 | |||
| 110 | /** | ||
| 111 | * struct tc35892_gpio_platform_data - TC35892 GPIO platform data | ||
| 112 | * @gpio_base: first gpio number assigned to TC35892. A maximum of | ||
| 113 | * %TC35892_NR_GPIOS GPIOs will be allocated. | ||
| 114 | */ | ||
| 115 | struct tc35892_gpio_platform_data { | ||
| 116 | int gpio_base; | ||
| 117 | }; | ||
| 118 | |||
| 119 | /** | ||
| 120 | * struct tc35892_platform_data - TC35892 platform data | ||
| 121 | * @irq_base: base IRQ number. %TC35892_NR_IRQS irqs will be used. | ||
| 122 | * @gpio: GPIO-specific platform data | ||
| 123 | */ | ||
| 124 | struct tc35892_platform_data { | ||
| 125 | int irq_base; | ||
| 126 | struct tc35892_gpio_platform_data *gpio; | ||
| 127 | }; | ||
| 128 | |||
| 129 | #define TC35892_NR_GPIOS 24 | ||
| 130 | #define TC35892_NR_IRQS TC35892_INT_GPIO(TC35892_NR_GPIOS) | ||
| 131 | |||
| 132 | #endif | ||
diff --git a/include/linux/mfd/tps6507x.h b/include/linux/mfd/tps6507x.h new file mode 100644 index 000000000000..c923e4864f55 --- /dev/null +++ b/include/linux/mfd/tps6507x.h | |||
| @@ -0,0 +1,169 @@ | |||
| 1 | /* linux/mfd/tps6507x.h | ||
| 2 | * | ||
| 3 | * Functions to access TPS65070 power management chip. | ||
| 4 | * | ||
| 5 | * Copyright (c) 2009 RidgeRun (todd.fischer@ridgerun.com) | ||
| 6 | * | ||
| 7 | * | ||
| 8 | * For licencing details see kernel-base/COPYING | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __LINUX_MFD_TPS6507X_H | ||
| 12 | #define __LINUX_MFD_TPS6507X_H | ||
| 13 | |||
| 14 | /* | ||
| 15 | * ---------------------------------------------------------------------------- | ||
| 16 | * Registers, all 8 bits | ||
| 17 | * ---------------------------------------------------------------------------- | ||
| 18 | */ | ||
| 19 | |||
| 20 | |||
| 21 | /* Register definitions */ | ||
| 22 | #define TPS6507X_REG_PPATH1 0X01 | ||
| 23 | #define TPS6507X_CHG_USB BIT(7) | ||
| 24 | #define TPS6507X_CHG_AC BIT(6) | ||
| 25 | #define TPS6507X_CHG_USB_PW_ENABLE BIT(5) | ||
| 26 | #define TPS6507X_CHG_AC_PW_ENABLE BIT(4) | ||
| 27 | #define TPS6507X_CHG_AC_CURRENT BIT(2) | ||
| 28 | #define TPS6507X_CHG_USB_CURRENT BIT(0) | ||
| 29 | |||
| 30 | #define TPS6507X_REG_INT 0X02 | ||
| 31 | #define TPS6507X_REG_MASK_AC_USB BIT(7) | ||
| 32 | #define TPS6507X_REG_MASK_TSC BIT(6) | ||
| 33 | #define TPS6507X_REG_MASK_PB_IN BIT(5) | ||
| 34 | #define TPS6507X_REG_TSC_INT BIT(3) | ||
| 35 | #define TPS6507X_REG_PB_IN_INT BIT(2) | ||
| 36 | #define TPS6507X_REG_AC_USB_APPLIED BIT(1) | ||
| 37 | #define TPS6507X_REG_AC_USB_REMOVED BIT(0) | ||
| 38 | |||
| 39 | #define TPS6507X_REG_CHGCONFIG0 0X03 | ||
| 40 | |||
| 41 | #define TPS6507X_REG_CHGCONFIG1 0X04 | ||
| 42 | #define TPS6507X_CON_CTRL1_DCDC1_ENABLE BIT(4) | ||
| 43 | #define TPS6507X_CON_CTRL1_DCDC2_ENABLE BIT(3) | ||
| 44 | #define TPS6507X_CON_CTRL1_DCDC3_ENABLE BIT(2) | ||
| 45 | #define TPS6507X_CON_CTRL1_LDO1_ENABLE BIT(1) | ||
| 46 | #define TPS6507X_CON_CTRL1_LDO2_ENABLE BIT(0) | ||
| 47 | |||
| 48 | #define TPS6507X_REG_CHGCONFIG2 0X05 | ||
| 49 | |||
| 50 | #define TPS6507X_REG_CHGCONFIG3 0X06 | ||
| 51 | |||
| 52 | #define TPS6507X_REG_ADCONFIG 0X07 | ||
| 53 | #define TPS6507X_ADCONFIG_AD_ENABLE BIT(7) | ||
| 54 | #define TPS6507X_ADCONFIG_START_CONVERSION BIT(6) | ||
| 55 | #define TPS6507X_ADCONFIG_CONVERSION_DONE BIT(5) | ||
| 56 | #define TPS6507X_ADCONFIG_VREF_ENABLE BIT(4) | ||
| 57 | #define TPS6507X_ADCONFIG_INPUT_AD_IN1 0 | ||
| 58 | #define TPS6507X_ADCONFIG_INPUT_AD_IN2 1 | ||
| 59 | #define TPS6507X_ADCONFIG_INPUT_AD_IN3 2 | ||
| 60 | #define TPS6507X_ADCONFIG_INPUT_AD_IN4 3 | ||
| 61 | #define TPS6507X_ADCONFIG_INPUT_TS_PIN 4 | ||
| 62 | #define TPS6507X_ADCONFIG_INPUT_BAT_CURRENT 5 | ||
| 63 | #define TPS6507X_ADCONFIG_INPUT_AC_VOLTAGE 6 | ||
| 64 | #define TPS6507X_ADCONFIG_INPUT_SYS_VOLTAGE 7 | ||
| 65 | #define TPS6507X_ADCONFIG_INPUT_CHARGER_VOLTAGE 8 | ||
| 66 | #define TPS6507X_ADCONFIG_INPUT_BAT_VOLTAGE 9 | ||
| 67 | #define TPS6507X_ADCONFIG_INPUT_THRESHOLD_VOLTAGE 10 | ||
| 68 | #define TPS6507X_ADCONFIG_INPUT_ISET1_VOLTAGE 11 | ||
| 69 | #define TPS6507X_ADCONFIG_INPUT_ISET2_VOLTAGE 12 | ||
| 70 | #define TPS6507X_ADCONFIG_INPUT_REAL_TSC 14 | ||
| 71 | #define TPS6507X_ADCONFIG_INPUT_TSC 15 | ||
| 72 | |||
| 73 | #define TPS6507X_REG_TSCMODE 0X08 | ||
| 74 | #define TPS6507X_TSCMODE_X_POSITION 0 | ||
| 75 | #define TPS6507X_TSCMODE_Y_POSITION 1 | ||
| 76 | #define TPS6507X_TSCMODE_PRESSURE 2 | ||
| 77 | #define TPS6507X_TSCMODE_X_PLATE 3 | ||
| 78 | #define TPS6507X_TSCMODE_Y_PLATE 4 | ||
| 79 | #define TPS6507X_TSCMODE_STANDBY 5 | ||
| 80 | #define TPS6507X_TSCMODE_ADC_INPUT 6 | ||
| 81 | #define TPS6507X_TSCMODE_DISABLE 7 | ||
| 82 | |||
| 83 | #define TPS6507X_REG_ADRESULT_1 0X09 | ||
| 84 | |||
| 85 | #define TPS6507X_REG_ADRESULT_2 0X0A | ||
| 86 | #define TPS6507X_REG_ADRESULT_2_MASK (BIT(1) | BIT(0)) | ||
| 87 | |||
| 88 | #define TPS6507X_REG_PGOOD 0X0B | ||
| 89 | |||
| 90 | #define TPS6507X_REG_PGOODMASK 0X0C | ||
| 91 | |||
| 92 | #define TPS6507X_REG_CON_CTRL1 0X0D | ||
| 93 | #define TPS6507X_CON_CTRL1_DCDC1_ENABLE BIT(4) | ||
| 94 | #define TPS6507X_CON_CTRL1_DCDC2_ENABLE BIT(3) | ||
| 95 | #define TPS6507X_CON_CTRL1_DCDC3_ENABLE BIT(2) | ||
| 96 | #define TPS6507X_CON_CTRL1_LDO1_ENABLE BIT(1) | ||
| 97 | #define TPS6507X_CON_CTRL1_LDO2_ENABLE BIT(0) | ||
| 98 | |||
| 99 | #define TPS6507X_REG_CON_CTRL2 0X0E | ||
| 100 | |||
| 101 | #define TPS6507X_REG_CON_CTRL3 0X0F | ||
| 102 | |||
| 103 | #define TPS6507X_REG_DEFDCDC1 0X10 | ||
| 104 | #define TPS6507X_DEFDCDC1_DCDC1_EXT_ADJ_EN BIT(7) | ||
| 105 | #define TPS6507X_DEFDCDC1_DCDC1_MASK 0X3F | ||
| 106 | |||
| 107 | #define TPS6507X_REG_DEFDCDC2_LOW 0X11 | ||
| 108 | #define TPS6507X_DEFDCDC2_LOW_DCDC2_MASK 0X3F | ||
| 109 | |||
| 110 | #define TPS6507X_REG_DEFDCDC2_HIGH 0X12 | ||
| 111 | #define TPS6507X_DEFDCDC2_HIGH_DCDC2_MASK 0X3F | ||
| 112 | |||
| 113 | #define TPS6507X_REG_DEFDCDC3_LOW 0X13 | ||
| 114 | #define TPS6507X_DEFDCDC3_LOW_DCDC3_MASK 0X3F | ||
| 115 | |||
| 116 | #define TPS6507X_REG_DEFDCDC3_HIGH 0X14 | ||
| 117 | #define TPS6507X_DEFDCDC3_HIGH_DCDC3_MASK 0X3F | ||
| 118 | |||
| 119 | #define TPS6507X_REG_DEFSLEW 0X15 | ||
| 120 | |||
| 121 | #define TPS6507X_REG_LDO_CTRL1 0X16 | ||
| 122 | #define TPS6507X_REG_LDO_CTRL1_LDO1_MASK 0X0F | ||
| 123 | |||
| 124 | #define TPS6507X_REG_DEFLDO2 0X17 | ||
| 125 | #define TPS6507X_REG_DEFLDO2_LDO2_MASK 0X3F | ||
| 126 | |||
| 127 | #define TPS6507X_REG_WLED_CTRL1 0X18 | ||
| 128 | |||
| 129 | #define TPS6507X_REG_WLED_CTRL2 0X19 | ||
| 130 | |||
| 131 | /* VDCDC MASK */ | ||
| 132 | #define TPS6507X_DEFDCDCX_DCDC_MASK 0X3F | ||
| 133 | |||
| 134 | #define TPS6507X_MAX_REGISTER 0X19 | ||
| 135 | |||
| 136 | /** | ||
| 137 | * struct tps6507x_board - packages regulator and touchscreen init data | ||
| 138 | * @tps6507x_regulator_data: regulator initialization values | ||
| 139 | * | ||
| 140 | * Board data may be used to initialize regulator and touchscreen. | ||
| 141 | */ | ||
| 142 | |||
| 143 | struct tps6507x_board { | ||
| 144 | struct regulator_init_data *tps6507x_pmic_init_data; | ||
| 145 | struct touchscreen_init_data *tps6507x_ts_init_data; | ||
| 146 | }; | ||
| 147 | |||
| 148 | /** | ||
| 149 | * struct tps6507x_dev - tps6507x sub-driver chip access routines | ||
| 150 | * @read_dev() - I2C register read function | ||
| 151 | * @write_dev() - I2C register write function | ||
| 152 | * | ||
| 153 | * Device data may be used to access the TPS6507x chip | ||
| 154 | */ | ||
| 155 | |||
| 156 | struct tps6507x_dev { | ||
| 157 | struct device *dev; | ||
| 158 | struct i2c_client *i2c_client; | ||
| 159 | int (*read_dev)(struct tps6507x_dev *tps6507x, char reg, int size, | ||
| 160 | void *dest); | ||
| 161 | int (*write_dev)(struct tps6507x_dev *tps6507x, char reg, int size, | ||
| 162 | void *src); | ||
| 163 | |||
| 164 | /* Client devices */ | ||
| 165 | struct tps6507x_pmic *pmic; | ||
| 166 | struct tps6507x_ts *ts; | ||
| 167 | }; | ||
| 168 | |||
| 169 | #endif /* __LINUX_MFD_TPS6507X_H */ | ||
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index 5915f6e3d9ab..eb5bd4e0e03c 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h | |||
| @@ -256,8 +256,9 @@ struct wm831x { | |||
| 256 | int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ | 256 | int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ |
| 257 | 257 | ||
| 258 | /* Chip revision based flags */ | 258 | /* Chip revision based flags */ |
| 259 | unsigned has_gpio_ena:1; /* Has GPIO enable bit */ | 259 | unsigned has_gpio_ena:1; /* Has GPIO enable bit */ |
| 260 | unsigned has_cs_sts:1; /* Has current sink status bit */ | 260 | unsigned has_cs_sts:1; /* Has current sink status bit */ |
| 261 | unsigned charger_irq_wake:1; /* Are charger IRQs a wake source? */ | ||
| 261 | 262 | ||
| 262 | int num_gpio; | 263 | int num_gpio; |
| 263 | 264 | ||
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 8a8f1d09c133..dba35e413371 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
| @@ -66,8 +66,6 @@ | |||
| 66 | * int num_online_nodes() Number of online Nodes | 66 | * int num_online_nodes() Number of online Nodes |
| 67 | * int num_possible_nodes() Number of all possible Nodes | 67 | * int num_possible_nodes() Number of all possible Nodes |
| 68 | * | 68 | * |
| 69 | * int node_random(mask) Random node with set bit in mask | ||
| 70 | * | ||
| 71 | * int node_online(node) Is some node online? | 69 | * int node_online(node) Is some node online? |
| 72 | * int node_possible(node) Is some node possible? | 70 | * int node_possible(node) Is some node possible? |
| 73 | * | 71 | * |
| @@ -432,10 +430,6 @@ static inline void node_set_offline(int nid) | |||
| 432 | node_clear_state(nid, N_ONLINE); | 430 | node_clear_state(nid, N_ONLINE); |
| 433 | nr_online_nodes = num_node_state(N_ONLINE); | 431 | nr_online_nodes = num_node_state(N_ONLINE); |
| 434 | } | 432 | } |
| 435 | |||
| 436 | #define node_random(mask) __node_random(&(mask)) | ||
| 437 | extern int __node_random(const nodemask_t *maskp); | ||
| 438 | |||
| 439 | #else | 433 | #else |
| 440 | 434 | ||
| 441 | static inline int node_state(int node, enum node_states state) | 435 | static inline int node_state(int node, enum node_states state) |
| @@ -466,8 +460,6 @@ static inline int num_node_state(enum node_states state) | |||
| 466 | 460 | ||
| 467 | #define node_set_online(node) node_set_state((node), N_ONLINE) | 461 | #define node_set_online(node) node_set_state((node), N_ONLINE) |
| 468 | #define node_set_offline(node) node_clear_state((node), N_ONLINE) | 462 | #define node_set_offline(node) node_clear_state((node), N_ONLINE) |
| 469 | |||
| 470 | static inline int node_random(const nodemask_t mask) { return 0; } | ||
| 471 | #endif | 463 | #endif |
| 472 | 464 | ||
| 473 | #define node_online_map node_states[N_ONLINE] | 465 | #define node_online_map node_states[N_ONLINE] |
diff --git a/include/linux/pci.h b/include/linux/pci.h index a327322a33ab..6a471aba3b07 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -311,7 +311,8 @@ struct pci_dev { | |||
| 311 | unsigned int is_virtfn:1; | 311 | unsigned int is_virtfn:1; |
| 312 | unsigned int reset_fn:1; | 312 | unsigned int reset_fn:1; |
| 313 | unsigned int is_hotplug_bridge:1; | 313 | unsigned int is_hotplug_bridge:1; |
| 314 | unsigned int aer_firmware_first:1; | 314 | unsigned int __aer_firmware_first_valid:1; |
| 315 | unsigned int __aer_firmware_first:1; | ||
| 315 | pci_dev_flags_t dev_flags; | 316 | pci_dev_flags_t dev_flags; |
| 316 | atomic_t enable_cnt; /* pci_enable_device has been called */ | 317 | atomic_t enable_cnt; /* pci_enable_device has been called */ |
| 317 | 318 | ||
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 3fd5c82e0e18..fb6c91eac7e3 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -485,6 +485,7 @@ struct perf_guest_info_callbacks { | |||
| 485 | #include <linux/ftrace.h> | 485 | #include <linux/ftrace.h> |
| 486 | #include <linux/cpu.h> | 486 | #include <linux/cpu.h> |
| 487 | #include <asm/atomic.h> | 487 | #include <asm/atomic.h> |
| 488 | #include <asm/local.h> | ||
| 488 | 489 | ||
| 489 | #define PERF_MAX_STACK_DEPTH 255 | 490 | #define PERF_MAX_STACK_DEPTH 255 |
| 490 | 491 | ||
| @@ -587,21 +588,19 @@ struct perf_mmap_data { | |||
| 587 | struct rcu_head rcu_head; | 588 | struct rcu_head rcu_head; |
| 588 | #ifdef CONFIG_PERF_USE_VMALLOC | 589 | #ifdef CONFIG_PERF_USE_VMALLOC |
| 589 | struct work_struct work; | 590 | struct work_struct work; |
| 591 | int page_order; /* allocation order */ | ||
| 590 | #endif | 592 | #endif |
| 591 | int data_order; | ||
| 592 | int nr_pages; /* nr of data pages */ | 593 | int nr_pages; /* nr of data pages */ |
| 593 | int writable; /* are we writable */ | 594 | int writable; /* are we writable */ |
| 594 | int nr_locked; /* nr pages mlocked */ | 595 | int nr_locked; /* nr pages mlocked */ |
| 595 | 596 | ||
| 596 | atomic_t poll; /* POLL_ for wakeups */ | 597 | atomic_t poll; /* POLL_ for wakeups */ |
| 597 | atomic_t events; /* event_id limit */ | ||
| 598 | 598 | ||
| 599 | atomic_long_t head; /* write position */ | 599 | local_t head; /* write position */ |
| 600 | atomic_long_t done_head; /* completed head */ | 600 | local_t nest; /* nested writers */ |
| 601 | 601 | local_t events; /* event limit */ | |
| 602 | atomic_t lock; /* concurrent writes */ | 602 | local_t wakeup; /* wakeup stamp */ |
| 603 | atomic_t wakeup; /* needs a wakeup */ | 603 | local_t lost; /* nr records lost */ |
| 604 | atomic_t lost; /* nr records lost */ | ||
| 605 | 604 | ||
| 606 | long watermark; /* wakeup watermark */ | 605 | long watermark; /* wakeup watermark */ |
| 607 | 606 | ||
| @@ -728,6 +727,7 @@ struct perf_event { | |||
| 728 | perf_overflow_handler_t overflow_handler; | 727 | perf_overflow_handler_t overflow_handler; |
| 729 | 728 | ||
| 730 | #ifdef CONFIG_EVENT_TRACING | 729 | #ifdef CONFIG_EVENT_TRACING |
| 730 | struct ftrace_event_call *tp_event; | ||
| 731 | struct event_filter *filter; | 731 | struct event_filter *filter; |
| 732 | #endif | 732 | #endif |
| 733 | 733 | ||
| @@ -803,11 +803,12 @@ struct perf_cpu_context { | |||
| 803 | struct perf_output_handle { | 803 | struct perf_output_handle { |
| 804 | struct perf_event *event; | 804 | struct perf_event *event; |
| 805 | struct perf_mmap_data *data; | 805 | struct perf_mmap_data *data; |
| 806 | unsigned long head; | 806 | unsigned long wakeup; |
| 807 | unsigned long offset; | 807 | unsigned long size; |
| 808 | void *addr; | ||
| 809 | int page; | ||
| 808 | int nmi; | 810 | int nmi; |
| 809 | int sample; | 811 | int sample; |
| 810 | int locked; | ||
| 811 | }; | 812 | }; |
| 812 | 813 | ||
| 813 | #ifdef CONFIG_PERF_EVENTS | 814 | #ifdef CONFIG_PERF_EVENTS |
| @@ -993,8 +994,9 @@ static inline bool perf_paranoid_kernel(void) | |||
| 993 | } | 994 | } |
| 994 | 995 | ||
| 995 | extern void perf_event_init(void); | 996 | extern void perf_event_init(void); |
| 996 | extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, | 997 | extern void perf_tp_event(u64 addr, u64 count, void *record, |
| 997 | int entry_size, struct pt_regs *regs); | 998 | int entry_size, struct pt_regs *regs, |
| 999 | struct hlist_head *head); | ||
| 998 | extern void perf_bp_event(struct perf_event *event, void *data); | 1000 | extern void perf_bp_event(struct perf_event *event, void *data); |
| 999 | 1001 | ||
| 1000 | #ifndef perf_misc_flags | 1002 | #ifndef perf_misc_flags |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 7126a15467f1..94c1f03b50eb 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
| @@ -174,8 +174,7 @@ enum { | |||
| 174 | #include <linux/rwsem.h> | 174 | #include <linux/rwsem.h> |
| 175 | #include <linux/spinlock.h> | 175 | #include <linux/spinlock.h> |
| 176 | #include <linux/wait.h> | 176 | #include <linux/wait.h> |
| 177 | #include <linux/percpu.h> | 177 | #include <linux/percpu_counter.h> |
| 178 | #include <linux/smp.h> | ||
| 179 | 178 | ||
| 180 | #include <linux/dqblk_xfs.h> | 179 | #include <linux/dqblk_xfs.h> |
| 181 | #include <linux/dqblk_v1.h> | 180 | #include <linux/dqblk_v1.h> |
| @@ -254,6 +253,7 @@ enum { | |||
| 254 | 253 | ||
| 255 | struct dqstats { | 254 | struct dqstats { |
| 256 | int stat[_DQST_DQSTAT_LAST]; | 255 | int stat[_DQST_DQSTAT_LAST]; |
| 256 | struct percpu_counter counter[_DQST_DQSTAT_LAST]; | ||
| 257 | }; | 257 | }; |
| 258 | 258 | ||
| 259 | extern struct dqstats *dqstats_pcpu; | 259 | extern struct dqstats *dqstats_pcpu; |
| @@ -261,20 +261,12 @@ extern struct dqstats dqstats; | |||
| 261 | 261 | ||
| 262 | static inline void dqstats_inc(unsigned int type) | 262 | static inline void dqstats_inc(unsigned int type) |
| 263 | { | 263 | { |
| 264 | #ifdef CONFIG_SMP | 264 | percpu_counter_inc(&dqstats.counter[type]); |
| 265 | per_cpu_ptr(dqstats_pcpu, smp_processor_id())->stat[type]++; | ||
| 266 | #else | ||
| 267 | dqstats.stat[type]++; | ||
| 268 | #endif | ||
| 269 | } | 265 | } |
| 270 | 266 | ||
| 271 | static inline void dqstats_dec(unsigned int type) | 267 | static inline void dqstats_dec(unsigned int type) |
| 272 | { | 268 | { |
| 273 | #ifdef CONFIG_SMP | 269 | percpu_counter_dec(&dqstats.counter[type]); |
| 274 | per_cpu_ptr(dqstats_pcpu, smp_processor_id())->stat[type]--; | ||
| 275 | #else | ||
| 276 | dqstats.stat[type]--; | ||
| 277 | #endif | ||
| 278 | } | 270 | } |
| 279 | 271 | ||
| 280 | #define DQ_MOD_B 0 /* dquot modified since read */ | 272 | #define DQ_MOD_B 0 /* dquot modified since read */ |
| @@ -332,8 +324,8 @@ struct dquot_operations { | |||
| 332 | 324 | ||
| 333 | /* Operations handling requests from userspace */ | 325 | /* Operations handling requests from userspace */ |
| 334 | struct quotactl_ops { | 326 | struct quotactl_ops { |
| 335 | int (*quota_on)(struct super_block *, int, int, char *, int); | 327 | int (*quota_on)(struct super_block *, int, int, char *); |
| 336 | int (*quota_off)(struct super_block *, int, int); | 328 | int (*quota_off)(struct super_block *, int); |
| 337 | int (*quota_sync)(struct super_block *, int, int); | 329 | int (*quota_sync)(struct super_block *, int, int); |
| 338 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); | 330 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); |
| 339 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); | 331 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index e38ae53f3529..aa36793b48bd 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
| @@ -53,6 +53,14 @@ int dquot_alloc_inode(const struct inode *inode); | |||
| 53 | int dquot_claim_space_nodirty(struct inode *inode, qsize_t number); | 53 | int dquot_claim_space_nodirty(struct inode *inode, qsize_t number); |
| 54 | void dquot_free_inode(const struct inode *inode); | 54 | void dquot_free_inode(const struct inode *inode); |
| 55 | 55 | ||
| 56 | int dquot_disable(struct super_block *sb, int type, unsigned int flags); | ||
| 57 | /* Suspend quotas on remount RO */ | ||
| 58 | static inline int dquot_suspend(struct super_block *sb, int type) | ||
| 59 | { | ||
| 60 | return dquot_disable(sb, type, DQUOT_SUSPENDED); | ||
| 61 | } | ||
| 62 | int dquot_resume(struct super_block *sb, int type); | ||
| 63 | |||
| 56 | int dquot_commit(struct dquot *dquot); | 64 | int dquot_commit(struct dquot *dquot); |
| 57 | int dquot_acquire(struct dquot *dquot); | 65 | int dquot_acquire(struct dquot *dquot); |
| 58 | int dquot_release(struct dquot *dquot); | 66 | int dquot_release(struct dquot *dquot); |
| @@ -61,27 +69,25 @@ int dquot_mark_dquot_dirty(struct dquot *dquot); | |||
| 61 | 69 | ||
| 62 | int dquot_file_open(struct inode *inode, struct file *file); | 70 | int dquot_file_open(struct inode *inode, struct file *file); |
| 63 | 71 | ||
| 64 | int vfs_quota_on(struct super_block *sb, int type, int format_id, | 72 | int dquot_quota_on(struct super_block *sb, int type, int format_id, |
| 65 | char *path, int remount); | 73 | char *path); |
| 66 | int vfs_quota_enable(struct inode *inode, int type, int format_id, | 74 | int dquot_enable(struct inode *inode, int type, int format_id, |
| 67 | unsigned int flags); | 75 | unsigned int flags); |
| 68 | int vfs_quota_on_path(struct super_block *sb, int type, int format_id, | 76 | int dquot_quota_on_path(struct super_block *sb, int type, int format_id, |
| 69 | struct path *path); | 77 | struct path *path); |
| 70 | int vfs_quota_on_mount(struct super_block *sb, char *qf_name, | 78 | int dquot_quota_on_mount(struct super_block *sb, char *qf_name, |
| 71 | int format_id, int type); | 79 | int format_id, int type); |
| 72 | int vfs_quota_off(struct super_block *sb, int type, int remount); | 80 | int dquot_quota_off(struct super_block *sb, int type); |
| 73 | int vfs_quota_disable(struct super_block *sb, int type, unsigned int flags); | 81 | int dquot_quota_sync(struct super_block *sb, int type, int wait); |
| 74 | int vfs_quota_sync(struct super_block *sb, int type, int wait); | 82 | int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); |
| 75 | int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); | 83 | int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); |
| 76 | int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); | 84 | int dquot_get_dqblk(struct super_block *sb, int type, qid_t id, |
| 77 | int vfs_get_dqblk(struct super_block *sb, int type, qid_t id, | ||
| 78 | struct fs_disk_quota *di); | 85 | struct fs_disk_quota *di); |
| 79 | int vfs_set_dqblk(struct super_block *sb, int type, qid_t id, | 86 | int dquot_set_dqblk(struct super_block *sb, int type, qid_t id, |
| 80 | struct fs_disk_quota *di); | 87 | struct fs_disk_quota *di); |
| 81 | 88 | ||
| 82 | int __dquot_transfer(struct inode *inode, struct dquot **transfer_to); | 89 | int __dquot_transfer(struct inode *inode, struct dquot **transfer_to); |
| 83 | int dquot_transfer(struct inode *inode, struct iattr *iattr); | 90 | int dquot_transfer(struct inode *inode, struct iattr *iattr); |
| 84 | int vfs_dq_quota_on_remount(struct super_block *sb); | ||
| 85 | 91 | ||
| 86 | static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type) | 92 | static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type) |
| 87 | { | 93 | { |
| @@ -148,20 +154,7 @@ static inline unsigned sb_any_quota_active(struct super_block *sb) | |||
| 148 | * Operations supported for diskquotas. | 154 | * Operations supported for diskquotas. |
| 149 | */ | 155 | */ |
| 150 | extern const struct dquot_operations dquot_operations; | 156 | extern const struct dquot_operations dquot_operations; |
| 151 | extern const struct quotactl_ops vfs_quotactl_ops; | 157 | extern const struct quotactl_ops dquot_quotactl_ops; |
| 152 | |||
| 153 | #define sb_dquot_ops (&dquot_operations) | ||
| 154 | #define sb_quotactl_ops (&vfs_quotactl_ops) | ||
| 155 | |||
| 156 | /* Cannot be called inside a transaction */ | ||
| 157 | static inline int vfs_dq_off(struct super_block *sb, int remount) | ||
| 158 | { | ||
| 159 | int ret = -ENOSYS; | ||
| 160 | |||
| 161 | if (sb->s_qcop && sb->s_qcop->quota_off) | ||
| 162 | ret = sb->s_qcop->quota_off(sb, -1, remount); | ||
| 163 | return ret; | ||
| 164 | } | ||
| 165 | 158 | ||
| 166 | #else | 159 | #else |
| 167 | 160 | ||
| @@ -206,12 +199,6 @@ static inline int sb_any_quota_active(struct super_block *sb) | |||
| 206 | return 0; | 199 | return 0; |
| 207 | } | 200 | } |
| 208 | 201 | ||
| 209 | /* | ||
| 210 | * NO-OP when quota not configured. | ||
| 211 | */ | ||
| 212 | #define sb_dquot_ops (NULL) | ||
| 213 | #define sb_quotactl_ops (NULL) | ||
| 214 | |||
| 215 | static inline void dquot_initialize(struct inode *inode) | 202 | static inline void dquot_initialize(struct inode *inode) |
| 216 | { | 203 | { |
| 217 | } | 204 | } |
| @@ -229,16 +216,6 @@ static inline void dquot_free_inode(const struct inode *inode) | |||
| 229 | { | 216 | { |
| 230 | } | 217 | } |
| 231 | 218 | ||
| 232 | static inline int vfs_dq_off(struct super_block *sb, int remount) | ||
| 233 | { | ||
| 234 | return 0; | ||
| 235 | } | ||
| 236 | |||
| 237 | static inline int vfs_dq_quota_on_remount(struct super_block *sb) | ||
| 238 | { | ||
| 239 | return 0; | ||
| 240 | } | ||
| 241 | |||
| 242 | static inline int dquot_transfer(struct inode *inode, struct iattr *iattr) | 219 | static inline int dquot_transfer(struct inode *inode, struct iattr *iattr) |
| 243 | { | 220 | { |
| 244 | return 0; | 221 | return 0; |
| @@ -265,6 +242,22 @@ static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) | |||
| 265 | return 0; | 242 | return 0; |
| 266 | } | 243 | } |
| 267 | 244 | ||
| 245 | static inline int dquot_disable(struct super_block *sb, int type, | ||
| 246 | unsigned int flags) | ||
| 247 | { | ||
| 248 | return 0; | ||
| 249 | } | ||
| 250 | |||
| 251 | static inline int dquot_suspend(struct super_block *sb, int type) | ||
| 252 | { | ||
| 253 | return 0; | ||
| 254 | } | ||
| 255 | |||
| 256 | static inline int dquot_resume(struct super_block *sb, int type) | ||
| 257 | { | ||
| 258 | return 0; | ||
| 259 | } | ||
| 260 | |||
| 268 | #define dquot_file_open generic_file_open | 261 | #define dquot_file_open generic_file_open |
| 269 | 262 | ||
| 270 | #endif /* CONFIG_QUOTA */ | 263 | #endif /* CONFIG_QUOTA */ |
diff --git a/include/linux/rio.h b/include/linux/rio.h index 19b5f227096e..bd6eb0ed34a7 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h | |||
| @@ -88,11 +88,15 @@ union rio_pw_msg; | |||
| 88 | * @swpinfo: Switch port info | 88 | * @swpinfo: Switch port info |
| 89 | * @src_ops: Source operation capabilities | 89 | * @src_ops: Source operation capabilities |
| 90 | * @dst_ops: Destination operation capabilities | 90 | * @dst_ops: Destination operation capabilities |
| 91 | * @comp_tag: RIO component tag | ||
| 92 | * @phys_efptr: RIO device extended features pointer | ||
| 93 | * @em_efptr: RIO Error Management features pointer | ||
| 91 | * @dma_mask: Mask of bits of RIO address this device implements | 94 | * @dma_mask: Mask of bits of RIO address this device implements |
| 92 | * @rswitch: Pointer to &struct rio_switch if valid for this device | 95 | * @rswitch: Pointer to &struct rio_switch if valid for this device |
| 93 | * @driver: Driver claiming this device | 96 | * @driver: Driver claiming this device |
| 94 | * @dev: Device model device | 97 | * @dev: Device model device |
| 95 | * @riores: RIO resources this device owns | 98 | * @riores: RIO resources this device owns |
| 99 | * @pwcback: port-write callback function for this device | ||
| 96 | * @destid: Network destination ID | 100 | * @destid: Network destination ID |
| 97 | */ | 101 | */ |
| 98 | struct rio_dev { | 102 | struct rio_dev { |
| @@ -222,6 +226,8 @@ struct rio_net { | |||
| 222 | * @add_entry: Callback for switch-specific route add function | 226 | * @add_entry: Callback for switch-specific route add function |
| 223 | * @get_entry: Callback for switch-specific route get function | 227 | * @get_entry: Callback for switch-specific route get function |
| 224 | * @clr_table: Callback for switch-specific clear route table function | 228 | * @clr_table: Callback for switch-specific clear route table function |
| 229 | * @set_domain: Callback for switch-specific domain setting function | ||
| 230 | * @get_domain: Callback for switch-specific domain get function | ||
| 225 | * @em_init: Callback for switch-specific error management initialization function | 231 | * @em_init: Callback for switch-specific error management initialization function |
| 226 | * @em_handle: Callback for switch-specific error management handler function | 232 | * @em_handle: Callback for switch-specific error management handler function |
| 227 | */ | 233 | */ |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 057929b0a651..a1a86a53bc73 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -103,22 +103,6 @@ struct perf_event_attr; | |||
| 103 | #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) | 103 | #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) |
| 104 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) | 104 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) |
| 105 | 105 | ||
| 106 | #ifdef CONFIG_PERF_EVENTS | ||
| 107 | |||
| 108 | #define TRACE_SYS_ENTER_PERF_INIT(sname) \ | ||
| 109 | .perf_event_enable = perf_sysenter_enable, \ | ||
| 110 | .perf_event_disable = perf_sysenter_disable, | ||
| 111 | |||
| 112 | #define TRACE_SYS_EXIT_PERF_INIT(sname) \ | ||
| 113 | .perf_event_enable = perf_sysexit_enable, \ | ||
| 114 | .perf_event_disable = perf_sysexit_disable, | ||
| 115 | #else | ||
| 116 | #define TRACE_SYS_ENTER_PERF(sname) | ||
| 117 | #define TRACE_SYS_ENTER_PERF_INIT(sname) | ||
| 118 | #define TRACE_SYS_EXIT_PERF(sname) | ||
| 119 | #define TRACE_SYS_EXIT_PERF_INIT(sname) | ||
| 120 | #endif /* CONFIG_PERF_EVENTS */ | ||
| 121 | |||
| 122 | #ifdef CONFIG_FTRACE_SYSCALLS | 106 | #ifdef CONFIG_FTRACE_SYSCALLS |
| 123 | #define __SC_STR_ADECL1(t, a) #a | 107 | #define __SC_STR_ADECL1(t, a) #a |
| 124 | #define __SC_STR_ADECL2(t, a, ...) #a, __SC_STR_ADECL1(__VA_ARGS__) | 108 | #define __SC_STR_ADECL2(t, a, ...) #a, __SC_STR_ADECL1(__VA_ARGS__) |
| @@ -134,54 +118,43 @@ struct perf_event_attr; | |||
| 134 | #define __SC_STR_TDECL5(t, a, ...) #t, __SC_STR_TDECL4(__VA_ARGS__) | 118 | #define __SC_STR_TDECL5(t, a, ...) #t, __SC_STR_TDECL4(__VA_ARGS__) |
| 135 | #define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__) | 119 | #define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__) |
| 136 | 120 | ||
| 121 | extern struct ftrace_event_class event_class_syscall_enter; | ||
| 122 | extern struct ftrace_event_class event_class_syscall_exit; | ||
| 123 | extern struct trace_event_functions enter_syscall_print_funcs; | ||
| 124 | extern struct trace_event_functions exit_syscall_print_funcs; | ||
| 125 | |||
| 137 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ | 126 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ |
| 138 | static const struct syscall_metadata __syscall_meta_##sname; \ | 127 | static struct syscall_metadata __syscall_meta_##sname; \ |
| 139 | static struct ftrace_event_call \ | 128 | static struct ftrace_event_call \ |
| 140 | __attribute__((__aligned__(4))) event_enter_##sname; \ | 129 | __attribute__((__aligned__(4))) event_enter_##sname; \ |
| 141 | static struct trace_event enter_syscall_print_##sname = { \ | ||
| 142 | .trace = print_syscall_enter, \ | ||
| 143 | }; \ | ||
| 144 | static struct ftrace_event_call __used \ | 130 | static struct ftrace_event_call __used \ |
| 145 | __attribute__((__aligned__(4))) \ | 131 | __attribute__((__aligned__(4))) \ |
| 146 | __attribute__((section("_ftrace_events"))) \ | 132 | __attribute__((section("_ftrace_events"))) \ |
| 147 | event_enter_##sname = { \ | 133 | event_enter_##sname = { \ |
| 148 | .name = "sys_enter"#sname, \ | 134 | .name = "sys_enter"#sname, \ |
| 149 | .system = "syscalls", \ | 135 | .class = &event_class_syscall_enter, \ |
| 150 | .event = &enter_syscall_print_##sname, \ | 136 | .event.funcs = &enter_syscall_print_funcs, \ |
| 151 | .raw_init = init_syscall_trace, \ | ||
| 152 | .define_fields = syscall_enter_define_fields, \ | ||
| 153 | .regfunc = reg_event_syscall_enter, \ | ||
| 154 | .unregfunc = unreg_event_syscall_enter, \ | ||
| 155 | .data = (void *)&__syscall_meta_##sname,\ | 137 | .data = (void *)&__syscall_meta_##sname,\ |
| 156 | TRACE_SYS_ENTER_PERF_INIT(sname) \ | ||
| 157 | } | 138 | } |
| 158 | 139 | ||
| 159 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ | 140 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ |
| 160 | static const struct syscall_metadata __syscall_meta_##sname; \ | 141 | static struct syscall_metadata __syscall_meta_##sname; \ |
| 161 | static struct ftrace_event_call \ | 142 | static struct ftrace_event_call \ |
| 162 | __attribute__((__aligned__(4))) event_exit_##sname; \ | 143 | __attribute__((__aligned__(4))) event_exit_##sname; \ |
| 163 | static struct trace_event exit_syscall_print_##sname = { \ | ||
| 164 | .trace = print_syscall_exit, \ | ||
| 165 | }; \ | ||
| 166 | static struct ftrace_event_call __used \ | 144 | static struct ftrace_event_call __used \ |
| 167 | __attribute__((__aligned__(4))) \ | 145 | __attribute__((__aligned__(4))) \ |
| 168 | __attribute__((section("_ftrace_events"))) \ | 146 | __attribute__((section("_ftrace_events"))) \ |
| 169 | event_exit_##sname = { \ | 147 | event_exit_##sname = { \ |
| 170 | .name = "sys_exit"#sname, \ | 148 | .name = "sys_exit"#sname, \ |
| 171 | .system = "syscalls", \ | 149 | .class = &event_class_syscall_exit, \ |
| 172 | .event = &exit_syscall_print_##sname, \ | 150 | .event.funcs = &exit_syscall_print_funcs, \ |
| 173 | .raw_init = init_syscall_trace, \ | ||
| 174 | .define_fields = syscall_exit_define_fields, \ | ||
| 175 | .regfunc = reg_event_syscall_exit, \ | ||
| 176 | .unregfunc = unreg_event_syscall_exit, \ | ||
| 177 | .data = (void *)&__syscall_meta_##sname,\ | 151 | .data = (void *)&__syscall_meta_##sname,\ |
| 178 | TRACE_SYS_EXIT_PERF_INIT(sname) \ | ||
| 179 | } | 152 | } |
| 180 | 153 | ||
| 181 | #define SYSCALL_METADATA(sname, nb) \ | 154 | #define SYSCALL_METADATA(sname, nb) \ |
| 182 | SYSCALL_TRACE_ENTER_EVENT(sname); \ | 155 | SYSCALL_TRACE_ENTER_EVENT(sname); \ |
| 183 | SYSCALL_TRACE_EXIT_EVENT(sname); \ | 156 | SYSCALL_TRACE_EXIT_EVENT(sname); \ |
| 184 | static const struct syscall_metadata __used \ | 157 | static struct syscall_metadata __used \ |
| 185 | __attribute__((__aligned__(4))) \ | 158 | __attribute__((__aligned__(4))) \ |
| 186 | __attribute__((section("__syscalls_metadata"))) \ | 159 | __attribute__((section("__syscalls_metadata"))) \ |
| 187 | __syscall_meta_##sname = { \ | 160 | __syscall_meta_##sname = { \ |
| @@ -191,12 +164,14 @@ struct perf_event_attr; | |||
| 191 | .args = args_##sname, \ | 164 | .args = args_##sname, \ |
| 192 | .enter_event = &event_enter_##sname, \ | 165 | .enter_event = &event_enter_##sname, \ |
| 193 | .exit_event = &event_exit_##sname, \ | 166 | .exit_event = &event_exit_##sname, \ |
| 167 | .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \ | ||
| 168 | .exit_fields = LIST_HEAD_INIT(__syscall_meta_##sname.exit_fields), \ | ||
| 194 | }; | 169 | }; |
| 195 | 170 | ||
| 196 | #define SYSCALL_DEFINE0(sname) \ | 171 | #define SYSCALL_DEFINE0(sname) \ |
| 197 | SYSCALL_TRACE_ENTER_EVENT(_##sname); \ | 172 | SYSCALL_TRACE_ENTER_EVENT(_##sname); \ |
| 198 | SYSCALL_TRACE_EXIT_EVENT(_##sname); \ | 173 | SYSCALL_TRACE_EXIT_EVENT(_##sname); \ |
| 199 | static const struct syscall_metadata __used \ | 174 | static struct syscall_metadata __used \ |
| 200 | __attribute__((__aligned__(4))) \ | 175 | __attribute__((__aligned__(4))) \ |
| 201 | __attribute__((section("__syscalls_metadata"))) \ | 176 | __attribute__((section("__syscalls_metadata"))) \ |
| 202 | __syscall_meta__##sname = { \ | 177 | __syscall_meta__##sname = { \ |
| @@ -204,6 +179,8 @@ struct perf_event_attr; | |||
| 204 | .nb_args = 0, \ | 179 | .nb_args = 0, \ |
| 205 | .enter_event = &event_enter__##sname, \ | 180 | .enter_event = &event_enter__##sname, \ |
| 206 | .exit_event = &event_exit__##sname, \ | 181 | .exit_event = &event_exit__##sname, \ |
| 182 | .enter_fields = LIST_HEAD_INIT(__syscall_meta__##sname.enter_fields), \ | ||
| 183 | .exit_fields = LIST_HEAD_INIT(__syscall_meta__##sname.exit_fields), \ | ||
| 207 | }; \ | 184 | }; \ |
| 208 | asmlinkage long sys_##sname(void) | 185 | asmlinkage long sys_##sname(void) |
| 209 | #else | 186 | #else |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 1d85f9a6a199..9a59d1f98cd4 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
| @@ -20,12 +20,17 @@ | |||
| 20 | struct module; | 20 | struct module; |
| 21 | struct tracepoint; | 21 | struct tracepoint; |
| 22 | 22 | ||
| 23 | struct tracepoint_func { | ||
| 24 | void *func; | ||
| 25 | void *data; | ||
| 26 | }; | ||
| 27 | |||
| 23 | struct tracepoint { | 28 | struct tracepoint { |
| 24 | const char *name; /* Tracepoint name */ | 29 | const char *name; /* Tracepoint name */ |
| 25 | int state; /* State. */ | 30 | int state; /* State. */ |
| 26 | void (*regfunc)(void); | 31 | void (*regfunc)(void); |
| 27 | void (*unregfunc)(void); | 32 | void (*unregfunc)(void); |
| 28 | void **funcs; | 33 | struct tracepoint_func *funcs; |
| 29 | } __attribute__((aligned(32))); /* | 34 | } __attribute__((aligned(32))); /* |
| 30 | * Aligned on 32 bytes because it is | 35 | * Aligned on 32 bytes because it is |
| 31 | * globally visible and gcc happily | 36 | * globally visible and gcc happily |
| @@ -37,16 +42,19 @@ struct tracepoint { | |||
| 37 | * Connect a probe to a tracepoint. | 42 | * Connect a probe to a tracepoint. |
| 38 | * Internal API, should not be used directly. | 43 | * Internal API, should not be used directly. |
| 39 | */ | 44 | */ |
| 40 | extern int tracepoint_probe_register(const char *name, void *probe); | 45 | extern int tracepoint_probe_register(const char *name, void *probe, void *data); |
| 41 | 46 | ||
| 42 | /* | 47 | /* |
| 43 | * Disconnect a probe from a tracepoint. | 48 | * Disconnect a probe from a tracepoint. |
| 44 | * Internal API, should not be used directly. | 49 | * Internal API, should not be used directly. |
| 45 | */ | 50 | */ |
| 46 | extern int tracepoint_probe_unregister(const char *name, void *probe); | 51 | extern int |
| 52 | tracepoint_probe_unregister(const char *name, void *probe, void *data); | ||
| 47 | 53 | ||
| 48 | extern int tracepoint_probe_register_noupdate(const char *name, void *probe); | 54 | extern int tracepoint_probe_register_noupdate(const char *name, void *probe, |
| 49 | extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe); | 55 | void *data); |
| 56 | extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe, | ||
| 57 | void *data); | ||
| 50 | extern void tracepoint_probe_update_all(void); | 58 | extern void tracepoint_probe_update_all(void); |
| 51 | 59 | ||
| 52 | struct tracepoint_iter { | 60 | struct tracepoint_iter { |
| @@ -102,17 +110,27 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
| 102 | /* | 110 | /* |
| 103 | * it_func[0] is never NULL because there is at least one element in the array | 111 | * it_func[0] is never NULL because there is at least one element in the array |
| 104 | * when the array itself is non NULL. | 112 | * when the array itself is non NULL. |
| 113 | * | ||
| 114 | * Note, the proto and args passed in includes "__data" as the first parameter. | ||
| 115 | * The reason for this is to handle the "void" prototype. If a tracepoint | ||
| 116 | * has a "void" prototype, then it is invalid to declare a function | ||
| 117 | * as "(void *, void)". The DECLARE_TRACE_NOARGS() will pass in just | ||
| 118 | * "void *data", where as the DECLARE_TRACE() will pass in "void *data, proto". | ||
| 105 | */ | 119 | */ |
| 106 | #define __DO_TRACE(tp, proto, args) \ | 120 | #define __DO_TRACE(tp, proto, args) \ |
| 107 | do { \ | 121 | do { \ |
| 108 | void **it_func; \ | 122 | struct tracepoint_func *it_func_ptr; \ |
| 123 | void *it_func; \ | ||
| 124 | void *__data; \ | ||
| 109 | \ | 125 | \ |
| 110 | rcu_read_lock_sched_notrace(); \ | 126 | rcu_read_lock_sched_notrace(); \ |
| 111 | it_func = rcu_dereference_sched((tp)->funcs); \ | 127 | it_func_ptr = rcu_dereference_sched((tp)->funcs); \ |
| 112 | if (it_func) { \ | 128 | if (it_func_ptr) { \ |
| 113 | do { \ | 129 | do { \ |
| 114 | ((void(*)(proto))(*it_func))(args); \ | 130 | it_func = (it_func_ptr)->func; \ |
| 115 | } while (*(++it_func)); \ | 131 | __data = (it_func_ptr)->data; \ |
| 132 | ((void(*)(proto))(it_func))(args); \ | ||
| 133 | } while ((++it_func_ptr)->func); \ | ||
| 116 | } \ | 134 | } \ |
| 117 | rcu_read_unlock_sched_notrace(); \ | 135 | rcu_read_unlock_sched_notrace(); \ |
| 118 | } while (0) | 136 | } while (0) |
| @@ -122,24 +140,32 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
| 122 | * not add unwanted padding between the beginning of the section and the | 140 | * not add unwanted padding between the beginning of the section and the |
| 123 | * structure. Force alignment to the same alignment as the section start. | 141 | * structure. Force alignment to the same alignment as the section start. |
| 124 | */ | 142 | */ |
| 125 | #define DECLARE_TRACE(name, proto, args) \ | 143 | #define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \ |
| 126 | extern struct tracepoint __tracepoint_##name; \ | 144 | extern struct tracepoint __tracepoint_##name; \ |
| 127 | static inline void trace_##name(proto) \ | 145 | static inline void trace_##name(proto) \ |
| 128 | { \ | 146 | { \ |
| 129 | if (unlikely(__tracepoint_##name.state)) \ | 147 | if (unlikely(__tracepoint_##name.state)) \ |
| 130 | __DO_TRACE(&__tracepoint_##name, \ | 148 | __DO_TRACE(&__tracepoint_##name, \ |
| 131 | TP_PROTO(proto), TP_ARGS(args)); \ | 149 | TP_PROTO(data_proto), \ |
| 150 | TP_ARGS(data_args)); \ | ||
| 151 | } \ | ||
| 152 | static inline int \ | ||
| 153 | register_trace_##name(void (*probe)(data_proto), void *data) \ | ||
| 154 | { \ | ||
| 155 | return tracepoint_probe_register(#name, (void *)probe, \ | ||
| 156 | data); \ | ||
| 132 | } \ | 157 | } \ |
| 133 | static inline int register_trace_##name(void (*probe)(proto)) \ | 158 | static inline int \ |
| 159 | unregister_trace_##name(void (*probe)(data_proto), void *data) \ | ||
| 134 | { \ | 160 | { \ |
| 135 | return tracepoint_probe_register(#name, (void *)probe); \ | 161 | return tracepoint_probe_unregister(#name, (void *)probe, \ |
| 162 | data); \ | ||
| 136 | } \ | 163 | } \ |
| 137 | static inline int unregister_trace_##name(void (*probe)(proto)) \ | 164 | static inline void \ |
| 165 | check_trace_callback_type_##name(void (*cb)(data_proto)) \ | ||
| 138 | { \ | 166 | { \ |
| 139 | return tracepoint_probe_unregister(#name, (void *)probe);\ | ||
| 140 | } | 167 | } |
| 141 | 168 | ||
| 142 | |||
| 143 | #define DEFINE_TRACE_FN(name, reg, unreg) \ | 169 | #define DEFINE_TRACE_FN(name, reg, unreg) \ |
| 144 | static const char __tpstrtab_##name[] \ | 170 | static const char __tpstrtab_##name[] \ |
| 145 | __attribute__((section("__tracepoints_strings"))) = #name; \ | 171 | __attribute__((section("__tracepoints_strings"))) = #name; \ |
| @@ -156,18 +182,23 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
| 156 | EXPORT_SYMBOL(__tracepoint_##name) | 182 | EXPORT_SYMBOL(__tracepoint_##name) |
| 157 | 183 | ||
| 158 | #else /* !CONFIG_TRACEPOINTS */ | 184 | #else /* !CONFIG_TRACEPOINTS */ |
| 159 | #define DECLARE_TRACE(name, proto, args) \ | 185 | #define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \ |
| 160 | static inline void _do_trace_##name(struct tracepoint *tp, proto) \ | ||
| 161 | { } \ | ||
| 162 | static inline void trace_##name(proto) \ | 186 | static inline void trace_##name(proto) \ |
| 163 | { } \ | 187 | { } \ |
| 164 | static inline int register_trace_##name(void (*probe)(proto)) \ | 188 | static inline int \ |
| 189 | register_trace_##name(void (*probe)(data_proto), \ | ||
| 190 | void *data) \ | ||
| 165 | { \ | 191 | { \ |
| 166 | return -ENOSYS; \ | 192 | return -ENOSYS; \ |
| 167 | } \ | 193 | } \ |
| 168 | static inline int unregister_trace_##name(void (*probe)(proto)) \ | 194 | static inline int \ |
| 195 | unregister_trace_##name(void (*probe)(data_proto), \ | ||
| 196 | void *data) \ | ||
| 169 | { \ | 197 | { \ |
| 170 | return -ENOSYS; \ | 198 | return -ENOSYS; \ |
| 199 | } \ | ||
| 200 | static inline void check_trace_callback_type_##name(void (*cb)(data_proto)) \ | ||
| 201 | { \ | ||
| 171 | } | 202 | } |
| 172 | 203 | ||
| 173 | #define DEFINE_TRACE_FN(name, reg, unreg) | 204 | #define DEFINE_TRACE_FN(name, reg, unreg) |
| @@ -176,6 +207,29 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
| 176 | #define EXPORT_TRACEPOINT_SYMBOL(name) | 207 | #define EXPORT_TRACEPOINT_SYMBOL(name) |
| 177 | 208 | ||
| 178 | #endif /* CONFIG_TRACEPOINTS */ | 209 | #endif /* CONFIG_TRACEPOINTS */ |
| 210 | |||
| 211 | /* | ||
| 212 | * The need for the DECLARE_TRACE_NOARGS() is to handle the prototype | ||
| 213 | * (void). "void" is a special value in a function prototype and can | ||
| 214 | * not be combined with other arguments. Since the DECLARE_TRACE() | ||
| 215 | * macro adds a data element at the beginning of the prototype, | ||
| 216 | * we need a way to differentiate "(void *data, proto)" from | ||
| 217 | * "(void *data, void)". The second prototype is invalid. | ||
| 218 | * | ||
| 219 | * DECLARE_TRACE_NOARGS() passes "void" as the tracepoint prototype | ||
| 220 | * and "void *__data" as the callback prototype. | ||
| 221 | * | ||
| 222 | * DECLARE_TRACE() passes "proto" as the tracepoint protoype and | ||
| 223 | * "void *__data, proto" as the callback prototype. | ||
| 224 | */ | ||
| 225 | #define DECLARE_TRACE_NOARGS(name) \ | ||
| 226 | __DECLARE_TRACE(name, void, , void *__data, __data) | ||
| 227 | |||
| 228 | #define DECLARE_TRACE(name, proto, args) \ | ||
| 229 | __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \ | ||
| 230 | PARAMS(void *__data, proto), \ | ||
| 231 | PARAMS(__data, args)) | ||
| 232 | |||
| 179 | #endif /* DECLARE_TRACE */ | 233 | #endif /* DECLARE_TRACE */ |
| 180 | 234 | ||
| 181 | #ifndef TRACE_EVENT | 235 | #ifndef TRACE_EVENT |
diff --git a/include/linux/usb/audio-v2.h b/include/linux/usb/audio-v2.h index 2389f93a28b5..92f1d99f0f17 100644 --- a/include/linux/usb/audio-v2.h +++ b/include/linux/usb/audio-v2.h | |||
| @@ -105,6 +105,22 @@ struct uac_as_header_descriptor_v2 { | |||
| 105 | __u8 iChannelNames; | 105 | __u8 iChannelNames; |
| 106 | } __attribute__((packed)); | 106 | } __attribute__((packed)); |
| 107 | 107 | ||
| 108 | /* 4.10.1.2 Class-Specific AS Isochronous Audio Data Endpoint Descriptor */ | ||
| 109 | |||
| 110 | struct uac2_iso_endpoint_descriptor { | ||
| 111 | __u8 bLength; /* in bytes: 8 */ | ||
| 112 | __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ | ||
| 113 | __u8 bDescriptorSubtype; /* EP_GENERAL */ | ||
| 114 | __u8 bmAttributes; | ||
| 115 | __u8 bmControls; | ||
| 116 | __u8 bLockDelayUnits; | ||
| 117 | __le16 wLockDelay; | ||
| 118 | } __attribute__((packed)); | ||
| 119 | |||
| 120 | #define UAC2_CONTROL_PITCH (3 << 0) | ||
| 121 | #define UAC2_CONTROL_DATA_OVERRUN (3 << 2) | ||
| 122 | #define UAC2_CONTROL_DATA_UNDERRUN (3 << 4) | ||
| 123 | |||
| 108 | /* 6.1 Interrupt Data Message */ | 124 | /* 6.1 Interrupt Data Message */ |
| 109 | 125 | ||
| 110 | #define UAC2_INTERRUPT_DATA_MSG_VENDOR (1 << 0) | 126 | #define UAC2_INTERRUPT_DATA_MSG_VENDOR (1 << 0) |
diff --git a/include/linux/uuid.h b/include/linux/uuid.h new file mode 100644 index 000000000000..5b7efbfcee4e --- /dev/null +++ b/include/linux/uuid.h | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | /* | ||
| 2 | * UUID/GUID definition | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010, Intel Corp. | ||
| 5 | * Huang Ying <ying.huang@intel.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU General Public License version | ||
| 9 | * 2 as published by the Free Software Foundation; | ||
| 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 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef _LINUX_UUID_H_ | ||
| 22 | #define _LINUX_UUID_H_ | ||
| 23 | |||
| 24 | #include <linux/types.h> | ||
| 25 | #include <linux/string.h> | ||
| 26 | |||
| 27 | typedef struct { | ||
| 28 | __u8 b[16]; | ||
| 29 | } uuid_le; | ||
| 30 | |||
| 31 | typedef struct { | ||
| 32 | __u8 b[16]; | ||
| 33 | } uuid_be; | ||
| 34 | |||
| 35 | #define UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \ | ||
| 36 | ((uuid_le) \ | ||
| 37 | {{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \ | ||
| 38 | (b) & 0xff, ((b) >> 8) & 0xff, \ | ||
| 39 | (c) & 0xff, ((c) >> 8) & 0xff, \ | ||
| 40 | (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }}) | ||
| 41 | |||
| 42 | #define UUID_BE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \ | ||
| 43 | ((uuid_be) \ | ||
| 44 | {{ ((a) >> 24) & 0xff, ((a) >> 16) & 0xff, ((a) >> 8) & 0xff, (a) & 0xff, \ | ||
| 45 | ((b) >> 8) & 0xff, (b) & 0xff, \ | ||
| 46 | ((c) >> 8) & 0xff, (c) & 0xff, \ | ||
| 47 | (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }}) | ||
| 48 | |||
| 49 | #define NULL_UUID_LE \ | ||
| 50 | UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \ | ||
| 51 | 0x00, 0x00, 0x00, 0x00) | ||
| 52 | |||
| 53 | #define NULL_UUID_BE \ | ||
| 54 | UUID_BE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \ | ||
| 55 | 0x00, 0x00, 0x00, 0x00) | ||
| 56 | |||
| 57 | static inline int uuid_le_cmp(const uuid_le u1, const uuid_le u2) | ||
| 58 | { | ||
| 59 | return memcmp(&u1, &u2, sizeof(uuid_le)); | ||
| 60 | } | ||
| 61 | |||
| 62 | static inline int uuid_be_cmp(const uuid_be u1, const uuid_be u2) | ||
| 63 | { | ||
| 64 | return memcmp(&u1, &u2, sizeof(uuid_be)); | ||
| 65 | } | ||
| 66 | |||
| 67 | extern void uuid_le_gen(uuid_le *u); | ||
| 68 | extern void uuid_be_gen(uuid_be *u); | ||
| 69 | |||
| 70 | #endif | ||
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h index 6cf44866cecd..726cc3536409 100644 --- a/include/net/cls_cgroup.h +++ b/include/net/cls_cgroup.h | |||
| @@ -39,7 +39,7 @@ extern int net_cls_subsys_id; | |||
| 39 | static inline u32 task_cls_classid(struct task_struct *p) | 39 | static inline u32 task_cls_classid(struct task_struct *p) |
| 40 | { | 40 | { |
| 41 | int id; | 41 | int id; |
| 42 | u32 classid; | 42 | u32 classid = 0; |
| 43 | 43 | ||
| 44 | if (in_interrupt()) | 44 | if (in_interrupt()) |
| 45 | return 0; | 45 | return 0; |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 6173c619913a..4b860116e096 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
| @@ -876,7 +876,7 @@ struct sctp_transport { | |||
| 876 | 876 | ||
| 877 | /* Reference counting. */ | 877 | /* Reference counting. */ |
| 878 | atomic_t refcnt; | 878 | atomic_t refcnt; |
| 879 | int dead:1, | 879 | __u32 dead:1, |
| 880 | /* RTO-Pending : A flag used to track if one of the DATA | 880 | /* RTO-Pending : A flag used to track if one of the DATA |
| 881 | * chunks sent to this address is currently being | 881 | * chunks sent to this address is currently being |
| 882 | * used to compute a RTT. If this flag is 0, | 882 | * used to compute a RTT. If this flag is 0, |
diff --git a/include/net/sock.h b/include/net/sock.h index d2a71b04a5ae..ca241ea14875 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -1026,15 +1026,23 @@ extern void release_sock(struct sock *sk); | |||
| 1026 | SINGLE_DEPTH_NESTING) | 1026 | SINGLE_DEPTH_NESTING) |
| 1027 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) | 1027 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) |
| 1028 | 1028 | ||
| 1029 | static inline void lock_sock_bh(struct sock *sk) | 1029 | extern bool lock_sock_fast(struct sock *sk); |
| 1030 | /** | ||
| 1031 | * unlock_sock_fast - complement of lock_sock_fast | ||
| 1032 | * @sk: socket | ||
| 1033 | * @slow: slow mode | ||
| 1034 | * | ||
| 1035 | * fast unlock socket for user context. | ||
| 1036 | * If slow mode is on, we call regular release_sock() | ||
| 1037 | */ | ||
| 1038 | static inline void unlock_sock_fast(struct sock *sk, bool slow) | ||
| 1030 | { | 1039 | { |
| 1031 | spin_lock_bh(&sk->sk_lock.slock); | 1040 | if (slow) |
| 1041 | release_sock(sk); | ||
| 1042 | else | ||
| 1043 | spin_unlock_bh(&sk->sk_lock.slock); | ||
| 1032 | } | 1044 | } |
| 1033 | 1045 | ||
| 1034 | static inline void unlock_sock_bh(struct sock *sk) | ||
| 1035 | { | ||
| 1036 | spin_unlock_bh(&sk->sk_lock.slock); | ||
| 1037 | } | ||
| 1038 | 1046 | ||
| 1039 | extern struct sock *sk_alloc(struct net *net, int family, | 1047 | extern struct sock *sk_alloc(struct net *net, int family, |
| 1040 | gfp_t priority, | 1048 | gfp_t priority, |
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 5d60ad4ebf78..f5b1ba90e952 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
| @@ -606,9 +606,9 @@ TRACE_EVENT(ext4_free_blocks, | |||
| 606 | ); | 606 | ); |
| 607 | 607 | ||
| 608 | TRACE_EVENT(ext4_sync_file, | 608 | TRACE_EVENT(ext4_sync_file, |
| 609 | TP_PROTO(struct file *file, struct dentry *dentry, int datasync), | 609 | TP_PROTO(struct file *file, int datasync), |
| 610 | 610 | ||
| 611 | TP_ARGS(file, dentry, datasync), | 611 | TP_ARGS(file, datasync), |
| 612 | 612 | ||
| 613 | TP_STRUCT__entry( | 613 | TP_STRUCT__entry( |
| 614 | __field( dev_t, dev ) | 614 | __field( dev_t, dev ) |
| @@ -618,6 +618,8 @@ TRACE_EVENT(ext4_sync_file, | |||
| 618 | ), | 618 | ), |
| 619 | 619 | ||
| 620 | TP_fast_assign( | 620 | TP_fast_assign( |
| 621 | struct dentry *dentry = file->f_path.dentry; | ||
| 622 | |||
| 621 | __entry->dev = dentry->d_inode->i_sb->s_dev; | 623 | __entry->dev = dentry->d_inode->i_sb->s_dev; |
| 622 | __entry->ino = dentry->d_inode->i_ino; | 624 | __entry->ino = dentry->d_inode->i_ino; |
| 623 | __entry->datasync = datasync; | 625 | __entry->datasync = datasync; |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 88c59c13ea7b..3d685d1f2a03 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
| @@ -62,10 +62,13 @@ | |||
| 62 | struct trace_entry ent; \ | 62 | struct trace_entry ent; \ |
| 63 | tstruct \ | 63 | tstruct \ |
| 64 | char __data[0]; \ | 64 | char __data[0]; \ |
| 65 | }; | 65 | }; \ |
| 66 | \ | ||
| 67 | static struct ftrace_event_class event_class_##name; | ||
| 68 | |||
| 66 | #undef DEFINE_EVENT | 69 | #undef DEFINE_EVENT |
| 67 | #define DEFINE_EVENT(template, name, proto, args) \ | 70 | #define DEFINE_EVENT(template, name, proto, args) \ |
| 68 | static struct ftrace_event_call \ | 71 | static struct ftrace_event_call __used \ |
| 69 | __attribute__((__aligned__(4))) event_##name | 72 | __attribute__((__aligned__(4))) event_##name |
| 70 | 73 | ||
| 71 | #undef DEFINE_EVENT_PRINT | 74 | #undef DEFINE_EVENT_PRINT |
| @@ -147,7 +150,7 @@ | |||
| 147 | * | 150 | * |
| 148 | * entry = iter->ent; | 151 | * entry = iter->ent; |
| 149 | * | 152 | * |
| 150 | * if (entry->type != event_<call>.id) { | 153 | * if (entry->type != event_<call>->event.type) { |
| 151 | * WARN_ON_ONCE(1); | 154 | * WARN_ON_ONCE(1); |
| 152 | * return TRACE_TYPE_UNHANDLED; | 155 | * return TRACE_TYPE_UNHANDLED; |
| 153 | * } | 156 | * } |
| @@ -206,18 +209,22 @@ | |||
| 206 | #undef DECLARE_EVENT_CLASS | 209 | #undef DECLARE_EVENT_CLASS |
| 207 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 210 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
| 208 | static notrace enum print_line_t \ | 211 | static notrace enum print_line_t \ |
| 209 | ftrace_raw_output_id_##call(int event_id, const char *name, \ | 212 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ |
| 210 | struct trace_iterator *iter, int flags) \ | 213 | struct trace_event *trace_event) \ |
| 211 | { \ | 214 | { \ |
| 215 | struct ftrace_event_call *event; \ | ||
| 212 | struct trace_seq *s = &iter->seq; \ | 216 | struct trace_seq *s = &iter->seq; \ |
| 213 | struct ftrace_raw_##call *field; \ | 217 | struct ftrace_raw_##call *field; \ |
| 214 | struct trace_entry *entry; \ | 218 | struct trace_entry *entry; \ |
| 215 | struct trace_seq *p; \ | 219 | struct trace_seq *p; \ |
| 216 | int ret; \ | 220 | int ret; \ |
| 217 | \ | 221 | \ |
| 222 | event = container_of(trace_event, struct ftrace_event_call, \ | ||
| 223 | event); \ | ||
| 224 | \ | ||
| 218 | entry = iter->ent; \ | 225 | entry = iter->ent; \ |
| 219 | \ | 226 | \ |
| 220 | if (entry->type != event_id) { \ | 227 | if (entry->type != event->event.type) { \ |
| 221 | WARN_ON_ONCE(1); \ | 228 | WARN_ON_ONCE(1); \ |
| 222 | return TRACE_TYPE_UNHANDLED; \ | 229 | return TRACE_TYPE_UNHANDLED; \ |
| 223 | } \ | 230 | } \ |
| @@ -226,7 +233,7 @@ ftrace_raw_output_id_##call(int event_id, const char *name, \ | |||
| 226 | \ | 233 | \ |
| 227 | p = &get_cpu_var(ftrace_event_seq); \ | 234 | p = &get_cpu_var(ftrace_event_seq); \ |
| 228 | trace_seq_init(p); \ | 235 | trace_seq_init(p); \ |
| 229 | ret = trace_seq_printf(s, "%s: ", name); \ | 236 | ret = trace_seq_printf(s, "%s: ", event->name); \ |
| 230 | if (ret) \ | 237 | if (ret) \ |
| 231 | ret = trace_seq_printf(s, print); \ | 238 | ret = trace_seq_printf(s, print); \ |
| 232 | put_cpu(); \ | 239 | put_cpu(); \ |
| @@ -234,21 +241,16 @@ ftrace_raw_output_id_##call(int event_id, const char *name, \ | |||
| 234 | return TRACE_TYPE_PARTIAL_LINE; \ | 241 | return TRACE_TYPE_PARTIAL_LINE; \ |
| 235 | \ | 242 | \ |
| 236 | return TRACE_TYPE_HANDLED; \ | 243 | return TRACE_TYPE_HANDLED; \ |
| 237 | } | 244 | } \ |
| 238 | 245 | static struct trace_event_functions ftrace_event_type_funcs_##call = { \ | |
| 239 | #undef DEFINE_EVENT | 246 | .trace = ftrace_raw_output_##call, \ |
| 240 | #define DEFINE_EVENT(template, name, proto, args) \ | 247 | }; |
| 241 | static notrace enum print_line_t \ | ||
| 242 | ftrace_raw_output_##name(struct trace_iterator *iter, int flags) \ | ||
| 243 | { \ | ||
| 244 | return ftrace_raw_output_id_##template(event_##name.id, \ | ||
| 245 | #name, iter, flags); \ | ||
| 246 | } | ||
| 247 | 248 | ||
| 248 | #undef DEFINE_EVENT_PRINT | 249 | #undef DEFINE_EVENT_PRINT |
| 249 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ | 250 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ |
| 250 | static notrace enum print_line_t \ | 251 | static notrace enum print_line_t \ |
| 251 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | 252 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ |
| 253 | struct trace_event *event) \ | ||
| 252 | { \ | 254 | { \ |
| 253 | struct trace_seq *s = &iter->seq; \ | 255 | struct trace_seq *s = &iter->seq; \ |
| 254 | struct ftrace_raw_##template *field; \ | 256 | struct ftrace_raw_##template *field; \ |
| @@ -258,7 +260,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
| 258 | \ | 260 | \ |
| 259 | entry = iter->ent; \ | 261 | entry = iter->ent; \ |
| 260 | \ | 262 | \ |
| 261 | if (entry->type != event_##call.id) { \ | 263 | if (entry->type != event_##call.event.type) { \ |
| 262 | WARN_ON_ONCE(1); \ | 264 | WARN_ON_ONCE(1); \ |
| 263 | return TRACE_TYPE_UNHANDLED; \ | 265 | return TRACE_TYPE_UNHANDLED; \ |
| 264 | } \ | 266 | } \ |
| @@ -275,7 +277,10 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
| 275 | return TRACE_TYPE_PARTIAL_LINE; \ | 277 | return TRACE_TYPE_PARTIAL_LINE; \ |
| 276 | \ | 278 | \ |
| 277 | return TRACE_TYPE_HANDLED; \ | 279 | return TRACE_TYPE_HANDLED; \ |
| 278 | } | 280 | } \ |
| 281 | static struct trace_event_functions ftrace_event_type_funcs_##call = { \ | ||
| 282 | .trace = ftrace_raw_output_##call, \ | ||
| 283 | }; | ||
| 279 | 284 | ||
| 280 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 285 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 281 | 286 | ||
| @@ -381,80 +386,18 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
| 381 | 386 | ||
| 382 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 387 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 383 | 388 | ||
| 384 | #ifdef CONFIG_PERF_EVENTS | ||
| 385 | |||
| 386 | /* | ||
| 387 | * Generate the functions needed for tracepoint perf_event support. | ||
| 388 | * | ||
| 389 | * NOTE: The insertion profile callback (ftrace_profile_<call>) is defined later | ||
| 390 | * | ||
| 391 | * static int ftrace_profile_enable_<call>(void) | ||
| 392 | * { | ||
| 393 | * return register_trace_<call>(ftrace_profile_<call>); | ||
| 394 | * } | ||
| 395 | * | ||
| 396 | * static void ftrace_profile_disable_<call>(void) | ||
| 397 | * { | ||
| 398 | * unregister_trace_<call>(ftrace_profile_<call>); | ||
| 399 | * } | ||
| 400 | * | ||
| 401 | */ | ||
| 402 | |||
| 403 | #undef DECLARE_EVENT_CLASS | ||
| 404 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) | ||
| 405 | |||
| 406 | #undef DEFINE_EVENT | ||
| 407 | #define DEFINE_EVENT(template, name, proto, args) \ | ||
| 408 | \ | ||
| 409 | static void perf_trace_##name(proto); \ | ||
| 410 | \ | ||
| 411 | static notrace int \ | ||
| 412 | perf_trace_enable_##name(struct ftrace_event_call *unused) \ | ||
| 413 | { \ | ||
| 414 | return register_trace_##name(perf_trace_##name); \ | ||
| 415 | } \ | ||
| 416 | \ | ||
| 417 | static notrace void \ | ||
| 418 | perf_trace_disable_##name(struct ftrace_event_call *unused) \ | ||
| 419 | { \ | ||
| 420 | unregister_trace_##name(perf_trace_##name); \ | ||
| 421 | } | ||
| 422 | |||
| 423 | #undef DEFINE_EVENT_PRINT | ||
| 424 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | ||
| 425 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | ||
| 426 | |||
| 427 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
| 428 | |||
| 429 | #endif /* CONFIG_PERF_EVENTS */ | ||
| 430 | |||
| 431 | /* | 389 | /* |
| 432 | * Stage 4 of the trace events. | 390 | * Stage 4 of the trace events. |
| 433 | * | 391 | * |
| 434 | * Override the macros in <trace/trace_events.h> to include the following: | 392 | * Override the macros in <trace/trace_events.h> to include the following: |
| 435 | * | 393 | * |
| 436 | * static void ftrace_event_<call>(proto) | ||
| 437 | * { | ||
| 438 | * event_trace_printk(_RET_IP_, "<call>: " <fmt>); | ||
| 439 | * } | ||
| 440 | * | ||
| 441 | * static int ftrace_reg_event_<call>(struct ftrace_event_call *unused) | ||
| 442 | * { | ||
| 443 | * return register_trace_<call>(ftrace_event_<call>); | ||
| 444 | * } | ||
| 445 | * | ||
| 446 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) | ||
| 447 | * { | ||
| 448 | * unregister_trace_<call>(ftrace_event_<call>); | ||
| 449 | * } | ||
| 450 | * | ||
| 451 | * | ||
| 452 | * For those macros defined with TRACE_EVENT: | 394 | * For those macros defined with TRACE_EVENT: |
| 453 | * | 395 | * |
| 454 | * static struct ftrace_event_call event_<call>; | 396 | * static struct ftrace_event_call event_<call>; |
| 455 | * | 397 | * |
| 456 | * static void ftrace_raw_event_<call>(proto) | 398 | * static void ftrace_raw_event_<call>(void *__data, proto) |
| 457 | * { | 399 | * { |
| 400 | * struct ftrace_event_call *event_call = __data; | ||
| 458 | * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; | 401 | * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; |
| 459 | * struct ring_buffer_event *event; | 402 | * struct ring_buffer_event *event; |
| 460 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 | 403 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 |
| @@ -469,7 +412,7 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \ | |||
| 469 | * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args); | 412 | * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args); |
| 470 | * | 413 | * |
| 471 | * event = trace_current_buffer_lock_reserve(&buffer, | 414 | * event = trace_current_buffer_lock_reserve(&buffer, |
| 472 | * event_<call>.id, | 415 | * event_<call>->event.type, |
| 473 | * sizeof(*entry) + __data_size, | 416 | * sizeof(*entry) + __data_size, |
| 474 | * irq_flags, pc); | 417 | * irq_flags, pc); |
| 475 | * if (!event) | 418 | * if (!event) |
| @@ -484,43 +427,42 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \ | |||
| 484 | * event, irq_flags, pc); | 427 | * event, irq_flags, pc); |
| 485 | * } | 428 | * } |
| 486 | * | 429 | * |
| 487 | * static int ftrace_raw_reg_event_<call>(struct ftrace_event_call *unused) | ||
| 488 | * { | ||
| 489 | * return register_trace_<call>(ftrace_raw_event_<call>); | ||
| 490 | * } | ||
| 491 | * | ||
| 492 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) | ||
| 493 | * { | ||
| 494 | * unregister_trace_<call>(ftrace_raw_event_<call>); | ||
| 495 | * } | ||
| 496 | * | ||
| 497 | * static struct trace_event ftrace_event_type_<call> = { | 430 | * static struct trace_event ftrace_event_type_<call> = { |
| 498 | * .trace = ftrace_raw_output_<call>, <-- stage 2 | 431 | * .trace = ftrace_raw_output_<call>, <-- stage 2 |
| 499 | * }; | 432 | * }; |
| 500 | * | 433 | * |
| 501 | * static const char print_fmt_<call>[] = <TP_printk>; | 434 | * static const char print_fmt_<call>[] = <TP_printk>; |
| 502 | * | 435 | * |
| 436 | * static struct ftrace_event_class __used event_class_<template> = { | ||
| 437 | * .system = "<system>", | ||
| 438 | * .define_fields = ftrace_define_fields_<call>, | ||
| 439 | * .fields = LIST_HEAD_INIT(event_class_##call.fields), | ||
| 440 | * .raw_init = trace_event_raw_init, | ||
| 441 | * .probe = ftrace_raw_event_##call, | ||
| 442 | * }; | ||
| 443 | * | ||
| 503 | * static struct ftrace_event_call __used | 444 | * static struct ftrace_event_call __used |
| 504 | * __attribute__((__aligned__(4))) | 445 | * __attribute__((__aligned__(4))) |
| 505 | * __attribute__((section("_ftrace_events"))) event_<call> = { | 446 | * __attribute__((section("_ftrace_events"))) event_<call> = { |
| 506 | * .name = "<call>", | 447 | * .name = "<call>", |
| 507 | * .system = "<system>", | 448 | * .class = event_class_<template>, |
| 508 | * .raw_init = trace_event_raw_init, | 449 | * .event = &ftrace_event_type_<call>, |
| 509 | * .regfunc = ftrace_reg_event_<call>, | ||
| 510 | * .unregfunc = ftrace_unreg_event_<call>, | ||
| 511 | * .print_fmt = print_fmt_<call>, | 450 | * .print_fmt = print_fmt_<call>, |
| 512 | * .define_fields = ftrace_define_fields_<call>, | 451 | * }; |
| 513 | * } | ||
| 514 | * | 452 | * |
| 515 | */ | 453 | */ |
| 516 | 454 | ||
| 517 | #ifdef CONFIG_PERF_EVENTS | 455 | #ifdef CONFIG_PERF_EVENTS |
| 518 | 456 | ||
| 457 | #define _TRACE_PERF_PROTO(call, proto) \ | ||
| 458 | static notrace void \ | ||
| 459 | perf_trace_##call(void *__data, proto); | ||
| 460 | |||
| 519 | #define _TRACE_PERF_INIT(call) \ | 461 | #define _TRACE_PERF_INIT(call) \ |
| 520 | .perf_event_enable = perf_trace_enable_##call, \ | 462 | .perf_probe = perf_trace_##call, |
| 521 | .perf_event_disable = perf_trace_disable_##call, | ||
| 522 | 463 | ||
| 523 | #else | 464 | #else |
| 465 | #define _TRACE_PERF_PROTO(call, proto) | ||
| 524 | #define _TRACE_PERF_INIT(call) | 466 | #define _TRACE_PERF_INIT(call) |
| 525 | #endif /* CONFIG_PERF_EVENTS */ | 467 | #endif /* CONFIG_PERF_EVENTS */ |
| 526 | 468 | ||
| @@ -554,9 +496,9 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \ | |||
| 554 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 496 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
| 555 | \ | 497 | \ |
| 556 | static notrace void \ | 498 | static notrace void \ |
| 557 | ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \ | 499 | ftrace_raw_event_##call(void *__data, proto) \ |
| 558 | proto) \ | ||
| 559 | { \ | 500 | { \ |
| 501 | struct ftrace_event_call *event_call = __data; \ | ||
| 560 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | 502 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
| 561 | struct ring_buffer_event *event; \ | 503 | struct ring_buffer_event *event; \ |
| 562 | struct ftrace_raw_##call *entry; \ | 504 | struct ftrace_raw_##call *entry; \ |
| @@ -571,7 +513,7 @@ ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \ | |||
| 571 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ | 513 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ |
| 572 | \ | 514 | \ |
| 573 | event = trace_current_buffer_lock_reserve(&buffer, \ | 515 | event = trace_current_buffer_lock_reserve(&buffer, \ |
| 574 | event_call->id, \ | 516 | event_call->event.type, \ |
| 575 | sizeof(*entry) + __data_size, \ | 517 | sizeof(*entry) + __data_size, \ |
| 576 | irq_flags, pc); \ | 518 | irq_flags, pc); \ |
| 577 | if (!event) \ | 519 | if (!event) \ |
| @@ -586,34 +528,21 @@ ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \ | |||
| 586 | trace_nowake_buffer_unlock_commit(buffer, \ | 528 | trace_nowake_buffer_unlock_commit(buffer, \ |
| 587 | event, irq_flags, pc); \ | 529 | event, irq_flags, pc); \ |
| 588 | } | 530 | } |
| 531 | /* | ||
| 532 | * The ftrace_test_probe is compiled out, it is only here as a build time check | ||
| 533 | * to make sure that if the tracepoint handling changes, the ftrace probe will | ||
| 534 | * fail to compile unless it too is updated. | ||
| 535 | */ | ||
| 589 | 536 | ||
| 590 | #undef DEFINE_EVENT | 537 | #undef DEFINE_EVENT |
| 591 | #define DEFINE_EVENT(template, call, proto, args) \ | 538 | #define DEFINE_EVENT(template, call, proto, args) \ |
| 592 | \ | 539 | static inline void ftrace_test_probe_##call(void) \ |
| 593 | static notrace void ftrace_raw_event_##call(proto) \ | ||
| 594 | { \ | ||
| 595 | ftrace_raw_event_id_##template(&event_##call, args); \ | ||
| 596 | } \ | ||
| 597 | \ | ||
| 598 | static notrace int \ | ||
| 599 | ftrace_raw_reg_event_##call(struct ftrace_event_call *unused) \ | ||
| 600 | { \ | 540 | { \ |
| 601 | return register_trace_##call(ftrace_raw_event_##call); \ | 541 | check_trace_callback_type_##call(ftrace_raw_event_##template); \ |
| 602 | } \ | 542 | } |
| 603 | \ | ||
| 604 | static notrace void \ | ||
| 605 | ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused) \ | ||
| 606 | { \ | ||
| 607 | unregister_trace_##call(ftrace_raw_event_##call); \ | ||
| 608 | } \ | ||
| 609 | \ | ||
| 610 | static struct trace_event ftrace_event_type_##call = { \ | ||
| 611 | .trace = ftrace_raw_output_##call, \ | ||
| 612 | }; | ||
| 613 | 543 | ||
| 614 | #undef DEFINE_EVENT_PRINT | 544 | #undef DEFINE_EVENT_PRINT |
| 615 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 545 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) |
| 616 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | ||
| 617 | 546 | ||
| 618 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 547 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 619 | 548 | ||
| @@ -630,7 +559,16 @@ static struct trace_event ftrace_event_type_##call = { \ | |||
| 630 | 559 | ||
| 631 | #undef DECLARE_EVENT_CLASS | 560 | #undef DECLARE_EVENT_CLASS |
| 632 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 561 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
| 633 | static const char print_fmt_##call[] = print; | 562 | _TRACE_PERF_PROTO(call, PARAMS(proto)); \ |
| 563 | static const char print_fmt_##call[] = print; \ | ||
| 564 | static struct ftrace_event_class __used event_class_##call = { \ | ||
| 565 | .system = __stringify(TRACE_SYSTEM), \ | ||
| 566 | .define_fields = ftrace_define_fields_##call, \ | ||
| 567 | .fields = LIST_HEAD_INIT(event_class_##call.fields),\ | ||
| 568 | .raw_init = trace_event_raw_init, \ | ||
| 569 | .probe = ftrace_raw_event_##call, \ | ||
| 570 | _TRACE_PERF_INIT(call) \ | ||
| 571 | }; | ||
| 634 | 572 | ||
| 635 | #undef DEFINE_EVENT | 573 | #undef DEFINE_EVENT |
| 636 | #define DEFINE_EVENT(template, call, proto, args) \ | 574 | #define DEFINE_EVENT(template, call, proto, args) \ |
| @@ -639,15 +577,10 @@ static struct ftrace_event_call __used \ | |||
| 639 | __attribute__((__aligned__(4))) \ | 577 | __attribute__((__aligned__(4))) \ |
| 640 | __attribute__((section("_ftrace_events"))) event_##call = { \ | 578 | __attribute__((section("_ftrace_events"))) event_##call = { \ |
| 641 | .name = #call, \ | 579 | .name = #call, \ |
| 642 | .system = __stringify(TRACE_SYSTEM), \ | 580 | .class = &event_class_##template, \ |
| 643 | .event = &ftrace_event_type_##call, \ | 581 | .event.funcs = &ftrace_event_type_funcs_##template, \ |
| 644 | .raw_init = trace_event_raw_init, \ | ||
| 645 | .regfunc = ftrace_raw_reg_event_##call, \ | ||
| 646 | .unregfunc = ftrace_raw_unreg_event_##call, \ | ||
| 647 | .print_fmt = print_fmt_##template, \ | 582 | .print_fmt = print_fmt_##template, \ |
| 648 | .define_fields = ftrace_define_fields_##template, \ | 583 | }; |
| 649 | _TRACE_PERF_INIT(call) \ | ||
| 650 | } | ||
| 651 | 584 | ||
| 652 | #undef DEFINE_EVENT_PRINT | 585 | #undef DEFINE_EVENT_PRINT |
| 653 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ | 586 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ |
| @@ -658,14 +591,9 @@ static struct ftrace_event_call __used \ | |||
| 658 | __attribute__((__aligned__(4))) \ | 591 | __attribute__((__aligned__(4))) \ |
| 659 | __attribute__((section("_ftrace_events"))) event_##call = { \ | 592 | __attribute__((section("_ftrace_events"))) event_##call = { \ |
| 660 | .name = #call, \ | 593 | .name = #call, \ |
| 661 | .system = __stringify(TRACE_SYSTEM), \ | 594 | .class = &event_class_##template, \ |
| 662 | .event = &ftrace_event_type_##call, \ | 595 | .event.funcs = &ftrace_event_type_funcs_##call, \ |
| 663 | .raw_init = trace_event_raw_init, \ | ||
| 664 | .regfunc = ftrace_raw_reg_event_##call, \ | ||
| 665 | .unregfunc = ftrace_raw_unreg_event_##call, \ | ||
| 666 | .print_fmt = print_fmt_##call, \ | 596 | .print_fmt = print_fmt_##call, \ |
| 667 | .define_fields = ftrace_define_fields_##template, \ | ||
| 668 | _TRACE_PERF_INIT(call) \ | ||
| 669 | } | 597 | } |
| 670 | 598 | ||
| 671 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 599 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| @@ -765,17 +693,20 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
| 765 | #undef DECLARE_EVENT_CLASS | 693 | #undef DECLARE_EVENT_CLASS |
| 766 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 694 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
| 767 | static notrace void \ | 695 | static notrace void \ |
| 768 | perf_trace_templ_##call(struct ftrace_event_call *event_call, \ | 696 | perf_trace_##call(void *__data, proto) \ |
| 769 | struct pt_regs *__regs, proto) \ | ||
| 770 | { \ | 697 | { \ |
| 698 | struct ftrace_event_call *event_call = __data; \ | ||
| 771 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | 699 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
| 772 | struct ftrace_raw_##call *entry; \ | 700 | struct ftrace_raw_##call *entry; \ |
| 701 | struct pt_regs __regs; \ | ||
| 773 | u64 __addr = 0, __count = 1; \ | 702 | u64 __addr = 0, __count = 1; \ |
| 774 | unsigned long irq_flags; \ | 703 | struct hlist_head *head; \ |
| 775 | int __entry_size; \ | 704 | int __entry_size; \ |
| 776 | int __data_size; \ | 705 | int __data_size; \ |
| 777 | int rctx; \ | 706 | int rctx; \ |
| 778 | \ | 707 | \ |
| 708 | perf_fetch_caller_regs(&__regs, 1); \ | ||
| 709 | \ | ||
| 779 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ | 710 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ |
| 780 | __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ | 711 | __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ |
| 781 | sizeof(u64)); \ | 712 | sizeof(u64)); \ |
| @@ -784,32 +715,34 @@ perf_trace_templ_##call(struct ftrace_event_call *event_call, \ | |||
| 784 | if (WARN_ONCE(__entry_size > PERF_MAX_TRACE_SIZE, \ | 715 | if (WARN_ONCE(__entry_size > PERF_MAX_TRACE_SIZE, \ |
| 785 | "profile buffer not large enough")) \ | 716 | "profile buffer not large enough")) \ |
| 786 | return; \ | 717 | return; \ |
| 718 | \ | ||
| 787 | entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \ | 719 | entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \ |
| 788 | __entry_size, event_call->id, &rctx, &irq_flags); \ | 720 | __entry_size, event_call->event.type, &__regs, &rctx); \ |
| 789 | if (!entry) \ | 721 | if (!entry) \ |
| 790 | return; \ | 722 | return; \ |
| 723 | \ | ||
| 791 | tstruct \ | 724 | tstruct \ |
| 792 | \ | 725 | \ |
| 793 | { assign; } \ | 726 | { assign; } \ |
| 794 | \ | 727 | \ |
| 728 | head = per_cpu_ptr(event_call->perf_events, smp_processor_id());\ | ||
| 795 | perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ | 729 | perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ |
| 796 | __count, irq_flags, __regs); \ | 730 | __count, &__regs, head); \ |
| 797 | } | 731 | } |
| 798 | 732 | ||
| 733 | /* | ||
| 734 | * This part is compiled out, it is only here as a build time check | ||
| 735 | * to make sure that if the tracepoint handling changes, the | ||
| 736 | * perf probe will fail to compile unless it too is updated. | ||
| 737 | */ | ||
| 799 | #undef DEFINE_EVENT | 738 | #undef DEFINE_EVENT |
| 800 | #define DEFINE_EVENT(template, call, proto, args) \ | 739 | #define DEFINE_EVENT(template, call, proto, args) \ |
| 801 | static notrace void perf_trace_##call(proto) \ | 740 | static inline void perf_test_probe_##call(void) \ |
| 802 | { \ | 741 | { \ |
| 803 | struct ftrace_event_call *event_call = &event_##call; \ | 742 | check_trace_callback_type_##call(perf_trace_##template); \ |
| 804 | struct pt_regs *__regs = &get_cpu_var(perf_trace_regs); \ | ||
| 805 | \ | ||
| 806 | perf_fetch_caller_regs(__regs, 1); \ | ||
| 807 | \ | ||
| 808 | perf_trace_templ_##template(event_call, __regs, args); \ | ||
| 809 | \ | ||
| 810 | put_cpu_var(perf_trace_regs); \ | ||
| 811 | } | 743 | } |
| 812 | 744 | ||
| 745 | |||
| 813 | #undef DEFINE_EVENT_PRINT | 746 | #undef DEFINE_EVENT_PRINT |
| 814 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 747 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
| 815 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | 748 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) |
diff --git a/include/trace/syscall.h b/include/trace/syscall.h index e5e5f48dbfb3..257e08960d7b 100644 --- a/include/trace/syscall.h +++ b/include/trace/syscall.h | |||
| @@ -25,6 +25,8 @@ struct syscall_metadata { | |||
| 25 | int nb_args; | 25 | int nb_args; |
| 26 | const char **types; | 26 | const char **types; |
| 27 | const char **args; | 27 | const char **args; |
| 28 | struct list_head enter_fields; | ||
| 29 | struct list_head exit_fields; | ||
| 28 | 30 | ||
| 29 | struct ftrace_event_call *enter_event; | 31 | struct ftrace_event_call *enter_event; |
| 30 | struct ftrace_event_call *exit_event; | 32 | struct ftrace_event_call *exit_event; |
| @@ -34,16 +36,16 @@ struct syscall_metadata { | |||
| 34 | extern unsigned long arch_syscall_addr(int nr); | 36 | extern unsigned long arch_syscall_addr(int nr); |
| 35 | extern int init_syscall_trace(struct ftrace_event_call *call); | 37 | extern int init_syscall_trace(struct ftrace_event_call *call); |
| 36 | 38 | ||
| 37 | extern int syscall_enter_define_fields(struct ftrace_event_call *call); | ||
| 38 | extern int syscall_exit_define_fields(struct ftrace_event_call *call); | ||
| 39 | extern int reg_event_syscall_enter(struct ftrace_event_call *call); | 39 | extern int reg_event_syscall_enter(struct ftrace_event_call *call); |
| 40 | extern void unreg_event_syscall_enter(struct ftrace_event_call *call); | 40 | extern void unreg_event_syscall_enter(struct ftrace_event_call *call); |
| 41 | extern int reg_event_syscall_exit(struct ftrace_event_call *call); | 41 | extern int reg_event_syscall_exit(struct ftrace_event_call *call); |
| 42 | extern void unreg_event_syscall_exit(struct ftrace_event_call *call); | 42 | extern void unreg_event_syscall_exit(struct ftrace_event_call *call); |
| 43 | extern int | 43 | extern int |
| 44 | ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s); | 44 | ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s); |
| 45 | enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags); | 45 | enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags, |
| 46 | enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags); | 46 | struct trace_event *event); |
| 47 | enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags, | ||
| 48 | struct trace_event *event); | ||
| 47 | #endif | 49 | #endif |
| 48 | 50 | ||
| 49 | #ifdef CONFIG_PERF_EVENTS | 51 | #ifdef CONFIG_PERF_EVENTS |
