diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/dcache.h | 1 | ||||
| -rw-r--r-- | include/linux/digsig.h | 64 | ||||
| -rw-r--r-- | include/linux/efi.h | 136 | ||||
| -rw-r--r-- | include/linux/kernel.h | 1 | ||||
| -rw-r--r-- | include/linux/key-type.h | 1 | ||||
| -rwxr-xr-x | include/linux/lp8727.h | 51 | ||||
| -rw-r--r-- | include/linux/mfd/max8925.h | 7 | ||||
| -rw-r--r-- | include/linux/mm.h | 10 | ||||
| -rw-r--r-- | include/linux/mpi.h | 146 | ||||
| -rw-r--r-- | include/linux/pci.h | 50 | ||||
| -rw-r--r-- | include/linux/pci_ids.h | 23 | ||||
| -rw-r--r-- | include/linux/pci_regs.h | 2 | ||||
| -rw-r--r-- | include/linux/pda_power.h | 2 | ||||
| -rw-r--r-- | include/linux/power/charger-manager.h | 147 | ||||
| -rw-r--r-- | include/linux/power/sbs-battery.h (renamed from include/linux/power/bq20z75.h) | 10 | ||||
| -rw-r--r-- | include/linux/power_supply.h | 11 | ||||
| -rw-r--r-- | include/linux/s3c_adc_battery.h | 4 | ||||
| -rw-r--r-- | include/linux/security.h | 4 |
18 files changed, 628 insertions, 42 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index a47bda5f76db..31f73220e7d7 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -203,6 +203,7 @@ struct dentry_operations { | |||
| 203 | 203 | ||
| 204 | #define DCACHE_CANT_MOUNT 0x0100 | 204 | #define DCACHE_CANT_MOUNT 0x0100 |
| 205 | #define DCACHE_GENOCIDE 0x0200 | 205 | #define DCACHE_GENOCIDE 0x0200 |
| 206 | #define DCACHE_SHRINK_LIST 0x0400 | ||
| 206 | 207 | ||
| 207 | #define DCACHE_NFSFS_RENAMED 0x1000 | 208 | #define DCACHE_NFSFS_RENAMED 0x1000 |
| 208 | /* this dentry has been "silly renamed" and has to be deleted on the last | 209 | /* this dentry has been "silly renamed" and has to be deleted on the last |
diff --git a/include/linux/digsig.h b/include/linux/digsig.h new file mode 100644 index 000000000000..efae755017d7 --- /dev/null +++ b/include/linux/digsig.h | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2011 Nokia Corporation | ||
| 3 | * Copyright (C) 2011 Intel Corporation | ||
| 4 | * | ||
| 5 | * Author: | ||
| 6 | * Dmitry Kasatkin <dmitry.kasatkin@nokia.com> | ||
| 7 | * <dmitry.kasatkin@intel.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation, version 2 of the License. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _DIGSIG_H | ||
| 16 | #define _DIGSIG_H | ||
| 17 | |||
| 18 | #include <linux/key.h> | ||
| 19 | |||
| 20 | enum pubkey_algo { | ||
| 21 | PUBKEY_ALGO_RSA, | ||
| 22 | PUBKEY_ALGO_MAX, | ||
| 23 | }; | ||
| 24 | |||
| 25 | enum digest_algo { | ||
| 26 | DIGEST_ALGO_SHA1, | ||
| 27 | DIGEST_ALGO_SHA256, | ||
| 28 | DIGEST_ALGO_MAX | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct pubkey_hdr { | ||
| 32 | uint8_t version; /* key format version */ | ||
| 33 | time_t timestamp; /* key made, always 0 for now */ | ||
| 34 | uint8_t algo; | ||
| 35 | uint8_t nmpi; | ||
| 36 | char mpi[0]; | ||
| 37 | } __packed; | ||
| 38 | |||
| 39 | struct signature_hdr { | ||
| 40 | uint8_t version; /* signature format version */ | ||
| 41 | time_t timestamp; /* signature made */ | ||
| 42 | uint8_t algo; | ||
| 43 | uint8_t hash; | ||
| 44 | uint8_t keyid[8]; | ||
| 45 | uint8_t nmpi; | ||
| 46 | char mpi[0]; | ||
| 47 | } __packed; | ||
| 48 | |||
| 49 | #if defined(CONFIG_DIGSIG) || defined(CONFIG_DIGSIG_MODULE) | ||
| 50 | |||
| 51 | int digsig_verify(struct key *keyring, const char *sig, int siglen, | ||
| 52 | const char *digest, int digestlen); | ||
| 53 | |||
| 54 | #else | ||
| 55 | |||
| 56 | static inline int digsig_verify(struct key *keyring, const char *sig, | ||
| 57 | int siglen, const char *digest, int digestlen) | ||
| 58 | { | ||
| 59 | return -EOPNOTSUPP; | ||
| 60 | } | ||
| 61 | |||
| 62 | #endif /* CONFIG_DIGSIG */ | ||
| 63 | |||
| 64 | #endif /* _DIGSIG_H */ | ||
diff --git a/include/linux/efi.h b/include/linux/efi.h index 2362a0bc7f0d..37c300712e02 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
| @@ -109,6 +109,14 @@ typedef struct { | |||
| 109 | u32 imagesize; | 109 | u32 imagesize; |
| 110 | } efi_capsule_header_t; | 110 | } efi_capsule_header_t; |
| 111 | 111 | ||
| 112 | /* | ||
| 113 | * Allocation types for calls to boottime->allocate_pages. | ||
| 114 | */ | ||
| 115 | #define EFI_ALLOCATE_ANY_PAGES 0 | ||
| 116 | #define EFI_ALLOCATE_MAX_ADDRESS 1 | ||
| 117 | #define EFI_ALLOCATE_ADDRESS 2 | ||
| 118 | #define EFI_MAX_ALLOCATE_TYPE 3 | ||
| 119 | |||
| 112 | typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg); | 120 | typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg); |
| 113 | 121 | ||
| 114 | /* | 122 | /* |
| @@ -139,6 +147,57 @@ typedef struct { | |||
| 139 | } efi_time_cap_t; | 147 | } efi_time_cap_t; |
| 140 | 148 | ||
| 141 | /* | 149 | /* |
| 150 | * EFI Boot Services table | ||
| 151 | */ | ||
| 152 | typedef struct { | ||
| 153 | efi_table_hdr_t hdr; | ||
| 154 | void *raise_tpl; | ||
| 155 | void *restore_tpl; | ||
| 156 | void *allocate_pages; | ||
| 157 | void *free_pages; | ||
| 158 | void *get_memory_map; | ||
| 159 | void *allocate_pool; | ||
| 160 | void *free_pool; | ||
| 161 | void *create_event; | ||
| 162 | void *set_timer; | ||
| 163 | void *wait_for_event; | ||
| 164 | void *signal_event; | ||
| 165 | void *close_event; | ||
| 166 | void *check_event; | ||
| 167 | void *install_protocol_interface; | ||
| 168 | void *reinstall_protocol_interface; | ||
| 169 | void *uninstall_protocol_interface; | ||
| 170 | void *handle_protocol; | ||
| 171 | void *__reserved; | ||
| 172 | void *register_protocol_notify; | ||
| 173 | void *locate_handle; | ||
| 174 | void *locate_device_path; | ||
| 175 | void *install_configuration_table; | ||
| 176 | void *load_image; | ||
| 177 | void *start_image; | ||
| 178 | void *exit; | ||
| 179 | void *unload_image; | ||
| 180 | void *exit_boot_services; | ||
| 181 | void *get_next_monotonic_count; | ||
| 182 | void *stall; | ||
| 183 | void *set_watchdog_timer; | ||
| 184 | void *connect_controller; | ||
| 185 | void *disconnect_controller; | ||
| 186 | void *open_protocol; | ||
| 187 | void *close_protocol; | ||
| 188 | void *open_protocol_information; | ||
| 189 | void *protocols_per_handle; | ||
| 190 | void *locate_handle_buffer; | ||
| 191 | void *locate_protocol; | ||
| 192 | void *install_multiple_protocol_interfaces; | ||
| 193 | void *uninstall_multiple_protocol_interfaces; | ||
| 194 | void *calculate_crc32; | ||
| 195 | void *copy_mem; | ||
| 196 | void *set_mem; | ||
| 197 | void *create_event_ex; | ||
| 198 | } efi_boot_services_t; | ||
| 199 | |||
| 200 | /* | ||
| 142 | * Types and defines for EFI ResetSystem | 201 | * Types and defines for EFI ResetSystem |
| 143 | */ | 202 | */ |
| 144 | #define EFI_RESET_COLD 0 | 203 | #define EFI_RESET_COLD 0 |
| @@ -236,6 +295,24 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules, | |||
| 236 | #define LINUX_EFI_CRASH_GUID \ | 295 | #define LINUX_EFI_CRASH_GUID \ |
| 237 | EFI_GUID( 0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0 ) | 296 | EFI_GUID( 0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0 ) |
| 238 | 297 | ||
| 298 | #define LOADED_IMAGE_PROTOCOL_GUID \ | ||
| 299 | EFI_GUID( 0x5b1b31a1, 0x9562, 0x11d2, 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b ) | ||
| 300 | |||
| 301 | #define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ | ||
| 302 | EFI_GUID( 0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a ) | ||
| 303 | |||
| 304 | #define EFI_UGA_PROTOCOL_GUID \ | ||
| 305 | EFI_GUID( 0x982c298b, 0xf4fa, 0x41cb, 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 ) | ||
| 306 | |||
| 307 | #define EFI_PCI_IO_PROTOCOL_GUID \ | ||
| 308 | EFI_GUID( 0x4cf5b200, 0x68b8, 0x4ca5, 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a ) | ||
| 309 | |||
| 310 | #define EFI_FILE_INFO_ID \ | ||
| 311 | EFI_GUID( 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b ) | ||
| 312 | |||
| 313 | #define EFI_FILE_SYSTEM_GUID \ | ||
| 314 | EFI_GUID( 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b ) | ||
| 315 | |||
| 239 | typedef struct { | 316 | typedef struct { |
| 240 | efi_guid_t guid; | 317 | efi_guid_t guid; |
| 241 | unsigned long table; | 318 | unsigned long table; |
| @@ -261,7 +338,7 @@ typedef struct { | |||
| 261 | unsigned long stderr_handle; | 338 | unsigned long stderr_handle; |
| 262 | unsigned long stderr; | 339 | unsigned long stderr; |
| 263 | efi_runtime_services_t *runtime; | 340 | efi_runtime_services_t *runtime; |
| 264 | unsigned long boottime; | 341 | efi_boot_services_t *boottime; |
| 265 | unsigned long nr_tables; | 342 | unsigned long nr_tables; |
| 266 | unsigned long tables; | 343 | unsigned long tables; |
| 267 | } efi_system_table_t; | 344 | } efi_system_table_t; |
| @@ -275,6 +352,56 @@ struct efi_memory_map { | |||
| 275 | unsigned long desc_size; | 352 | unsigned long desc_size; |
| 276 | }; | 353 | }; |
| 277 | 354 | ||
| 355 | typedef struct { | ||
| 356 | u32 revision; | ||
| 357 | void *parent_handle; | ||
| 358 | efi_system_table_t *system_table; | ||
| 359 | void *device_handle; | ||
| 360 | void *file_path; | ||
| 361 | void *reserved; | ||
| 362 | u32 load_options_size; | ||
| 363 | void *load_options; | ||
| 364 | void *image_base; | ||
| 365 | __aligned_u64 image_size; | ||
| 366 | unsigned int image_code_type; | ||
| 367 | unsigned int image_data_type; | ||
| 368 | unsigned long unload; | ||
| 369 | } efi_loaded_image_t; | ||
| 370 | |||
| 371 | typedef struct { | ||
| 372 | u64 revision; | ||
| 373 | void *open_volume; | ||
| 374 | } efi_file_io_interface_t; | ||
| 375 | |||
| 376 | typedef struct { | ||
| 377 | u64 size; | ||
| 378 | u64 file_size; | ||
| 379 | u64 phys_size; | ||
| 380 | efi_time_t create_time; | ||
| 381 | efi_time_t last_access_time; | ||
| 382 | efi_time_t modification_time; | ||
| 383 | __aligned_u64 attribute; | ||
| 384 | efi_char16_t filename[1]; | ||
| 385 | } efi_file_info_t; | ||
| 386 | |||
| 387 | typedef struct { | ||
| 388 | u64 revision; | ||
| 389 | void *open; | ||
| 390 | void *close; | ||
| 391 | void *delete; | ||
| 392 | void *read; | ||
| 393 | void *write; | ||
| 394 | void *get_position; | ||
| 395 | void *set_position; | ||
| 396 | void *get_info; | ||
| 397 | void *set_info; | ||
| 398 | void *flush; | ||
| 399 | } efi_file_handle_t; | ||
| 400 | |||
| 401 | #define EFI_FILE_MODE_READ 0x0000000000000001 | ||
| 402 | #define EFI_FILE_MODE_WRITE 0x0000000000000002 | ||
| 403 | #define EFI_FILE_MODE_CREATE 0x8000000000000000 | ||
| 404 | |||
| 278 | #define EFI_INVALID_TABLE_ADDR (~0UL) | 405 | #define EFI_INVALID_TABLE_ADDR (~0UL) |
| 279 | 406 | ||
| 280 | /* | 407 | /* |
| @@ -385,6 +512,13 @@ extern int __init efi_setup_pcdp_console(char *); | |||
| 385 | #define EFI_VARIABLE_RUNTIME_ACCESS 0x0000000000000004 | 512 | #define EFI_VARIABLE_RUNTIME_ACCESS 0x0000000000000004 |
| 386 | 513 | ||
| 387 | /* | 514 | /* |
| 515 | * The type of search to perform when calling boottime->locate_handle | ||
| 516 | */ | ||
| 517 | #define EFI_LOCATE_ALL_HANDLES 0 | ||
| 518 | #define EFI_LOCATE_BY_REGISTER_NOTIFY 1 | ||
| 519 | #define EFI_LOCATE_BY_PROTOCOL 2 | ||
| 520 | |||
| 521 | /* | ||
| 388 | * EFI Device Path information | 522 | * EFI Device Path information |
| 389 | */ | 523 | */ |
| 390 | #define EFI_DEV_HW 0x01 | 524 | #define EFI_DEV_HW 0x01 |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f48e8a528544..d0a7a0c71661 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -341,6 +341,7 @@ extern int panic_timeout; | |||
| 341 | extern int panic_on_oops; | 341 | extern int panic_on_oops; |
| 342 | extern int panic_on_unrecovered_nmi; | 342 | extern int panic_on_unrecovered_nmi; |
| 343 | extern int panic_on_io_nmi; | 343 | extern int panic_on_io_nmi; |
| 344 | extern int sysctl_panic_on_stackoverflow; | ||
| 344 | extern const char *print_tainted(void); | 345 | extern const char *print_tainted(void); |
| 345 | extern void add_taint(unsigned flag); | 346 | extern void add_taint(unsigned flag); |
| 346 | extern int test_taint(unsigned flag); | 347 | extern int test_taint(unsigned flag); |
diff --git a/include/linux/key-type.h b/include/linux/key-type.h index 9efd081bb31e..39e3c082c49d 100644 --- a/include/linux/key-type.h +++ b/include/linux/key-type.h | |||
| @@ -92,6 +92,7 @@ struct key_type { | |||
| 92 | 92 | ||
| 93 | /* internal fields */ | 93 | /* internal fields */ |
| 94 | struct list_head link; /* link in types list */ | 94 | struct list_head link; /* link in types list */ |
| 95 | struct lock_class_key lock_class; /* key->sem lock class */ | ||
| 95 | }; | 96 | }; |
| 96 | 97 | ||
| 97 | extern struct key_type key_type_keyring; | 98 | extern struct key_type key_type_keyring; |
diff --git a/include/linux/lp8727.h b/include/linux/lp8727.h new file mode 100755 index 000000000000..d21fa2865bf4 --- /dev/null +++ b/include/linux/lp8727.h | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2011 National Semiconductor | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 as | ||
| 6 | * published by the Free Software Foundation. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _LP8727_H | ||
| 10 | #define _LP8727_H | ||
| 11 | |||
| 12 | enum lp8727_eoc_level { | ||
| 13 | EOC_5P, | ||
| 14 | EOC_10P, | ||
| 15 | EOC_16P, | ||
| 16 | EOC_20P, | ||
| 17 | EOC_25P, | ||
| 18 | EOC_33P, | ||
| 19 | EOC_50P, | ||
| 20 | }; | ||
| 21 | |||
| 22 | enum lp8727_ichg { | ||
| 23 | ICHG_90mA, | ||
| 24 | ICHG_100mA, | ||
| 25 | ICHG_400mA, | ||
| 26 | ICHG_450mA, | ||
| 27 | ICHG_500mA, | ||
| 28 | ICHG_600mA, | ||
| 29 | ICHG_700mA, | ||
| 30 | ICHG_800mA, | ||
| 31 | ICHG_900mA, | ||
| 32 | ICHG_1000mA, | ||
| 33 | }; | ||
| 34 | |||
| 35 | struct lp8727_chg_param { | ||
| 36 | /* end of charge level setting */ | ||
| 37 | enum lp8727_eoc_level eoc_level; | ||
| 38 | /* charging current */ | ||
| 39 | enum lp8727_ichg ichg; | ||
| 40 | }; | ||
| 41 | |||
| 42 | struct lp8727_platform_data { | ||
| 43 | u8 (*get_batt_present)(void); | ||
| 44 | u16 (*get_batt_level)(void); | ||
| 45 | u8 (*get_batt_capacity)(void); | ||
| 46 | u8 (*get_batt_temp)(void); | ||
| 47 | struct lp8727_chg_param ac; | ||
| 48 | struct lp8727_chg_param usb; | ||
| 49 | }; | ||
| 50 | |||
| 51 | #endif | ||
diff --git a/include/linux/mfd/max8925.h b/include/linux/mfd/max8925.h index 5259dfe8c585..b8e6d9449086 100644 --- a/include/linux/mfd/max8925.h +++ b/include/linux/mfd/max8925.h | |||
| @@ -167,9 +167,6 @@ enum { | |||
| 167 | MAX8925_IRQ_VCHG_DC_OVP, | 167 | MAX8925_IRQ_VCHG_DC_OVP, |
| 168 | MAX8925_IRQ_VCHG_DC_F, | 168 | MAX8925_IRQ_VCHG_DC_F, |
| 169 | MAX8925_IRQ_VCHG_DC_R, | 169 | MAX8925_IRQ_VCHG_DC_R, |
| 170 | MAX8925_IRQ_VCHG_USB_OVP, | ||
| 171 | MAX8925_IRQ_VCHG_USB_F, | ||
| 172 | MAX8925_IRQ_VCHG_USB_R, | ||
| 173 | MAX8925_IRQ_VCHG_THM_OK_R, | 170 | MAX8925_IRQ_VCHG_THM_OK_R, |
| 174 | MAX8925_IRQ_VCHG_THM_OK_F, | 171 | MAX8925_IRQ_VCHG_THM_OK_F, |
| 175 | MAX8925_IRQ_VCHG_SYSLOW_F, | 172 | MAX8925_IRQ_VCHG_SYSLOW_F, |
| @@ -223,6 +220,10 @@ struct max8925_power_pdata { | |||
| 223 | unsigned batt_detect:1; | 220 | unsigned batt_detect:1; |
| 224 | unsigned topoff_threshold:2; | 221 | unsigned topoff_threshold:2; |
| 225 | unsigned fast_charge:3; /* charge current */ | 222 | unsigned fast_charge:3; /* charge current */ |
| 223 | unsigned no_temp_support:1; /* set if no temperature detect */ | ||
| 224 | unsigned no_insert_detect:1; /* set if no ac insert detect */ | ||
| 225 | char **supplied_to; | ||
| 226 | int num_supplicants; | ||
| 226 | }; | 227 | }; |
| 227 | 228 | ||
| 228 | /* | 229 | /* |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 6eba2cc016c9..17b27cd269c4 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -1540,23 +1540,13 @@ static inline void vm_stat_account(struct mm_struct *mm, | |||
| 1540 | #endif /* CONFIG_PROC_FS */ | 1540 | #endif /* CONFIG_PROC_FS */ |
| 1541 | 1541 | ||
| 1542 | #ifdef CONFIG_DEBUG_PAGEALLOC | 1542 | #ifdef CONFIG_DEBUG_PAGEALLOC |
| 1543 | extern int debug_pagealloc_enabled; | ||
| 1544 | |||
| 1545 | extern void kernel_map_pages(struct page *page, int numpages, int enable); | 1543 | extern void kernel_map_pages(struct page *page, int numpages, int enable); |
| 1546 | |||
| 1547 | static inline void enable_debug_pagealloc(void) | ||
| 1548 | { | ||
| 1549 | debug_pagealloc_enabled = 1; | ||
| 1550 | } | ||
| 1551 | #ifdef CONFIG_HIBERNATION | 1544 | #ifdef CONFIG_HIBERNATION |
| 1552 | extern bool kernel_page_present(struct page *page); | 1545 | extern bool kernel_page_present(struct page *page); |
| 1553 | #endif /* CONFIG_HIBERNATION */ | 1546 | #endif /* CONFIG_HIBERNATION */ |
| 1554 | #else | 1547 | #else |
| 1555 | static inline void | 1548 | static inline void |
| 1556 | kernel_map_pages(struct page *page, int numpages, int enable) {} | 1549 | kernel_map_pages(struct page *page, int numpages, int enable) {} |
| 1557 | static inline void enable_debug_pagealloc(void) | ||
| 1558 | { | ||
| 1559 | } | ||
| 1560 | #ifdef CONFIG_HIBERNATION | 1550 | #ifdef CONFIG_HIBERNATION |
| 1561 | static inline bool kernel_page_present(struct page *page) { return true; } | 1551 | static inline bool kernel_page_present(struct page *page) { return true; } |
| 1562 | #endif /* CONFIG_HIBERNATION */ | 1552 | #endif /* CONFIG_HIBERNATION */ |
diff --git a/include/linux/mpi.h b/include/linux/mpi.h new file mode 100644 index 000000000000..06f88994ccaa --- /dev/null +++ b/include/linux/mpi.h | |||
| @@ -0,0 +1,146 @@ | |||
| 1 | /* mpi.h - Multi Precision Integers | ||
| 2 | * Copyright (C) 1994, 1996, 1998, 1999, | ||
| 3 | * 2000, 2001 Free Software Foundation, Inc. | ||
| 4 | * | ||
| 5 | * This file is part of GNUPG. | ||
| 6 | * | ||
| 7 | * GNUPG is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * GNUPG is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA | ||
| 20 | * | ||
| 21 | * Note: This code is heavily based on the GNU MP Library. | ||
| 22 | * Actually it's the same code with only minor changes in the | ||
| 23 | * way the data is stored; this is to support the abstraction | ||
| 24 | * of an optional secure memory allocation which may be used | ||
| 25 | * to avoid revealing of sensitive data due to paging etc. | ||
| 26 | * The GNU MP Library itself is published under the LGPL; | ||
| 27 | * however I decided to publish this code under the plain GPL. | ||
| 28 | */ | ||
| 29 | |||
| 30 | #ifndef G10_MPI_H | ||
| 31 | #define G10_MPI_H | ||
| 32 | |||
| 33 | #include <linux/types.h> | ||
| 34 | |||
| 35 | /* DSI defines */ | ||
| 36 | |||
| 37 | #define SHA1_DIGEST_LENGTH 20 | ||
| 38 | |||
| 39 | /*end of DSI defines */ | ||
| 40 | |||
| 41 | #define BYTES_PER_MPI_LIMB (BITS_PER_LONG / 8) | ||
| 42 | #define BITS_PER_MPI_LIMB BITS_PER_LONG | ||
| 43 | |||
| 44 | typedef unsigned long int mpi_limb_t; | ||
| 45 | typedef signed long int mpi_limb_signed_t; | ||
| 46 | |||
| 47 | struct gcry_mpi { | ||
| 48 | int alloced; /* array size (# of allocated limbs) */ | ||
| 49 | int nlimbs; /* number of valid limbs */ | ||
| 50 | int nbits; /* the real number of valid bits (info only) */ | ||
| 51 | int sign; /* indicates a negative number */ | ||
| 52 | unsigned flags; /* bit 0: array must be allocated in secure memory space */ | ||
| 53 | /* bit 1: not used */ | ||
| 54 | /* bit 2: the limb is a pointer to some m_alloced data */ | ||
| 55 | mpi_limb_t *d; /* array with the limbs */ | ||
| 56 | }; | ||
| 57 | |||
| 58 | typedef struct gcry_mpi *MPI; | ||
| 59 | |||
| 60 | #define MPI_NULL NULL | ||
| 61 | |||
| 62 | #define mpi_get_nlimbs(a) ((a)->nlimbs) | ||
| 63 | #define mpi_is_neg(a) ((a)->sign) | ||
| 64 | |||
| 65 | /*-- mpiutil.c --*/ | ||
| 66 | MPI mpi_alloc(unsigned nlimbs); | ||
| 67 | MPI mpi_alloc_secure(unsigned nlimbs); | ||
| 68 | MPI mpi_alloc_like(MPI a); | ||
| 69 | void mpi_free(MPI a); | ||
| 70 | int mpi_resize(MPI a, unsigned nlimbs); | ||
| 71 | int mpi_copy(MPI *copy, const MPI a); | ||
| 72 | void mpi_clear(MPI a); | ||
| 73 | int mpi_set(MPI w, MPI u); | ||
| 74 | int mpi_set_ui(MPI w, ulong u); | ||
| 75 | MPI mpi_alloc_set_ui(unsigned long u); | ||
| 76 | void mpi_m_check(MPI a); | ||
| 77 | void mpi_swap(MPI a, MPI b); | ||
| 78 | |||
| 79 | /*-- mpicoder.c --*/ | ||
| 80 | MPI do_encode_md(const void *sha_buffer, unsigned nbits); | ||
| 81 | MPI mpi_read_from_buffer(const void *buffer, unsigned *ret_nread); | ||
| 82 | int mpi_fromstr(MPI val, const char *str); | ||
| 83 | u32 mpi_get_keyid(MPI a, u32 *keyid); | ||
| 84 | void *mpi_get_buffer(MPI a, unsigned *nbytes, int *sign); | ||
| 85 | void *mpi_get_secure_buffer(MPI a, unsigned *nbytes, int *sign); | ||
| 86 | int mpi_set_buffer(MPI a, const void *buffer, unsigned nbytes, int sign); | ||
| 87 | |||
| 88 | #define log_mpidump g10_log_mpidump | ||
| 89 | |||
| 90 | /*-- mpi-add.c --*/ | ||
| 91 | int mpi_add_ui(MPI w, MPI u, ulong v); | ||
| 92 | int mpi_add(MPI w, MPI u, MPI v); | ||
| 93 | int mpi_addm(MPI w, MPI u, MPI v, MPI m); | ||
| 94 | int mpi_sub_ui(MPI w, MPI u, ulong v); | ||
| 95 | int mpi_sub(MPI w, MPI u, MPI v); | ||
| 96 | int mpi_subm(MPI w, MPI u, MPI v, MPI m); | ||
| 97 | |||
| 98 | /*-- mpi-mul.c --*/ | ||
| 99 | int mpi_mul_ui(MPI w, MPI u, ulong v); | ||
| 100 | int mpi_mul_2exp(MPI w, MPI u, ulong cnt); | ||
| 101 | int mpi_mul(MPI w, MPI u, MPI v); | ||
| 102 | int mpi_mulm(MPI w, MPI u, MPI v, MPI m); | ||
| 103 | |||
| 104 | /*-- mpi-div.c --*/ | ||
| 105 | ulong mpi_fdiv_r_ui(MPI rem, MPI dividend, ulong divisor); | ||
| 106 | int mpi_fdiv_r(MPI rem, MPI dividend, MPI divisor); | ||
| 107 | int mpi_fdiv_q(MPI quot, MPI dividend, MPI divisor); | ||
| 108 | int mpi_fdiv_qr(MPI quot, MPI rem, MPI dividend, MPI divisor); | ||
| 109 | int mpi_tdiv_r(MPI rem, MPI num, MPI den); | ||
| 110 | int mpi_tdiv_qr(MPI quot, MPI rem, MPI num, MPI den); | ||
| 111 | int mpi_tdiv_q_2exp(MPI w, MPI u, unsigned count); | ||
| 112 | int mpi_divisible_ui(const MPI dividend, ulong divisor); | ||
| 113 | |||
| 114 | /*-- mpi-gcd.c --*/ | ||
| 115 | int mpi_gcd(MPI g, const MPI a, const MPI b); | ||
| 116 | |||
| 117 | /*-- mpi-pow.c --*/ | ||
| 118 | int mpi_pow(MPI w, MPI u, MPI v); | ||
| 119 | int mpi_powm(MPI res, MPI base, MPI exp, MPI mod); | ||
| 120 | |||
| 121 | /*-- mpi-mpow.c --*/ | ||
| 122 | int mpi_mulpowm(MPI res, MPI *basearray, MPI *exparray, MPI mod); | ||
| 123 | |||
| 124 | /*-- mpi-cmp.c --*/ | ||
| 125 | int mpi_cmp_ui(MPI u, ulong v); | ||
| 126 | int mpi_cmp(MPI u, MPI v); | ||
| 127 | |||
| 128 | /*-- mpi-scan.c --*/ | ||
| 129 | int mpi_getbyte(MPI a, unsigned idx); | ||
| 130 | void mpi_putbyte(MPI a, unsigned idx, int value); | ||
| 131 | unsigned mpi_trailing_zeros(MPI a); | ||
| 132 | |||
| 133 | /*-- mpi-bit.c --*/ | ||
| 134 | void mpi_normalize(MPI a); | ||
| 135 | unsigned mpi_get_nbits(MPI a); | ||
| 136 | int mpi_test_bit(MPI a, unsigned n); | ||
| 137 | int mpi_set_bit(MPI a, unsigned n); | ||
| 138 | int mpi_set_highbit(MPI a, unsigned n); | ||
| 139 | void mpi_clear_highbit(MPI a, unsigned n); | ||
| 140 | void mpi_clear_bit(MPI a, unsigned n); | ||
| 141 | int mpi_rshift(MPI x, MPI a, unsigned n); | ||
| 142 | |||
| 143 | /*-- mpi-inv.c --*/ | ||
| 144 | int mpi_invm(MPI x, MPI u, MPI v); | ||
| 145 | |||
| 146 | #endif /*G10_MPI_H */ | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index 84225c756bd1..a16b1df3deff 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -111,7 +111,7 @@ enum { | |||
| 111 | PCI_NUM_RESOURCES, | 111 | PCI_NUM_RESOURCES, |
| 112 | 112 | ||
| 113 | /* preserve this for compatibility */ | 113 | /* preserve this for compatibility */ |
| 114 | DEVICE_COUNT_RESOURCE | 114 | DEVICE_COUNT_RESOURCE = PCI_NUM_RESOURCES, |
| 115 | }; | 115 | }; |
| 116 | 116 | ||
| 117 | typedef int __bitwise pci_power_t; | 117 | typedef int __bitwise pci_power_t; |
| @@ -308,7 +308,7 @@ struct pci_dev { | |||
| 308 | unsigned int is_added:1; | 308 | unsigned int is_added:1; |
| 309 | unsigned int is_busmaster:1; /* device is busmaster */ | 309 | unsigned int is_busmaster:1; /* device is busmaster */ |
| 310 | unsigned int no_msi:1; /* device may not use msi */ | 310 | unsigned int no_msi:1; /* device may not use msi */ |
| 311 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ | 311 | unsigned int block_cfg_access:1; /* config space access is blocked */ |
| 312 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ | 312 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ |
| 313 | unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */ | 313 | unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */ |
| 314 | unsigned int msi_enabled:1; | 314 | unsigned int msi_enabled:1; |
| @@ -661,17 +661,13 @@ extern struct pci_bus *pci_find_bus(int domain, int busnr); | |||
| 661 | void pci_bus_add_devices(const struct pci_bus *bus); | 661 | void pci_bus_add_devices(const struct pci_bus *bus); |
| 662 | struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, | 662 | struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, |
| 663 | struct pci_ops *ops, void *sysdata); | 663 | struct pci_ops *ops, void *sysdata); |
| 664 | static inline struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops, | 664 | struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata); |
| 665 | void *sysdata) | 665 | struct pci_bus *pci_create_root_bus(struct device *parent, int bus, |
| 666 | { | 666 | struct pci_ops *ops, void *sysdata, |
| 667 | struct pci_bus *root_bus; | 667 | struct list_head *resources); |
| 668 | root_bus = pci_scan_bus_parented(NULL, bus, ops, sysdata); | 668 | struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus, |
| 669 | if (root_bus) | 669 | struct pci_ops *ops, void *sysdata, |
| 670 | pci_bus_add_devices(root_bus); | 670 | struct list_head *resources); |
| 671 | return root_bus; | ||
| 672 | } | ||
| 673 | struct pci_bus *pci_create_bus(struct device *parent, int bus, | ||
| 674 | struct pci_ops *ops, void *sysdata); | ||
| 675 | struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, | 671 | struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, |
| 676 | int busnr); | 672 | int busnr); |
| 677 | void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); | 673 | void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); |
| @@ -795,8 +791,11 @@ static inline int pci_is_managed(struct pci_dev *pdev) | |||
| 795 | } | 791 | } |
| 796 | 792 | ||
| 797 | void pci_disable_device(struct pci_dev *dev); | 793 | void pci_disable_device(struct pci_dev *dev); |
| 794 | |||
| 795 | extern unsigned int pcibios_max_latency; | ||
| 798 | void pci_set_master(struct pci_dev *dev); | 796 | void pci_set_master(struct pci_dev *dev); |
| 799 | void pci_clear_master(struct pci_dev *dev); | 797 | void pci_clear_master(struct pci_dev *dev); |
| 798 | |||
| 800 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); | 799 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); |
| 801 | int pci_set_cacheline_size(struct pci_dev *dev); | 800 | int pci_set_cacheline_size(struct pci_dev *dev); |
| 802 | #define HAVE_PCI_SET_MWI | 801 | #define HAVE_PCI_SET_MWI |
| @@ -804,6 +803,9 @@ int __must_check pci_set_mwi(struct pci_dev *dev); | |||
| 804 | int pci_try_set_mwi(struct pci_dev *dev); | 803 | int pci_try_set_mwi(struct pci_dev *dev); |
| 805 | void pci_clear_mwi(struct pci_dev *dev); | 804 | void pci_clear_mwi(struct pci_dev *dev); |
| 806 | void pci_intx(struct pci_dev *dev, int enable); | 805 | void pci_intx(struct pci_dev *dev, int enable); |
| 806 | bool pci_intx_mask_supported(struct pci_dev *dev); | ||
| 807 | bool pci_check_and_mask_intx(struct pci_dev *dev); | ||
| 808 | bool pci_check_and_unmask_intx(struct pci_dev *dev); | ||
| 807 | void pci_msi_off(struct pci_dev *dev); | 809 | void pci_msi_off(struct pci_dev *dev); |
| 808 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); | 810 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); |
| 809 | int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); | 811 | int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); |
| @@ -911,6 +913,8 @@ int pci_request_selected_regions_exclusive(struct pci_dev *, int, const char *); | |||
| 911 | void pci_release_selected_regions(struct pci_dev *, int); | 913 | void pci_release_selected_regions(struct pci_dev *, int); |
| 912 | 914 | ||
| 913 | /* drivers/pci/bus.c */ | 915 | /* drivers/pci/bus.c */ |
| 916 | void pci_add_resource(struct list_head *resources, struct resource *res); | ||
| 917 | void pci_free_resource_list(struct list_head *resources); | ||
| 914 | void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags); | 918 | void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags); |
| 915 | struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n); | 919 | struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n); |
| 916 | void pci_bus_remove_resources(struct pci_bus *bus); | 920 | void pci_bus_remove_resources(struct pci_bus *bus); |
| @@ -1085,8 +1089,9 @@ int ht_create_irq(struct pci_dev *dev, int idx); | |||
| 1085 | void ht_destroy_irq(unsigned int irq); | 1089 | void ht_destroy_irq(unsigned int irq); |
| 1086 | #endif /* CONFIG_HT_IRQ */ | 1090 | #endif /* CONFIG_HT_IRQ */ |
| 1087 | 1091 | ||
| 1088 | extern void pci_block_user_cfg_access(struct pci_dev *dev); | 1092 | extern void pci_cfg_access_lock(struct pci_dev *dev); |
| 1089 | extern void pci_unblock_user_cfg_access(struct pci_dev *dev); | 1093 | extern bool pci_cfg_access_trylock(struct pci_dev *dev); |
| 1094 | extern void pci_cfg_access_unlock(struct pci_dev *dev); | ||
| 1090 | 1095 | ||
| 1091 | /* | 1096 | /* |
| 1092 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), | 1097 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), |
| @@ -1283,10 +1288,13 @@ static inline void pci_release_regions(struct pci_dev *dev) | |||
| 1283 | 1288 | ||
| 1284 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) | 1289 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) |
| 1285 | 1290 | ||
| 1286 | static inline void pci_block_user_cfg_access(struct pci_dev *dev) | 1291 | static inline void pci_block_cfg_access(struct pci_dev *dev) |
| 1287 | { } | 1292 | { } |
| 1288 | 1293 | ||
| 1289 | static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) | 1294 | static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev) |
| 1295 | { return 0; } | ||
| 1296 | |||
| 1297 | static inline void pci_unblock_cfg_access(struct pci_dev *dev) | ||
| 1290 | { } | 1298 | { } |
| 1291 | 1299 | ||
| 1292 | static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) | 1300 | static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) |
| @@ -1424,10 +1432,10 @@ static inline void pci_fixup_device(enum pci_fixup_pass pass, | |||
| 1424 | void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); | 1432 | void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); |
| 1425 | void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); | 1433 | void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); |
| 1426 | void __iomem * const *pcim_iomap_table(struct pci_dev *pdev); | 1434 | void __iomem * const *pcim_iomap_table(struct pci_dev *pdev); |
| 1427 | int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name); | 1435 | int pcim_iomap_regions(struct pci_dev *pdev, int mask, const char *name); |
| 1428 | int pcim_iomap_regions_request_all(struct pci_dev *pdev, u16 mask, | 1436 | int pcim_iomap_regions_request_all(struct pci_dev *pdev, int mask, |
| 1429 | const char *name); | 1437 | const char *name); |
| 1430 | void pcim_iounmap_regions(struct pci_dev *pdev, u16 mask); | 1438 | void pcim_iounmap_regions(struct pci_dev *pdev, int mask); |
| 1431 | 1439 | ||
| 1432 | extern int pci_pci_problems; | 1440 | extern int pci_pci_problems; |
| 1433 | #define PCIPCI_FAIL 1 /* No PCI PCI DMA */ | 1441 | #define PCIPCI_FAIL 1 /* No PCI PCI DMA */ |
| @@ -1446,8 +1454,10 @@ extern u8 pci_cache_line_size; | |||
| 1446 | extern unsigned long pci_hotplug_io_size; | 1454 | extern unsigned long pci_hotplug_io_size; |
| 1447 | extern unsigned long pci_hotplug_mem_size; | 1455 | extern unsigned long pci_hotplug_mem_size; |
| 1448 | 1456 | ||
| 1457 | /* Architecture specific versions may override these (weak) */ | ||
| 1449 | int pcibios_add_platform_entries(struct pci_dev *dev); | 1458 | int pcibios_add_platform_entries(struct pci_dev *dev); |
| 1450 | void pcibios_disable_device(struct pci_dev *dev); | 1459 | void pcibios_disable_device(struct pci_dev *dev); |
| 1460 | void pcibios_set_master(struct pci_dev *dev); | ||
| 1451 | int pcibios_set_pcie_reset_state(struct pci_dev *dev, | 1461 | int pcibios_set_pcie_reset_state(struct pci_dev *dev, |
| 1452 | enum pcie_reset_state state); | 1462 | enum pcie_reset_state state); |
| 1453 | 1463 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 2aaee0ca9da8..31d77af2ef42 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -776,6 +776,29 @@ | |||
| 776 | #define PCI_DEVICE_ID_ELSA_QS3000 0x3000 | 776 | #define PCI_DEVICE_ID_ELSA_QS3000 0x3000 |
| 777 | 777 | ||
| 778 | #define PCI_VENDOR_ID_STMICRO 0x104A | 778 | #define PCI_VENDOR_ID_STMICRO 0x104A |
| 779 | #define PCI_DEVICE_ID_STMICRO_USB_HOST 0xCC00 | ||
| 780 | #define PCI_DEVICE_ID_STMICRO_USB_OHCI 0xCC01 | ||
| 781 | #define PCI_DEVICE_ID_STMICRO_USB_OTG 0xCC02 | ||
| 782 | #define PCI_DEVICE_ID_STMICRO_UART_HWFC 0xCC03 | ||
| 783 | #define PCI_DEVICE_ID_STMICRO_UART_NO_HWFC 0xCC04 | ||
| 784 | #define PCI_DEVICE_ID_STMICRO_SOC_DMA 0xCC05 | ||
| 785 | #define PCI_DEVICE_ID_STMICRO_SATA 0xCC06 | ||
| 786 | #define PCI_DEVICE_ID_STMICRO_I2C 0xCC07 | ||
| 787 | #define PCI_DEVICE_ID_STMICRO_SPI_HS 0xCC08 | ||
| 788 | #define PCI_DEVICE_ID_STMICRO_MAC 0xCC09 | ||
| 789 | #define PCI_DEVICE_ID_STMICRO_SDIO_EMMC 0xCC0A | ||
| 790 | #define PCI_DEVICE_ID_STMICRO_SDIO 0xCC0B | ||
| 791 | #define PCI_DEVICE_ID_STMICRO_GPIO 0xCC0C | ||
| 792 | #define PCI_DEVICE_ID_STMICRO_VIP 0xCC0D | ||
| 793 | #define PCI_DEVICE_ID_STMICRO_AUDIO_ROUTER_DMA 0xCC0E | ||
| 794 | #define PCI_DEVICE_ID_STMICRO_AUDIO_ROUTER_SRCS 0xCC0F | ||
| 795 | #define PCI_DEVICE_ID_STMICRO_AUDIO_ROUTER_MSPS 0xCC10 | ||
| 796 | #define PCI_DEVICE_ID_STMICRO_CAN 0xCC11 | ||
| 797 | #define PCI_DEVICE_ID_STMICRO_MLB 0xCC12 | ||
| 798 | #define PCI_DEVICE_ID_STMICRO_DBP 0xCC13 | ||
| 799 | #define PCI_DEVICE_ID_STMICRO_SATA_PHY 0xCC14 | ||
| 800 | #define PCI_DEVICE_ID_STMICRO_ESRAM 0xCC15 | ||
| 801 | #define PCI_DEVICE_ID_STMICRO_VIC 0xCC16 | ||
| 779 | 802 | ||
| 780 | #define PCI_VENDOR_ID_BUSLOGIC 0x104B | 803 | #define PCI_VENDOR_ID_BUSLOGIC 0x104B |
| 781 | #define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 | 804 | #define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 28fe380cb19d..e41a10f5ae83 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
| @@ -392,7 +392,7 @@ | |||
| 392 | #define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */ | 392 | #define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */ |
| 393 | #define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */ | 393 | #define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */ |
| 394 | #define PCI_EXP_TYPE_RC_END 0x9 /* Root Complex Integrated Endpoint */ | 394 | #define PCI_EXP_TYPE_RC_END 0x9 /* Root Complex Integrated Endpoint */ |
| 395 | #define PCI_EXP_TYPE_RC_EC 0x10 /* Root Complex Event Collector */ | 395 | #define PCI_EXP_TYPE_RC_EC 0xa /* Root Complex Event Collector */ |
| 396 | #define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */ | 396 | #define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */ |
| 397 | #define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */ | 397 | #define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */ |
| 398 | #define PCI_EXP_DEVCAP 4 /* Device capabilities */ | 398 | #define PCI_EXP_DEVCAP 4 /* Device capabilities */ |
diff --git a/include/linux/pda_power.h b/include/linux/pda_power.h index c9e4d814ff77..2bb62bf296ac 100644 --- a/include/linux/pda_power.h +++ b/include/linux/pda_power.h | |||
| @@ -35,6 +35,8 @@ struct pda_power_pdata { | |||
| 35 | unsigned int polling_interval; /* msecs, default is 2000 */ | 35 | unsigned int polling_interval; /* msecs, default is 2000 */ |
| 36 | 36 | ||
| 37 | unsigned long ac_max_uA; /* current to draw when on AC */ | 37 | unsigned long ac_max_uA; /* current to draw when on AC */ |
| 38 | |||
| 39 | bool use_otg_notifier; | ||
| 38 | }; | 40 | }; |
| 39 | 41 | ||
| 40 | #endif /* __PDA_POWER_H__ */ | 42 | #endif /* __PDA_POWER_H__ */ |
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h new file mode 100644 index 000000000000..4f75e531c112 --- /dev/null +++ b/include/linux/power/charger-manager.h | |||
| @@ -0,0 +1,147 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2011 Samsung Electronics Co., Ltd. | ||
| 3 | * MyungJoo.Ham <myungjoo.ham@samsung.com> | ||
| 4 | * | ||
| 5 | * Charger Manager. | ||
| 6 | * This framework enables to control and multiple chargers and to | ||
| 7 | * monitor charging even in the context of suspend-to-RAM with | ||
| 8 | * an interface combining the chargers. | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | **/ | ||
| 14 | |||
| 15 | #ifndef _CHARGER_MANAGER_H | ||
| 16 | #define _CHARGER_MANAGER_H | ||
| 17 | |||
| 18 | #include <linux/power_supply.h> | ||
| 19 | |||
| 20 | enum data_source { | ||
| 21 | CM_FUEL_GAUGE, | ||
| 22 | CM_CHARGER_STAT, | ||
| 23 | }; | ||
| 24 | |||
| 25 | enum polling_modes { | ||
| 26 | CM_POLL_DISABLE = 0, | ||
| 27 | CM_POLL_ALWAYS, | ||
| 28 | CM_POLL_EXTERNAL_POWER_ONLY, | ||
| 29 | CM_POLL_CHARGING_ONLY, | ||
| 30 | }; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * struct charger_global_desc | ||
| 34 | * @rtc_name: the name of RTC used to wake up the system from suspend. | ||
| 35 | * @rtc_only_wakeup: | ||
| 36 | * If the system is woken up by waekup-sources other than the RTC or | ||
| 37 | * callbacks, Charger Manager should recognize with | ||
| 38 | * rtc_only_wakeup() returning false. | ||
| 39 | * If the RTC given to CM is the only wakeup reason, | ||
| 40 | * rtc_only_wakeup should return true. | ||
| 41 | */ | ||
| 42 | struct charger_global_desc { | ||
| 43 | char *rtc_name; | ||
| 44 | |||
| 45 | bool (*rtc_only_wakeup)(void); | ||
| 46 | }; | ||
| 47 | |||
| 48 | /** | ||
| 49 | * struct charger_desc | ||
| 50 | * @psy_name: the name of power-supply-class for charger manager | ||
| 51 | * @polling_mode: | ||
| 52 | * Determine which polling mode will be used | ||
| 53 | * @fullbatt_uV: voltage in microvolt | ||
| 54 | * If it is not being charged and VBATT >= fullbatt_uV, | ||
| 55 | * it is assumed to be full. | ||
| 56 | * @polling_interval_ms: interval in millisecond at which | ||
| 57 | * charger manager will monitor battery health | ||
| 58 | * @battery_present: | ||
| 59 | * Specify where information for existance of battery can be obtained | ||
| 60 | * @psy_charger_stat: the names of power-supply for chargers | ||
| 61 | * @num_charger_regulator: the number of entries in charger_regulators | ||
| 62 | * @charger_regulators: array of regulator_bulk_data for chargers | ||
| 63 | * @psy_fuel_gauge: the name of power-supply for fuel gauge | ||
| 64 | * @temperature_out_of_range: | ||
| 65 | * Determine whether the status is overheat or cold or normal. | ||
| 66 | * return_value > 0: overheat | ||
| 67 | * return_value == 0: normal | ||
| 68 | * return_value < 0: cold | ||
| 69 | * @measure_battery_temp: | ||
| 70 | * true: measure battery temperature | ||
| 71 | * false: measure ambient temperature | ||
| 72 | */ | ||
| 73 | struct charger_desc { | ||
| 74 | char *psy_name; | ||
| 75 | |||
| 76 | enum polling_modes polling_mode; | ||
| 77 | unsigned int polling_interval_ms; | ||
| 78 | |||
| 79 | unsigned int fullbatt_uV; | ||
| 80 | |||
| 81 | enum data_source battery_present; | ||
| 82 | |||
| 83 | char **psy_charger_stat; | ||
| 84 | |||
| 85 | int num_charger_regulators; | ||
| 86 | struct regulator_bulk_data *charger_regulators; | ||
| 87 | |||
| 88 | char *psy_fuel_gauge; | ||
| 89 | |||
| 90 | int (*temperature_out_of_range)(int *mC); | ||
| 91 | bool measure_battery_temp; | ||
| 92 | }; | ||
| 93 | |||
| 94 | #define PSY_NAME_MAX 30 | ||
| 95 | |||
| 96 | /** | ||
| 97 | * struct charger_manager | ||
| 98 | * @entry: entry for list | ||
| 99 | * @dev: device pointer | ||
| 100 | * @desc: instance of charger_desc | ||
| 101 | * @fuel_gauge: power_supply for fuel gauge | ||
| 102 | * @charger_stat: array of power_supply for chargers | ||
| 103 | * @charger_enabled: the state of charger | ||
| 104 | * @emergency_stop: | ||
| 105 | * When setting true, stop charging | ||
| 106 | * @last_temp_mC: the measured temperature in milli-Celsius | ||
| 107 | * @psy_name_buf: the name of power-supply-class for charger manager | ||
| 108 | * @charger_psy: power_supply for charger manager | ||
| 109 | * @status_save_ext_pwr_inserted: | ||
| 110 | * saved status of external power before entering suspend-to-RAM | ||
| 111 | * @status_save_batt: | ||
| 112 | * saved status of battery before entering suspend-to-RAM | ||
| 113 | */ | ||
| 114 | struct charger_manager { | ||
| 115 | struct list_head entry; | ||
| 116 | struct device *dev; | ||
| 117 | struct charger_desc *desc; | ||
| 118 | |||
| 119 | struct power_supply *fuel_gauge; | ||
| 120 | struct power_supply **charger_stat; | ||
| 121 | |||
| 122 | bool charger_enabled; | ||
| 123 | |||
| 124 | int emergency_stop; | ||
| 125 | int last_temp_mC; | ||
| 126 | |||
| 127 | char psy_name_buf[PSY_NAME_MAX + 1]; | ||
| 128 | struct power_supply charger_psy; | ||
| 129 | |||
| 130 | bool status_save_ext_pwr_inserted; | ||
| 131 | bool status_save_batt; | ||
| 132 | }; | ||
| 133 | |||
| 134 | #ifdef CONFIG_CHARGER_MANAGER | ||
| 135 | extern int setup_charger_manager(struct charger_global_desc *gd); | ||
| 136 | extern bool cm_suspend_again(void); | ||
| 137 | #else | ||
| 138 | static void __maybe_unused setup_charger_manager(struct charger_global_desc *gd) | ||
| 139 | { } | ||
| 140 | |||
| 141 | static bool __maybe_unused cm_suspend_again(void) | ||
| 142 | { | ||
| 143 | return false; | ||
| 144 | } | ||
| 145 | #endif | ||
| 146 | |||
| 147 | #endif /* _CHARGER_MANAGER_H */ | ||
diff --git a/include/linux/power/bq20z75.h b/include/linux/power/sbs-battery.h index 1398eb004e83..2b0a9d9ff57e 100644 --- a/include/linux/power/bq20z75.h +++ b/include/linux/power/sbs-battery.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Gas Gauge driver for TI's BQ20Z75 | 2 | * Gas Gauge driver for SBS Compliant Gas Gauges |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2010, NVIDIA Corporation. | 4 | * Copyright (c) 2010, NVIDIA Corporation. |
| 5 | * | 5 | * |
| @@ -18,21 +18,21 @@ | |||
| 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | #ifndef __LINUX_POWER_BQ20Z75_H_ | 21 | #ifndef __LINUX_POWER_SBS_BATTERY_H_ |
| 22 | #define __LINUX_POWER_BQ20Z75_H_ | 22 | #define __LINUX_POWER_SBS_BATTERY_H_ |
| 23 | 23 | ||
| 24 | #include <linux/power_supply.h> | 24 | #include <linux/power_supply.h> |
| 25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
| 26 | 26 | ||
| 27 | /** | 27 | /** |
| 28 | * struct bq20z75_platform_data - platform data for bq20z75 devices | 28 | * struct sbs_platform_data - platform data for sbs devices |
| 29 | * @battery_detect: GPIO which is used to detect battery presence | 29 | * @battery_detect: GPIO which is used to detect battery presence |
| 30 | * @battery_detect_present: gpio state when battery is present (0 / 1) | 30 | * @battery_detect_present: gpio state when battery is present (0 / 1) |
| 31 | * @i2c_retry_count: # of times to retry on i2c IO failure | 31 | * @i2c_retry_count: # of times to retry on i2c IO failure |
| 32 | * @poll_retry_count: # of times to retry looking for new status after | 32 | * @poll_retry_count: # of times to retry looking for new status after |
| 33 | * external change notification | 33 | * external change notification |
| 34 | */ | 34 | */ |
| 35 | struct bq20z75_platform_data { | 35 | struct sbs_platform_data { |
| 36 | int battery_detect; | 36 | int battery_detect; |
| 37 | int battery_detect_present; | 37 | int battery_detect_present; |
| 38 | int i2c_retry_count; | 38 | int i2c_retry_count; |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 204c18dfdc9e..fa9b962aec12 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
| @@ -74,6 +74,12 @@ enum { | |||
| 74 | POWER_SUPPLY_CAPACITY_LEVEL_FULL, | 74 | POWER_SUPPLY_CAPACITY_LEVEL_FULL, |
| 75 | }; | 75 | }; |
| 76 | 76 | ||
| 77 | enum { | ||
| 78 | POWER_SUPPLY_SCOPE_UNKNOWN = 0, | ||
| 79 | POWER_SUPPLY_SCOPE_SYSTEM, | ||
| 80 | POWER_SUPPLY_SCOPE_DEVICE, | ||
| 81 | }; | ||
| 82 | |||
| 77 | enum power_supply_property { | 83 | enum power_supply_property { |
| 78 | /* Properties of type `int' */ | 84 | /* Properties of type `int' */ |
| 79 | POWER_SUPPLY_PROP_STATUS = 0, | 85 | POWER_SUPPLY_PROP_STATUS = 0, |
| @@ -116,6 +122,7 @@ enum power_supply_property { | |||
| 116 | POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, | 122 | POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, |
| 117 | POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, | 123 | POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, |
| 118 | POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */ | 124 | POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */ |
| 125 | POWER_SUPPLY_PROP_SCOPE, | ||
| 119 | /* Properties of type `const char *' */ | 126 | /* Properties of type `const char *' */ |
| 120 | POWER_SUPPLY_PROP_MODEL_NAME, | 127 | POWER_SUPPLY_PROP_MODEL_NAME, |
| 121 | POWER_SUPPLY_PROP_MANUFACTURER, | 128 | POWER_SUPPLY_PROP_MANUFACTURER, |
| @@ -123,7 +130,8 @@ enum power_supply_property { | |||
| 123 | }; | 130 | }; |
| 124 | 131 | ||
| 125 | enum power_supply_type { | 132 | enum power_supply_type { |
| 126 | POWER_SUPPLY_TYPE_BATTERY = 0, | 133 | POWER_SUPPLY_TYPE_UNKNOWN = 0, |
| 134 | POWER_SUPPLY_TYPE_BATTERY, | ||
| 127 | POWER_SUPPLY_TYPE_UPS, | 135 | POWER_SUPPLY_TYPE_UPS, |
| 128 | POWER_SUPPLY_TYPE_MAINS, | 136 | POWER_SUPPLY_TYPE_MAINS, |
| 129 | POWER_SUPPLY_TYPE_USB, /* Standard Downstream Port */ | 137 | POWER_SUPPLY_TYPE_USB, /* Standard Downstream Port */ |
| @@ -211,6 +219,7 @@ static inline int power_supply_is_system_supplied(void) { return -ENOSYS; } | |||
| 211 | extern int power_supply_register(struct device *parent, | 219 | extern int power_supply_register(struct device *parent, |
| 212 | struct power_supply *psy); | 220 | struct power_supply *psy); |
| 213 | extern void power_supply_unregister(struct power_supply *psy); | 221 | extern void power_supply_unregister(struct power_supply *psy); |
| 222 | extern int power_supply_powers(struct power_supply *psy, struct device *dev); | ||
| 214 | 223 | ||
| 215 | /* For APM emulation, think legacy userspace. */ | 224 | /* For APM emulation, think legacy userspace. */ |
| 216 | extern struct class *power_supply_class; | 225 | extern struct class *power_supply_class; |
diff --git a/include/linux/s3c_adc_battery.h b/include/linux/s3c_adc_battery.h index fbe58b7e63eb..99dadbffdd4f 100644 --- a/include/linux/s3c_adc_battery.h +++ b/include/linux/s3c_adc_battery.h | |||
| @@ -25,6 +25,10 @@ struct s3c_adc_bat_pdata { | |||
| 25 | const unsigned int current_channel; | 25 | const unsigned int current_channel; |
| 26 | const unsigned int backup_volt_channel; | 26 | const unsigned int backup_volt_channel; |
| 27 | 27 | ||
| 28 | const unsigned int volt_samples; | ||
| 29 | const unsigned int current_samples; | ||
| 30 | const unsigned int backup_volt_samples; | ||
| 31 | |||
| 28 | const unsigned int volt_mult; | 32 | const unsigned int volt_mult; |
| 29 | const unsigned int current_mult; | 33 | const unsigned int current_mult; |
| 30 | const unsigned int backup_volt_mult; | 34 | const unsigned int backup_volt_mult; |
diff --git a/include/linux/security.h b/include/linux/security.h index 98112cf93884..0ccceb9b1046 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -590,6 +590,8 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 590 | * @reqprot contains the protection requested by the application. | 590 | * @reqprot contains the protection requested by the application. |
| 591 | * @prot contains the protection that will be applied by the kernel. | 591 | * @prot contains the protection that will be applied by the kernel. |
| 592 | * @flags contains the operational flags. | 592 | * @flags contains the operational flags. |
| 593 | * @addr contains virtual address that will be used for the operation. | ||
| 594 | * @addr_only contains a boolean: 0 if file-backed VMA, otherwise 1. | ||
| 593 | * Return 0 if permission is granted. | 595 | * Return 0 if permission is granted. |
| 594 | * @file_mprotect: | 596 | * @file_mprotect: |
| 595 | * Check permissions before changing memory access permissions. | 597 | * Check permissions before changing memory access permissions. |
| @@ -2043,7 +2045,7 @@ static inline void security_inode_free(struct inode *inode) | |||
| 2043 | static inline int security_inode_init_security(struct inode *inode, | 2045 | static inline int security_inode_init_security(struct inode *inode, |
| 2044 | struct inode *dir, | 2046 | struct inode *dir, |
| 2045 | const struct qstr *qstr, | 2047 | const struct qstr *qstr, |
| 2046 | initxattrs initxattrs, | 2048 | const initxattrs initxattrs, |
| 2047 | void *fs_data) | 2049 | void *fs_data) |
| 2048 | { | 2050 | { |
| 2049 | return 0; | 2051 | return 0; |
