diff options
Diffstat (limited to 'include')
165 files changed, 4668 insertions, 758 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 03f14856bd09..0943457e0fa5 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h | |||
@@ -241,6 +241,7 @@ | |||
241 | *****************************************************************************/ | 241 | *****************************************************************************/ |
242 | 242 | ||
243 | #define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */ | 243 | #define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */ |
244 | #define ACPI_DB_LINE_BUFFER_SIZE 512 | ||
244 | 245 | ||
245 | #define ACPI_DEBUGGER_COMMAND_PROMPT '-' | 246 | #define ACPI_DEBUGGER_COMMAND_PROMPT '-' |
246 | #define ACPI_DEBUGGER_EXECUTE_PROMPT '%' | 247 | #define ACPI_DEBUGGER_EXECUTE_PROMPT '%' |
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 19503449814f..6c3890e02140 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h | |||
@@ -122,7 +122,7 @@ | |||
122 | #define AE_CODE_TBL_MAX 0x0005 | 122 | #define AE_CODE_TBL_MAX 0x0005 |
123 | 123 | ||
124 | /* | 124 | /* |
125 | * AML exceptions. These are caused by problems with | 125 | * AML exceptions. These are caused by problems with |
126 | * the actual AML byte stream | 126 | * the actual AML byte stream |
127 | */ | 127 | */ |
128 | #define AE_AML_BAD_OPCODE (acpi_status) (0x0001 | AE_CODE_AML) | 128 | #define AE_AML_BAD_OPCODE (acpi_status) (0x0001 | AE_CODE_AML) |
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h index 745dd24e3cb5..7665df663284 100644 --- a/include/acpi/acnames.h +++ b/include/acpi/acnames.h | |||
@@ -50,6 +50,7 @@ | |||
50 | #define METHOD_NAME__HID "_HID" | 50 | #define METHOD_NAME__HID "_HID" |
51 | #define METHOD_NAME__CID "_CID" | 51 | #define METHOD_NAME__CID "_CID" |
52 | #define METHOD_NAME__UID "_UID" | 52 | #define METHOD_NAME__UID "_UID" |
53 | #define METHOD_NAME__SUB "_SUB" | ||
53 | #define METHOD_NAME__ADR "_ADR" | 54 | #define METHOD_NAME__ADR "_ADR" |
54 | #define METHOD_NAME__INI "_INI" | 55 | #define METHOD_NAME__INI "_INI" |
55 | #define METHOD_NAME__STA "_STA" | 56 | #define METHOD_NAME__STA "_STA" |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 0daa0fbd8654..7ced5dc20dd3 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -144,12 +144,11 @@ struct acpi_device_flags { | |||
144 | u32 bus_address:1; | 144 | u32 bus_address:1; |
145 | u32 removable:1; | 145 | u32 removable:1; |
146 | u32 ejectable:1; | 146 | u32 ejectable:1; |
147 | u32 lockable:1; | ||
148 | u32 suprise_removal_ok:1; | 147 | u32 suprise_removal_ok:1; |
149 | u32 power_manageable:1; | 148 | u32 power_manageable:1; |
150 | u32 performance_manageable:1; | 149 | u32 performance_manageable:1; |
151 | u32 eject_pending:1; | 150 | u32 eject_pending:1; |
152 | u32 reserved:23; | 151 | u32 reserved:24; |
153 | }; | 152 | }; |
154 | 153 | ||
155 | /* File System */ | 154 | /* File System */ |
@@ -180,6 +179,7 @@ struct acpi_device_pnp { | |||
180 | acpi_device_name device_name; /* Driver-determined */ | 179 | acpi_device_name device_name; /* Driver-determined */ |
181 | acpi_device_class device_class; /* " */ | 180 | acpi_device_class device_class; /* " */ |
182 | union acpi_object *str_obj; /* unicode string for _STR method */ | 181 | union acpi_object *str_obj; /* unicode string for _STR method */ |
182 | unsigned long sun; /* _SUN */ | ||
183 | }; | 183 | }; |
184 | 184 | ||
185 | #define acpi_device_bid(d) ((d)->pnp.bus_id) | 185 | #define acpi_device_bid(d) ((d)->pnp.bus_id) |
@@ -201,6 +201,7 @@ struct acpi_device_power_flags { | |||
201 | struct acpi_device_power_state { | 201 | struct acpi_device_power_state { |
202 | struct { | 202 | struct { |
203 | u8 valid:1; | 203 | u8 valid:1; |
204 | u8 os_accessible:1; | ||
204 | u8 explicit_set:1; /* _PSx present? */ | 205 | u8 explicit_set:1; /* _PSx present? */ |
205 | u8 reserved:6; | 206 | u8 reserved:6; |
206 | } flags; | 207 | } flags; |
@@ -339,6 +340,7 @@ acpi_status acpi_bus_get_status_handle(acpi_handle handle, | |||
339 | unsigned long long *sta); | 340 | unsigned long long *sta); |
340 | int acpi_bus_get_status(struct acpi_device *device); | 341 | int acpi_bus_get_status(struct acpi_device *device); |
341 | int acpi_bus_set_power(acpi_handle handle, int state); | 342 | int acpi_bus_set_power(acpi_handle handle, int state); |
343 | int acpi_device_set_power(struct acpi_device *device, int state); | ||
342 | int acpi_bus_update_power(acpi_handle handle, int *state_p); | 344 | int acpi_bus_update_power(acpi_handle handle, int *state_p); |
343 | bool acpi_bus_power_manageable(acpi_handle handle); | 345 | bool acpi_bus_power_manageable(acpi_handle handle); |
344 | bool acpi_bus_can_wakeup(acpi_handle handle); | 346 | bool acpi_bus_can_wakeup(acpi_handle handle); |
@@ -410,36 +412,100 @@ acpi_handle acpi_get_child(acpi_handle, u64); | |||
410 | int acpi_is_root_bridge(acpi_handle); | 412 | int acpi_is_root_bridge(acpi_handle); |
411 | acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); | 413 | acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); |
412 | struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); | 414 | struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); |
413 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) | 415 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)ACPI_HANDLE(dev)) |
414 | 416 | ||
415 | int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state); | 417 | int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state); |
416 | int acpi_disable_wakeup_device_power(struct acpi_device *dev); | 418 | int acpi_disable_wakeup_device_power(struct acpi_device *dev); |
417 | 419 | ||
418 | #ifdef CONFIG_PM | 420 | #ifdef CONFIG_PM |
421 | acpi_status acpi_add_pm_notifier(struct acpi_device *adev, | ||
422 | acpi_notify_handler handler, void *context); | ||
423 | acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, | ||
424 | acpi_notify_handler handler); | ||
425 | int acpi_device_power_state(struct device *dev, struct acpi_device *adev, | ||
426 | u32 target_state, int d_max_in, int *d_min_p); | ||
419 | int acpi_pm_device_sleep_state(struct device *, int *, int); | 427 | int acpi_pm_device_sleep_state(struct device *, int *, int); |
420 | #else | 428 | #else |
421 | static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) | 429 | static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, |
430 | acpi_notify_handler handler, | ||
431 | void *context) | ||
432 | { | ||
433 | return AE_SUPPORT; | ||
434 | } | ||
435 | static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, | ||
436 | acpi_notify_handler handler) | ||
437 | { | ||
438 | return AE_SUPPORT; | ||
439 | } | ||
440 | static inline int __acpi_device_power_state(int m, int *p) | ||
422 | { | 441 | { |
423 | if (p) | 442 | if (p) |
424 | *p = ACPI_STATE_D0; | 443 | *p = ACPI_STATE_D0; |
425 | return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0; | 444 | return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0; |
426 | } | 445 | } |
446 | static inline int acpi_device_power_state(struct device *dev, | ||
447 | struct acpi_device *adev, | ||
448 | u32 target_state, int d_max_in, | ||
449 | int *d_min_p) | ||
450 | { | ||
451 | return __acpi_device_power_state(d_max_in, d_min_p); | ||
452 | } | ||
453 | static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) | ||
454 | { | ||
455 | return __acpi_device_power_state(m, p); | ||
456 | } | ||
427 | #endif | 457 | #endif |
428 | 458 | ||
429 | #ifdef CONFIG_PM_SLEEP | 459 | #ifdef CONFIG_PM_RUNTIME |
460 | int __acpi_device_run_wake(struct acpi_device *, bool); | ||
430 | int acpi_pm_device_run_wake(struct device *, bool); | 461 | int acpi_pm_device_run_wake(struct device *, bool); |
431 | int acpi_pm_device_sleep_wake(struct device *, bool); | ||
432 | #else | 462 | #else |
463 | static inline int __acpi_device_run_wake(struct acpi_device *adev, bool en) | ||
464 | { | ||
465 | return -ENODEV; | ||
466 | } | ||
433 | static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) | 467 | static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) |
434 | { | 468 | { |
435 | return -ENODEV; | 469 | return -ENODEV; |
436 | } | 470 | } |
471 | #endif | ||
472 | |||
473 | #ifdef CONFIG_PM_SLEEP | ||
474 | int __acpi_device_sleep_wake(struct acpi_device *, u32, bool); | ||
475 | int acpi_pm_device_sleep_wake(struct device *, bool); | ||
476 | #else | ||
477 | static inline int __acpi_device_sleep_wake(struct acpi_device *adev, | ||
478 | u32 target_state, bool enable) | ||
479 | { | ||
480 | return -ENODEV; | ||
481 | } | ||
437 | static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable) | 482 | static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable) |
438 | { | 483 | { |
439 | return -ENODEV; | 484 | return -ENODEV; |
440 | } | 485 | } |
441 | #endif | 486 | #endif |
442 | 487 | ||
488 | #ifdef CONFIG_ACPI_SLEEP | ||
489 | u32 acpi_target_system_state(void); | ||
490 | #else | ||
491 | static inline u32 acpi_target_system_state(void) { return ACPI_STATE_S0; } | ||
492 | #endif | ||
493 | |||
494 | static inline bool acpi_device_power_manageable(struct acpi_device *adev) | ||
495 | { | ||
496 | return adev->flags.power_manageable; | ||
497 | } | ||
498 | |||
499 | static inline bool acpi_device_can_wakeup(struct acpi_device *adev) | ||
500 | { | ||
501 | return adev->wakeup.flags.valid; | ||
502 | } | ||
503 | |||
504 | static inline bool acpi_device_can_poweroff(struct acpi_device *adev) | ||
505 | { | ||
506 | return adev->power.states[ACPI_STATE_D3_COLD].flags.os_accessible; | ||
507 | } | ||
508 | |||
443 | #else /* CONFIG_ACPI */ | 509 | #else /* CONFIG_ACPI */ |
444 | 510 | ||
445 | static inline int register_acpi_bus_type(void *bus) { return 0; } | 511 | static inline int register_acpi_bus_type(void *bus) { return 0; } |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 1222ba93d80a..43152742b46f 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -1,7 +1,6 @@ | |||
1 | |||
2 | /****************************************************************************** | 1 | /****************************************************************************** |
3 | * | 2 | * |
4 | * Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These | 3 | * Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These |
5 | * interfaces must be implemented by OSL to interface the | 4 | * interfaces must be implemented by OSL to interface the |
6 | * ACPI components to the host operating system. | 5 | * ACPI components to the host operating system. |
7 | * | 6 | * |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 8b891dbead66..3d88395d4d6f 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -1,4 +1,3 @@ | |||
1 | |||
2 | /****************************************************************************** | 1 | /****************************************************************************** |
3 | * | 2 | * |
4 | * Name: acpixf.h - External interfaces to the ACPI subsystem | 3 | * Name: acpixf.h - External interfaces to the ACPI subsystem |
@@ -47,7 +46,7 @@ | |||
47 | 46 | ||
48 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 47 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
49 | 48 | ||
50 | #define ACPI_CA_VERSION 0x20120913 | 49 | #define ACPI_CA_VERSION 0x20121018 |
51 | 50 | ||
52 | #include <acpi/acconfig.h> | 51 | #include <acpi/acconfig.h> |
53 | #include <acpi/actypes.h> | 52 | #include <acpi/actypes.h> |
@@ -178,8 +177,7 @@ acpi_status acpi_unload_table_id(acpi_owner_id id); | |||
178 | 177 | ||
179 | acpi_status | 178 | acpi_status |
180 | acpi_get_table_header(acpi_string signature, | 179 | acpi_get_table_header(acpi_string signature, |
181 | u32 instance, | 180 | u32 instance, struct acpi_table_header *out_table_header); |
182 | struct acpi_table_header *out_table_header); | ||
183 | 181 | ||
184 | acpi_status | 182 | acpi_status |
185 | acpi_get_table_with_size(acpi_string signature, | 183 | acpi_get_table_with_size(acpi_string signature, |
@@ -190,8 +188,7 @@ acpi_get_table(acpi_string signature, | |||
190 | u32 instance, struct acpi_table_header **out_table); | 188 | u32 instance, struct acpi_table_header **out_table); |
191 | 189 | ||
192 | acpi_status | 190 | acpi_status |
193 | acpi_get_table_by_index(u32 table_index, | 191 | acpi_get_table_by_index(u32 table_index, struct acpi_table_header **out_table); |
194 | struct acpi_table_header **out_table); | ||
195 | 192 | ||
196 | acpi_status | 193 | acpi_status |
197 | acpi_install_table_handler(acpi_tbl_handler handler, void *context); | 194 | acpi_install_table_handler(acpi_tbl_handler handler, void *context); |
@@ -274,7 +271,7 @@ acpi_install_initialization_handler(acpi_init_handler handler, u32 function); | |||
274 | 271 | ||
275 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 272 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
276 | acpi_install_global_event_handler | 273 | acpi_install_global_event_handler |
277 | (ACPI_GBL_EVENT_HANDLER handler, void *context)) | 274 | (acpi_gbl_event_handler handler, void *context)) |
278 | 275 | ||
279 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 276 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
280 | acpi_install_fixed_event_handler(u32 | 277 | acpi_install_fixed_event_handler(u32 |
@@ -300,10 +297,9 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
300 | u32 gpe_number, | 297 | u32 gpe_number, |
301 | acpi_gpe_handler | 298 | acpi_gpe_handler |
302 | address)) | 299 | address)) |
303 | acpi_status | 300 | acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type, |
304 | acpi_install_notify_handler(acpi_handle device, | 301 | acpi_notify_handler handler, |
305 | u32 handler_type, | 302 | void *context); |
306 | acpi_notify_handler handler, void *context); | ||
307 | 303 | ||
308 | acpi_status | 304 | acpi_status |
309 | acpi_remove_notify_handler(acpi_handle device, | 305 | acpi_remove_notify_handler(acpi_handle device, |
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h index 8c61b5fe42a4..6585141e4b97 100644 --- a/include/acpi/actbl3.h +++ b/include/acpi/actbl3.h | |||
@@ -277,10 +277,10 @@ struct acpi_table_gtdt { | |||
277 | ******************************************************************************/ | 277 | ******************************************************************************/ |
278 | 278 | ||
279 | #define ACPI_MPST_CHANNEL_INFO \ | 279 | #define ACPI_MPST_CHANNEL_INFO \ |
280 | u16 reserved1; \ | ||
281 | u8 channel_id; \ | 280 | u8 channel_id; \ |
282 | u8 reserved2; \ | 281 | u8 reserved1[3]; \ |
283 | u16 power_node_count; | 282 | u16 power_node_count; \ |
283 | u16 reserved2; | ||
284 | 284 | ||
285 | /* Main table */ | 285 | /* Main table */ |
286 | 286 | ||
@@ -304,9 +304,8 @@ struct acpi_mpst_power_node { | |||
304 | u32 length; | 304 | u32 length; |
305 | u64 range_address; | 305 | u64 range_address; |
306 | u64 range_length; | 306 | u64 range_length; |
307 | u8 num_power_states; | 307 | u32 num_power_states; |
308 | u8 num_physical_components; | 308 | u32 num_physical_components; |
309 | u16 reserved2; | ||
310 | }; | 309 | }; |
311 | 310 | ||
312 | /* Values for Flags field above */ | 311 | /* Values for Flags field above */ |
@@ -332,10 +331,11 @@ struct acpi_mpst_component { | |||
332 | 331 | ||
333 | struct acpi_mpst_data_hdr { | 332 | struct acpi_mpst_data_hdr { |
334 | u16 characteristics_count; | 333 | u16 characteristics_count; |
334 | u16 reserved; | ||
335 | }; | 335 | }; |
336 | 336 | ||
337 | struct acpi_mpst_power_data { | 337 | struct acpi_mpst_power_data { |
338 | u8 revision; | 338 | u8 structure_id; |
339 | u8 flags; | 339 | u8 flags; |
340 | u16 reserved1; | 340 | u16 reserved1; |
341 | u32 average_power; | 341 | u32 average_power; |
@@ -356,10 +356,10 @@ struct acpi_mpst_shared { | |||
356 | u32 signature; | 356 | u32 signature; |
357 | u16 pcc_command; | 357 | u16 pcc_command; |
358 | u16 pcc_status; | 358 | u16 pcc_status; |
359 | u16 command_register; | 359 | u32 command_register; |
360 | u16 status_register; | 360 | u32 status_register; |
361 | u16 power_state_id; | 361 | u32 power_state_id; |
362 | u16 power_node_id; | 362 | u32 power_node_id; |
363 | u64 energy_consumed; | 363 | u64 energy_consumed; |
364 | u64 average_power; | 364 | u64 average_power; |
365 | }; | 365 | }; |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index a85bae968262..4f43f1fba132 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -453,10 +453,14 @@ typedef u64 acpi_integer; | |||
453 | #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) | 453 | #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) |
454 | #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) | 454 | #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) |
455 | 455 | ||
456 | /* Optimizations for 4-character (32-bit) acpi_name manipulation */ | ||
457 | |||
456 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED | 458 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED |
457 | #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b))) | 459 | #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b))) |
460 | #define ACPI_MOVE_NAME(dest,src) (*ACPI_CAST_PTR (u32, (dest)) = *ACPI_CAST_PTR (u32, (src))) | ||
458 | #else | 461 | #else |
459 | #define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) | 462 | #define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) |
463 | #define ACPI_MOVE_NAME(dest,src) (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) | ||
460 | #endif | 464 | #endif |
461 | 465 | ||
462 | /******************************************************************************* | 466 | /******************************************************************************* |
@@ -796,11 +800,11 @@ typedef u8 acpi_adr_space_type; | |||
796 | 800 | ||
797 | /* Sleep function dispatch */ | 801 | /* Sleep function dispatch */ |
798 | 802 | ||
799 | typedef acpi_status(*ACPI_SLEEP_FUNCTION) (u8 sleep_state); | 803 | typedef acpi_status(*acpi_sleep_function) (u8 sleep_state); |
800 | 804 | ||
801 | struct acpi_sleep_functions { | 805 | struct acpi_sleep_functions { |
802 | ACPI_SLEEP_FUNCTION legacy_function; | 806 | acpi_sleep_function legacy_function; |
803 | ACPI_SLEEP_FUNCTION extended_function; | 807 | acpi_sleep_function extended_function; |
804 | }; | 808 | }; |
805 | 809 | ||
806 | /* | 810 | /* |
@@ -922,7 +926,8 @@ struct acpi_system_info { | |||
922 | /* | 926 | /* |
923 | * Types specific to the OS service interfaces | 927 | * Types specific to the OS service interfaces |
924 | */ | 928 | */ |
925 | typedef u32(ACPI_SYSTEM_XFACE * acpi_osd_handler) (void *context); | 929 | typedef u32 |
930 | (ACPI_SYSTEM_XFACE * acpi_osd_handler) (void *context); | ||
926 | 931 | ||
927 | typedef void | 932 | typedef void |
928 | (ACPI_SYSTEM_XFACE * acpi_osd_exec_callback) (void *context); | 933 | (ACPI_SYSTEM_XFACE * acpi_osd_exec_callback) (void *context); |
@@ -931,14 +936,15 @@ typedef void | |||
931 | * Various handlers and callback procedures | 936 | * Various handlers and callback procedures |
932 | */ | 937 | */ |
933 | typedef | 938 | typedef |
934 | void (*ACPI_GBL_EVENT_HANDLER) (u32 event_type, | 939 | void (*acpi_gbl_event_handler) (u32 event_type, |
935 | acpi_handle device, | 940 | acpi_handle device, |
936 | u32 event_number, void *context); | 941 | u32 event_number, void *context); |
937 | 942 | ||
938 | #define ACPI_EVENT_TYPE_GPE 0 | 943 | #define ACPI_EVENT_TYPE_GPE 0 |
939 | #define ACPI_EVENT_TYPE_FIXED 1 | 944 | #define ACPI_EVENT_TYPE_FIXED 1 |
940 | 945 | ||
941 | typedef u32(*acpi_event_handler) (void *context); | 946 | typedef |
947 | u32(*acpi_event_handler) (void *context); | ||
942 | 948 | ||
943 | typedef | 949 | typedef |
944 | u32 (*acpi_gpe_handler) (acpi_handle gpe_device, u32 gpe_number, void *context); | 950 | u32 (*acpi_gpe_handler) (acpi_handle gpe_device, u32 gpe_number, void *context); |
@@ -1018,17 +1024,17 @@ u32 (*acpi_interface_handler) (acpi_string interface_name, u32 supported); | |||
1018 | 1024 | ||
1019 | #define ACPI_UUID_LENGTH 16 | 1025 | #define ACPI_UUID_LENGTH 16 |
1020 | 1026 | ||
1021 | /* Structures used for device/processor HID, UID, CID */ | 1027 | /* Structures used for device/processor HID, UID, CID, and SUB */ |
1022 | 1028 | ||
1023 | struct acpica_device_id { | 1029 | struct acpi_pnp_device_id { |
1024 | u32 length; /* Length of string + null */ | 1030 | u32 length; /* Length of string + null */ |
1025 | char *string; | 1031 | char *string; |
1026 | }; | 1032 | }; |
1027 | 1033 | ||
1028 | struct acpica_device_id_list { | 1034 | struct acpi_pnp_device_id_list { |
1029 | u32 count; /* Number of IDs in Ids array */ | 1035 | u32 count; /* Number of IDs in Ids array */ |
1030 | u32 list_size; /* Size of list, including ID strings */ | 1036 | u32 list_size; /* Size of list, including ID strings */ |
1031 | struct acpica_device_id ids[1]; /* ID array */ | 1037 | struct acpi_pnp_device_id ids[1]; /* ID array */ |
1032 | }; | 1038 | }; |
1033 | 1039 | ||
1034 | /* | 1040 | /* |
@@ -1046,9 +1052,10 @@ struct acpi_device_info { | |||
1046 | u8 lowest_dstates[5]; /* _sx_w values: 0xFF indicates not valid */ | 1052 | u8 lowest_dstates[5]; /* _sx_w values: 0xFF indicates not valid */ |
1047 | u32 current_status; /* _STA value */ | 1053 | u32 current_status; /* _STA value */ |
1048 | u64 address; /* _ADR value */ | 1054 | u64 address; /* _ADR value */ |
1049 | struct acpica_device_id hardware_id; /* _HID value */ | 1055 | struct acpi_pnp_device_id hardware_id; /* _HID value */ |
1050 | struct acpica_device_id unique_id; /* _UID value */ | 1056 | struct acpi_pnp_device_id unique_id; /* _UID value */ |
1051 | struct acpica_device_id_list compatible_id_list; /* _CID list <must be last> */ | 1057 | struct acpi_pnp_device_id subsystem_id; /* _SUB value */ |
1058 | struct acpi_pnp_device_id_list compatible_id_list; /* _CID list <must be last> */ | ||
1052 | }; | 1059 | }; |
1053 | 1060 | ||
1054 | /* Values for Flags field above (acpi_get_object_info) */ | 1061 | /* Values for Flags field above (acpi_get_object_info) */ |
@@ -1061,11 +1068,12 @@ struct acpi_device_info { | |||
1061 | #define ACPI_VALID_ADR 0x02 | 1068 | #define ACPI_VALID_ADR 0x02 |
1062 | #define ACPI_VALID_HID 0x04 | 1069 | #define ACPI_VALID_HID 0x04 |
1063 | #define ACPI_VALID_UID 0x08 | 1070 | #define ACPI_VALID_UID 0x08 |
1064 | #define ACPI_VALID_CID 0x10 | 1071 | #define ACPI_VALID_SUB 0x10 |
1065 | #define ACPI_VALID_SXDS 0x20 | 1072 | #define ACPI_VALID_CID 0x20 |
1066 | #define ACPI_VALID_SXWS 0x40 | 1073 | #define ACPI_VALID_SXDS 0x40 |
1074 | #define ACPI_VALID_SXWS 0x80 | ||
1067 | 1075 | ||
1068 | /* Flags for _STA method */ | 1076 | /* Flags for _STA return value (current_status above) */ |
1069 | 1077 | ||
1070 | #define ACPI_STA_DEVICE_PRESENT 0x01 | 1078 | #define ACPI_STA_DEVICE_PRESENT 0x01 |
1071 | #define ACPI_STA_DEVICE_ENABLED 0x02 | 1079 | #define ACPI_STA_DEVICE_ENABLED 0x02 |
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index eb70ca295971..20ca7663975f 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/errno.h> | 6 | #include <linux/errno.h> |
7 | #include <linux/of.h> | 7 | #include <linux/of.h> |
8 | #include <linux/pinctrl/pinctrl.h> | ||
8 | 9 | ||
9 | #ifdef CONFIG_GPIOLIB | 10 | #ifdef CONFIG_GPIOLIB |
10 | 11 | ||
@@ -137,6 +138,15 @@ struct gpio_chip { | |||
137 | int (*of_xlate)(struct gpio_chip *gc, | 138 | int (*of_xlate)(struct gpio_chip *gc, |
138 | const struct of_phandle_args *gpiospec, u32 *flags); | 139 | const struct of_phandle_args *gpiospec, u32 *flags); |
139 | #endif | 140 | #endif |
141 | #ifdef CONFIG_PINCTRL | ||
142 | /* | ||
143 | * If CONFIG_PINCTRL is enabled, then gpio controllers can optionally | ||
144 | * describe the actual pin range which they serve in an SoC. This | ||
145 | * information would be used by pinctrl subsystem to configure | ||
146 | * corresponding pins for gpio usage. | ||
147 | */ | ||
148 | struct list_head pin_ranges; | ||
149 | #endif | ||
140 | }; | 150 | }; |
141 | 151 | ||
142 | extern const char *gpiochip_is_requested(struct gpio_chip *chip, | 152 | extern const char *gpiochip_is_requested(struct gpio_chip *chip, |
@@ -260,4 +270,41 @@ static inline void gpio_unexport(unsigned gpio) | |||
260 | } | 270 | } |
261 | #endif /* CONFIG_GPIO_SYSFS */ | 271 | #endif /* CONFIG_GPIO_SYSFS */ |
262 | 272 | ||
273 | #ifdef CONFIG_PINCTRL | ||
274 | |||
275 | /** | ||
276 | * struct gpio_pin_range - pin range controlled by a gpio chip | ||
277 | * @head: list for maintaining set of pin ranges, used internally | ||
278 | * @pctldev: pinctrl device which handles corresponding pins | ||
279 | * @range: actual range of pins controlled by a gpio controller | ||
280 | */ | ||
281 | |||
282 | struct gpio_pin_range { | ||
283 | struct list_head node; | ||
284 | struct pinctrl_dev *pctldev; | ||
285 | struct pinctrl_gpio_range range; | ||
286 | }; | ||
287 | |||
288 | int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
289 | unsigned int gpio_offset, unsigned int pin_offset, | ||
290 | unsigned int npins); | ||
291 | void gpiochip_remove_pin_ranges(struct gpio_chip *chip); | ||
292 | |||
293 | #else | ||
294 | |||
295 | static inline int | ||
296 | gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
297 | unsigned int gpio_offset, unsigned int pin_offset, | ||
298 | unsigned int npins) | ||
299 | { | ||
300 | return 0; | ||
301 | } | ||
302 | |||
303 | static inline void | ||
304 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) | ||
305 | { | ||
306 | } | ||
307 | |||
308 | #endif /* CONFIG_PINCTRL */ | ||
309 | |||
263 | #endif /* _ASM_GENERIC_GPIO_H */ | 310 | #endif /* _ASM_GENERIC_GPIO_H */ |
diff --git a/include/asm-generic/trace_clock.h b/include/asm-generic/trace_clock.h new file mode 100644 index 000000000000..6726f1bafb5e --- /dev/null +++ b/include/asm-generic/trace_clock.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef _ASM_GENERIC_TRACE_CLOCK_H | ||
2 | #define _ASM_GENERIC_TRACE_CLOCK_H | ||
3 | /* | ||
4 | * Arch-specific trace clocks. | ||
5 | */ | ||
6 | |||
7 | /* | ||
8 | * Additional trace clocks added to the trace_clocks | ||
9 | * array in kernel/trace/trace.c | ||
10 | * None if the architecture has not defined it. | ||
11 | */ | ||
12 | #ifndef ARCH_TRACE_CLOCKS | ||
13 | # define ARCH_TRACE_CLOCKS | ||
14 | #endif | ||
15 | |||
16 | #endif /* _ASM_GENERIC_TRACE_CLOCK_H */ | ||
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index af1cbaf535ed..c5c35e629426 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
@@ -210,6 +210,7 @@ | |||
210 | {0x1002, 0x6798, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 210 | {0x1002, 0x6798, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
211 | {0x1002, 0x6799, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 211 | {0x1002, 0x6799, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
212 | {0x1002, 0x679A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 212 | {0x1002, 0x679A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
213 | {0x1002, 0x679B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | ||
213 | {0x1002, 0x679E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 214 | {0x1002, 0x679E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
214 | {0x1002, 0x679F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 215 | {0x1002, 0x679F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
215 | {0x1002, 0x6800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 216 | {0x1002, 0x6800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 90be98981102..c33fa3ce9b7c 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -25,7 +25,9 @@ | |||
25 | #ifndef _LINUX_ACPI_H | 25 | #ifndef _LINUX_ACPI_H |
26 | #define _LINUX_ACPI_H | 26 | #define _LINUX_ACPI_H |
27 | 27 | ||
28 | #include <linux/errno.h> | ||
28 | #include <linux/ioport.h> /* for struct resource */ | 29 | #include <linux/ioport.h> /* for struct resource */ |
30 | #include <linux/device.h> | ||
29 | 31 | ||
30 | #ifdef CONFIG_ACPI | 32 | #ifdef CONFIG_ACPI |
31 | 33 | ||
@@ -250,6 +252,26 @@ extern int pnpacpi_disabled; | |||
250 | 252 | ||
251 | #define PXM_INVAL (-1) | 253 | #define PXM_INVAL (-1) |
252 | 254 | ||
255 | bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res); | ||
256 | bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res); | ||
257 | bool acpi_dev_resource_address_space(struct acpi_resource *ares, | ||
258 | struct resource *res); | ||
259 | bool acpi_dev_resource_ext_address_space(struct acpi_resource *ares, | ||
260 | struct resource *res); | ||
261 | unsigned long acpi_dev_irq_flags(u8 triggering, u8 polarity, u8 shareable); | ||
262 | bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index, | ||
263 | struct resource *res); | ||
264 | |||
265 | struct resource_list_entry { | ||
266 | struct list_head node; | ||
267 | struct resource res; | ||
268 | }; | ||
269 | |||
270 | void acpi_dev_free_resource_list(struct list_head *list); | ||
271 | int acpi_dev_get_resources(struct acpi_device *adev, struct list_head *list, | ||
272 | int (*preproc)(struct acpi_resource *, void *), | ||
273 | void *preproc_data); | ||
274 | |||
253 | int acpi_check_resource_conflict(const struct resource *res); | 275 | int acpi_check_resource_conflict(const struct resource *res); |
254 | 276 | ||
255 | int acpi_check_region(resource_size_t start, resource_size_t n, | 277 | int acpi_check_region(resource_size_t start, resource_size_t n, |
@@ -257,10 +279,14 @@ int acpi_check_region(resource_size_t start, resource_size_t n, | |||
257 | 279 | ||
258 | int acpi_resources_are_enforced(void); | 280 | int acpi_resources_are_enforced(void); |
259 | 281 | ||
260 | #ifdef CONFIG_PM_SLEEP | 282 | #ifdef CONFIG_HIBERNATION |
261 | void __init acpi_no_s4_hw_signature(void); | 283 | void __init acpi_no_s4_hw_signature(void); |
284 | #endif | ||
285 | |||
286 | #ifdef CONFIG_PM_SLEEP | ||
262 | void __init acpi_old_suspend_ordering(void); | 287 | void __init acpi_old_suspend_ordering(void); |
263 | void __init acpi_nvs_nosave(void); | 288 | void __init acpi_nvs_nosave(void); |
289 | void __init acpi_nvs_nosave_s3(void); | ||
264 | #endif /* CONFIG_PM_SLEEP */ | 290 | #endif /* CONFIG_PM_SLEEP */ |
265 | 291 | ||
266 | struct acpi_osc_context { | 292 | struct acpi_osc_context { |
@@ -364,6 +390,17 @@ extern int acpi_nvs_register(__u64 start, __u64 size); | |||
364 | extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *), | 390 | extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *), |
365 | void *data); | 391 | void *data); |
366 | 392 | ||
393 | const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids, | ||
394 | const struct device *dev); | ||
395 | |||
396 | static inline bool acpi_driver_match_device(struct device *dev, | ||
397 | const struct device_driver *drv) | ||
398 | { | ||
399 | return !!acpi_match_device(drv->acpi_match_table, dev); | ||
400 | } | ||
401 | |||
402 | #define ACPI_PTR(_ptr) (_ptr) | ||
403 | |||
367 | #else /* !CONFIG_ACPI */ | 404 | #else /* !CONFIG_ACPI */ |
368 | 405 | ||
369 | #define acpi_disabled 1 | 406 | #define acpi_disabled 1 |
@@ -418,6 +455,22 @@ static inline int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *), | |||
418 | return 0; | 455 | return 0; |
419 | } | 456 | } |
420 | 457 | ||
458 | struct acpi_device_id; | ||
459 | |||
460 | static inline const struct acpi_device_id *acpi_match_device( | ||
461 | const struct acpi_device_id *ids, const struct device *dev) | ||
462 | { | ||
463 | return NULL; | ||
464 | } | ||
465 | |||
466 | static inline bool acpi_driver_match_device(struct device *dev, | ||
467 | const struct device_driver *drv) | ||
468 | { | ||
469 | return false; | ||
470 | } | ||
471 | |||
472 | #define ACPI_PTR(_ptr) (NULL) | ||
473 | |||
421 | #endif /* !CONFIG_ACPI */ | 474 | #endif /* !CONFIG_ACPI */ |
422 | 475 | ||
423 | #ifdef CONFIG_ACPI | 476 | #ifdef CONFIG_ACPI |
@@ -430,4 +483,84 @@ acpi_status acpi_os_prepare_sleep(u8 sleep_state, | |||
430 | #define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0) | 483 | #define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0) |
431 | #endif | 484 | #endif |
432 | 485 | ||
486 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM_RUNTIME) | ||
487 | int acpi_dev_runtime_suspend(struct device *dev); | ||
488 | int acpi_dev_runtime_resume(struct device *dev); | ||
489 | int acpi_subsys_runtime_suspend(struct device *dev); | ||
490 | int acpi_subsys_runtime_resume(struct device *dev); | ||
491 | #else | ||
492 | static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; } | ||
493 | static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; } | ||
494 | static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } | ||
495 | static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } | ||
496 | #endif | ||
497 | |||
498 | #ifdef CONFIG_ACPI_SLEEP | ||
499 | int acpi_dev_suspend_late(struct device *dev); | ||
500 | int acpi_dev_resume_early(struct device *dev); | ||
501 | int acpi_subsys_prepare(struct device *dev); | ||
502 | int acpi_subsys_suspend_late(struct device *dev); | ||
503 | int acpi_subsys_resume_early(struct device *dev); | ||
504 | #else | ||
505 | static inline int acpi_dev_suspend_late(struct device *dev) { return 0; } | ||
506 | static inline int acpi_dev_resume_early(struct device *dev) { return 0; } | ||
507 | static inline int acpi_subsys_prepare(struct device *dev) { return 0; } | ||
508 | static inline int acpi_subsys_suspend_late(struct device *dev) { return 0; } | ||
509 | static inline int acpi_subsys_resume_early(struct device *dev) { return 0; } | ||
510 | #endif | ||
511 | |||
512 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM) | ||
513 | int acpi_dev_pm_attach(struct device *dev, bool power_on); | ||
514 | void acpi_dev_pm_detach(struct device *dev, bool power_off); | ||
515 | #else | ||
516 | static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) | ||
517 | { | ||
518 | return -ENODEV; | ||
519 | } | ||
520 | static inline void acpi_dev_pm_detach(struct device *dev, bool power_off) {} | ||
521 | #endif | ||
522 | |||
523 | #ifdef CONFIG_ACPI | ||
524 | __printf(3, 4) | ||
525 | void acpi_handle_printk(const char *level, acpi_handle handle, | ||
526 | const char *fmt, ...); | ||
527 | #else /* !CONFIG_ACPI */ | ||
528 | static inline __printf(3, 4) void | ||
529 | acpi_handle_printk(const char *level, void *handle, const char *fmt, ...) {} | ||
530 | #endif /* !CONFIG_ACPI */ | ||
531 | |||
532 | /* | ||
533 | * acpi_handle_<level>: Print message with ACPI prefix and object path | ||
534 | * | ||
535 | * These interfaces acquire the global namespace mutex to obtain an object | ||
536 | * path. In interrupt context, it shows the object path as <n/a>. | ||
537 | */ | ||
538 | #define acpi_handle_emerg(handle, fmt, ...) \ | ||
539 | acpi_handle_printk(KERN_EMERG, handle, fmt, ##__VA_ARGS__) | ||
540 | #define acpi_handle_alert(handle, fmt, ...) \ | ||
541 | acpi_handle_printk(KERN_ALERT, handle, fmt, ##__VA_ARGS__) | ||
542 | #define acpi_handle_crit(handle, fmt, ...) \ | ||
543 | acpi_handle_printk(KERN_CRIT, handle, fmt, ##__VA_ARGS__) | ||
544 | #define acpi_handle_err(handle, fmt, ...) \ | ||
545 | acpi_handle_printk(KERN_ERR, handle, fmt, ##__VA_ARGS__) | ||
546 | #define acpi_handle_warn(handle, fmt, ...) \ | ||
547 | acpi_handle_printk(KERN_WARNING, handle, fmt, ##__VA_ARGS__) | ||
548 | #define acpi_handle_notice(handle, fmt, ...) \ | ||
549 | acpi_handle_printk(KERN_NOTICE, handle, fmt, ##__VA_ARGS__) | ||
550 | #define acpi_handle_info(handle, fmt, ...) \ | ||
551 | acpi_handle_printk(KERN_INFO, handle, fmt, ##__VA_ARGS__) | ||
552 | |||
553 | /* REVISIT: Support CONFIG_DYNAMIC_DEBUG when necessary */ | ||
554 | #if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG) | ||
555 | #define acpi_handle_debug(handle, fmt, ...) \ | ||
556 | acpi_handle_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__) | ||
557 | #else | ||
558 | #define acpi_handle_debug(handle, fmt, ...) \ | ||
559 | ({ \ | ||
560 | if (0) \ | ||
561 | acpi_handle_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__); \ | ||
562 | 0; \ | ||
563 | }) | ||
564 | #endif | ||
565 | |||
433 | #endif /*_LINUX_ACPI_H*/ | 566 | #endif /*_LINUX_ACPI_H*/ |
diff --git a/include/linux/acpi_gpio.h b/include/linux/acpi_gpio.h new file mode 100644 index 000000000000..91615a389b65 --- /dev/null +++ b/include/linux/acpi_gpio.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef _LINUX_ACPI_GPIO_H_ | ||
2 | #define _LINUX_ACPI_GPIO_H_ | ||
3 | |||
4 | #include <linux/errno.h> | ||
5 | |||
6 | #ifdef CONFIG_GPIO_ACPI | ||
7 | |||
8 | int acpi_get_gpio(char *path, int pin); | ||
9 | |||
10 | #else /* CONFIG_GPIO_ACPI */ | ||
11 | |||
12 | static inline int acpi_get_gpio(char *path, int pin) | ||
13 | { | ||
14 | return -ENODEV; | ||
15 | } | ||
16 | |||
17 | #endif /* CONFIG_GPIO_ACPI */ | ||
18 | |||
19 | #endif /* _LINUX_ACPI_GPIO_H_ */ | ||
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index d36417158d8f..43ec7e247a80 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
@@ -71,6 +71,16 @@ struct amba_device *amba_ahb_device_add(struct device *parent, const char *name, | |||
71 | resource_size_t base, size_t size, | 71 | resource_size_t base, size_t size, |
72 | int irq1, int irq2, void *pdata, | 72 | int irq1, int irq2, void *pdata, |
73 | unsigned int periphid); | 73 | unsigned int periphid); |
74 | struct amba_device * | ||
75 | amba_apb_device_add_res(struct device *parent, const char *name, | ||
76 | resource_size_t base, size_t size, int irq1, | ||
77 | int irq2, void *pdata, unsigned int periphid, | ||
78 | struct resource *resbase); | ||
79 | struct amba_device * | ||
80 | amba_ahb_device_add_res(struct device *parent, const char *name, | ||
81 | resource_size_t base, size_t size, int irq1, | ||
82 | int irq2, void *pdata, unsigned int periphid, | ||
83 | struct resource *resbase); | ||
74 | void amba_device_unregister(struct amba_device *); | 84 | void amba_device_unregister(struct amba_device *); |
75 | struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int); | 85 | struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int); |
76 | int amba_request_regions(struct amba_device *, const char *); | 86 | int amba_request_regions(struct amba_device *, const char *); |
diff --git a/include/linux/balloon_compaction.h b/include/linux/balloon_compaction.h new file mode 100644 index 000000000000..f7f1d7169b11 --- /dev/null +++ b/include/linux/balloon_compaction.h | |||
@@ -0,0 +1,272 @@ | |||
1 | /* | ||
2 | * include/linux/balloon_compaction.h | ||
3 | * | ||
4 | * Common interface definitions for making balloon pages movable by compaction. | ||
5 | * | ||
6 | * Despite being perfectly possible to perform ballooned pages migration, they | ||
7 | * make a special corner case to compaction scans because balloon pages are not | ||
8 | * enlisted at any LRU list like the other pages we do compact / migrate. | ||
9 | * | ||
10 | * As the page isolation scanning step a compaction thread does is a lockless | ||
11 | * procedure (from a page standpoint), it might bring some racy situations while | ||
12 | * performing balloon page compaction. In order to sort out these racy scenarios | ||
13 | * and safely perform balloon's page compaction and migration we must, always, | ||
14 | * ensure following these three simple rules: | ||
15 | * | ||
16 | * i. when updating a balloon's page ->mapping element, strictly do it under | ||
17 | * the following lock order, independently of the far superior | ||
18 | * locking scheme (lru_lock, balloon_lock): | ||
19 | * +-page_lock(page); | ||
20 | * +--spin_lock_irq(&b_dev_info->pages_lock); | ||
21 | * ... page->mapping updates here ... | ||
22 | * | ||
23 | * ii. before isolating or dequeueing a balloon page from the balloon device | ||
24 | * pages list, the page reference counter must be raised by one and the | ||
25 | * extra refcount must be dropped when the page is enqueued back into | ||
26 | * the balloon device page list, thus a balloon page keeps its reference | ||
27 | * counter raised only while it is under our special handling; | ||
28 | * | ||
29 | * iii. after the lockless scan step have selected a potential balloon page for | ||
30 | * isolation, re-test the page->mapping flags and the page ref counter | ||
31 | * under the proper page lock, to ensure isolating a valid balloon page | ||
32 | * (not yet isolated, nor under release procedure) | ||
33 | * | ||
34 | * The functions provided by this interface are placed to help on coping with | ||
35 | * the aforementioned balloon page corner case, as well as to ensure the simple | ||
36 | * set of exposed rules are satisfied while we are dealing with balloon pages | ||
37 | * compaction / migration. | ||
38 | * | ||
39 | * Copyright (C) 2012, Red Hat, Inc. Rafael Aquini <aquini@redhat.com> | ||
40 | */ | ||
41 | #ifndef _LINUX_BALLOON_COMPACTION_H | ||
42 | #define _LINUX_BALLOON_COMPACTION_H | ||
43 | #include <linux/pagemap.h> | ||
44 | #include <linux/page-flags.h> | ||
45 | #include <linux/migrate.h> | ||
46 | #include <linux/gfp.h> | ||
47 | #include <linux/err.h> | ||
48 | |||
49 | /* | ||
50 | * Balloon device information descriptor. | ||
51 | * This struct is used to allow the common balloon compaction interface | ||
52 | * procedures to find the proper balloon device holding memory pages they'll | ||
53 | * have to cope for page compaction / migration, as well as it serves the | ||
54 | * balloon driver as a page book-keeper for its registered balloon devices. | ||
55 | */ | ||
56 | struct balloon_dev_info { | ||
57 | void *balloon_device; /* balloon device descriptor */ | ||
58 | struct address_space *mapping; /* balloon special page->mapping */ | ||
59 | unsigned long isolated_pages; /* # of isolated pages for migration */ | ||
60 | spinlock_t pages_lock; /* Protection to pages list */ | ||
61 | struct list_head pages; /* Pages enqueued & handled to Host */ | ||
62 | }; | ||
63 | |||
64 | extern struct page *balloon_page_enqueue(struct balloon_dev_info *b_dev_info); | ||
65 | extern struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info); | ||
66 | extern struct balloon_dev_info *balloon_devinfo_alloc( | ||
67 | void *balloon_dev_descriptor); | ||
68 | |||
69 | static inline void balloon_devinfo_free(struct balloon_dev_info *b_dev_info) | ||
70 | { | ||
71 | kfree(b_dev_info); | ||
72 | } | ||
73 | |||
74 | /* | ||
75 | * balloon_page_free - release a balloon page back to the page free lists | ||
76 | * @page: ballooned page to be set free | ||
77 | * | ||
78 | * This function must be used to properly set free an isolated/dequeued balloon | ||
79 | * page at the end of a sucessful page migration, or at the balloon driver's | ||
80 | * page release procedure. | ||
81 | */ | ||
82 | static inline void balloon_page_free(struct page *page) | ||
83 | { | ||
84 | /* | ||
85 | * Balloon pages always get an extra refcount before being isolated | ||
86 | * and before being dequeued to help on sorting out fortuite colisions | ||
87 | * between a thread attempting to isolate and another thread attempting | ||
88 | * to release the very same balloon page. | ||
89 | * | ||
90 | * Before we handle the page back to Buddy, lets drop its extra refcnt. | ||
91 | */ | ||
92 | put_page(page); | ||
93 | __free_page(page); | ||
94 | } | ||
95 | |||
96 | #ifdef CONFIG_BALLOON_COMPACTION | ||
97 | extern bool balloon_page_isolate(struct page *page); | ||
98 | extern void balloon_page_putback(struct page *page); | ||
99 | extern int balloon_page_migrate(struct page *newpage, | ||
100 | struct page *page, enum migrate_mode mode); | ||
101 | extern struct address_space | ||
102 | *balloon_mapping_alloc(struct balloon_dev_info *b_dev_info, | ||
103 | const struct address_space_operations *a_ops); | ||
104 | |||
105 | static inline void balloon_mapping_free(struct address_space *balloon_mapping) | ||
106 | { | ||
107 | kfree(balloon_mapping); | ||
108 | } | ||
109 | |||
110 | /* | ||
111 | * page_flags_cleared - helper to perform balloon @page ->flags tests. | ||
112 | * | ||
113 | * As balloon pages are obtained from buddy and we do not play with page->flags | ||
114 | * at driver level (exception made when we get the page lock for compaction), | ||
115 | * we can safely identify a ballooned page by checking if the | ||
116 | * PAGE_FLAGS_CHECK_AT_PREP page->flags are all cleared. This approach also | ||
117 | * helps us skip ballooned pages that are locked for compaction or release, thus | ||
118 | * mitigating their racy check at balloon_page_movable() | ||
119 | */ | ||
120 | static inline bool page_flags_cleared(struct page *page) | ||
121 | { | ||
122 | return !(page->flags & PAGE_FLAGS_CHECK_AT_PREP); | ||
123 | } | ||
124 | |||
125 | /* | ||
126 | * __is_movable_balloon_page - helper to perform @page mapping->flags tests | ||
127 | */ | ||
128 | static inline bool __is_movable_balloon_page(struct page *page) | ||
129 | { | ||
130 | struct address_space *mapping = page->mapping; | ||
131 | return mapping_balloon(mapping); | ||
132 | } | ||
133 | |||
134 | /* | ||
135 | * balloon_page_movable - test page->mapping->flags to identify balloon pages | ||
136 | * that can be moved by compaction/migration. | ||
137 | * | ||
138 | * This function is used at core compaction's page isolation scheme, therefore | ||
139 | * most pages exposed to it are not enlisted as balloon pages and so, to avoid | ||
140 | * undesired side effects like racing against __free_pages(), we cannot afford | ||
141 | * holding the page locked while testing page->mapping->flags here. | ||
142 | * | ||
143 | * As we might return false positives in the case of a balloon page being just | ||
144 | * released under us, the page->mapping->flags need to be re-tested later, | ||
145 | * under the proper page lock, at the functions that will be coping with the | ||
146 | * balloon page case. | ||
147 | */ | ||
148 | static inline bool balloon_page_movable(struct page *page) | ||
149 | { | ||
150 | /* | ||
151 | * Before dereferencing and testing mapping->flags, let's make sure | ||
152 | * this is not a page that uses ->mapping in a different way | ||
153 | */ | ||
154 | if (page_flags_cleared(page) && !page_mapped(page) && | ||
155 | page_count(page) == 1) | ||
156 | return __is_movable_balloon_page(page); | ||
157 | |||
158 | return false; | ||
159 | } | ||
160 | |||
161 | /* | ||
162 | * balloon_page_insert - insert a page into the balloon's page list and make | ||
163 | * the page->mapping assignment accordingly. | ||
164 | * @page : page to be assigned as a 'balloon page' | ||
165 | * @mapping : allocated special 'balloon_mapping' | ||
166 | * @head : balloon's device page list head | ||
167 | * | ||
168 | * Caller must ensure the page is locked and the spin_lock protecting balloon | ||
169 | * pages list is held before inserting a page into the balloon device. | ||
170 | */ | ||
171 | static inline void balloon_page_insert(struct page *page, | ||
172 | struct address_space *mapping, | ||
173 | struct list_head *head) | ||
174 | { | ||
175 | page->mapping = mapping; | ||
176 | list_add(&page->lru, head); | ||
177 | } | ||
178 | |||
179 | /* | ||
180 | * balloon_page_delete - delete a page from balloon's page list and clear | ||
181 | * the page->mapping assignement accordingly. | ||
182 | * @page : page to be released from balloon's page list | ||
183 | * | ||
184 | * Caller must ensure the page is locked and the spin_lock protecting balloon | ||
185 | * pages list is held before deleting a page from the balloon device. | ||
186 | */ | ||
187 | static inline void balloon_page_delete(struct page *page) | ||
188 | { | ||
189 | page->mapping = NULL; | ||
190 | list_del(&page->lru); | ||
191 | } | ||
192 | |||
193 | /* | ||
194 | * balloon_page_device - get the b_dev_info descriptor for the balloon device | ||
195 | * that enqueues the given page. | ||
196 | */ | ||
197 | static inline struct balloon_dev_info *balloon_page_device(struct page *page) | ||
198 | { | ||
199 | struct address_space *mapping = page->mapping; | ||
200 | if (likely(mapping)) | ||
201 | return mapping->private_data; | ||
202 | |||
203 | return NULL; | ||
204 | } | ||
205 | |||
206 | static inline gfp_t balloon_mapping_gfp_mask(void) | ||
207 | { | ||
208 | return GFP_HIGHUSER_MOVABLE; | ||
209 | } | ||
210 | |||
211 | static inline bool balloon_compaction_check(void) | ||
212 | { | ||
213 | return true; | ||
214 | } | ||
215 | |||
216 | #else /* !CONFIG_BALLOON_COMPACTION */ | ||
217 | |||
218 | static inline void *balloon_mapping_alloc(void *balloon_device, | ||
219 | const struct address_space_operations *a_ops) | ||
220 | { | ||
221 | return ERR_PTR(-EOPNOTSUPP); | ||
222 | } | ||
223 | |||
224 | static inline void balloon_mapping_free(struct address_space *balloon_mapping) | ||
225 | { | ||
226 | return; | ||
227 | } | ||
228 | |||
229 | static inline void balloon_page_insert(struct page *page, | ||
230 | struct address_space *mapping, | ||
231 | struct list_head *head) | ||
232 | { | ||
233 | list_add(&page->lru, head); | ||
234 | } | ||
235 | |||
236 | static inline void balloon_page_delete(struct page *page) | ||
237 | { | ||
238 | list_del(&page->lru); | ||
239 | } | ||
240 | |||
241 | static inline bool balloon_page_movable(struct page *page) | ||
242 | { | ||
243 | return false; | ||
244 | } | ||
245 | |||
246 | static inline bool balloon_page_isolate(struct page *page) | ||
247 | { | ||
248 | return false; | ||
249 | } | ||
250 | |||
251 | static inline void balloon_page_putback(struct page *page) | ||
252 | { | ||
253 | return; | ||
254 | } | ||
255 | |||
256 | static inline int balloon_page_migrate(struct page *newpage, | ||
257 | struct page *page, enum migrate_mode mode) | ||
258 | { | ||
259 | return 0; | ||
260 | } | ||
261 | |||
262 | static inline gfp_t balloon_mapping_gfp_mask(void) | ||
263 | { | ||
264 | return GFP_HIGHUSER; | ||
265 | } | ||
266 | |||
267 | static inline bool balloon_compaction_check(void) | ||
268 | { | ||
269 | return false; | ||
270 | } | ||
271 | #endif /* CONFIG_BALLOON_COMPACTION */ | ||
272 | #endif /* _LINUX_BALLOON_COMPACTION_H */ | ||
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 6d6795d46a75..7b74452c5317 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -51,8 +51,8 @@ extern unsigned long free_all_bootmem(void); | |||
51 | extern void free_bootmem_node(pg_data_t *pgdat, | 51 | extern void free_bootmem_node(pg_data_t *pgdat, |
52 | unsigned long addr, | 52 | unsigned long addr, |
53 | unsigned long size); | 53 | unsigned long size); |
54 | extern void free_bootmem(unsigned long addr, unsigned long size); | 54 | extern void free_bootmem(unsigned long physaddr, unsigned long size); |
55 | extern void free_bootmem_late(unsigned long addr, unsigned long size); | 55 | extern void free_bootmem_late(unsigned long physaddr, unsigned long size); |
56 | 56 | ||
57 | /* | 57 | /* |
58 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | 58 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, |
diff --git a/include/linux/bug.h b/include/linux/bug.h index aaac4bba6f5c..b1cf40de847e 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h | |||
@@ -15,6 +15,7 @@ struct pt_regs; | |||
15 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) | 15 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) |
16 | #define BUILD_BUG_ON_ZERO(e) (0) | 16 | #define BUILD_BUG_ON_ZERO(e) (0) |
17 | #define BUILD_BUG_ON_NULL(e) ((void*)0) | 17 | #define BUILD_BUG_ON_NULL(e) ((void*)0) |
18 | #define BUILD_BUG_ON_INVALID(e) (0) | ||
18 | #define BUILD_BUG_ON(condition) | 19 | #define BUILD_BUG_ON(condition) |
19 | #define BUILD_BUG() (0) | 20 | #define BUILD_BUG() (0) |
20 | #else /* __CHECKER__ */ | 21 | #else /* __CHECKER__ */ |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index f8a030ced0c7..7d73905dcba2 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/cpumask.h> | 12 | #include <linux/cpumask.h> |
13 | #include <linux/nodemask.h> | 13 | #include <linux/nodemask.h> |
14 | #include <linux/rcupdate.h> | 14 | #include <linux/rcupdate.h> |
15 | #include <linux/rculist.h> | ||
15 | #include <linux/cgroupstats.h> | 16 | #include <linux/cgroupstats.h> |
16 | #include <linux/prio_heap.h> | 17 | #include <linux/prio_heap.h> |
17 | #include <linux/rwsem.h> | 18 | #include <linux/rwsem.h> |
@@ -34,7 +35,6 @@ extern int cgroup_lock_is_held(void); | |||
34 | extern bool cgroup_lock_live_group(struct cgroup *cgrp); | 35 | extern bool cgroup_lock_live_group(struct cgroup *cgrp); |
35 | extern void cgroup_unlock(void); | 36 | extern void cgroup_unlock(void); |
36 | extern void cgroup_fork(struct task_struct *p); | 37 | extern void cgroup_fork(struct task_struct *p); |
37 | extern void cgroup_fork_callbacks(struct task_struct *p); | ||
38 | extern void cgroup_post_fork(struct task_struct *p); | 38 | extern void cgroup_post_fork(struct task_struct *p); |
39 | extern void cgroup_exit(struct task_struct *p, int run_callbacks); | 39 | extern void cgroup_exit(struct task_struct *p, int run_callbacks); |
40 | extern int cgroupstats_build(struct cgroupstats *stats, | 40 | extern int cgroupstats_build(struct cgroupstats *stats, |
@@ -66,7 +66,7 @@ struct cgroup_subsys_state { | |||
66 | /* | 66 | /* |
67 | * State maintained by the cgroup system to allow subsystems | 67 | * State maintained by the cgroup system to allow subsystems |
68 | * to be "busy". Should be accessed via css_get(), | 68 | * to be "busy". Should be accessed via css_get(), |
69 | * css_tryget() and and css_put(). | 69 | * css_tryget() and css_put(). |
70 | */ | 70 | */ |
71 | 71 | ||
72 | atomic_t refcnt; | 72 | atomic_t refcnt; |
@@ -81,9 +81,8 @@ struct cgroup_subsys_state { | |||
81 | 81 | ||
82 | /* bits in struct cgroup_subsys_state flags field */ | 82 | /* bits in struct cgroup_subsys_state flags field */ |
83 | enum { | 83 | enum { |
84 | CSS_ROOT, /* This CSS is the root of the subsystem */ | 84 | CSS_ROOT = (1 << 0), /* this CSS is the root of the subsystem */ |
85 | CSS_REMOVED, /* This CSS is dead */ | 85 | CSS_ONLINE = (1 << 1), /* between ->css_online() and ->css_offline() */ |
86 | CSS_CLEAR_CSS_REFS, /* @ss->__DEPRECATED_clear_css_refs */ | ||
87 | }; | 86 | }; |
88 | 87 | ||
89 | /* Caller must verify that the css is not for root cgroup */ | 88 | /* Caller must verify that the css is not for root cgroup */ |
@@ -102,15 +101,10 @@ static inline void __css_get(struct cgroup_subsys_state *css, int count) | |||
102 | static inline void css_get(struct cgroup_subsys_state *css) | 101 | static inline void css_get(struct cgroup_subsys_state *css) |
103 | { | 102 | { |
104 | /* We don't need to reference count the root state */ | 103 | /* We don't need to reference count the root state */ |
105 | if (!test_bit(CSS_ROOT, &css->flags)) | 104 | if (!(css->flags & CSS_ROOT)) |
106 | __css_get(css, 1); | 105 | __css_get(css, 1); |
107 | } | 106 | } |
108 | 107 | ||
109 | static inline bool css_is_removed(struct cgroup_subsys_state *css) | ||
110 | { | ||
111 | return test_bit(CSS_REMOVED, &css->flags); | ||
112 | } | ||
113 | |||
114 | /* | 108 | /* |
115 | * Call css_tryget() to take a reference on a css if your existing | 109 | * Call css_tryget() to take a reference on a css if your existing |
116 | * (known-valid) reference isn't already ref-counted. Returns false if | 110 | * (known-valid) reference isn't already ref-counted. Returns false if |
@@ -120,7 +114,7 @@ static inline bool css_is_removed(struct cgroup_subsys_state *css) | |||
120 | extern bool __css_tryget(struct cgroup_subsys_state *css); | 114 | extern bool __css_tryget(struct cgroup_subsys_state *css); |
121 | static inline bool css_tryget(struct cgroup_subsys_state *css) | 115 | static inline bool css_tryget(struct cgroup_subsys_state *css) |
122 | { | 116 | { |
123 | if (test_bit(CSS_ROOT, &css->flags)) | 117 | if (css->flags & CSS_ROOT) |
124 | return true; | 118 | return true; |
125 | return __css_tryget(css); | 119 | return __css_tryget(css); |
126 | } | 120 | } |
@@ -133,7 +127,7 @@ static inline bool css_tryget(struct cgroup_subsys_state *css) | |||
133 | extern void __css_put(struct cgroup_subsys_state *css); | 127 | extern void __css_put(struct cgroup_subsys_state *css); |
134 | static inline void css_put(struct cgroup_subsys_state *css) | 128 | static inline void css_put(struct cgroup_subsys_state *css) |
135 | { | 129 | { |
136 | if (!test_bit(CSS_ROOT, &css->flags)) | 130 | if (!(css->flags & CSS_ROOT)) |
137 | __css_put(css); | 131 | __css_put(css); |
138 | } | 132 | } |
139 | 133 | ||
@@ -149,13 +143,11 @@ enum { | |||
149 | /* Control Group requires release notifications to userspace */ | 143 | /* Control Group requires release notifications to userspace */ |
150 | CGRP_NOTIFY_ON_RELEASE, | 144 | CGRP_NOTIFY_ON_RELEASE, |
151 | /* | 145 | /* |
152 | * A thread in rmdir() is wating for this cgroup. | 146 | * Clone the parent's configuration when creating a new child |
153 | */ | 147 | * cpuset cgroup. For historical reasons, this option can be |
154 | CGRP_WAIT_ON_RMDIR, | 148 | * specified at mount time and thus is implemented here. |
155 | /* | ||
156 | * Clone cgroup values when creating a new child cgroup | ||
157 | */ | 149 | */ |
158 | CGRP_CLONE_CHILDREN, | 150 | CGRP_CPUSET_CLONE_CHILDREN, |
159 | }; | 151 | }; |
160 | 152 | ||
161 | struct cgroup { | 153 | struct cgroup { |
@@ -167,6 +159,8 @@ struct cgroup { | |||
167 | */ | 159 | */ |
168 | atomic_t count; | 160 | atomic_t count; |
169 | 161 | ||
162 | int id; /* ida allocated in-hierarchy ID */ | ||
163 | |||
170 | /* | 164 | /* |
171 | * We link our 'sibling' struct into our parent's 'children'. | 165 | * We link our 'sibling' struct into our parent's 'children'. |
172 | * Our children link their 'sibling' into our 'children'. | 166 | * Our children link their 'sibling' into our 'children'. |
@@ -176,7 +170,7 @@ struct cgroup { | |||
176 | struct list_head files; /* my files */ | 170 | struct list_head files; /* my files */ |
177 | 171 | ||
178 | struct cgroup *parent; /* my parent */ | 172 | struct cgroup *parent; /* my parent */ |
179 | struct dentry __rcu *dentry; /* cgroup fs entry, RCU protected */ | 173 | struct dentry *dentry; /* cgroup fs entry, RCU protected */ |
180 | 174 | ||
181 | /* Private pointers for each registered subsystem */ | 175 | /* Private pointers for each registered subsystem */ |
182 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; | 176 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; |
@@ -282,7 +276,7 @@ struct cgroup_map_cb { | |||
282 | 276 | ||
283 | /* cftype->flags */ | 277 | /* cftype->flags */ |
284 | #define CFTYPE_ONLY_ON_ROOT (1U << 0) /* only create on root cg */ | 278 | #define CFTYPE_ONLY_ON_ROOT (1U << 0) /* only create on root cg */ |
285 | #define CFTYPE_NOT_ON_ROOT (1U << 1) /* don't create onp root cg */ | 279 | #define CFTYPE_NOT_ON_ROOT (1U << 1) /* don't create on root cg */ |
286 | 280 | ||
287 | #define MAX_CFTYPE_NAME 64 | 281 | #define MAX_CFTYPE_NAME 64 |
288 | 282 | ||
@@ -422,23 +416,6 @@ int cgroup_task_count(const struct cgroup *cgrp); | |||
422 | int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task); | 416 | int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task); |
423 | 417 | ||
424 | /* | 418 | /* |
425 | * When the subsys has to access css and may add permanent refcnt to css, | ||
426 | * it should take care of racy conditions with rmdir(). Following set of | ||
427 | * functions, is for stop/restart rmdir if necessary. | ||
428 | * Because these will call css_get/put, "css" should be alive css. | ||
429 | * | ||
430 | * cgroup_exclude_rmdir(); | ||
431 | * ...do some jobs which may access arbitrary empty cgroup | ||
432 | * cgroup_release_and_wakeup_rmdir(); | ||
433 | * | ||
434 | * When someone removes a cgroup while cgroup_exclude_rmdir() holds it, | ||
435 | * it sleeps and cgroup_release_and_wakeup_rmdir() will wake him up. | ||
436 | */ | ||
437 | |||
438 | void cgroup_exclude_rmdir(struct cgroup_subsys_state *css); | ||
439 | void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css); | ||
440 | |||
441 | /* | ||
442 | * Control Group taskset, used to pass around set of tasks to cgroup_subsys | 419 | * Control Group taskset, used to pass around set of tasks to cgroup_subsys |
443 | * methods. | 420 | * methods. |
444 | */ | 421 | */ |
@@ -466,16 +443,17 @@ int cgroup_taskset_size(struct cgroup_taskset *tset); | |||
466 | */ | 443 | */ |
467 | 444 | ||
468 | struct cgroup_subsys { | 445 | struct cgroup_subsys { |
469 | struct cgroup_subsys_state *(*create)(struct cgroup *cgrp); | 446 | struct cgroup_subsys_state *(*css_alloc)(struct cgroup *cgrp); |
470 | int (*pre_destroy)(struct cgroup *cgrp); | 447 | int (*css_online)(struct cgroup *cgrp); |
471 | void (*destroy)(struct cgroup *cgrp); | 448 | void (*css_offline)(struct cgroup *cgrp); |
449 | void (*css_free)(struct cgroup *cgrp); | ||
450 | |||
472 | int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); | 451 | int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); |
473 | void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); | 452 | void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); |
474 | void (*attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); | 453 | void (*attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); |
475 | void (*fork)(struct task_struct *task); | 454 | void (*fork)(struct task_struct *task); |
476 | void (*exit)(struct cgroup *cgrp, struct cgroup *old_cgrp, | 455 | void (*exit)(struct cgroup *cgrp, struct cgroup *old_cgrp, |
477 | struct task_struct *task); | 456 | struct task_struct *task); |
478 | void (*post_clone)(struct cgroup *cgrp); | ||
479 | void (*bind)(struct cgroup *root); | 457 | void (*bind)(struct cgroup *root); |
480 | 458 | ||
481 | int subsys_id; | 459 | int subsys_id; |
@@ -489,17 +467,6 @@ struct cgroup_subsys { | |||
489 | bool use_id; | 467 | bool use_id; |
490 | 468 | ||
491 | /* | 469 | /* |
492 | * If %true, cgroup removal will try to clear css refs by retrying | ||
493 | * ss->pre_destroy() until there's no css ref left. This behavior | ||
494 | * is strictly for backward compatibility and will be removed as | ||
495 | * soon as the current user (memcg) is updated. | ||
496 | * | ||
497 | * If %false, ss->pre_destroy() can't fail and cgroup removal won't | ||
498 | * wait for css refs to drop to zero before proceeding. | ||
499 | */ | ||
500 | bool __DEPRECATED_clear_css_refs; | ||
501 | |||
502 | /* | ||
503 | * If %false, this subsystem is properly hierarchical - | 470 | * If %false, this subsystem is properly hierarchical - |
504 | * configuration, resource accounting and restriction on a parent | 471 | * configuration, resource accounting and restriction on a parent |
505 | * cgroup cover those of its children. If %true, hierarchy support | 472 | * cgroup cover those of its children. If %true, hierarchy support |
@@ -572,6 +539,100 @@ static inline struct cgroup* task_cgroup(struct task_struct *task, | |||
572 | return task_subsys_state(task, subsys_id)->cgroup; | 539 | return task_subsys_state(task, subsys_id)->cgroup; |
573 | } | 540 | } |
574 | 541 | ||
542 | /** | ||
543 | * cgroup_for_each_child - iterate through children of a cgroup | ||
544 | * @pos: the cgroup * to use as the loop cursor | ||
545 | * @cgroup: cgroup whose children to walk | ||
546 | * | ||
547 | * Walk @cgroup's children. Must be called under rcu_read_lock(). A child | ||
548 | * cgroup which hasn't finished ->css_online() or already has finished | ||
549 | * ->css_offline() may show up during traversal and it's each subsystem's | ||
550 | * responsibility to verify that each @pos is alive. | ||
551 | * | ||
552 | * If a subsystem synchronizes against the parent in its ->css_online() and | ||
553 | * before starting iterating, a cgroup which finished ->css_online() is | ||
554 | * guaranteed to be visible in the future iterations. | ||
555 | */ | ||
556 | #define cgroup_for_each_child(pos, cgroup) \ | ||
557 | list_for_each_entry_rcu(pos, &(cgroup)->children, sibling) | ||
558 | |||
559 | struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos, | ||
560 | struct cgroup *cgroup); | ||
561 | |||
562 | /** | ||
563 | * cgroup_for_each_descendant_pre - pre-order walk of a cgroup's descendants | ||
564 | * @pos: the cgroup * to use as the loop cursor | ||
565 | * @cgroup: cgroup whose descendants to walk | ||
566 | * | ||
567 | * Walk @cgroup's descendants. Must be called under rcu_read_lock(). A | ||
568 | * descendant cgroup which hasn't finished ->css_online() or already has | ||
569 | * finished ->css_offline() may show up during traversal and it's each | ||
570 | * subsystem's responsibility to verify that each @pos is alive. | ||
571 | * | ||
572 | * If a subsystem synchronizes against the parent in its ->css_online() and | ||
573 | * before starting iterating, and synchronizes against @pos on each | ||
574 | * iteration, any descendant cgroup which finished ->css_offline() is | ||
575 | * guaranteed to be visible in the future iterations. | ||
576 | * | ||
577 | * In other words, the following guarantees that a descendant can't escape | ||
578 | * state updates of its ancestors. | ||
579 | * | ||
580 | * my_online(@cgrp) | ||
581 | * { | ||
582 | * Lock @cgrp->parent and @cgrp; | ||
583 | * Inherit state from @cgrp->parent; | ||
584 | * Unlock both. | ||
585 | * } | ||
586 | * | ||
587 | * my_update_state(@cgrp) | ||
588 | * { | ||
589 | * Lock @cgrp; | ||
590 | * Update @cgrp's state; | ||
591 | * Unlock @cgrp; | ||
592 | * | ||
593 | * cgroup_for_each_descendant_pre(@pos, @cgrp) { | ||
594 | * Lock @pos; | ||
595 | * Verify @pos is alive and inherit state from @pos->parent; | ||
596 | * Unlock @pos; | ||
597 | * } | ||
598 | * } | ||
599 | * | ||
600 | * As long as the inheriting step, including checking the parent state, is | ||
601 | * enclosed inside @pos locking, double-locking the parent isn't necessary | ||
602 | * while inheriting. The state update to the parent is guaranteed to be | ||
603 | * visible by walking order and, as long as inheriting operations to the | ||
604 | * same @pos are atomic to each other, multiple updates racing each other | ||
605 | * still result in the correct state. It's guaranateed that at least one | ||
606 | * inheritance happens for any cgroup after the latest update to its | ||
607 | * parent. | ||
608 | * | ||
609 | * If checking parent's state requires locking the parent, each inheriting | ||
610 | * iteration should lock and unlock both @pos->parent and @pos. | ||
611 | * | ||
612 | * Alternatively, a subsystem may choose to use a single global lock to | ||
613 | * synchronize ->css_online() and ->css_offline() against tree-walking | ||
614 | * operations. | ||
615 | */ | ||
616 | #define cgroup_for_each_descendant_pre(pos, cgroup) \ | ||
617 | for (pos = cgroup_next_descendant_pre(NULL, (cgroup)); (pos); \ | ||
618 | pos = cgroup_next_descendant_pre((pos), (cgroup))) | ||
619 | |||
620 | struct cgroup *cgroup_next_descendant_post(struct cgroup *pos, | ||
621 | struct cgroup *cgroup); | ||
622 | |||
623 | /** | ||
624 | * cgroup_for_each_descendant_post - post-order walk of a cgroup's descendants | ||
625 | * @pos: the cgroup * to use as the loop cursor | ||
626 | * @cgroup: cgroup whose descendants to walk | ||
627 | * | ||
628 | * Similar to cgroup_for_each_descendant_pre() but performs post-order | ||
629 | * traversal instead. Note that the walk visibility guarantee described in | ||
630 | * pre-order walk doesn't apply the same to post-order walks. | ||
631 | */ | ||
632 | #define cgroup_for_each_descendant_post(pos, cgroup) \ | ||
633 | for (pos = cgroup_next_descendant_post(NULL, (cgroup)); (pos); \ | ||
634 | pos = cgroup_next_descendant_post((pos), (cgroup))) | ||
635 | |||
575 | /* A cgroup_iter should be treated as an opaque object */ | 636 | /* A cgroup_iter should be treated as an opaque object */ |
576 | struct cgroup_iter { | 637 | struct cgroup_iter { |
577 | struct list_head *cg_link; | 638 | struct list_head *cg_link; |
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 172d5bdaf03d..4989b8a7bed1 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
@@ -57,6 +57,11 @@ struct clk_hw; | |||
57 | * This function must not sleep. Optional, if this op is not | 57 | * This function must not sleep. Optional, if this op is not |
58 | * set then the enable count will be used. | 58 | * set then the enable count will be used. |
59 | * | 59 | * |
60 | * @disable_unused: Disable the clock atomically. Only called from | ||
61 | * clk_disable_unused for gate clocks with special needs. | ||
62 | * Called with enable_lock held. This function must not | ||
63 | * sleep. | ||
64 | * | ||
60 | * @recalc_rate Recalculate the rate of this clock, by querying hardware. The | 65 | * @recalc_rate Recalculate the rate of this clock, by querying hardware. The |
61 | * parent rate is an input parameter. It is up to the caller to | 66 | * parent rate is an input parameter. It is up to the caller to |
62 | * ensure that the prepare_mutex is held across this call. | 67 | * ensure that the prepare_mutex is held across this call. |
@@ -106,6 +111,7 @@ struct clk_ops { | |||
106 | int (*enable)(struct clk_hw *hw); | 111 | int (*enable)(struct clk_hw *hw); |
107 | void (*disable)(struct clk_hw *hw); | 112 | void (*disable)(struct clk_hw *hw); |
108 | int (*is_enabled)(struct clk_hw *hw); | 113 | int (*is_enabled)(struct clk_hw *hw); |
114 | void (*disable_unused)(struct clk_hw *hw); | ||
109 | unsigned long (*recalc_rate)(struct clk_hw *hw, | 115 | unsigned long (*recalc_rate)(struct clk_hw *hw, |
110 | unsigned long parent_rate); | 116 | unsigned long parent_rate); |
111 | long (*round_rate)(struct clk_hw *hw, unsigned long, | 117 | long (*round_rate)(struct clk_hw *hw, unsigned long, |
@@ -331,8 +337,10 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name, | |||
331 | * error code; drivers must test for an error code after calling clk_register. | 337 | * error code; drivers must test for an error code after calling clk_register. |
332 | */ | 338 | */ |
333 | struct clk *clk_register(struct device *dev, struct clk_hw *hw); | 339 | struct clk *clk_register(struct device *dev, struct clk_hw *hw); |
340 | struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw); | ||
334 | 341 | ||
335 | void clk_unregister(struct clk *clk); | 342 | void clk_unregister(struct clk *clk); |
343 | void devm_clk_unregister(struct device *dev, struct clk *clk); | ||
336 | 344 | ||
337 | /* helper functions */ | 345 | /* helper functions */ |
338 | const char *__clk_get_name(struct clk *clk); | 346 | const char *__clk_get_name(struct clk *clk); |
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h new file mode 100644 index 000000000000..e24339ccb7f0 --- /dev/null +++ b/include/linux/context_tracking.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef _LINUX_CONTEXT_TRACKING_H | ||
2 | #define _LINUX_CONTEXT_TRACKING_H | ||
3 | |||
4 | #ifdef CONFIG_CONTEXT_TRACKING | ||
5 | #include <linux/sched.h> | ||
6 | |||
7 | extern void user_enter(void); | ||
8 | extern void user_exit(void); | ||
9 | extern void context_tracking_task_switch(struct task_struct *prev, | ||
10 | struct task_struct *next); | ||
11 | #else | ||
12 | static inline void user_enter(void) { } | ||
13 | static inline void user_exit(void) { } | ||
14 | static inline void context_tracking_task_switch(struct task_struct *prev, | ||
15 | struct task_struct *next) { } | ||
16 | #endif /* !CONFIG_CONTEXT_TRACKING */ | ||
17 | |||
18 | #endif | ||
diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h index 851530128e65..40b4ef54cc7d 100644 --- a/include/linux/cpu_cooling.h +++ b/include/linux/cpu_cooling.h | |||
@@ -29,13 +29,13 @@ | |||
29 | #define CPUFREQ_COOLING_START 0 | 29 | #define CPUFREQ_COOLING_START 0 |
30 | #define CPUFREQ_COOLING_STOP 1 | 30 | #define CPUFREQ_COOLING_STOP 1 |
31 | 31 | ||
32 | #ifdef CONFIG_CPU_THERMAL | 32 | #if defined(CONFIG_CPU_THERMAL) || defined(CONFIG_CPU_THERMAL_MODULE) |
33 | /** | 33 | /** |
34 | * cpufreq_cooling_register - function to create cpufreq cooling device. | 34 | * cpufreq_cooling_register - function to create cpufreq cooling device. |
35 | * @clip_cpus: cpumask of cpus where the frequency constraints will happen | 35 | * @clip_cpus: cpumask of cpus where the frequency constraints will happen |
36 | */ | 36 | */ |
37 | struct thermal_cooling_device *cpufreq_cooling_register( | 37 | struct thermal_cooling_device *cpufreq_cooling_register( |
38 | struct cpumask *clip_cpus); | 38 | const struct cpumask *clip_cpus); |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * cpufreq_cooling_unregister - function to remove cpufreq cooling device. | 41 | * cpufreq_cooling_unregister - function to remove cpufreq cooling device. |
@@ -44,7 +44,7 @@ struct thermal_cooling_device *cpufreq_cooling_register( | |||
44 | void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev); | 44 | void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev); |
45 | #else /* !CONFIG_CPU_THERMAL */ | 45 | #else /* !CONFIG_CPU_THERMAL */ |
46 | static inline struct thermal_cooling_device *cpufreq_cooling_register( | 46 | static inline struct thermal_cooling_device *cpufreq_cooling_register( |
47 | struct cpumask *clip_cpus) | 47 | const struct cpumask *clip_cpus) |
48 | { | 48 | { |
49 | return NULL; | 49 | return NULL; |
50 | } | 50 | } |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index b60f6ba01d0c..a55b88eaf96a 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #ifndef _LINUX_CPUFREQ_H | 11 | #ifndef _LINUX_CPUFREQ_H |
12 | #define _LINUX_CPUFREQ_H | 12 | #define _LINUX_CPUFREQ_H |
13 | 13 | ||
14 | #include <asm/cputime.h> | ||
14 | #include <linux/mutex.h> | 15 | #include <linux/mutex.h> |
15 | #include <linux/notifier.h> | 16 | #include <linux/notifier.h> |
16 | #include <linux/threads.h> | 17 | #include <linux/threads.h> |
@@ -22,6 +23,8 @@ | |||
22 | #include <asm/div64.h> | 23 | #include <asm/div64.h> |
23 | 24 | ||
24 | #define CPUFREQ_NAME_LEN 16 | 25 | #define CPUFREQ_NAME_LEN 16 |
26 | /* Print length for names. Extra 1 space for accomodating '\n' in prints */ | ||
27 | #define CPUFREQ_NAME_PLEN (CPUFREQ_NAME_LEN + 1) | ||
25 | 28 | ||
26 | 29 | ||
27 | /********************************************************************* | 30 | /********************************************************************* |
@@ -404,6 +407,4 @@ void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, | |||
404 | unsigned int cpu); | 407 | unsigned int cpu); |
405 | 408 | ||
406 | void cpufreq_frequency_table_put_attr(unsigned int cpu); | 409 | void cpufreq_frequency_table_put_attr(unsigned int cpu); |
407 | |||
408 | |||
409 | #endif /* _LINUX_CPUFREQ_H */ | 410 | #endif /* _LINUX_CPUFREQ_H */ |
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 279b1eaa8b73..3711b34dc4f9 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
@@ -82,13 +82,6 @@ cpuidle_set_statedata(struct cpuidle_state_usage *st_usage, void *data) | |||
82 | st_usage->driver_data = data; | 82 | st_usage->driver_data = data; |
83 | } | 83 | } |
84 | 84 | ||
85 | struct cpuidle_state_kobj { | ||
86 | struct cpuidle_state *state; | ||
87 | struct cpuidle_state_usage *state_usage; | ||
88 | struct completion kobj_unregister; | ||
89 | struct kobject kobj; | ||
90 | }; | ||
91 | |||
92 | struct cpuidle_device { | 85 | struct cpuidle_device { |
93 | unsigned int registered:1; | 86 | unsigned int registered:1; |
94 | unsigned int enabled:1; | 87 | unsigned int enabled:1; |
@@ -98,7 +91,7 @@ struct cpuidle_device { | |||
98 | int state_count; | 91 | int state_count; |
99 | struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX]; | 92 | struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX]; |
100 | struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX]; | 93 | struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX]; |
101 | 94 | struct cpuidle_driver_kobj *kobj_driver; | |
102 | struct list_head device_list; | 95 | struct list_head device_list; |
103 | struct kobject kobj; | 96 | struct kobject kobj; |
104 | struct completion kobj_unregister; | 97 | struct completion kobj_unregister; |
@@ -131,6 +124,7 @@ static inline int cpuidle_get_last_residency(struct cpuidle_device *dev) | |||
131 | struct cpuidle_driver { | 124 | struct cpuidle_driver { |
132 | const char *name; | 125 | const char *name; |
133 | struct module *owner; | 126 | struct module *owner; |
127 | int refcnt; | ||
134 | 128 | ||
135 | unsigned int power_specified:1; | 129 | unsigned int power_specified:1; |
136 | /* set to 1 to use the core cpuidle time keeping (for all states). */ | 130 | /* set to 1 to use the core cpuidle time keeping (for all states). */ |
@@ -163,6 +157,10 @@ extern int cpuidle_wrap_enter(struct cpuidle_device *dev, | |||
163 | struct cpuidle_driver *drv, int index)); | 157 | struct cpuidle_driver *drv, int index)); |
164 | extern int cpuidle_play_dead(void); | 158 | extern int cpuidle_play_dead(void); |
165 | 159 | ||
160 | extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev); | ||
161 | extern int cpuidle_register_cpu_driver(struct cpuidle_driver *drv, int cpu); | ||
162 | extern void cpuidle_unregister_cpu_driver(struct cpuidle_driver *drv, int cpu); | ||
163 | |||
166 | #else | 164 | #else |
167 | static inline void disable_cpuidle(void) { } | 165 | static inline void disable_cpuidle(void) { } |
168 | static inline int cpuidle_idle_call(void) { return -ENODEV; } | 166 | static inline int cpuidle_idle_call(void) { return -ENODEV; } |
@@ -189,7 +187,6 @@ static inline int cpuidle_wrap_enter(struct cpuidle_device *dev, | |||
189 | struct cpuidle_driver *drv, int index)) | 187 | struct cpuidle_driver *drv, int index)) |
190 | { return -ENODEV; } | 188 | { return -ENODEV; } |
191 | static inline int cpuidle_play_dead(void) {return -ENODEV; } | 189 | static inline int cpuidle_play_dead(void) {return -ENODEV; } |
192 | |||
193 | #endif | 190 | #endif |
194 | 191 | ||
195 | #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED | 192 | #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED |
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index 281c72a3b9d5..e83ef39b3bea 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h | |||
@@ -25,12 +25,12 @@ struct devfreq; | |||
25 | * struct devfreq_dev_status - Data given from devfreq user device to | 25 | * struct devfreq_dev_status - Data given from devfreq user device to |
26 | * governors. Represents the performance | 26 | * governors. Represents the performance |
27 | * statistics. | 27 | * statistics. |
28 | * @total_time The total time represented by this instance of | 28 | * @total_time: The total time represented by this instance of |
29 | * devfreq_dev_status | 29 | * devfreq_dev_status |
30 | * @busy_time The time that the device was working among the | 30 | * @busy_time: The time that the device was working among the |
31 | * total_time. | 31 | * total_time. |
32 | * @current_frequency The operating frequency. | 32 | * @current_frequency: The operating frequency. |
33 | * @private_data An entry not specified by the devfreq framework. | 33 | * @private_data: An entry not specified by the devfreq framework. |
34 | * A device and a specific governor may have their | 34 | * A device and a specific governor may have their |
35 | * own protocol with private_data. However, because | 35 | * own protocol with private_data. However, because |
36 | * this is governor-specific, a governor using this | 36 | * this is governor-specific, a governor using this |
@@ -54,23 +54,27 @@ struct devfreq_dev_status { | |||
54 | 54 | ||
55 | /** | 55 | /** |
56 | * struct devfreq_dev_profile - Devfreq's user device profile | 56 | * struct devfreq_dev_profile - Devfreq's user device profile |
57 | * @initial_freq The operating frequency when devfreq_add_device() is | 57 | * @initial_freq: The operating frequency when devfreq_add_device() is |
58 | * called. | 58 | * called. |
59 | * @polling_ms The polling interval in ms. 0 disables polling. | 59 | * @polling_ms: The polling interval in ms. 0 disables polling. |
60 | * @target The device should set its operating frequency at | 60 | * @target: The device should set its operating frequency at |
61 | * freq or lowest-upper-than-freq value. If freq is | 61 | * freq or lowest-upper-than-freq value. If freq is |
62 | * higher than any operable frequency, set maximum. | 62 | * higher than any operable frequency, set maximum. |
63 | * Before returning, target function should set | 63 | * Before returning, target function should set |
64 | * freq at the current frequency. | 64 | * freq at the current frequency. |
65 | * The "flags" parameter's possible values are | 65 | * The "flags" parameter's possible values are |
66 | * explained above with "DEVFREQ_FLAG_*" macros. | 66 | * explained above with "DEVFREQ_FLAG_*" macros. |
67 | * @get_dev_status The device should provide the current performance | 67 | * @get_dev_status: The device should provide the current performance |
68 | * status to devfreq, which is used by governors. | 68 | * status to devfreq, which is used by governors. |
69 | * @exit An optional callback that is called when devfreq | 69 | * @get_cur_freq: The device should provide the current frequency |
70 | * at which it is operating. | ||
71 | * @exit: An optional callback that is called when devfreq | ||
70 | * is removing the devfreq object due to error or | 72 | * is removing the devfreq object due to error or |
71 | * from devfreq_remove_device() call. If the user | 73 | * from devfreq_remove_device() call. If the user |
72 | * has registered devfreq->nb at a notifier-head, | 74 | * has registered devfreq->nb at a notifier-head, |
73 | * this is the time to unregister it. | 75 | * this is the time to unregister it. |
76 | * @freq_table: Optional list of frequencies to support statistics. | ||
77 | * @max_state: The size of freq_table. | ||
74 | */ | 78 | */ |
75 | struct devfreq_dev_profile { | 79 | struct devfreq_dev_profile { |
76 | unsigned long initial_freq; | 80 | unsigned long initial_freq; |
@@ -79,63 +83,63 @@ struct devfreq_dev_profile { | |||
79 | int (*target)(struct device *dev, unsigned long *freq, u32 flags); | 83 | int (*target)(struct device *dev, unsigned long *freq, u32 flags); |
80 | int (*get_dev_status)(struct device *dev, | 84 | int (*get_dev_status)(struct device *dev, |
81 | struct devfreq_dev_status *stat); | 85 | struct devfreq_dev_status *stat); |
86 | int (*get_cur_freq)(struct device *dev, unsigned long *freq); | ||
82 | void (*exit)(struct device *dev); | 87 | void (*exit)(struct device *dev); |
88 | |||
89 | unsigned int *freq_table; | ||
90 | unsigned int max_state; | ||
83 | }; | 91 | }; |
84 | 92 | ||
85 | /** | 93 | /** |
86 | * struct devfreq_governor - Devfreq policy governor | 94 | * struct devfreq_governor - Devfreq policy governor |
87 | * @name Governor's name | 95 | * @node: list node - contains registered devfreq governors |
88 | * @get_target_freq Returns desired operating frequency for the device. | 96 | * @name: Governor's name |
97 | * @get_target_freq: Returns desired operating frequency for the device. | ||
89 | * Basically, get_target_freq will run | 98 | * Basically, get_target_freq will run |
90 | * devfreq_dev_profile.get_dev_status() to get the | 99 | * devfreq_dev_profile.get_dev_status() to get the |
91 | * status of the device (load = busy_time / total_time). | 100 | * status of the device (load = busy_time / total_time). |
92 | * If no_central_polling is set, this callback is called | 101 | * If no_central_polling is set, this callback is called |
93 | * only with update_devfreq() notified by OPP. | 102 | * only with update_devfreq() notified by OPP. |
94 | * @init Called when the devfreq is being attached to a device | 103 | * @event_handler: Callback for devfreq core framework to notify events |
95 | * @exit Called when the devfreq is being removed from a | 104 | * to governors. Events include per device governor |
96 | * device. Governor should stop any internal routines | 105 | * init and exit, opp changes out of devfreq, suspend |
97 | * before return because related data may be | 106 | * and resume of per device devfreq during device idle. |
98 | * freed after exit(). | ||
99 | * @no_central_polling Do not use devfreq's central polling mechanism. | ||
100 | * When this is set, devfreq will not call | ||
101 | * get_target_freq with devfreq_monitor(). However, | ||
102 | * devfreq will call get_target_freq with | ||
103 | * devfreq_update() notified by OPP framework. | ||
104 | * | 107 | * |
105 | * Note that the callbacks are called with devfreq->lock locked by devfreq. | 108 | * Note that the callbacks are called with devfreq->lock locked by devfreq. |
106 | */ | 109 | */ |
107 | struct devfreq_governor { | 110 | struct devfreq_governor { |
111 | struct list_head node; | ||
112 | |||
108 | const char name[DEVFREQ_NAME_LEN]; | 113 | const char name[DEVFREQ_NAME_LEN]; |
109 | int (*get_target_freq)(struct devfreq *this, unsigned long *freq); | 114 | int (*get_target_freq)(struct devfreq *this, unsigned long *freq); |
110 | int (*init)(struct devfreq *this); | 115 | int (*event_handler)(struct devfreq *devfreq, |
111 | void (*exit)(struct devfreq *this); | 116 | unsigned int event, void *data); |
112 | const bool no_central_polling; | ||
113 | }; | 117 | }; |
114 | 118 | ||
115 | /** | 119 | /** |
116 | * struct devfreq - Device devfreq structure | 120 | * struct devfreq - Device devfreq structure |
117 | * @node list node - contains the devices with devfreq that have been | 121 | * @node: list node - contains the devices with devfreq that have been |
118 | * registered. | 122 | * registered. |
119 | * @lock a mutex to protect accessing devfreq. | 123 | * @lock: a mutex to protect accessing devfreq. |
120 | * @dev device registered by devfreq class. dev.parent is the device | 124 | * @dev: device registered by devfreq class. dev.parent is the device |
121 | * using devfreq. | 125 | * using devfreq. |
122 | * @profile device-specific devfreq profile | 126 | * @profile: device-specific devfreq profile |
123 | * @governor method how to choose frequency based on the usage. | 127 | * @governor: method how to choose frequency based on the usage. |
124 | * @nb notifier block used to notify devfreq object that it should | 128 | * @governor_name: devfreq governor name for use with this devfreq |
129 | * @nb: notifier block used to notify devfreq object that it should | ||
125 | * reevaluate operable frequencies. Devfreq users may use | 130 | * reevaluate operable frequencies. Devfreq users may use |
126 | * devfreq.nb to the corresponding register notifier call chain. | 131 | * devfreq.nb to the corresponding register notifier call chain. |
127 | * @polling_jiffies interval in jiffies. | 132 | * @work: delayed work for load monitoring. |
128 | * @previous_freq previously configured frequency value. | 133 | * @previous_freq: previously configured frequency value. |
129 | * @next_polling the number of remaining jiffies to poll with | 134 | * @data: Private data of the governor. The devfreq framework does not |
130 | * "devfreq_monitor" executions to reevaluate | ||
131 | * frequency/voltage of the device. Set by | ||
132 | * profile's polling_ms interval. | ||
133 | * @data Private data of the governor. The devfreq framework does not | ||
134 | * touch this. | 135 | * touch this. |
135 | * @being_removed a flag to mark that this object is being removed in | 136 | * @min_freq: Limit minimum frequency requested by user (0: none) |
136 | * order to prevent trying to remove the object multiple times. | 137 | * @max_freq: Limit maximum frequency requested by user (0: none) |
137 | * @min_freq Limit minimum frequency requested by user (0: none) | 138 | * @stop_polling: devfreq polling status of a device. |
138 | * @max_freq Limit maximum frequency requested by user (0: none) | 139 | * @total_trans: Number of devfreq transitions |
140 | * @trans_table: Statistics of devfreq transitions | ||
141 | * @time_in_state: Statistics of devfreq states | ||
142 | * @last_stat_updated: The last time stat updated | ||
139 | * | 143 | * |
140 | * This structure stores the devfreq information for a give device. | 144 | * This structure stores the devfreq information for a give device. |
141 | * | 145 | * |
@@ -152,26 +156,33 @@ struct devfreq { | |||
152 | struct device dev; | 156 | struct device dev; |
153 | struct devfreq_dev_profile *profile; | 157 | struct devfreq_dev_profile *profile; |
154 | const struct devfreq_governor *governor; | 158 | const struct devfreq_governor *governor; |
159 | char governor_name[DEVFREQ_NAME_LEN]; | ||
155 | struct notifier_block nb; | 160 | struct notifier_block nb; |
161 | struct delayed_work work; | ||
156 | 162 | ||
157 | unsigned long polling_jiffies; | ||
158 | unsigned long previous_freq; | 163 | unsigned long previous_freq; |
159 | unsigned int next_polling; | ||
160 | 164 | ||
161 | void *data; /* private data for governors */ | 165 | void *data; /* private data for governors */ |
162 | 166 | ||
163 | bool being_removed; | ||
164 | |||
165 | unsigned long min_freq; | 167 | unsigned long min_freq; |
166 | unsigned long max_freq; | 168 | unsigned long max_freq; |
169 | bool stop_polling; | ||
170 | |||
171 | /* information for device freqeuncy transition */ | ||
172 | unsigned int total_trans; | ||
173 | unsigned int *trans_table; | ||
174 | unsigned long *time_in_state; | ||
175 | unsigned long last_stat_updated; | ||
167 | }; | 176 | }; |
168 | 177 | ||
169 | #if defined(CONFIG_PM_DEVFREQ) | 178 | #if defined(CONFIG_PM_DEVFREQ) |
170 | extern struct devfreq *devfreq_add_device(struct device *dev, | 179 | extern struct devfreq *devfreq_add_device(struct device *dev, |
171 | struct devfreq_dev_profile *profile, | 180 | struct devfreq_dev_profile *profile, |
172 | const struct devfreq_governor *governor, | 181 | const char *governor_name, |
173 | void *data); | 182 | void *data); |
174 | extern int devfreq_remove_device(struct devfreq *devfreq); | 183 | extern int devfreq_remove_device(struct devfreq *devfreq); |
184 | extern int devfreq_suspend_device(struct devfreq *devfreq); | ||
185 | extern int devfreq_resume_device(struct devfreq *devfreq); | ||
175 | 186 | ||
176 | /* Helper functions for devfreq user device driver with OPP. */ | 187 | /* Helper functions for devfreq user device driver with OPP. */ |
177 | extern struct opp *devfreq_recommended_opp(struct device *dev, | 188 | extern struct opp *devfreq_recommended_opp(struct device *dev, |
@@ -181,23 +192,13 @@ extern int devfreq_register_opp_notifier(struct device *dev, | |||
181 | extern int devfreq_unregister_opp_notifier(struct device *dev, | 192 | extern int devfreq_unregister_opp_notifier(struct device *dev, |
182 | struct devfreq *devfreq); | 193 | struct devfreq *devfreq); |
183 | 194 | ||
184 | #ifdef CONFIG_DEVFREQ_GOV_POWERSAVE | 195 | #if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) |
185 | extern const struct devfreq_governor devfreq_powersave; | ||
186 | #endif | ||
187 | #ifdef CONFIG_DEVFREQ_GOV_PERFORMANCE | ||
188 | extern const struct devfreq_governor devfreq_performance; | ||
189 | #endif | ||
190 | #ifdef CONFIG_DEVFREQ_GOV_USERSPACE | ||
191 | extern const struct devfreq_governor devfreq_userspace; | ||
192 | #endif | ||
193 | #ifdef CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND | ||
194 | extern const struct devfreq_governor devfreq_simple_ondemand; | ||
195 | /** | 196 | /** |
196 | * struct devfreq_simple_ondemand_data - void *data fed to struct devfreq | 197 | * struct devfreq_simple_ondemand_data - void *data fed to struct devfreq |
197 | * and devfreq_add_device | 198 | * and devfreq_add_device |
198 | * @ upthreshold If the load is over this value, the frequency jumps. | 199 | * @upthreshold: If the load is over this value, the frequency jumps. |
199 | * Specify 0 to use the default. Valid value = 0 to 100. | 200 | * Specify 0 to use the default. Valid value = 0 to 100. |
200 | * @ downdifferential If the load is under upthreshold - downdifferential, | 201 | * @downdifferential: If the load is under upthreshold - downdifferential, |
201 | * the governor may consider slowing the frequency down. | 202 | * the governor may consider slowing the frequency down. |
202 | * Specify 0 to use the default. Valid value = 0 to 100. | 203 | * Specify 0 to use the default. Valid value = 0 to 100. |
203 | * downdifferential < upthreshold must hold. | 204 | * downdifferential < upthreshold must hold. |
@@ -214,7 +215,7 @@ struct devfreq_simple_ondemand_data { | |||
214 | #else /* !CONFIG_PM_DEVFREQ */ | 215 | #else /* !CONFIG_PM_DEVFREQ */ |
215 | static struct devfreq *devfreq_add_device(struct device *dev, | 216 | static struct devfreq *devfreq_add_device(struct device *dev, |
216 | struct devfreq_dev_profile *profile, | 217 | struct devfreq_dev_profile *profile, |
217 | struct devfreq_governor *governor, | 218 | const char *governor_name, |
218 | void *data) | 219 | void *data) |
219 | { | 220 | { |
220 | return NULL; | 221 | return NULL; |
@@ -225,6 +226,16 @@ static int devfreq_remove_device(struct devfreq *devfreq) | |||
225 | return 0; | 226 | return 0; |
226 | } | 227 | } |
227 | 228 | ||
229 | static int devfreq_suspend_device(struct devfreq *devfreq) | ||
230 | { | ||
231 | return 0; | ||
232 | } | ||
233 | |||
234 | static int devfreq_resume_device(struct devfreq *devfreq) | ||
235 | { | ||
236 | return 0; | ||
237 | } | ||
238 | |||
228 | static struct opp *devfreq_recommended_opp(struct device *dev, | 239 | static struct opp *devfreq_recommended_opp(struct device *dev, |
229 | unsigned long *freq, u32 flags) | 240 | unsigned long *freq, u32 flags) |
230 | { | 241 | { |
@@ -243,11 +254,6 @@ static int devfreq_unregister_opp_notifier(struct device *dev, | |||
243 | return -EINVAL; | 254 | return -EINVAL; |
244 | } | 255 | } |
245 | 256 | ||
246 | #define devfreq_powersave NULL | ||
247 | #define devfreq_performance NULL | ||
248 | #define devfreq_userspace NULL | ||
249 | #define devfreq_simple_ondemand NULL | ||
250 | |||
251 | #endif /* CONFIG_PM_DEVFREQ */ | 257 | #endif /* CONFIG_PM_DEVFREQ */ |
252 | 258 | ||
253 | #endif /* __LINUX_DEVFREQ_H__ */ | 259 | #endif /* __LINUX_DEVFREQ_H__ */ |
diff --git a/include/linux/device.h b/include/linux/device.h index 86ef6ab553b1..05292e488346 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -190,6 +190,7 @@ extern struct klist *bus_get_device_klist(struct bus_type *bus); | |||
190 | * @mod_name: Used for built-in modules. | 190 | * @mod_name: Used for built-in modules. |
191 | * @suppress_bind_attrs: Disables bind/unbind via sysfs. | 191 | * @suppress_bind_attrs: Disables bind/unbind via sysfs. |
192 | * @of_match_table: The open firmware table. | 192 | * @of_match_table: The open firmware table. |
193 | * @acpi_match_table: The ACPI match table. | ||
193 | * @probe: Called to query the existence of a specific device, | 194 | * @probe: Called to query the existence of a specific device, |
194 | * whether this driver can work with it, and bind the driver | 195 | * whether this driver can work with it, and bind the driver |
195 | * to a specific device. | 196 | * to a specific device. |
@@ -223,6 +224,7 @@ struct device_driver { | |||
223 | bool suppress_bind_attrs; /* disables bind/unbind via sysfs */ | 224 | bool suppress_bind_attrs; /* disables bind/unbind via sysfs */ |
224 | 225 | ||
225 | const struct of_device_id *of_match_table; | 226 | const struct of_device_id *of_match_table; |
227 | const struct acpi_device_id *acpi_match_table; | ||
226 | 228 | ||
227 | int (*probe) (struct device *dev); | 229 | int (*probe) (struct device *dev); |
228 | int (*remove) (struct device *dev); | 230 | int (*remove) (struct device *dev); |
@@ -576,6 +578,12 @@ struct device_dma_parameters { | |||
576 | unsigned long segment_boundary_mask; | 578 | unsigned long segment_boundary_mask; |
577 | }; | 579 | }; |
578 | 580 | ||
581 | struct acpi_dev_node { | ||
582 | #ifdef CONFIG_ACPI | ||
583 | void *handle; | ||
584 | #endif | ||
585 | }; | ||
586 | |||
579 | /** | 587 | /** |
580 | * struct device - The basic device structure | 588 | * struct device - The basic device structure |
581 | * @parent: The device's "parent" device, the device to which it is attached. | 589 | * @parent: The device's "parent" device, the device to which it is attached. |
@@ -616,6 +624,7 @@ struct device_dma_parameters { | |||
616 | * @dma_mem: Internal for coherent mem override. | 624 | * @dma_mem: Internal for coherent mem override. |
617 | * @archdata: For arch-specific additions. | 625 | * @archdata: For arch-specific additions. |
618 | * @of_node: Associated device tree node. | 626 | * @of_node: Associated device tree node. |
627 | * @acpi_node: Associated ACPI device node. | ||
619 | * @devt: For creating the sysfs "dev". | 628 | * @devt: For creating the sysfs "dev". |
620 | * @id: device instance | 629 | * @id: device instance |
621 | * @devres_lock: Spinlock to protect the resource of the device. | 630 | * @devres_lock: Spinlock to protect the resource of the device. |
@@ -680,6 +689,7 @@ struct device { | |||
680 | struct dev_archdata archdata; | 689 | struct dev_archdata archdata; |
681 | 690 | ||
682 | struct device_node *of_node; /* associated device tree node */ | 691 | struct device_node *of_node; /* associated device tree node */ |
692 | struct acpi_dev_node acpi_node; /* associated ACPI device node */ | ||
683 | 693 | ||
684 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 694 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
685 | u32 id; /* device instance */ | 695 | u32 id; /* device instance */ |
@@ -700,6 +710,14 @@ static inline struct device *kobj_to_dev(struct kobject *kobj) | |||
700 | return container_of(kobj, struct device, kobj); | 710 | return container_of(kobj, struct device, kobj); |
701 | } | 711 | } |
702 | 712 | ||
713 | #ifdef CONFIG_ACPI | ||
714 | #define ACPI_HANDLE(dev) ((dev)->acpi_node.handle) | ||
715 | #define ACPI_HANDLE_SET(dev, _handle_) (dev)->acpi_node.handle = (_handle_) | ||
716 | #else | ||
717 | #define ACPI_HANDLE(dev) (NULL) | ||
718 | #define ACPI_HANDLE_SET(dev, _handle_) do { } while (0) | ||
719 | #endif | ||
720 | |||
703 | /* Get the wakeup routines, which depend on struct device */ | 721 | /* Get the wakeup routines, which depend on struct device */ |
704 | #include <linux/pm_wakeup.h> | 722 | #include <linux/pm_wakeup.h> |
705 | 723 | ||
diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h index 5ce0e5fd712e..251a2090a554 100644 --- a/include/linux/devpts_fs.h +++ b/include/linux/devpts_fs.h | |||
@@ -20,28 +20,28 @@ | |||
20 | int devpts_new_index(struct inode *ptmx_inode); | 20 | int devpts_new_index(struct inode *ptmx_inode); |
21 | void devpts_kill_index(struct inode *ptmx_inode, int idx); | 21 | void devpts_kill_index(struct inode *ptmx_inode, int idx); |
22 | /* mknod in devpts */ | 22 | /* mknod in devpts */ |
23 | int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty); | 23 | struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index, |
24 | /* get tty structure */ | 24 | void *priv); |
25 | struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number); | 25 | /* get private structure */ |
26 | void *devpts_get_priv(struct inode *pts_inode); | ||
26 | /* unlink */ | 27 | /* unlink */ |
27 | void devpts_pty_kill(struct tty_struct *tty); | 28 | void devpts_pty_kill(struct inode *inode); |
28 | 29 | ||
29 | #else | 30 | #else |
30 | 31 | ||
31 | /* Dummy stubs in the no-pty case */ | 32 | /* Dummy stubs in the no-pty case */ |
32 | static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; } | 33 | static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; } |
33 | static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { } | 34 | static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { } |
34 | static inline int devpts_pty_new(struct inode *ptmx_inode, | 35 | static inline struct inode *devpts_pty_new(struct inode *ptmx_inode, |
35 | struct tty_struct *tty) | 36 | dev_t device, int index, void *priv) |
36 | { | 37 | { |
37 | return -EINVAL; | 38 | return ERR_PTR(-EINVAL); |
38 | } | 39 | } |
39 | static inline struct tty_struct *devpts_get_tty(struct inode *pts_inode, | 40 | static inline void *devpts_get_priv(struct inode *pts_inode) |
40 | int number) | ||
41 | { | 41 | { |
42 | return NULL; | 42 | return NULL; |
43 | } | 43 | } |
44 | static inline void devpts_pty_kill(struct tty_struct *tty) { } | 44 | static inline void devpts_pty_kill(struct inode *inode) { } |
45 | 45 | ||
46 | #endif | 46 | #endif |
47 | 47 | ||
diff --git a/include/linux/dma-contiguous.h b/include/linux/dma-contiguous.h index 2f303e4b7ed3..01b5c84be828 100644 --- a/include/linux/dma-contiguous.h +++ b/include/linux/dma-contiguous.h | |||
@@ -68,7 +68,7 @@ struct device; | |||
68 | extern struct cma *dma_contiguous_default_area; | 68 | extern struct cma *dma_contiguous_default_area; |
69 | 69 | ||
70 | void dma_contiguous_reserve(phys_addr_t addr_limit); | 70 | void dma_contiguous_reserve(phys_addr_t addr_limit); |
71 | int dma_declare_contiguous(struct device *dev, unsigned long size, | 71 | int dma_declare_contiguous(struct device *dev, phys_addr_t size, |
72 | phys_addr_t base, phys_addr_t limit); | 72 | phys_addr_t base, phys_addr_t limit); |
73 | 73 | ||
74 | struct page *dma_alloc_from_contiguous(struct device *dev, int count, | 74 | struct page *dma_alloc_from_contiguous(struct device *dev, int count, |
@@ -83,7 +83,7 @@ bool dma_release_from_contiguous(struct device *dev, struct page *pages, | |||
83 | static inline void dma_contiguous_reserve(phys_addr_t limit) { } | 83 | static inline void dma_contiguous_reserve(phys_addr_t limit) { } |
84 | 84 | ||
85 | static inline | 85 | static inline |
86 | int dma_declare_contiguous(struct device *dev, unsigned long size, | 86 | int dma_declare_contiguous(struct device *dev, phys_addr_t size, |
87 | phys_addr_t base, phys_addr_t limit) | 87 | phys_addr_t base, phys_addr_t limit) |
88 | { | 88 | { |
89 | return -ENOSYS; | 89 | return -ENOSYS; |
diff --git a/include/linux/edac.h b/include/linux/edac.h index bab9f8473dc1..1b8c02b36f76 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
@@ -533,6 +533,7 @@ struct csrow_info { | |||
533 | 533 | ||
534 | u32 ue_count; /* Uncorrectable Errors for this csrow */ | 534 | u32 ue_count; /* Uncorrectable Errors for this csrow */ |
535 | u32 ce_count; /* Correctable Errors for this csrow */ | 535 | u32 ce_count; /* Correctable Errors for this csrow */ |
536 | u32 nr_pages; /* combined pages count of all channels */ | ||
536 | 537 | ||
537 | struct mem_ctl_info *mci; /* the parent */ | 538 | struct mem_ctl_info *mci; /* the parent */ |
538 | 539 | ||
@@ -667,6 +668,8 @@ struct mem_ctl_info { | |||
667 | u32 fake_inject_ue; | 668 | u32 fake_inject_ue; |
668 | u16 fake_inject_count; | 669 | u16 fake_inject_count; |
669 | #endif | 670 | #endif |
671 | __u8 csbased : 1, /* csrow-based memory controller */ | ||
672 | __resv : 7; | ||
670 | }; | 673 | }; |
671 | 674 | ||
672 | #endif | 675 | #endif |
diff --git a/include/linux/efi.h b/include/linux/efi.h index 8670eb1eb8cd..c47ec36f3f39 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -643,6 +643,7 @@ struct efivar_operations { | |||
643 | efi_get_variable_t *get_variable; | 643 | efi_get_variable_t *get_variable; |
644 | efi_get_next_variable_t *get_next_variable; | 644 | efi_get_next_variable_t *get_next_variable; |
645 | efi_set_variable_t *set_variable; | 645 | efi_set_variable_t *set_variable; |
646 | efi_query_variable_info_t *query_variable_info; | ||
646 | }; | 647 | }; |
647 | 648 | ||
648 | struct efivars { | 649 | struct efivars { |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index d09af4b67cf1..e4238ceaa4d6 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -75,35 +75,68 @@ static inline bool cgroup_freezing(struct task_struct *task) | |||
75 | */ | 75 | */ |
76 | 76 | ||
77 | 77 | ||
78 | /* Tell the freezer not to count the current task as freezable. */ | 78 | /** |
79 | * freezer_do_not_count - tell freezer to ignore %current | ||
80 | * | ||
81 | * Tell freezers to ignore the current task when determining whether the | ||
82 | * target frozen state is reached. IOW, the current task will be | ||
83 | * considered frozen enough by freezers. | ||
84 | * | ||
85 | * The caller shouldn't do anything which isn't allowed for a frozen task | ||
86 | * until freezer_cont() is called. Usually, freezer[_do_not]_count() pair | ||
87 | * wrap a scheduling operation and nothing much else. | ||
88 | */ | ||
79 | static inline void freezer_do_not_count(void) | 89 | static inline void freezer_do_not_count(void) |
80 | { | 90 | { |
81 | current->flags |= PF_FREEZER_SKIP; | 91 | current->flags |= PF_FREEZER_SKIP; |
82 | } | 92 | } |
83 | 93 | ||
84 | /* | 94 | /** |
85 | * Tell the freezer to count the current task as freezable again and try to | 95 | * freezer_count - tell freezer to stop ignoring %current |
86 | * freeze it. | 96 | * |
97 | * Undo freezer_do_not_count(). It tells freezers that %current should be | ||
98 | * considered again and tries to freeze if freezing condition is already in | ||
99 | * effect. | ||
87 | */ | 100 | */ |
88 | static inline void freezer_count(void) | 101 | static inline void freezer_count(void) |
89 | { | 102 | { |
90 | current->flags &= ~PF_FREEZER_SKIP; | 103 | current->flags &= ~PF_FREEZER_SKIP; |
104 | /* | ||
105 | * If freezing is in progress, the following paired with smp_mb() | ||
106 | * in freezer_should_skip() ensures that either we see %true | ||
107 | * freezing() or freezer_should_skip() sees !PF_FREEZER_SKIP. | ||
108 | */ | ||
109 | smp_mb(); | ||
91 | try_to_freeze(); | 110 | try_to_freeze(); |
92 | } | 111 | } |
93 | 112 | ||
94 | /* | 113 | /** |
95 | * Check if the task should be counted as freezable by the freezer | 114 | * freezer_should_skip - whether to skip a task when determining frozen |
115 | * state is reached | ||
116 | * @p: task in quesion | ||
117 | * | ||
118 | * This function is used by freezers after establishing %true freezing() to | ||
119 | * test whether a task should be skipped when determining the target frozen | ||
120 | * state is reached. IOW, if this function returns %true, @p is considered | ||
121 | * frozen enough. | ||
96 | */ | 122 | */ |
97 | static inline int freezer_should_skip(struct task_struct *p) | 123 | static inline bool freezer_should_skip(struct task_struct *p) |
98 | { | 124 | { |
99 | return !!(p->flags & PF_FREEZER_SKIP); | 125 | /* |
126 | * The following smp_mb() paired with the one in freezer_count() | ||
127 | * ensures that either freezer_count() sees %true freezing() or we | ||
128 | * see cleared %PF_FREEZER_SKIP and return %false. This makes it | ||
129 | * impossible for a task to slip frozen state testing after | ||
130 | * clearing %PF_FREEZER_SKIP. | ||
131 | */ | ||
132 | smp_mb(); | ||
133 | return p->flags & PF_FREEZER_SKIP; | ||
100 | } | 134 | } |
101 | 135 | ||
102 | /* | 136 | /* |
103 | * These macros are intended to be used whenever you want allow a task that's | 137 | * These macros are intended to be used whenever you want allow a sleeping |
104 | * sleeping in TASK_UNINTERRUPTIBLE or TASK_KILLABLE state to be frozen. Note | 138 | * task to be frozen. Note that neither return any clear indication of |
105 | * that neither return any clear indication of whether a freeze event happened | 139 | * whether a freeze event happened while in this function. |
106 | * while in this function. | ||
107 | */ | 140 | */ |
108 | 141 | ||
109 | /* Like schedule(), but should not block the freezer. */ | 142 | /* Like schedule(), but should not block the freezer. */ |
@@ -177,6 +210,7 @@ static inline int freeze_kernel_threads(void) { return -ENOSYS; } | |||
177 | static inline void thaw_processes(void) {} | 210 | static inline void thaw_processes(void) {} |
178 | static inline void thaw_kernel_threads(void) {} | 211 | static inline void thaw_kernel_threads(void) {} |
179 | 212 | ||
213 | static inline bool try_to_freeze_nowarn(void) { return false; } | ||
180 | static inline bool try_to_freeze(void) { return false; } | 214 | static inline bool try_to_freeze(void) { return false; } |
181 | 215 | ||
182 | static inline void freezer_do_not_count(void) {} | 216 | static inline void freezer_do_not_count(void) {} |
diff --git a/include/linux/fs.h b/include/linux/fs.h index b33cfc97b9ca..408fb1e77a0a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -418,7 +418,7 @@ struct address_space { | |||
418 | struct backing_dev_info *backing_dev_info; /* device readahead, etc */ | 418 | struct backing_dev_info *backing_dev_info; /* device readahead, etc */ |
419 | spinlock_t private_lock; /* for use by the address_space */ | 419 | spinlock_t private_lock; /* for use by the address_space */ |
420 | struct list_head private_list; /* ditto */ | 420 | struct list_head private_list; /* ditto */ |
421 | struct address_space *assoc_mapping; /* ditto */ | 421 | void *private_data; /* ditto */ |
422 | } __attribute__((aligned(sizeof(long)))); | 422 | } __attribute__((aligned(sizeof(long)))); |
423 | /* | 423 | /* |
424 | * On most architectures that alignment is already the case; but | 424 | * On most architectures that alignment is already the case; but |
@@ -462,8 +462,6 @@ struct block_device { | |||
462 | int bd_fsfreeze_count; | 462 | int bd_fsfreeze_count; |
463 | /* Mutex for freeze */ | 463 | /* Mutex for freeze */ |
464 | struct mutex bd_fsfreeze_mutex; | 464 | struct mutex bd_fsfreeze_mutex; |
465 | /* A semaphore that prevents I/O while block size is being changed */ | ||
466 | struct percpu_rw_semaphore bd_block_size_semaphore; | ||
467 | }; | 465 | }; |
468 | 466 | ||
469 | /* | 467 | /* |
@@ -2049,7 +2047,6 @@ extern void unregister_blkdev(unsigned int, const char *); | |||
2049 | extern struct block_device *bdget(dev_t); | 2047 | extern struct block_device *bdget(dev_t); |
2050 | extern struct block_device *bdgrab(struct block_device *bdev); | 2048 | extern struct block_device *bdgrab(struct block_device *bdev); |
2051 | extern void bd_set_size(struct block_device *, loff_t size); | 2049 | extern void bd_set_size(struct block_device *, loff_t size); |
2052 | extern sector_t blkdev_max_block(struct block_device *bdev); | ||
2053 | extern void bd_forget(struct inode *inode); | 2050 | extern void bd_forget(struct inode *inode); |
2054 | extern void bdput(struct block_device *); | 2051 | extern void bdput(struct block_device *); |
2055 | extern void invalidate_bdev(struct block_device *); | 2052 | extern void invalidate_bdev(struct block_device *); |
@@ -2379,8 +2376,6 @@ extern int generic_segment_checks(const struct iovec *iov, | |||
2379 | unsigned long *nr_segs, size_t *count, int access_flags); | 2376 | unsigned long *nr_segs, size_t *count, int access_flags); |
2380 | 2377 | ||
2381 | /* fs/block_dev.c */ | 2378 | /* fs/block_dev.c */ |
2382 | extern ssize_t blkdev_aio_read(struct kiocb *iocb, const struct iovec *iov, | ||
2383 | unsigned long nr_segs, loff_t pos); | ||
2384 | extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, | 2379 | extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, |
2385 | unsigned long nr_segs, loff_t pos); | 2380 | unsigned long nr_segs, loff_t pos); |
2386 | extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end, | 2381 | extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end, |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 642928cf57b4..a3d489531d83 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -86,6 +86,12 @@ struct trace_iterator { | |||
86 | cpumask_var_t started; | 86 | cpumask_var_t started; |
87 | }; | 87 | }; |
88 | 88 | ||
89 | enum trace_iter_flags { | ||
90 | TRACE_FILE_LAT_FMT = 1, | ||
91 | TRACE_FILE_ANNOTATE = 2, | ||
92 | TRACE_FILE_TIME_IN_NS = 4, | ||
93 | }; | ||
94 | |||
89 | 95 | ||
90 | struct trace_event; | 96 | struct trace_event; |
91 | 97 | ||
@@ -127,13 +133,13 @@ trace_current_buffer_lock_reserve(struct ring_buffer **current_buffer, | |||
127 | void trace_current_buffer_unlock_commit(struct ring_buffer *buffer, | 133 | void trace_current_buffer_unlock_commit(struct ring_buffer *buffer, |
128 | struct ring_buffer_event *event, | 134 | struct ring_buffer_event *event, |
129 | unsigned long flags, int pc); | 135 | unsigned long flags, int pc); |
130 | void trace_nowake_buffer_unlock_commit(struct ring_buffer *buffer, | 136 | void trace_buffer_unlock_commit(struct ring_buffer *buffer, |
131 | struct ring_buffer_event *event, | 137 | struct ring_buffer_event *event, |
132 | unsigned long flags, int pc); | 138 | unsigned long flags, int pc); |
133 | void trace_nowake_buffer_unlock_commit_regs(struct ring_buffer *buffer, | 139 | void trace_buffer_unlock_commit_regs(struct ring_buffer *buffer, |
134 | struct ring_buffer_event *event, | 140 | struct ring_buffer_event *event, |
135 | unsigned long flags, int pc, | 141 | unsigned long flags, int pc, |
136 | struct pt_regs *regs); | 142 | struct pt_regs *regs); |
137 | void trace_current_buffer_discard_commit(struct ring_buffer *buffer, | 143 | void trace_current_buffer_discard_commit(struct ring_buffer *buffer, |
138 | struct ring_buffer_event *event); | 144 | struct ring_buffer_event *event); |
139 | 145 | ||
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 02c1c9710be0..31e8041274f6 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -31,6 +31,7 @@ struct vm_area_struct; | |||
31 | #define ___GFP_THISNODE 0x40000u | 31 | #define ___GFP_THISNODE 0x40000u |
32 | #define ___GFP_RECLAIMABLE 0x80000u | 32 | #define ___GFP_RECLAIMABLE 0x80000u |
33 | #define ___GFP_NOTRACK 0x200000u | 33 | #define ___GFP_NOTRACK 0x200000u |
34 | #define ___GFP_NO_KSWAPD 0x400000u | ||
34 | #define ___GFP_OTHER_NODE 0x800000u | 35 | #define ___GFP_OTHER_NODE 0x800000u |
35 | #define ___GFP_WRITE 0x1000000u | 36 | #define ___GFP_WRITE 0x1000000u |
36 | 37 | ||
@@ -85,6 +86,7 @@ struct vm_area_struct; | |||
85 | #define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */ | 86 | #define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */ |
86 | #define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */ | 87 | #define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */ |
87 | 88 | ||
89 | #define __GFP_NO_KSWAPD ((__force gfp_t)___GFP_NO_KSWAPD) | ||
88 | #define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */ | 90 | #define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */ |
89 | #define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */ | 91 | #define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */ |
90 | 92 | ||
@@ -114,7 +116,8 @@ struct vm_area_struct; | |||
114 | __GFP_MOVABLE) | 116 | __GFP_MOVABLE) |
115 | #define GFP_IOFS (__GFP_IO | __GFP_FS) | 117 | #define GFP_IOFS (__GFP_IO | __GFP_FS) |
116 | #define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ | 118 | #define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ |
117 | __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN) | 119 | __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | \ |
120 | __GFP_NO_KSWAPD) | ||
118 | 121 | ||
119 | #ifdef CONFIG_NUMA | 122 | #ifdef CONFIG_NUMA |
120 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) | 123 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) |
@@ -263,7 +266,7 @@ static inline enum zone_type gfp_zone(gfp_t flags) | |||
263 | 266 | ||
264 | static inline int gfp_zonelist(gfp_t flags) | 267 | static inline int gfp_zonelist(gfp_t flags) |
265 | { | 268 | { |
266 | if (NUMA_BUILD && unlikely(flags & __GFP_THISNODE)) | 269 | if (IS_ENABLED(CONFIG_NUMA) && unlikely(flags & __GFP_THISNODE)) |
267 | return 1; | 270 | return 1; |
268 | 271 | ||
269 | return 0; | 272 | return 0; |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 2e31e8b3a190..bfe665621536 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -72,9 +72,9 @@ static inline int irq_to_gpio(unsigned int irq) | |||
72 | return -EINVAL; | 72 | return -EINVAL; |
73 | } | 73 | } |
74 | 74 | ||
75 | #endif | 75 | #endif /* ! CONFIG_ARCH_HAVE_CUSTOM_GPIO_H */ |
76 | 76 | ||
77 | #else | 77 | #else /* ! CONFIG_GENERIC_GPIO */ |
78 | 78 | ||
79 | #include <linux/kernel.h> | 79 | #include <linux/kernel.h> |
80 | #include <linux/types.h> | 80 | #include <linux/types.h> |
@@ -231,6 +231,21 @@ static inline int irq_to_gpio(unsigned irq) | |||
231 | return -EINVAL; | 231 | return -EINVAL; |
232 | } | 232 | } |
233 | 233 | ||
234 | #endif | 234 | static inline int |
235 | gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
236 | unsigned int gpio_offset, unsigned int pin_offset, | ||
237 | unsigned int npins) | ||
238 | { | ||
239 | WARN_ON(1); | ||
240 | return -EINVAL; | ||
241 | } | ||
242 | |||
243 | static inline void | ||
244 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) | ||
245 | { | ||
246 | WARN_ON(1); | ||
247 | } | ||
248 | |||
249 | #endif /* ! CONFIG_GENERIC_GPIO */ | ||
235 | 250 | ||
236 | #endif /* __LINUX_GPIO_H */ | 251 | #endif /* __LINUX_GPIO_H */ |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index cab3da3d0949..624ef3f45c8e 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/preempt.h> | 4 | #include <linux/preempt.h> |
5 | #include <linux/lockdep.h> | 5 | #include <linux/lockdep.h> |
6 | #include <linux/ftrace_irq.h> | 6 | #include <linux/ftrace_irq.h> |
7 | #include <linux/vtime.h> | ||
7 | #include <asm/hardirq.h> | 8 | #include <asm/hardirq.h> |
8 | 9 | ||
9 | /* | 10 | /* |
@@ -129,16 +130,6 @@ extern void synchronize_irq(unsigned int irq); | |||
129 | # define synchronize_irq(irq) barrier() | 130 | # define synchronize_irq(irq) barrier() |
130 | #endif | 131 | #endif |
131 | 132 | ||
132 | struct task_struct; | ||
133 | |||
134 | #if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING) | ||
135 | static inline void vtime_account(struct task_struct *tsk) | ||
136 | { | ||
137 | } | ||
138 | #else | ||
139 | extern void vtime_account(struct task_struct *tsk); | ||
140 | #endif | ||
141 | |||
142 | #if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) | 133 | #if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) |
143 | 134 | ||
144 | static inline void rcu_nmi_enter(void) | 135 | static inline void rcu_nmi_enter(void) |
@@ -162,7 +153,7 @@ extern void rcu_nmi_exit(void); | |||
162 | */ | 153 | */ |
163 | #define __irq_enter() \ | 154 | #define __irq_enter() \ |
164 | do { \ | 155 | do { \ |
165 | vtime_account(current); \ | 156 | vtime_account_irq_enter(current); \ |
166 | add_preempt_count(HARDIRQ_OFFSET); \ | 157 | add_preempt_count(HARDIRQ_OFFSET); \ |
167 | trace_hardirq_enter(); \ | 158 | trace_hardirq_enter(); \ |
168 | } while (0) | 159 | } while (0) |
@@ -178,7 +169,7 @@ extern void irq_enter(void); | |||
178 | #define __irq_exit() \ | 169 | #define __irq_exit() \ |
179 | do { \ | 170 | do { \ |
180 | trace_hardirq_exit(); \ | 171 | trace_hardirq_exit(); \ |
181 | vtime_account(current); \ | 172 | vtime_account_irq_exit(current); \ |
182 | sub_preempt_count(HARDIRQ_OFFSET); \ | 173 | sub_preempt_count(HARDIRQ_OFFSET); \ |
183 | } while (0) | 174 | } while (0) |
184 | 175 | ||
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index b31cb7da0346..1af477552459 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
@@ -8,6 +8,10 @@ extern int do_huge_pmd_anonymous_page(struct mm_struct *mm, | |||
8 | extern int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm, | 8 | extern int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm, |
9 | pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr, | 9 | pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr, |
10 | struct vm_area_struct *vma); | 10 | struct vm_area_struct *vma); |
11 | extern void huge_pmd_set_accessed(struct mm_struct *mm, | ||
12 | struct vm_area_struct *vma, | ||
13 | unsigned long address, pmd_t *pmd, | ||
14 | pmd_t orig_pmd, int dirty); | ||
11 | extern int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, | 15 | extern int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, |
12 | unsigned long address, pmd_t *pmd, | 16 | unsigned long address, pmd_t *pmd, |
13 | pmd_t orig_pmd); | 17 | pmd_t orig_pmd); |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 225164842ab6..3e7fa1acf09c 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -183,7 +183,8 @@ extern const struct file_operations hugetlbfs_file_operations; | |||
183 | extern const struct vm_operations_struct hugetlb_vm_ops; | 183 | extern const struct vm_operations_struct hugetlb_vm_ops; |
184 | struct file *hugetlb_file_setup(const char *name, unsigned long addr, | 184 | struct file *hugetlb_file_setup(const char *name, unsigned long addr, |
185 | size_t size, vm_flags_t acct, | 185 | size_t size, vm_flags_t acct, |
186 | struct user_struct **user, int creat_flags); | 186 | struct user_struct **user, int creat_flags, |
187 | int page_size_log); | ||
187 | 188 | ||
188 | static inline int is_file_hugepages(struct file *file) | 189 | static inline int is_file_hugepages(struct file *file) |
189 | { | 190 | { |
@@ -195,12 +196,14 @@ static inline int is_file_hugepages(struct file *file) | |||
195 | return 0; | 196 | return 0; |
196 | } | 197 | } |
197 | 198 | ||
199 | |||
198 | #else /* !CONFIG_HUGETLBFS */ | 200 | #else /* !CONFIG_HUGETLBFS */ |
199 | 201 | ||
200 | #define is_file_hugepages(file) 0 | 202 | #define is_file_hugepages(file) 0 |
201 | static inline struct file * | 203 | static inline struct file * |
202 | hugetlb_file_setup(const char *name, unsigned long addr, size_t size, | 204 | hugetlb_file_setup(const char *name, unsigned long addr, size_t size, |
203 | vm_flags_t acctflag, struct user_struct **user, int creat_flags) | 205 | vm_flags_t acctflag, struct user_struct **user, int creat_flags, |
206 | int page_size_log) | ||
204 | { | 207 | { |
205 | return ERR_PTR(-ENOSYS); | 208 | return ERR_PTR(-ENOSYS); |
206 | } | 209 | } |
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index 6ae9c631a1be..0464c85e63fd 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h | |||
@@ -1,35 +1,8 @@ | |||
1 | #ifndef _LINUX_HW_BREAKPOINT_H | 1 | #ifndef _LINUX_HW_BREAKPOINT_H |
2 | #define _LINUX_HW_BREAKPOINT_H | 2 | #define _LINUX_HW_BREAKPOINT_H |
3 | 3 | ||
4 | enum { | ||
5 | HW_BREAKPOINT_LEN_1 = 1, | ||
6 | HW_BREAKPOINT_LEN_2 = 2, | ||
7 | HW_BREAKPOINT_LEN_4 = 4, | ||
8 | HW_BREAKPOINT_LEN_8 = 8, | ||
9 | }; | ||
10 | |||
11 | enum { | ||
12 | HW_BREAKPOINT_EMPTY = 0, | ||
13 | HW_BREAKPOINT_R = 1, | ||
14 | HW_BREAKPOINT_W = 2, | ||
15 | HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W, | ||
16 | HW_BREAKPOINT_X = 4, | ||
17 | HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X, | ||
18 | }; | ||
19 | |||
20 | enum bp_type_idx { | ||
21 | TYPE_INST = 0, | ||
22 | #ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS | ||
23 | TYPE_DATA = 0, | ||
24 | #else | ||
25 | TYPE_DATA = 1, | ||
26 | #endif | ||
27 | TYPE_MAX | ||
28 | }; | ||
29 | |||
30 | #ifdef __KERNEL__ | ||
31 | |||
32 | #include <linux/perf_event.h> | 4 | #include <linux/perf_event.h> |
5 | #include <uapi/linux/hw_breakpoint.h> | ||
33 | 6 | ||
34 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 7 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
35 | 8 | ||
@@ -151,6 +124,4 @@ static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp) | |||
151 | } | 124 | } |
152 | 125 | ||
153 | #endif /* CONFIG_HAVE_HW_BREAKPOINT */ | 126 | #endif /* CONFIG_HAVE_HW_BREAKPOINT */ |
154 | #endif /* __KERNEL__ */ | ||
155 | |||
156 | #endif /* _LINUX_HW_BREAKPOINT_H */ | 127 | #endif /* _LINUX_HW_BREAKPOINT_H */ |
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h index df804ba73e0b..92a0dc75bc74 100644 --- a/include/linux/i2c-omap.h +++ b/include/linux/i2c-omap.h | |||
@@ -34,6 +34,7 @@ struct omap_i2c_bus_platform_data { | |||
34 | u32 clkrate; | 34 | u32 clkrate; |
35 | u32 rev; | 35 | u32 rev; |
36 | u32 flags; | 36 | u32 flags; |
37 | void (*set_mpu_wkup_lat)(struct device *dev, long set); | ||
37 | }; | 38 | }; |
38 | 39 | ||
39 | #endif | 40 | #endif |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 800de224336b..d0c4db7b4872 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -259,6 +259,7 @@ static inline void i2c_set_clientdata(struct i2c_client *dev, void *data) | |||
259 | * @platform_data: stored in i2c_client.dev.platform_data | 259 | * @platform_data: stored in i2c_client.dev.platform_data |
260 | * @archdata: copied into i2c_client.dev.archdata | 260 | * @archdata: copied into i2c_client.dev.archdata |
261 | * @of_node: pointer to OpenFirmware device node | 261 | * @of_node: pointer to OpenFirmware device node |
262 | * @acpi_node: ACPI device node | ||
262 | * @irq: stored in i2c_client.irq | 263 | * @irq: stored in i2c_client.irq |
263 | * | 264 | * |
264 | * I2C doesn't actually support hardware probing, although controllers and | 265 | * I2C doesn't actually support hardware probing, although controllers and |
@@ -279,6 +280,7 @@ struct i2c_board_info { | |||
279 | void *platform_data; | 280 | void *platform_data; |
280 | struct dev_archdata *archdata; | 281 | struct dev_archdata *archdata; |
281 | struct device_node *of_node; | 282 | struct device_node *of_node; |
283 | struct acpi_dev_node acpi_node; | ||
282 | int irq; | 284 | int irq; |
283 | }; | 285 | }; |
284 | 286 | ||
@@ -501,4 +503,11 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap) | |||
501 | i2c_del_driver) | 503 | i2c_del_driver) |
502 | 504 | ||
503 | #endif /* I2C */ | 505 | #endif /* I2C */ |
506 | |||
507 | #if IS_ENABLED(CONFIG_ACPI_I2C) | ||
508 | extern void acpi_i2c_register_devices(struct i2c_adapter *adap); | ||
509 | #else | ||
510 | static inline void acpi_i2c_register_devices(struct i2c_adapter *adap) {} | ||
511 | #endif | ||
512 | |||
504 | #endif /* _LINUX_I2C_H */ | 513 | #endif /* _LINUX_I2C_H */ |
diff --git a/include/linux/i2c/pcf857x.h b/include/linux/i2c/pcf857x.h index 781e6bd06c34..0767a2a6b2f1 100644 --- a/include/linux/i2c/pcf857x.h +++ b/include/linux/i2c/pcf857x.h | |||
@@ -10,7 +10,6 @@ | |||
10 | * @setup: optional callback issued once the GPIOs are valid | 10 | * @setup: optional callback issued once the GPIOs are valid |
11 | * @teardown: optional callback issued before the GPIOs are invalidated | 11 | * @teardown: optional callback issued before the GPIOs are invalidated |
12 | * @context: optional parameter passed to setup() and teardown() | 12 | * @context: optional parameter passed to setup() and teardown() |
13 | * @irq: optional interrupt number | ||
14 | * | 13 | * |
15 | * In addition to the I2C_BOARD_INFO() state appropriate to each chip, | 14 | * In addition to the I2C_BOARD_INFO() state appropriate to each chip, |
16 | * the i2c_board_info used with the pcf875x driver must provide its | 15 | * the i2c_board_info used with the pcf875x driver must provide its |
@@ -40,8 +39,6 @@ struct pcf857x_platform_data { | |||
40 | int gpio, unsigned ngpio, | 39 | int gpio, unsigned ngpio, |
41 | void *context); | 40 | void *context); |
42 | void *context; | 41 | void *context; |
43 | |||
44 | int irq; | ||
45 | }; | 42 | }; |
46 | 43 | ||
47 | #endif /* __LINUX_PCF857X_H */ | 44 | #endif /* __LINUX_PCF857X_H */ |
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h index c629b3a1d9a9..f3eea18fdf46 100644 --- a/include/linux/iio/buffer.h +++ b/include/linux/iio/buffer.h | |||
@@ -66,7 +66,8 @@ struct iio_buffer_access_funcs { | |||
66 | * @stufftoread: [INTERN] flag to indicate new data. | 66 | * @stufftoread: [INTERN] flag to indicate new data. |
67 | * @demux_list: [INTERN] list of operations required to demux the scan. | 67 | * @demux_list: [INTERN] list of operations required to demux the scan. |
68 | * @demux_bounce: [INTERN] buffer for doing gather from incoming scan. | 68 | * @demux_bounce: [INTERN] buffer for doing gather from incoming scan. |
69 | **/ | 69 | * @buffer_list: [INTERN] entry in the devices list of current buffers. |
70 | */ | ||
70 | struct iio_buffer { | 71 | struct iio_buffer { |
71 | int length; | 72 | int length; |
72 | int bytes_per_datum; | 73 | int bytes_per_datum; |
@@ -81,9 +82,22 @@ struct iio_buffer { | |||
81 | const struct attribute_group *attrs; | 82 | const struct attribute_group *attrs; |
82 | struct list_head demux_list; | 83 | struct list_head demux_list; |
83 | unsigned char *demux_bounce; | 84 | unsigned char *demux_bounce; |
85 | struct list_head buffer_list; | ||
84 | }; | 86 | }; |
85 | 87 | ||
86 | /** | 88 | /** |
89 | * iio_update_buffers() - add or remove buffer from active list | ||
90 | * @indio_dev: device to add buffer to | ||
91 | * @insert_buffer: buffer to insert | ||
92 | * @remove_buffer: buffer_to_remove | ||
93 | * | ||
94 | * Note this will tear down the all buffering and build it up again | ||
95 | */ | ||
96 | int iio_update_buffers(struct iio_dev *indio_dev, | ||
97 | struct iio_buffer *insert_buffer, | ||
98 | struct iio_buffer *remove_buffer); | ||
99 | |||
100 | /** | ||
87 | * iio_buffer_init() - Initialize the buffer structure | 101 | * iio_buffer_init() - Initialize the buffer structure |
88 | * @buffer: buffer to be initialized | 102 | * @buffer: buffer to be initialized |
89 | **/ | 103 | **/ |
@@ -115,11 +129,11 @@ int iio_scan_mask_set(struct iio_dev *indio_dev, | |||
115 | struct iio_buffer *buffer, int bit); | 129 | struct iio_buffer *buffer, int bit); |
116 | 130 | ||
117 | /** | 131 | /** |
118 | * iio_push_to_buffer() - push to a registered buffer. | 132 | * iio_push_to_buffers() - push to a registered buffer. |
119 | * @buffer: IIO buffer structure for device | 133 | * @indio_dev: iio_dev structure for device. |
120 | * @data: the data to push to the buffer | 134 | * @data: Full scan. |
121 | */ | 135 | */ |
122 | int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data); | 136 | int iio_push_to_buffers(struct iio_dev *indio_dev, unsigned char *data); |
123 | 137 | ||
124 | int iio_update_demux(struct iio_dev *indio_dev); | 138 | int iio_update_demux(struct iio_dev *indio_dev); |
125 | 139 | ||
@@ -181,7 +195,7 @@ bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev, | |||
181 | #else /* CONFIG_IIO_BUFFER */ | 195 | #else /* CONFIG_IIO_BUFFER */ |
182 | 196 | ||
183 | static inline int iio_buffer_register(struct iio_dev *indio_dev, | 197 | static inline int iio_buffer_register(struct iio_dev *indio_dev, |
184 | struct iio_chan_spec *channels, | 198 | const struct iio_chan_spec *channels, |
185 | int num_channels) | 199 | int num_channels) |
186 | { | 200 | { |
187 | return 0; | 201 | return 0; |
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h index e875bcf0478f..16c35ac045bd 100644 --- a/include/linux/iio/consumer.h +++ b/include/linux/iio/consumer.h | |||
@@ -9,6 +9,8 @@ | |||
9 | */ | 9 | */ |
10 | #ifndef _IIO_INKERN_CONSUMER_H_ | 10 | #ifndef _IIO_INKERN_CONSUMER_H_ |
11 | #define _IIO_INKERN_CONSUMER_H_ | 11 | #define _IIO_INKERN_CONSUMER_H_ |
12 | |||
13 | #include <linux/types.h> | ||
12 | #include <linux/iio/types.h> | 14 | #include <linux/iio/types.h> |
13 | 15 | ||
14 | struct iio_dev; | 16 | struct iio_dev; |
@@ -18,10 +20,12 @@ struct iio_chan_spec; | |||
18 | * struct iio_channel - everything needed for a consumer to use a channel | 20 | * struct iio_channel - everything needed for a consumer to use a channel |
19 | * @indio_dev: Device on which the channel exists. | 21 | * @indio_dev: Device on which the channel exists. |
20 | * @channel: Full description of the channel. | 22 | * @channel: Full description of the channel. |
23 | * @data: Data about the channel used by consumer. | ||
21 | */ | 24 | */ |
22 | struct iio_channel { | 25 | struct iio_channel { |
23 | struct iio_dev *indio_dev; | 26 | struct iio_dev *indio_dev; |
24 | const struct iio_chan_spec *channel; | 27 | const struct iio_chan_spec *channel; |
28 | void *data; | ||
25 | }; | 29 | }; |
26 | 30 | ||
27 | /** | 31 | /** |
@@ -59,6 +63,52 @@ struct iio_channel *iio_channel_get_all(const char *name); | |||
59 | */ | 63 | */ |
60 | void iio_channel_release_all(struct iio_channel *chan); | 64 | void iio_channel_release_all(struct iio_channel *chan); |
61 | 65 | ||
66 | struct iio_cb_buffer; | ||
67 | /** | ||
68 | * iio_channel_get_all_cb() - register callback for triggered capture | ||
69 | * @name: Name of client device. | ||
70 | * @cb: Callback function. | ||
71 | * @private: Private data passed to callback. | ||
72 | * | ||
73 | * NB right now we have no ability to mux data from multiple devices. | ||
74 | * So if the channels requested come from different devices this will | ||
75 | * fail. | ||
76 | */ | ||
77 | struct iio_cb_buffer *iio_channel_get_all_cb(const char *name, | ||
78 | int (*cb)(u8 *data, | ||
79 | void *private), | ||
80 | void *private); | ||
81 | /** | ||
82 | * iio_channel_release_all_cb() - release and unregister the callback. | ||
83 | * @cb_buffer: The callback buffer that was allocated. | ||
84 | */ | ||
85 | void iio_channel_release_all_cb(struct iio_cb_buffer *cb_buffer); | ||
86 | |||
87 | /** | ||
88 | * iio_channel_start_all_cb() - start the flow of data through callback. | ||
89 | * @cb_buff: The callback buffer we are starting. | ||
90 | */ | ||
91 | int iio_channel_start_all_cb(struct iio_cb_buffer *cb_buff); | ||
92 | |||
93 | /** | ||
94 | * iio_channel_stop_all_cb() - stop the flow of data through the callback. | ||
95 | * @cb_buff: The callback buffer we are stopping. | ||
96 | */ | ||
97 | void iio_channel_stop_all_cb(struct iio_cb_buffer *cb_buff); | ||
98 | |||
99 | /** | ||
100 | * iio_channel_cb_get_channels() - get access to the underlying channels. | ||
101 | * @cb_buff: The callback buffer from whom we want the channel | ||
102 | * information. | ||
103 | * | ||
104 | * This function allows one to obtain information about the channels. | ||
105 | * Whilst this may allow direct reading if all buffers are disabled, the | ||
106 | * primary aim is to allow drivers that are consuming a channel to query | ||
107 | * things like scaling of the channel. | ||
108 | */ | ||
109 | struct iio_channel | ||
110 | *iio_channel_cb_get_channels(const struct iio_cb_buffer *cb_buffer); | ||
111 | |||
62 | /** | 112 | /** |
63 | * iio_read_channel_raw() - read from a given channel | 113 | * iio_read_channel_raw() - read from a given channel |
64 | * @chan: The channel being queried. | 114 | * @chan: The channel being queried. |
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 7806c24e5bc8..da8c776ba0bd 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
@@ -410,6 +410,7 @@ struct iio_buffer_setup_ops { | |||
410 | * and owner | 410 | * and owner |
411 | * @event_interface: [INTERN] event chrdevs associated with interrupt lines | 411 | * @event_interface: [INTERN] event chrdevs associated with interrupt lines |
412 | * @buffer: [DRIVER] any buffer present | 412 | * @buffer: [DRIVER] any buffer present |
413 | * @buffer_list: [INTERN] list of all buffers currently attached | ||
413 | * @scan_bytes: [INTERN] num bytes captured to be fed to buffer demux | 414 | * @scan_bytes: [INTERN] num bytes captured to be fed to buffer demux |
414 | * @mlock: [INTERN] lock used to prevent simultaneous device state | 415 | * @mlock: [INTERN] lock used to prevent simultaneous device state |
415 | * changes | 416 | * changes |
@@ -448,6 +449,7 @@ struct iio_dev { | |||
448 | struct iio_event_interface *event_interface; | 449 | struct iio_event_interface *event_interface; |
449 | 450 | ||
450 | struct iio_buffer *buffer; | 451 | struct iio_buffer *buffer; |
452 | struct list_head buffer_list; | ||
451 | int scan_bytes; | 453 | int scan_bytes; |
452 | struct mutex mlock; | 454 | struct mutex mlock; |
453 | 455 | ||
@@ -618,6 +620,9 @@ static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev) | |||
618 | }; | 620 | }; |
619 | #endif | 621 | #endif |
620 | 622 | ||
623 | int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer, | ||
624 | int *fract); | ||
625 | |||
621 | /** | 626 | /** |
622 | * IIO_DEGREE_TO_RAD() - Convert degree to rad | 627 | * IIO_DEGREE_TO_RAD() - Convert degree to rad |
623 | * @deg: A value in degree | 628 | * @deg: A value in degree |
diff --git a/include/linux/iio/imu/adis.h b/include/linux/iio/imu/adis.h new file mode 100644 index 000000000000..ff781dca2e9a --- /dev/null +++ b/include/linux/iio/imu/adis.h | |||
@@ -0,0 +1,280 @@ | |||
1 | /* | ||
2 | * Common library for ADIS16XXX devices | ||
3 | * | ||
4 | * Copyright 2012 Analog Devices Inc. | ||
5 | * Author: Lars-Peter Clausen <lars@metafoo.de> | ||
6 | * | ||
7 | * Licensed under the GPL-2 or later. | ||
8 | */ | ||
9 | |||
10 | #ifndef __IIO_ADIS_H__ | ||
11 | #define __IIO_ADIS_H__ | ||
12 | |||
13 | #include <linux/spi/spi.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | #include <linux/iio/types.h> | ||
16 | |||
17 | #define ADIS_WRITE_REG(reg) ((0x80 | (reg))) | ||
18 | #define ADIS_READ_REG(reg) ((reg) & 0x7f) | ||
19 | |||
20 | #define ADIS_PAGE_SIZE 0x80 | ||
21 | #define ADIS_REG_PAGE_ID 0x00 | ||
22 | |||
23 | struct adis; | ||
24 | |||
25 | /** | ||
26 | * struct adis_data - ADIS chip variant specific data | ||
27 | * @read_delay: SPI delay for read operations in us | ||
28 | * @write_delay: SPI delay for write operations in us | ||
29 | * @glob_cmd_reg: Register address of the GLOB_CMD register | ||
30 | * @msc_ctrl_reg: Register address of the MSC_CTRL register | ||
31 | * @diag_stat_reg: Register address of the DIAG_STAT register | ||
32 | * @status_error_msgs: Array of error messgaes | ||
33 | * @status_error_mask: | ||
34 | */ | ||
35 | struct adis_data { | ||
36 | unsigned int read_delay; | ||
37 | unsigned int write_delay; | ||
38 | |||
39 | unsigned int glob_cmd_reg; | ||
40 | unsigned int msc_ctrl_reg; | ||
41 | unsigned int diag_stat_reg; | ||
42 | |||
43 | unsigned int self_test_mask; | ||
44 | unsigned int startup_delay; | ||
45 | |||
46 | const char * const *status_error_msgs; | ||
47 | unsigned int status_error_mask; | ||
48 | |||
49 | int (*enable_irq)(struct adis *adis, bool enable); | ||
50 | |||
51 | bool has_paging; | ||
52 | }; | ||
53 | |||
54 | struct adis { | ||
55 | struct spi_device *spi; | ||
56 | struct iio_trigger *trig; | ||
57 | |||
58 | const struct adis_data *data; | ||
59 | |||
60 | struct mutex txrx_lock; | ||
61 | struct spi_message msg; | ||
62 | struct spi_transfer *xfer; | ||
63 | unsigned int current_page; | ||
64 | void *buffer; | ||
65 | |||
66 | uint8_t tx[10] ____cacheline_aligned; | ||
67 | uint8_t rx[4]; | ||
68 | }; | ||
69 | |||
70 | int adis_init(struct adis *adis, struct iio_dev *indio_dev, | ||
71 | struct spi_device *spi, const struct adis_data *data); | ||
72 | int adis_reset(struct adis *adis); | ||
73 | |||
74 | int adis_write_reg(struct adis *adis, unsigned int reg, | ||
75 | unsigned int val, unsigned int size); | ||
76 | int adis_read_reg(struct adis *adis, unsigned int reg, | ||
77 | unsigned int *val, unsigned int size); | ||
78 | |||
79 | /** | ||
80 | * adis_write_reg_8() - Write single byte to a register | ||
81 | * @adis: The adis device | ||
82 | * @reg: The address of the register to be written | ||
83 | * @value: The value to write | ||
84 | */ | ||
85 | static inline int adis_write_reg_8(struct adis *adis, unsigned int reg, | ||
86 | uint8_t val) | ||
87 | { | ||
88 | return adis_write_reg(adis, reg, val, 1); | ||
89 | } | ||
90 | |||
91 | /** | ||
92 | * adis_write_reg_16() - Write 2 bytes to a pair of registers | ||
93 | * @adis: The adis device | ||
94 | * @reg: The address of the lower of the two registers | ||
95 | * @value: Value to be written | ||
96 | */ | ||
97 | static inline int adis_write_reg_16(struct adis *adis, unsigned int reg, | ||
98 | uint16_t val) | ||
99 | { | ||
100 | return adis_write_reg(adis, reg, val, 2); | ||
101 | } | ||
102 | |||
103 | /** | ||
104 | * adis_write_reg_32() - write 4 bytes to four registers | ||
105 | * @adis: The adis device | ||
106 | * @reg: The address of the lower of the four register | ||
107 | * @value: Value to be written | ||
108 | */ | ||
109 | static inline int adis_write_reg_32(struct adis *adis, unsigned int reg, | ||
110 | uint32_t val) | ||
111 | { | ||
112 | return adis_write_reg(adis, reg, val, 4); | ||
113 | } | ||
114 | |||
115 | /** | ||
116 | * adis_read_reg_16() - read 2 bytes from a 16-bit register | ||
117 | * @adis: The adis device | ||
118 | * @reg: The address of the lower of the two registers | ||
119 | * @val: The value read back from the device | ||
120 | */ | ||
121 | static inline int adis_read_reg_16(struct adis *adis, unsigned int reg, | ||
122 | uint16_t *val) | ||
123 | { | ||
124 | unsigned int tmp; | ||
125 | int ret; | ||
126 | |||
127 | ret = adis_read_reg(adis, reg, &tmp, 2); | ||
128 | *val = tmp; | ||
129 | |||
130 | return ret; | ||
131 | } | ||
132 | |||
133 | /** | ||
134 | * adis_read_reg_32() - read 4 bytes from a 32-bit register | ||
135 | * @adis: The adis device | ||
136 | * @reg: The address of the lower of the two registers | ||
137 | * @val: The value read back from the device | ||
138 | */ | ||
139 | static inline int adis_read_reg_32(struct adis *adis, unsigned int reg, | ||
140 | uint32_t *val) | ||
141 | { | ||
142 | unsigned int tmp; | ||
143 | int ret; | ||
144 | |||
145 | ret = adis_read_reg(adis, reg, &tmp, 4); | ||
146 | *val = tmp; | ||
147 | |||
148 | return ret; | ||
149 | } | ||
150 | |||
151 | int adis_enable_irq(struct adis *adis, bool enable); | ||
152 | int adis_check_status(struct adis *adis); | ||
153 | |||
154 | int adis_initial_startup(struct adis *adis); | ||
155 | |||
156 | int adis_single_conversion(struct iio_dev *indio_dev, | ||
157 | const struct iio_chan_spec *chan, unsigned int error_mask, | ||
158 | int *val); | ||
159 | |||
160 | #define ADIS_VOLTAGE_CHAN(addr, si, chan, name, bits) { \ | ||
161 | .type = IIO_VOLTAGE, \ | ||
162 | .indexed = 1, \ | ||
163 | .channel = (chan), \ | ||
164 | .extend_name = name, \ | ||
165 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | ||
166 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ | ||
167 | .address = (addr), \ | ||
168 | .scan_index = (si), \ | ||
169 | .scan_type = { \ | ||
170 | .sign = 'u', \ | ||
171 | .realbits = (bits), \ | ||
172 | .storagebits = 16, \ | ||
173 | .endianness = IIO_BE, \ | ||
174 | }, \ | ||
175 | } | ||
176 | |||
177 | #define ADIS_SUPPLY_CHAN(addr, si, bits) \ | ||
178 | ADIS_VOLTAGE_CHAN(addr, si, 0, "supply", bits) | ||
179 | |||
180 | #define ADIS_AUX_ADC_CHAN(addr, si, bits) \ | ||
181 | ADIS_VOLTAGE_CHAN(addr, si, 1, NULL, bits) | ||
182 | |||
183 | #define ADIS_TEMP_CHAN(addr, si, bits) { \ | ||
184 | .type = IIO_TEMP, \ | ||
185 | .indexed = 1, \ | ||
186 | .channel = 0, \ | ||
187 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | ||
188 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT | \ | ||
189 | IIO_CHAN_INFO_OFFSET_SEPARATE_BIT, \ | ||
190 | .address = (addr), \ | ||
191 | .scan_index = (si), \ | ||
192 | .scan_type = { \ | ||
193 | .sign = 'u', \ | ||
194 | .realbits = (bits), \ | ||
195 | .storagebits = 16, \ | ||
196 | .endianness = IIO_BE, \ | ||
197 | }, \ | ||
198 | } | ||
199 | |||
200 | #define ADIS_MOD_CHAN(_type, mod, addr, si, info, bits) { \ | ||
201 | .type = (_type), \ | ||
202 | .modified = 1, \ | ||
203 | .channel2 = IIO_MOD_ ## mod, \ | ||
204 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | ||
205 | IIO_CHAN_INFO_SCALE_SHARED_BIT | \ | ||
206 | info, \ | ||
207 | .address = (addr), \ | ||
208 | .scan_index = (si), \ | ||
209 | .scan_type = { \ | ||
210 | .sign = 's', \ | ||
211 | .realbits = (bits), \ | ||
212 | .storagebits = 16, \ | ||
213 | .endianness = IIO_BE, \ | ||
214 | }, \ | ||
215 | } | ||
216 | |||
217 | #define ADIS_ACCEL_CHAN(mod, addr, si, info, bits) \ | ||
218 | ADIS_MOD_CHAN(IIO_ACCEL, mod, addr, si, info, bits) | ||
219 | |||
220 | #define ADIS_GYRO_CHAN(mod, addr, si, info, bits) \ | ||
221 | ADIS_MOD_CHAN(IIO_ANGL_VEL, mod, addr, si, info, bits) | ||
222 | |||
223 | #define ADIS_INCLI_CHAN(mod, addr, si, info, bits) \ | ||
224 | ADIS_MOD_CHAN(IIO_INCLI, mod, addr, si, info, bits) | ||
225 | |||
226 | #define ADIS_ROT_CHAN(mod, addr, si, info, bits) \ | ||
227 | ADIS_MOD_CHAN(IIO_ROT, mod, addr, si, info, bits) | ||
228 | |||
229 | #ifdef CONFIG_IIO_ADIS_LIB_BUFFER | ||
230 | |||
231 | int adis_setup_buffer_and_trigger(struct adis *adis, | ||
232 | struct iio_dev *indio_dev, irqreturn_t (*trigger_handler)(int, void *)); | ||
233 | void adis_cleanup_buffer_and_trigger(struct adis *adis, | ||
234 | struct iio_dev *indio_dev); | ||
235 | |||
236 | int adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev); | ||
237 | void adis_remove_trigger(struct adis *adis); | ||
238 | |||
239 | int adis_update_scan_mode(struct iio_dev *indio_dev, | ||
240 | const unsigned long *scan_mask); | ||
241 | |||
242 | #else /* CONFIG_IIO_BUFFER */ | ||
243 | |||
244 | static inline int adis_setup_buffer_and_trigger(struct adis *adis, | ||
245 | struct iio_dev *indio_dev, irqreturn_t (*trigger_handler)(int, void *)) | ||
246 | { | ||
247 | return 0; | ||
248 | } | ||
249 | |||
250 | static inline void adis_cleanup_buffer_and_trigger(struct adis *adis, | ||
251 | struct iio_dev *indio_dev) | ||
252 | { | ||
253 | } | ||
254 | |||
255 | static inline int adis_probe_trigger(struct adis *adis, | ||
256 | struct iio_dev *indio_dev) | ||
257 | { | ||
258 | return 0; | ||
259 | } | ||
260 | |||
261 | static inline void adis_remove_trigger(struct adis *adis) | ||
262 | { | ||
263 | } | ||
264 | |||
265 | #define adis_update_scan_mode NULL | ||
266 | |||
267 | #endif /* CONFIG_IIO_BUFFER */ | ||
268 | |||
269 | #ifdef CONFIG_DEBUG_FS | ||
270 | |||
271 | int adis_debugfs_reg_access(struct iio_dev *indio_dev, | ||
272 | unsigned int reg, unsigned int writeval, unsigned int *readval); | ||
273 | |||
274 | #else | ||
275 | |||
276 | #define adis_debugfs_reg_access NULL | ||
277 | |||
278 | #endif | ||
279 | |||
280 | #endif | ||
diff --git a/include/linux/iio/machine.h b/include/linux/iio/machine.h index 809a3f08d5a5..1601a2a63a72 100644 --- a/include/linux/iio/machine.h +++ b/include/linux/iio/machine.h | |||
@@ -19,11 +19,13 @@ | |||
19 | * @consumer_dev_name: Name to uniquely identify the consumer device. | 19 | * @consumer_dev_name: Name to uniquely identify the consumer device. |
20 | * @consumer_channel: Unique name used to identify the channel on the | 20 | * @consumer_channel: Unique name used to identify the channel on the |
21 | * consumer side. | 21 | * consumer side. |
22 | * @consumer_data: Data about the channel for use by the consumer driver. | ||
22 | */ | 23 | */ |
23 | struct iio_map { | 24 | struct iio_map { |
24 | const char *adc_channel_label; | 25 | const char *adc_channel_label; |
25 | const char *consumer_dev_name; | 26 | const char *consumer_dev_name; |
26 | const char *consumer_channel; | 27 | const char *consumer_channel; |
28 | void *consumer_data; | ||
27 | }; | 29 | }; |
28 | 30 | ||
29 | #endif | 31 | #endif |
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 5c647ecfd5ba..88bf0f0d27b4 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h | |||
@@ -28,6 +28,7 @@ enum iio_chan_type { | |||
28 | IIO_CAPACITANCE, | 28 | IIO_CAPACITANCE, |
29 | IIO_ALTVOLTAGE, | 29 | IIO_ALTVOLTAGE, |
30 | IIO_CCT, | 30 | IIO_CCT, |
31 | IIO_PRESSURE, | ||
31 | }; | 32 | }; |
32 | 33 | ||
33 | enum iio_modifier { | 34 | enum iio_modifier { |
@@ -58,5 +59,6 @@ enum iio_modifier { | |||
58 | #define IIO_VAL_INT_PLUS_NANO 3 | 59 | #define IIO_VAL_INT_PLUS_NANO 3 |
59 | #define IIO_VAL_INT_PLUS_MICRO_DB 4 | 60 | #define IIO_VAL_INT_PLUS_MICRO_DB 4 |
60 | #define IIO_VAL_FRACTIONAL 10 | 61 | #define IIO_VAL_FRACTIONAL 10 |
62 | #define IIO_VAL_FRACTIONAL_LOG2 11 | ||
61 | 63 | ||
62 | #endif /* _IIO_TYPES_H_ */ | 64 | #endif /* _IIO_TYPES_H_ */ |
diff --git a/include/linux/init.h b/include/linux/init.h index e59041e21df3..f63692d6902e 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -93,13 +93,13 @@ | |||
93 | 93 | ||
94 | #define __exit __section(.exit.text) __exitused __cold notrace | 94 | #define __exit __section(.exit.text) __exitused __cold notrace |
95 | 95 | ||
96 | /* Used for HOTPLUG */ | 96 | /* Used for HOTPLUG, but that is always enabled now, so just make them noops */ |
97 | #define __devinit __section(.devinit.text) __cold notrace | 97 | #define __devinit |
98 | #define __devinitdata __section(.devinit.data) | 98 | #define __devinitdata |
99 | #define __devinitconst __constsection(.devinit.rodata) | 99 | #define __devinitconst |
100 | #define __devexit __section(.devexit.text) __exitused __cold notrace | 100 | #define __devexit |
101 | #define __devexitdata __section(.devexit.data) | 101 | #define __devexitdata |
102 | #define __devexitconst __constsection(.devexit.rodata) | 102 | #define __devexitconst |
103 | 103 | ||
104 | /* Used for HOTPLUG_CPU */ | 104 | /* Used for HOTPLUG_CPU */ |
105 | #define __cpuinit __section(.cpuinit.text) __cold notrace | 105 | #define __cpuinit __section(.cpuinit.text) __cold notrace |
@@ -126,10 +126,6 @@ | |||
126 | #define __INITRODATA .section ".init.rodata","a",%progbits | 126 | #define __INITRODATA .section ".init.rodata","a",%progbits |
127 | #define __FINITDATA .previous | 127 | #define __FINITDATA .previous |
128 | 128 | ||
129 | #define __DEVINIT .section ".devinit.text", "ax" | ||
130 | #define __DEVINITDATA .section ".devinit.data", "aw" | ||
131 | #define __DEVINITRODATA .section ".devinit.rodata", "a" | ||
132 | |||
133 | #define __CPUINIT .section ".cpuinit.text", "ax" | 129 | #define __CPUINIT .section ".cpuinit.text", "ax" |
134 | #define __CPUINITDATA .section ".cpuinit.data", "aw" | 130 | #define __CPUINITDATA .section ".cpuinit.data", "aw" |
135 | #define __CPUINITRODATA .section ".cpuinit.rodata", "a" | 131 | #define __CPUINITRODATA .section ".cpuinit.rodata", "a" |
diff --git a/include/linux/ipack.h b/include/linux/ipack.h new file mode 100644 index 000000000000..fea12cbb2aeb --- /dev/null +++ b/include/linux/ipack.h | |||
@@ -0,0 +1,245 @@ | |||
1 | /* | ||
2 | * Industry-pack bus. | ||
3 | * | ||
4 | * Copyright (C) 2011-2012 CERN (www.cern.ch) | ||
5 | * Author: Samuel Iglesias Gonsalvez <siglesias@igalia.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the Free | ||
9 | * Software Foundation; version 2 of the License. | ||
10 | */ | ||
11 | |||
12 | #include <linux/mod_devicetable.h> | ||
13 | #include <linux/device.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | |||
16 | #define IPACK_IDPROM_OFFSET_I 0x01 | ||
17 | #define IPACK_IDPROM_OFFSET_P 0x03 | ||
18 | #define IPACK_IDPROM_OFFSET_A 0x05 | ||
19 | #define IPACK_IDPROM_OFFSET_C 0x07 | ||
20 | #define IPACK_IDPROM_OFFSET_MANUFACTURER_ID 0x09 | ||
21 | #define IPACK_IDPROM_OFFSET_MODEL 0x0B | ||
22 | #define IPACK_IDPROM_OFFSET_REVISION 0x0D | ||
23 | #define IPACK_IDPROM_OFFSET_RESERVED 0x0F | ||
24 | #define IPACK_IDPROM_OFFSET_DRIVER_ID_L 0x11 | ||
25 | #define IPACK_IDPROM_OFFSET_DRIVER_ID_H 0x13 | ||
26 | #define IPACK_IDPROM_OFFSET_NUM_BYTES 0x15 | ||
27 | #define IPACK_IDPROM_OFFSET_CRC 0x17 | ||
28 | |||
29 | /* | ||
30 | * IndustryPack Fromat, Vendor and Device IDs. | ||
31 | */ | ||
32 | |||
33 | /* ID section format versions */ | ||
34 | #define IPACK_ID_VERSION_INVALID 0x00 | ||
35 | #define IPACK_ID_VERSION_1 0x01 | ||
36 | #define IPACK_ID_VERSION_2 0x02 | ||
37 | |||
38 | /* Vendors and devices. Sort key: vendor first, device next. */ | ||
39 | #define IPACK1_VENDOR_ID_RESERVED1 0x00 | ||
40 | #define IPACK1_VENDOR_ID_RESERVED2 0xFF | ||
41 | #define IPACK1_VENDOR_ID_UNREGISTRED01 0x01 | ||
42 | #define IPACK1_VENDOR_ID_UNREGISTRED02 0x02 | ||
43 | #define IPACK1_VENDOR_ID_UNREGISTRED03 0x03 | ||
44 | #define IPACK1_VENDOR_ID_UNREGISTRED04 0x04 | ||
45 | #define IPACK1_VENDOR_ID_UNREGISTRED05 0x05 | ||
46 | #define IPACK1_VENDOR_ID_UNREGISTRED06 0x06 | ||
47 | #define IPACK1_VENDOR_ID_UNREGISTRED07 0x07 | ||
48 | #define IPACK1_VENDOR_ID_UNREGISTRED08 0x08 | ||
49 | #define IPACK1_VENDOR_ID_UNREGISTRED09 0x09 | ||
50 | #define IPACK1_VENDOR_ID_UNREGISTRED10 0x0A | ||
51 | #define IPACK1_VENDOR_ID_UNREGISTRED11 0x0B | ||
52 | #define IPACK1_VENDOR_ID_UNREGISTRED12 0x0C | ||
53 | #define IPACK1_VENDOR_ID_UNREGISTRED13 0x0D | ||
54 | #define IPACK1_VENDOR_ID_UNREGISTRED14 0x0E | ||
55 | #define IPACK1_VENDOR_ID_UNREGISTRED15 0x0F | ||
56 | |||
57 | #define IPACK1_VENDOR_ID_SBS 0xF0 | ||
58 | #define IPACK1_DEVICE_ID_SBS_OCTAL_232 0x22 | ||
59 | #define IPACK1_DEVICE_ID_SBS_OCTAL_422 0x2A | ||
60 | #define IPACK1_DEVICE_ID_SBS_OCTAL_485 0x48 | ||
61 | |||
62 | struct ipack_bus_ops; | ||
63 | struct ipack_driver; | ||
64 | |||
65 | enum ipack_space { | ||
66 | IPACK_IO_SPACE = 0, | ||
67 | IPACK_ID_SPACE, | ||
68 | IPACK_INT_SPACE, | ||
69 | IPACK_MEM8_SPACE, | ||
70 | IPACK_MEM16_SPACE, | ||
71 | /* Dummy for counting the number of entries. Must remain the last | ||
72 | * entry */ | ||
73 | IPACK_SPACE_COUNT, | ||
74 | }; | ||
75 | |||
76 | /** | ||
77 | */ | ||
78 | struct ipack_region { | ||
79 | phys_addr_t start; | ||
80 | size_t size; | ||
81 | }; | ||
82 | |||
83 | /** | ||
84 | * struct ipack_device | ||
85 | * | ||
86 | * @slot: Slot where the device is plugged in the carrier board | ||
87 | * @bus: ipack_bus_device where the device is plugged to. | ||
88 | * @id_space: Virtual address to ID space. | ||
89 | * @io_space: Virtual address to IO space. | ||
90 | * @mem_space: Virtual address to MEM space. | ||
91 | * @dev: device in kernel representation. | ||
92 | * | ||
93 | * Warning: Direct access to mapped memory is possible but the endianness | ||
94 | * is not the same with PCI carrier or VME carrier. The endianness is managed | ||
95 | * by the carrier board throught bus->ops. | ||
96 | */ | ||
97 | struct ipack_device { | ||
98 | unsigned int slot; | ||
99 | struct ipack_bus_device *bus; | ||
100 | struct device dev; | ||
101 | void (*release) (struct ipack_device *dev); | ||
102 | struct ipack_region region[IPACK_SPACE_COUNT]; | ||
103 | u8 *id; | ||
104 | size_t id_avail; | ||
105 | u32 id_vendor; | ||
106 | u32 id_device; | ||
107 | u8 id_format; | ||
108 | unsigned int id_crc_correct:1; | ||
109 | unsigned int speed_8mhz:1; | ||
110 | unsigned int speed_32mhz:1; | ||
111 | }; | ||
112 | |||
113 | /** | ||
114 | * struct ipack_driver_ops -- Callbacks to IPack device driver | ||
115 | * | ||
116 | * @probe: Probe function | ||
117 | * @remove: Prepare imminent removal of the device. Services provided by the | ||
118 | * device should be revoked. | ||
119 | */ | ||
120 | |||
121 | struct ipack_driver_ops { | ||
122 | int (*probe) (struct ipack_device *dev); | ||
123 | void (*remove) (struct ipack_device *dev); | ||
124 | }; | ||
125 | |||
126 | /** | ||
127 | * struct ipack_driver -- Specific data to each ipack device driver | ||
128 | * | ||
129 | * @driver: Device driver kernel representation | ||
130 | * @ops: Callbacks provided by the IPack device driver | ||
131 | */ | ||
132 | struct ipack_driver { | ||
133 | struct device_driver driver; | ||
134 | const struct ipack_device_id *id_table; | ||
135 | const struct ipack_driver_ops *ops; | ||
136 | }; | ||
137 | |||
138 | /** | ||
139 | * struct ipack_bus_ops - available operations on a bridge module | ||
140 | * | ||
141 | * @map_space: map IP address space | ||
142 | * @unmap_space: unmap IP address space | ||
143 | * @request_irq: request IRQ | ||
144 | * @free_irq: free IRQ | ||
145 | * @get_clockrate: Returns the clockrate the carrier is currently | ||
146 | * communicating with the device at. | ||
147 | * @set_clockrate: Sets the clock-rate for carrier / module communication. | ||
148 | * Should return -EINVAL if the requested speed is not supported. | ||
149 | * @get_error: Returns the error state for the slot the device is attached | ||
150 | * to. | ||
151 | * @get_timeout: Returns 1 if the communication with the device has | ||
152 | * previously timed out. | ||
153 | * @reset_timeout: Resets the state returned by get_timeout. | ||
154 | */ | ||
155 | struct ipack_bus_ops { | ||
156 | int (*request_irq) (struct ipack_device *dev, | ||
157 | irqreturn_t (*handler)(void *), void *arg); | ||
158 | int (*free_irq) (struct ipack_device *dev); | ||
159 | int (*get_clockrate) (struct ipack_device *dev); | ||
160 | int (*set_clockrate) (struct ipack_device *dev, int mherz); | ||
161 | int (*get_error) (struct ipack_device *dev); | ||
162 | int (*get_timeout) (struct ipack_device *dev); | ||
163 | int (*reset_timeout) (struct ipack_device *dev); | ||
164 | }; | ||
165 | |||
166 | /** | ||
167 | * struct ipack_bus_device | ||
168 | * | ||
169 | * @dev: pointer to carrier device | ||
170 | * @slots: number of slots available | ||
171 | * @bus_nr: ipack bus number | ||
172 | * @ops: bus operations for the mezzanine drivers | ||
173 | */ | ||
174 | struct ipack_bus_device { | ||
175 | struct device *parent; | ||
176 | int slots; | ||
177 | int bus_nr; | ||
178 | const struct ipack_bus_ops *ops; | ||
179 | }; | ||
180 | |||
181 | /** | ||
182 | * ipack_bus_register -- register a new ipack bus | ||
183 | * | ||
184 | * @parent: pointer to the parent device, if any. | ||
185 | * @slots: number of slots available in the bus device. | ||
186 | * @ops: bus operations for the mezzanine drivers. | ||
187 | * | ||
188 | * The carrier board device should call this function to register itself as | ||
189 | * available bus device in ipack. | ||
190 | */ | ||
191 | struct ipack_bus_device *ipack_bus_register(struct device *parent, int slots, | ||
192 | const struct ipack_bus_ops *ops); | ||
193 | |||
194 | /** | ||
195 | * ipack_bus_unregister -- unregister an ipack bus | ||
196 | */ | ||
197 | int ipack_bus_unregister(struct ipack_bus_device *bus); | ||
198 | |||
199 | /** | ||
200 | * ipack_driver_register -- Register a new ipack device driver | ||
201 | * | ||
202 | * Called by a ipack driver to register itself as a driver | ||
203 | * that can manage ipack devices. | ||
204 | */ | ||
205 | int ipack_driver_register(struct ipack_driver *edrv, struct module *owner, | ||
206 | const char *name); | ||
207 | void ipack_driver_unregister(struct ipack_driver *edrv); | ||
208 | |||
209 | /** | ||
210 | * ipack_device_register -- register an IPack device with the kernel | ||
211 | * @dev: the new device to register. | ||
212 | * | ||
213 | * Register a new IPack device ("module" in IndustryPack jargon). The call | ||
214 | * is done by the carrier driver. The carrier should populate the fields | ||
215 | * bus and slot as well as the region array of @dev prior to calling this | ||
216 | * function. The rest of the fields will be allocated and populated | ||
217 | * during registration. | ||
218 | * | ||
219 | * Return zero on success or error code on failure. | ||
220 | */ | ||
221 | int ipack_device_register(struct ipack_device *dev); | ||
222 | void ipack_device_unregister(struct ipack_device *dev); | ||
223 | |||
224 | /** | ||
225 | * DEFINE_IPACK_DEVICE_TABLE - macro used to describe a IndustryPack table | ||
226 | * @_table: device table name | ||
227 | * | ||
228 | * This macro is used to create a struct ipack_device_id array (a device table) | ||
229 | * in a generic manner. | ||
230 | */ | ||
231 | #define DEFINE_IPACK_DEVICE_TABLE(_table) \ | ||
232 | const struct ipack_device_id _table[] | ||
233 | /** | ||
234 | * IPACK_DEVICE - macro used to describe a specific IndustryPack device | ||
235 | * @_format: the format version (currently either 1 or 2, 8 bit value) | ||
236 | * @vend: the 8 or 24 bit IndustryPack Vendor ID | ||
237 | * @dev: the 8 or 16 bit IndustryPack Device ID | ||
238 | * | ||
239 | * This macro is used to create a struct ipack_device_id that matches a specific | ||
240 | * device. | ||
241 | */ | ||
242 | #define IPACK_DEVICE(_format, vend, dev) \ | ||
243 | .format = (_format), \ | ||
244 | .vendor = (vend), \ | ||
245 | .device = (dev) | ||
diff --git a/include/linux/irq.h b/include/linux/irq.h index 216b0ba109d7..526f10a637c1 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -392,6 +392,15 @@ static inline void irq_move_masked_irq(struct irq_data *data) { } | |||
392 | 392 | ||
393 | extern int no_irq_affinity; | 393 | extern int no_irq_affinity; |
394 | 394 | ||
395 | #ifdef CONFIG_HARDIRQS_SW_RESEND | ||
396 | int irq_set_parent(int irq, int parent_irq); | ||
397 | #else | ||
398 | static inline int irq_set_parent(int irq, int parent_irq) | ||
399 | { | ||
400 | return 0; | ||
401 | } | ||
402 | #endif | ||
403 | |||
395 | /* | 404 | /* |
396 | * Built-in IRQ handlers for various IRQ types, | 405 | * Built-in IRQ handlers for various IRQ types, |
397 | * callable via desc->handle_irq() | 406 | * callable via desc->handle_irq() |
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index 0ba014c55056..623325e2ff97 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h | |||
@@ -11,6 +11,8 @@ | |||
11 | struct irq_affinity_notify; | 11 | struct irq_affinity_notify; |
12 | struct proc_dir_entry; | 12 | struct proc_dir_entry; |
13 | struct module; | 13 | struct module; |
14 | struct irq_desc; | ||
15 | |||
14 | /** | 16 | /** |
15 | * struct irq_desc - interrupt descriptor | 17 | * struct irq_desc - interrupt descriptor |
16 | * @irq_data: per irq and chip data passed down to chip functions | 18 | * @irq_data: per irq and chip data passed down to chip functions |
@@ -65,6 +67,7 @@ struct irq_desc { | |||
65 | #ifdef CONFIG_PROC_FS | 67 | #ifdef CONFIG_PROC_FS |
66 | struct proc_dir_entry *dir; | 68 | struct proc_dir_entry *dir; |
67 | #endif | 69 | #endif |
70 | int parent_irq; | ||
68 | struct module *owner; | 71 | struct module *owner; |
69 | const char *name; | 72 | const char *name; |
70 | } ____cacheline_internodealigned_in_smp; | 73 | } ____cacheline_internodealigned_in_smp; |
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 6b87413da9d6..82ed068b1ebe 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
@@ -70,11 +70,12 @@ extern int register_refined_jiffies(long clock_tick_rate); | |||
70 | 70 | ||
71 | /* | 71 | /* |
72 | * The 64-bit value is not atomic - you MUST NOT read it | 72 | * The 64-bit value is not atomic - you MUST NOT read it |
73 | * without sampling the sequence number in xtime_lock. | 73 | * without sampling the sequence number in jiffies_lock. |
74 | * get_jiffies_64() will do this for you as appropriate. | 74 | * get_jiffies_64() will do this for you as appropriate. |
75 | */ | 75 | */ |
76 | extern u64 __jiffy_data jiffies_64; | 76 | extern u64 __jiffy_data jiffies_64; |
77 | extern unsigned long volatile __jiffy_data jiffies; | 77 | extern unsigned long volatile __jiffy_data jiffies; |
78 | extern seqlock_t jiffies_lock; | ||
78 | 79 | ||
79 | #if (BITS_PER_LONG < 64) | 80 | #if (BITS_PER_LONG < 64) |
80 | u64 get_jiffies_64(void); | 81 | u64 get_jiffies_64(void); |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index a123b13b70fd..d97ed5897447 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -527,9 +527,6 @@ __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap); | |||
527 | 527 | ||
528 | extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); | 528 | extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); |
529 | #else | 529 | #else |
530 | static inline __printf(1, 2) | ||
531 | int trace_printk(const char *fmt, ...); | ||
532 | |||
533 | static inline void tracing_start(void) { } | 530 | static inline void tracing_start(void) { } |
534 | static inline void tracing_stop(void) { } | 531 | static inline void tracing_stop(void) { } |
535 | static inline void ftrace_off_permanent(void) { } | 532 | static inline void ftrace_off_permanent(void) { } |
@@ -539,8 +536,8 @@ static inline void tracing_on(void) { } | |||
539 | static inline void tracing_off(void) { } | 536 | static inline void tracing_off(void) { } |
540 | static inline int tracing_is_on(void) { return 0; } | 537 | static inline int tracing_is_on(void) { return 0; } |
541 | 538 | ||
542 | static inline int | 539 | static inline __printf(1, 2) |
543 | trace_printk(const char *fmt, ...) | 540 | int trace_printk(const char *fmt, ...) |
544 | { | 541 | { |
545 | return 0; | 542 | return 0; |
546 | } | 543 | } |
@@ -687,18 +684,11 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } | |||
687 | /* Trap pasters of __FUNCTION__ at compile-time */ | 684 | /* Trap pasters of __FUNCTION__ at compile-time */ |
688 | #define __FUNCTION__ (__func__) | 685 | #define __FUNCTION__ (__func__) |
689 | 686 | ||
690 | /* This helps us to avoid #ifdef CONFIG_NUMA */ | 687 | /* This helps us to avoid #ifdef CONFIG_SYMBOL_PREFIX */ |
691 | #ifdef CONFIG_NUMA | 688 | #ifdef CONFIG_SYMBOL_PREFIX |
692 | #define NUMA_BUILD 1 | 689 | #define SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX |
693 | #else | ||
694 | #define NUMA_BUILD 0 | ||
695 | #endif | ||
696 | |||
697 | /* This helps us avoid #ifdef CONFIG_COMPACTION */ | ||
698 | #ifdef CONFIG_COMPACTION | ||
699 | #define COMPACTION_BUILD 1 | ||
700 | #else | 690 | #else |
701 | #define COMPACTION_BUILD 0 | 691 | #define SYMBOL_PREFIX "" |
702 | #endif | 692 | #endif |
703 | 693 | ||
704 | /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ | 694 | /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 36d12f0884c3..66b70780e910 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/cpumask.h> | 7 | #include <linux/cpumask.h> |
8 | #include <linux/interrupt.h> | 8 | #include <linux/interrupt.h> |
9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
10 | #include <linux/vtime.h> | ||
10 | #include <asm/irq.h> | 11 | #include <asm/irq.h> |
11 | #include <asm/cputime.h> | 12 | #include <asm/cputime.h> |
12 | 13 | ||
@@ -126,16 +127,16 @@ extern void account_system_time(struct task_struct *, int, cputime_t, cputime_t) | |||
126 | extern void account_steal_time(cputime_t); | 127 | extern void account_steal_time(cputime_t); |
127 | extern void account_idle_time(cputime_t); | 128 | extern void account_idle_time(cputime_t); |
128 | 129 | ||
129 | extern void account_process_tick(struct task_struct *, int user); | ||
130 | extern void account_steal_ticks(unsigned long ticks); | ||
131 | extern void account_idle_ticks(unsigned long ticks); | ||
132 | |||
133 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | 130 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
134 | extern void vtime_task_switch(struct task_struct *prev); | 131 | static inline void account_process_tick(struct task_struct *tsk, int user) |
135 | extern void vtime_account_system(struct task_struct *tsk); | 132 | { |
136 | extern void vtime_account_idle(struct task_struct *tsk); | 133 | vtime_account_user(tsk); |
134 | } | ||
137 | #else | 135 | #else |
138 | static inline void vtime_task_switch(struct task_struct *prev) { } | 136 | extern void account_process_tick(struct task_struct *, int user); |
139 | #endif | 137 | #endif |
140 | 138 | ||
139 | extern void account_steal_ticks(unsigned long ticks); | ||
140 | extern void account_idle_ticks(unsigned long ticks); | ||
141 | |||
141 | #endif /* _LINUX_KERNEL_STAT_H */ | 142 | #endif /* _LINUX_KERNEL_STAT_H */ |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 1e57449395b1..939b11268c86 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -203,7 +203,6 @@ extern struct kobject *power_kobj; | |||
203 | /* The global /sys/firmware/ kobject for people to chain off of */ | 203 | /* The global /sys/firmware/ kobject for people to chain off of */ |
204 | extern struct kobject *firmware_kobj; | 204 | extern struct kobject *firmware_kobj; |
205 | 205 | ||
206 | #if defined(CONFIG_HOTPLUG) | ||
207 | int kobject_uevent(struct kobject *kobj, enum kobject_action action); | 206 | int kobject_uevent(struct kobject *kobj, enum kobject_action action); |
208 | int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, | 207 | int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, |
209 | char *envp[]); | 208 | char *envp[]); |
@@ -213,22 +212,5 @@ int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...); | |||
213 | 212 | ||
214 | int kobject_action_type(const char *buf, size_t count, | 213 | int kobject_action_type(const char *buf, size_t count, |
215 | enum kobject_action *type); | 214 | enum kobject_action *type); |
216 | #else | ||
217 | static inline int kobject_uevent(struct kobject *kobj, | ||
218 | enum kobject_action action) | ||
219 | { return 0; } | ||
220 | static inline int kobject_uevent_env(struct kobject *kobj, | ||
221 | enum kobject_action action, | ||
222 | char *envp[]) | ||
223 | { return 0; } | ||
224 | |||
225 | static inline __printf(2, 3) | ||
226 | int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) | ||
227 | { return -ENOMEM; } | ||
228 | |||
229 | static inline int kobject_action_type(const char *buf, size_t count, | ||
230 | enum kobject_action *type) | ||
231 | { return -EINVAL; } | ||
232 | #endif | ||
233 | 215 | ||
234 | #endif /* _KOBJECT_H_ */ | 216 | #endif /* _KOBJECT_H_ */ |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index ecc554374e44..d5cddd8dcc5c 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -726,7 +726,11 @@ static inline int kvm_deassign_device(struct kvm *kvm, | |||
726 | static inline void kvm_guest_enter(void) | 726 | static inline void kvm_guest_enter(void) |
727 | { | 727 | { |
728 | BUG_ON(preemptible()); | 728 | BUG_ON(preemptible()); |
729 | vtime_account(current); | 729 | /* |
730 | * This is running in ioctl context so we can avoid | ||
731 | * the call to vtime_account() with its unnecessary idle check. | ||
732 | */ | ||
733 | vtime_account_system_irqsafe(current); | ||
730 | current->flags |= PF_VCPU; | 734 | current->flags |= PF_VCPU; |
731 | /* KVM does not hold any references to rcu protected data when it | 735 | /* KVM does not hold any references to rcu protected data when it |
732 | * switches CPU into a guest mode. In fact switching to a guest mode | 736 | * switches CPU into a guest mode. In fact switching to a guest mode |
@@ -740,7 +744,11 @@ static inline void kvm_guest_enter(void) | |||
740 | 744 | ||
741 | static inline void kvm_guest_exit(void) | 745 | static inline void kvm_guest_exit(void) |
742 | { | 746 | { |
743 | vtime_account(current); | 747 | /* |
748 | * This is running in ioctl context so we can avoid | ||
749 | * the call to vtime_account() with its unnecessary idle check. | ||
750 | */ | ||
751 | vtime_account_system_irqsafe(current); | ||
744 | current->flags &= ~PF_VCPU; | 752 | current->flags &= ~PF_VCPU; |
745 | } | 753 | } |
746 | 754 | ||
diff --git a/include/linux/memory.h b/include/linux/memory.h index ff9a9f8e0ed9..a09216d0dcc7 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -53,6 +53,7 @@ int arch_get_memory_phys_device(unsigned long start_pfn); | |||
53 | struct memory_notify { | 53 | struct memory_notify { |
54 | unsigned long start_pfn; | 54 | unsigned long start_pfn; |
55 | unsigned long nr_pages; | 55 | unsigned long nr_pages; |
56 | int status_change_nid_normal; | ||
56 | int status_change_nid; | 57 | int status_change_nid; |
57 | }; | 58 | }; |
58 | 59 | ||
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 95573ec4ee6c..4a45c4e50025 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -26,6 +26,13 @@ enum { | |||
26 | MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE = NODE_INFO, | 26 | MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE = NODE_INFO, |
27 | }; | 27 | }; |
28 | 28 | ||
29 | /* Types for control the zone type of onlined memory */ | ||
30 | enum { | ||
31 | ONLINE_KEEP, | ||
32 | ONLINE_KERNEL, | ||
33 | ONLINE_MOVABLE, | ||
34 | }; | ||
35 | |||
29 | /* | 36 | /* |
30 | * pgdat resizing functions | 37 | * pgdat resizing functions |
31 | */ | 38 | */ |
@@ -46,6 +53,10 @@ void pgdat_resize_init(struct pglist_data *pgdat) | |||
46 | } | 53 | } |
47 | /* | 54 | /* |
48 | * Zone resizing functions | 55 | * Zone resizing functions |
56 | * | ||
57 | * Note: any attempt to resize a zone should has pgdat_resize_lock() | ||
58 | * zone_span_writelock() both held. This ensure the size of a zone | ||
59 | * can't be changed while pgdat_resize_lock() held. | ||
49 | */ | 60 | */ |
50 | static inline unsigned zone_span_seqbegin(struct zone *zone) | 61 | static inline unsigned zone_span_seqbegin(struct zone *zone) |
51 | { | 62 | { |
@@ -71,7 +82,7 @@ extern int zone_grow_free_lists(struct zone *zone, unsigned long new_nr_pages); | |||
71 | extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages); | 82 | extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages); |
72 | extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); | 83 | extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); |
73 | /* VM interface that may be used by firmware interface */ | 84 | /* VM interface that may be used by firmware interface */ |
74 | extern int online_pages(unsigned long, unsigned long); | 85 | extern int online_pages(unsigned long, unsigned long, int); |
75 | extern void __offline_isolated_pages(unsigned long, unsigned long); | 86 | extern void __offline_isolated_pages(unsigned long, unsigned long); |
76 | 87 | ||
77 | typedef void (*online_page_callback_t)(struct page *page); | 88 | typedef void (*online_page_callback_t)(struct page *page); |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index e5ccb9ddd90e..dbd212723b74 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -82,16 +82,6 @@ static inline void mpol_cond_put(struct mempolicy *pol) | |||
82 | __mpol_put(pol); | 82 | __mpol_put(pol); |
83 | } | 83 | } |
84 | 84 | ||
85 | extern struct mempolicy *__mpol_cond_copy(struct mempolicy *tompol, | ||
86 | struct mempolicy *frompol); | ||
87 | static inline struct mempolicy *mpol_cond_copy(struct mempolicy *tompol, | ||
88 | struct mempolicy *frompol) | ||
89 | { | ||
90 | if (!frompol) | ||
91 | return frompol; | ||
92 | return __mpol_cond_copy(tompol, frompol); | ||
93 | } | ||
94 | |||
95 | extern struct mempolicy *__mpol_dup(struct mempolicy *pol); | 85 | extern struct mempolicy *__mpol_dup(struct mempolicy *pol); |
96 | static inline struct mempolicy *mpol_dup(struct mempolicy *pol) | 86 | static inline struct mempolicy *mpol_dup(struct mempolicy *pol) |
97 | { | 87 | { |
@@ -215,12 +205,6 @@ static inline void mpol_cond_put(struct mempolicy *pol) | |||
215 | { | 205 | { |
216 | } | 206 | } |
217 | 207 | ||
218 | static inline struct mempolicy *mpol_cond_copy(struct mempolicy *to, | ||
219 | struct mempolicy *from) | ||
220 | { | ||
221 | return from; | ||
222 | } | ||
223 | |||
224 | static inline void mpol_get(struct mempolicy *pol) | 208 | static inline void mpol_get(struct mempolicy *pol) |
225 | { | 209 | { |
226 | } | 210 | } |
diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h index a0ca0dca1244..478672ed0c3d 100644 --- a/include/linux/mfd/88pm80x.h +++ b/include/linux/mfd/88pm80x.h | |||
@@ -364,6 +364,6 @@ static inline int pm80x_dev_resume(struct device *dev) | |||
364 | #endif | 364 | #endif |
365 | 365 | ||
366 | extern int pm80x_init(struct i2c_client *client, | 366 | extern int pm80x_init(struct i2c_client *client, |
367 | const struct i2c_device_id *id) __devinit; | 367 | const struct i2c_device_id *id); |
368 | extern int pm80x_deinit(struct i2c_client *client); | 368 | extern int pm80x_deinit(struct i2c_client *client); |
369 | #endif /* __LINUX_MFD_88PM80X_H */ | 369 | #endif /* __LINUX_MFD_88PM80X_H */ |
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index 1491044efa10..1cb5698b4d76 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h | |||
@@ -291,9 +291,9 @@ struct ab8500_platform_data { | |||
291 | struct ab8500_codec_platform_data *codec; | 291 | struct ab8500_codec_platform_data *codec; |
292 | }; | 292 | }; |
293 | 293 | ||
294 | extern int __devinit ab8500_init(struct ab8500 *ab8500, | 294 | extern int ab8500_init(struct ab8500 *ab8500, |
295 | enum ab8500_version version); | 295 | enum ab8500_version version); |
296 | extern int __devexit ab8500_exit(struct ab8500 *ab8500); | 296 | extern int ab8500_exit(struct ab8500 *ab8500); |
297 | 297 | ||
298 | extern int ab8500_suspend(struct ab8500 *ab8500); | 298 | extern int ab8500_suspend(struct ab8500 *ab8500); |
299 | 299 | ||
diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h new file mode 100644 index 000000000000..f097e89134cb --- /dev/null +++ b/include/linux/mfd/menelaus.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * Functions to access Menelaus power management chip | ||
3 | */ | ||
4 | |||
5 | #ifndef __ASM_ARCH_MENELAUS_H | ||
6 | #define __ASM_ARCH_MENELAUS_H | ||
7 | |||
8 | struct device; | ||
9 | |||
10 | struct menelaus_platform_data { | ||
11 | int (* late_init)(struct device *dev); | ||
12 | }; | ||
13 | |||
14 | extern int menelaus_register_mmc_callback(void (*callback)(void *data, u8 card_mask), | ||
15 | void *data); | ||
16 | extern void menelaus_unregister_mmc_callback(void); | ||
17 | extern int menelaus_set_mmc_opendrain(int slot, int enable); | ||
18 | extern int menelaus_set_mmc_slot(int slot, int enable, int power, int cd_on); | ||
19 | |||
20 | extern int menelaus_set_vmem(unsigned int mV); | ||
21 | extern int menelaus_set_vio(unsigned int mV); | ||
22 | extern int menelaus_set_vmmc(unsigned int mV); | ||
23 | extern int menelaus_set_vaux(unsigned int mV); | ||
24 | extern int menelaus_set_vdcdc(int dcdc, unsigned int mV); | ||
25 | extern int menelaus_set_slot_sel(int enable); | ||
26 | extern int menelaus_get_slot_pin_states(void); | ||
27 | extern int menelaus_set_vcore_sw(unsigned int mV); | ||
28 | extern int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV); | ||
29 | |||
30 | #define EN_VPLL_SLEEP (1 << 7) | ||
31 | #define EN_VMMC_SLEEP (1 << 6) | ||
32 | #define EN_VAUX_SLEEP (1 << 5) | ||
33 | #define EN_VIO_SLEEP (1 << 4) | ||
34 | #define EN_VMEM_SLEEP (1 << 3) | ||
35 | #define EN_DC3_SLEEP (1 << 2) | ||
36 | #define EN_DC2_SLEEP (1 << 1) | ||
37 | #define EN_VC_SLEEP (1 << 0) | ||
38 | |||
39 | extern int menelaus_set_regulator_sleep(int enable, u32 val); | ||
40 | |||
41 | #if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_MENELAUS) | ||
42 | #define omap_has_menelaus() 1 | ||
43 | #else | ||
44 | #define omap_has_menelaus() 0 | ||
45 | #endif | ||
46 | |||
47 | #endif | ||
diff --git a/include/linux/mfd/pm8xxx/irq.h b/include/linux/mfd/pm8xxx/irq.h index 4b21769f4483..f83d6b43ecbb 100644 --- a/include/linux/mfd/pm8xxx/irq.h +++ b/include/linux/mfd/pm8xxx/irq.h | |||
@@ -37,21 +37,21 @@ struct pm_irq_chip; | |||
37 | 37 | ||
38 | #ifdef CONFIG_MFD_PM8XXX_IRQ | 38 | #ifdef CONFIG_MFD_PM8XXX_IRQ |
39 | int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq); | 39 | int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq); |
40 | struct pm_irq_chip * __devinit pm8xxx_irq_init(struct device *dev, | 40 | struct pm_irq_chip *pm8xxx_irq_init(struct device *dev, |
41 | const struct pm8xxx_irq_platform_data *pdata); | 41 | const struct pm8xxx_irq_platform_data *pdata); |
42 | int __devexit pm8xxx_irq_exit(struct pm_irq_chip *chip); | 42 | int pm8xxx_irq_exit(struct pm_irq_chip *chip); |
43 | #else | 43 | #else |
44 | static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq) | 44 | static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq) |
45 | { | 45 | { |
46 | return -ENXIO; | 46 | return -ENXIO; |
47 | } | 47 | } |
48 | static inline struct pm_irq_chip * __devinit pm8xxx_irq_init( | 48 | static inline struct pm_irq_chip *pm8xxx_irq_init( |
49 | const struct device *dev, | 49 | const struct device *dev, |
50 | const struct pm8xxx_irq_platform_data *pdata) | 50 | const struct pm8xxx_irq_platform_data *pdata) |
51 | { | 51 | { |
52 | return ERR_PTR(-ENXIO); | 52 | return ERR_PTR(-ENXIO); |
53 | } | 53 | } |
54 | static inline int __devexit pm8xxx_irq_exit(struct pm_irq_chip *chip) | 54 | static inline int pm8xxx_irq_exit(struct pm_irq_chip *chip) |
55 | { | 55 | { |
56 | return -ENXIO; | 56 | return -ENXIO; |
57 | } | 57 | } |
diff --git a/include/linux/mfd/rtsx_common.h b/include/linux/mfd/rtsx_common.h new file mode 100644 index 000000000000..a8d393e3066b --- /dev/null +++ b/include/linux/mfd/rtsx_common.h | |||
@@ -0,0 +1,48 @@ | |||
1 | /* Driver for Realtek driver-based card reader | ||
2 | * | ||
3 | * Copyright(c) 2009 Realtek Semiconductor Corp. All rights reserved. | ||
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, or (at your option) any | ||
8 | * later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, but | ||
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | * General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License along | ||
16 | * with this program; if not, see <http://www.gnu.org/licenses/>. | ||
17 | * | ||
18 | * Author: | ||
19 | * Wei WANG <wei_wang@realsil.com.cn> | ||
20 | * No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China | ||
21 | */ | ||
22 | |||
23 | #ifndef __RTSX_COMMON_H | ||
24 | #define __RTSX_COMMON_H | ||
25 | |||
26 | #define DRV_NAME_RTSX_PCI "rtsx_pci" | ||
27 | #define DRV_NAME_RTSX_PCI_SDMMC "rtsx_pci_sdmmc" | ||
28 | #define DRV_NAME_RTSX_PCI_MS "rtsx_pci_ms" | ||
29 | |||
30 | #define RTSX_REG_PAIR(addr, val) (((u32)(addr) << 16) | (u8)(val)) | ||
31 | |||
32 | #define RTSX_SSC_DEPTH_4M 0x01 | ||
33 | #define RTSX_SSC_DEPTH_2M 0x02 | ||
34 | #define RTSX_SSC_DEPTH_1M 0x03 | ||
35 | #define RTSX_SSC_DEPTH_500K 0x04 | ||
36 | #define RTSX_SSC_DEPTH_250K 0x05 | ||
37 | |||
38 | #define RTSX_SD_CARD 0 | ||
39 | #define RTSX_MS_CARD 1 | ||
40 | |||
41 | struct platform_device; | ||
42 | |||
43 | struct rtsx_slot { | ||
44 | struct platform_device *p_dev; | ||
45 | void (*card_event)(struct platform_device *p_dev); | ||
46 | }; | ||
47 | |||
48 | #endif | ||
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h new file mode 100644 index 000000000000..060b721fcbfb --- /dev/null +++ b/include/linux/mfd/rtsx_pci.h | |||
@@ -0,0 +1,794 @@ | |||
1 | /* Driver for Realtek PCI-Express card reader | ||
2 | * | ||
3 | * Copyright(c) 2009 Realtek Semiconductor Corp. All rights reserved. | ||
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, or (at your option) any | ||
8 | * later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, but | ||
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | * General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License along | ||
16 | * with this program; if not, see <http://www.gnu.org/licenses/>. | ||
17 | * | ||
18 | * Author: | ||
19 | * Wei WANG <wei_wang@realsil.com.cn> | ||
20 | * No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China | ||
21 | */ | ||
22 | |||
23 | #ifndef __RTSX_PCI_H | ||
24 | #define __RTSX_PCI_H | ||
25 | |||
26 | #include <linux/sched.h> | ||
27 | #include <linux/pci.h> | ||
28 | |||
29 | #include "rtsx_common.h" | ||
30 | |||
31 | #define MAX_RW_REG_CNT 1024 | ||
32 | |||
33 | /* PCI Operation Register Address */ | ||
34 | #define RTSX_HCBAR 0x00 | ||
35 | #define RTSX_HCBCTLR 0x04 | ||
36 | #define RTSX_HDBAR 0x08 | ||
37 | #define RTSX_HDBCTLR 0x0C | ||
38 | #define RTSX_HAIMR 0x10 | ||
39 | #define RTSX_BIPR 0x14 | ||
40 | #define RTSX_BIER 0x18 | ||
41 | |||
42 | /* Host command buffer control register */ | ||
43 | #define STOP_CMD (0x01 << 28) | ||
44 | |||
45 | /* Host data buffer control register */ | ||
46 | #define SDMA_MODE 0x00 | ||
47 | #define ADMA_MODE (0x02 << 26) | ||
48 | #define STOP_DMA (0x01 << 28) | ||
49 | #define TRIG_DMA (0x01 << 31) | ||
50 | |||
51 | /* Host access internal memory register */ | ||
52 | #define HAIMR_TRANS_START (0x01 << 31) | ||
53 | #define HAIMR_READ 0x00 | ||
54 | #define HAIMR_WRITE (0x01 << 30) | ||
55 | #define HAIMR_READ_START (HAIMR_TRANS_START | HAIMR_READ) | ||
56 | #define HAIMR_WRITE_START (HAIMR_TRANS_START | HAIMR_WRITE) | ||
57 | #define HAIMR_TRANS_END (HAIMR_TRANS_START) | ||
58 | |||
59 | /* Bus interrupt pending register */ | ||
60 | #define CMD_DONE_INT (1 << 31) | ||
61 | #define DATA_DONE_INT (1 << 30) | ||
62 | #define TRANS_OK_INT (1 << 29) | ||
63 | #define TRANS_FAIL_INT (1 << 28) | ||
64 | #define XD_INT (1 << 27) | ||
65 | #define MS_INT (1 << 26) | ||
66 | #define SD_INT (1 << 25) | ||
67 | #define GPIO0_INT (1 << 24) | ||
68 | #define OC_INT (1 << 23) | ||
69 | #define SD_WRITE_PROTECT (1 << 19) | ||
70 | #define XD_EXIST (1 << 18) | ||
71 | #define MS_EXIST (1 << 17) | ||
72 | #define SD_EXIST (1 << 16) | ||
73 | #define DELINK_INT GPIO0_INT | ||
74 | #define MS_OC_INT (1 << 23) | ||
75 | #define SD_OC_INT (1 << 22) | ||
76 | |||
77 | #define CARD_INT (XD_INT | MS_INT | SD_INT) | ||
78 | #define NEED_COMPLETE_INT (DATA_DONE_INT | TRANS_OK_INT | TRANS_FAIL_INT) | ||
79 | #define RTSX_INT (CMD_DONE_INT | NEED_COMPLETE_INT | \ | ||
80 | CARD_INT | GPIO0_INT | OC_INT) | ||
81 | |||
82 | #define CARD_EXIST (XD_EXIST | MS_EXIST | SD_EXIST) | ||
83 | |||
84 | /* Bus interrupt enable register */ | ||
85 | #define CMD_DONE_INT_EN (1 << 31) | ||
86 | #define DATA_DONE_INT_EN (1 << 30) | ||
87 | #define TRANS_OK_INT_EN (1 << 29) | ||
88 | #define TRANS_FAIL_INT_EN (1 << 28) | ||
89 | #define XD_INT_EN (1 << 27) | ||
90 | #define MS_INT_EN (1 << 26) | ||
91 | #define SD_INT_EN (1 << 25) | ||
92 | #define GPIO0_INT_EN (1 << 24) | ||
93 | #define OC_INT_EN (1 << 23) | ||
94 | #define DELINK_INT_EN GPIO0_INT_EN | ||
95 | #define MS_OC_INT_EN (1 << 23) | ||
96 | #define SD_OC_INT_EN (1 << 22) | ||
97 | |||
98 | #define READ_REG_CMD 0 | ||
99 | #define WRITE_REG_CMD 1 | ||
100 | #define CHECK_REG_CMD 2 | ||
101 | |||
102 | /* | ||
103 | * macros for easy use | ||
104 | */ | ||
105 | #define rtsx_pci_writel(pcr, reg, value) \ | ||
106 | iowrite32(value, (pcr)->remap_addr + reg) | ||
107 | #define rtsx_pci_readl(pcr, reg) \ | ||
108 | ioread32((pcr)->remap_addr + reg) | ||
109 | #define rtsx_pci_writew(pcr, reg, value) \ | ||
110 | iowrite16(value, (pcr)->remap_addr + reg) | ||
111 | #define rtsx_pci_readw(pcr, reg) \ | ||
112 | ioread16((pcr)->remap_addr + reg) | ||
113 | #define rtsx_pci_writeb(pcr, reg, value) \ | ||
114 | iowrite8(value, (pcr)->remap_addr + reg) | ||
115 | #define rtsx_pci_readb(pcr, reg) \ | ||
116 | ioread8((pcr)->remap_addr + reg) | ||
117 | |||
118 | #define rtsx_pci_read_config_byte(pcr, where, val) \ | ||
119 | pci_read_config_byte((pcr)->pci, where, val) | ||
120 | |||
121 | #define rtsx_pci_write_config_byte(pcr, where, val) \ | ||
122 | pci_write_config_byte((pcr)->pci, where, val) | ||
123 | |||
124 | #define rtsx_pci_read_config_dword(pcr, where, val) \ | ||
125 | pci_read_config_dword((pcr)->pci, where, val) | ||
126 | |||
127 | #define rtsx_pci_write_config_dword(pcr, where, val) \ | ||
128 | pci_write_config_dword((pcr)->pci, where, val) | ||
129 | |||
130 | #define STATE_TRANS_NONE 0 | ||
131 | #define STATE_TRANS_CMD 1 | ||
132 | #define STATE_TRANS_BUF 2 | ||
133 | #define STATE_TRANS_SG 3 | ||
134 | |||
135 | #define TRANS_NOT_READY 0 | ||
136 | #define TRANS_RESULT_OK 1 | ||
137 | #define TRANS_RESULT_FAIL 2 | ||
138 | #define TRANS_NO_DEVICE 3 | ||
139 | |||
140 | #define RTSX_RESV_BUF_LEN 4096 | ||
141 | #define HOST_CMDS_BUF_LEN 1024 | ||
142 | #define HOST_SG_TBL_BUF_LEN (RTSX_RESV_BUF_LEN - HOST_CMDS_BUF_LEN) | ||
143 | #define HOST_SG_TBL_ITEMS (HOST_SG_TBL_BUF_LEN / 8) | ||
144 | #define MAX_SG_ITEM_LEN 0x80000 | ||
145 | |||
146 | #define HOST_TO_DEVICE 0 | ||
147 | #define DEVICE_TO_HOST 1 | ||
148 | |||
149 | #define MAX_PHASE 31 | ||
150 | #define RX_TUNING_CNT 3 | ||
151 | |||
152 | /* SG descriptor */ | ||
153 | #define SG_INT 0x04 | ||
154 | #define SG_END 0x02 | ||
155 | #define SG_VALID 0x01 | ||
156 | |||
157 | #define SG_NO_OP 0x00 | ||
158 | #define SG_TRANS_DATA (0x02 << 4) | ||
159 | #define SG_LINK_DESC (0x03 << 4) | ||
160 | |||
161 | /* SD bank voltage */ | ||
162 | #define SD_IO_3V3 0 | ||
163 | #define SD_IO_1V8 1 | ||
164 | |||
165 | |||
166 | /* Card Clock Enable Register */ | ||
167 | #define SD_CLK_EN 0x04 | ||
168 | #define MS_CLK_EN 0x08 | ||
169 | |||
170 | /* Card Select Register */ | ||
171 | #define SD_MOD_SEL 2 | ||
172 | #define MS_MOD_SEL 3 | ||
173 | |||
174 | /* Card Output Enable Register */ | ||
175 | #define SD_OUTPUT_EN 0x04 | ||
176 | #define MS_OUTPUT_EN 0x08 | ||
177 | |||
178 | /* CARD_SHARE_MODE */ | ||
179 | #define CARD_SHARE_MASK 0x0F | ||
180 | #define CARD_SHARE_MULTI_LUN 0x00 | ||
181 | #define CARD_SHARE_NORMAL 0x00 | ||
182 | #define CARD_SHARE_48_SD 0x04 | ||
183 | #define CARD_SHARE_48_MS 0x08 | ||
184 | /* CARD_SHARE_MODE for barossa */ | ||
185 | #define CARD_SHARE_BAROSSA_SD 0x01 | ||
186 | #define CARD_SHARE_BAROSSA_MS 0x02 | ||
187 | |||
188 | /* SD30_DRIVE_SEL */ | ||
189 | #define DRIVER_TYPE_A 0x05 | ||
190 | #define DRIVER_TYPE_B 0x03 | ||
191 | #define DRIVER_TYPE_C 0x02 | ||
192 | #define DRIVER_TYPE_D 0x01 | ||
193 | |||
194 | /* FPDCTL */ | ||
195 | #define SSC_POWER_DOWN 0x01 | ||
196 | #define SD_OC_POWER_DOWN 0x02 | ||
197 | #define ALL_POWER_DOWN 0x07 | ||
198 | #define OC_POWER_DOWN 0x06 | ||
199 | |||
200 | /* CLK_CTL */ | ||
201 | #define CHANGE_CLK 0x01 | ||
202 | |||
203 | /* LDO_CTL */ | ||
204 | #define BPP_LDO_POWB 0x03 | ||
205 | #define BPP_LDO_ON 0x00 | ||
206 | #define BPP_LDO_SUSPEND 0x02 | ||
207 | #define BPP_LDO_OFF 0x03 | ||
208 | |||
209 | /* CD_PAD_CTL */ | ||
210 | #define CD_DISABLE_MASK 0x07 | ||
211 | #define MS_CD_DISABLE 0x04 | ||
212 | #define SD_CD_DISABLE 0x02 | ||
213 | #define XD_CD_DISABLE 0x01 | ||
214 | #define CD_DISABLE 0x07 | ||
215 | #define CD_ENABLE 0x00 | ||
216 | #define MS_CD_EN_ONLY 0x03 | ||
217 | #define SD_CD_EN_ONLY 0x05 | ||
218 | #define XD_CD_EN_ONLY 0x06 | ||
219 | #define FORCE_CD_LOW_MASK 0x38 | ||
220 | #define FORCE_CD_XD_LOW 0x08 | ||
221 | #define FORCE_CD_SD_LOW 0x10 | ||
222 | #define FORCE_CD_MS_LOW 0x20 | ||
223 | #define CD_AUTO_DISABLE 0x40 | ||
224 | |||
225 | /* SD_STAT1 */ | ||
226 | #define SD_CRC7_ERR 0x80 | ||
227 | #define SD_CRC16_ERR 0x40 | ||
228 | #define SD_CRC_WRITE_ERR 0x20 | ||
229 | #define SD_CRC_WRITE_ERR_MASK 0x1C | ||
230 | #define GET_CRC_TIME_OUT 0x02 | ||
231 | #define SD_TUNING_COMPARE_ERR 0x01 | ||
232 | |||
233 | /* SD_STAT2 */ | ||
234 | #define SD_RSP_80CLK_TIMEOUT 0x01 | ||
235 | |||
236 | /* SD_BUS_STAT */ | ||
237 | #define SD_CLK_TOGGLE_EN 0x80 | ||
238 | #define SD_CLK_FORCE_STOP 0x40 | ||
239 | #define SD_DAT3_STATUS 0x10 | ||
240 | #define SD_DAT2_STATUS 0x08 | ||
241 | #define SD_DAT1_STATUS 0x04 | ||
242 | #define SD_DAT0_STATUS 0x02 | ||
243 | #define SD_CMD_STATUS 0x01 | ||
244 | |||
245 | /* SD_PAD_CTL */ | ||
246 | #define SD_IO_USING_1V8 0x80 | ||
247 | #define SD_IO_USING_3V3 0x7F | ||
248 | #define TYPE_A_DRIVING 0x00 | ||
249 | #define TYPE_B_DRIVING 0x01 | ||
250 | #define TYPE_C_DRIVING 0x02 | ||
251 | #define TYPE_D_DRIVING 0x03 | ||
252 | |||
253 | /* SD_SAMPLE_POINT_CTL */ | ||
254 | #define DDR_FIX_RX_DAT 0x00 | ||
255 | #define DDR_VAR_RX_DAT 0x80 | ||
256 | #define DDR_FIX_RX_DAT_EDGE 0x00 | ||
257 | #define DDR_FIX_RX_DAT_14_DELAY 0x40 | ||
258 | #define DDR_FIX_RX_CMD 0x00 | ||
259 | #define DDR_VAR_RX_CMD 0x20 | ||
260 | #define DDR_FIX_RX_CMD_POS_EDGE 0x00 | ||
261 | #define DDR_FIX_RX_CMD_14_DELAY 0x10 | ||
262 | #define SD20_RX_POS_EDGE 0x00 | ||
263 | #define SD20_RX_14_DELAY 0x08 | ||
264 | #define SD20_RX_SEL_MASK 0x08 | ||
265 | |||
266 | /* SD_PUSH_POINT_CTL */ | ||
267 | #define DDR_FIX_TX_CMD_DAT 0x00 | ||
268 | #define DDR_VAR_TX_CMD_DAT 0x80 | ||
269 | #define DDR_FIX_TX_DAT_14_TSU 0x00 | ||
270 | #define DDR_FIX_TX_DAT_12_TSU 0x40 | ||
271 | #define DDR_FIX_TX_CMD_NEG_EDGE 0x00 | ||
272 | #define DDR_FIX_TX_CMD_14_AHEAD 0x20 | ||
273 | #define SD20_TX_NEG_EDGE 0x00 | ||
274 | #define SD20_TX_14_AHEAD 0x10 | ||
275 | #define SD20_TX_SEL_MASK 0x10 | ||
276 | #define DDR_VAR_SDCLK_POL_SWAP 0x01 | ||
277 | |||
278 | /* SD_TRANSFER */ | ||
279 | #define SD_TRANSFER_START 0x80 | ||
280 | #define SD_TRANSFER_END 0x40 | ||
281 | #define SD_STAT_IDLE 0x20 | ||
282 | #define SD_TRANSFER_ERR 0x10 | ||
283 | /* SD Transfer Mode definition */ | ||
284 | #define SD_TM_NORMAL_WRITE 0x00 | ||
285 | #define SD_TM_AUTO_WRITE_3 0x01 | ||
286 | #define SD_TM_AUTO_WRITE_4 0x02 | ||
287 | #define SD_TM_AUTO_READ_3 0x05 | ||
288 | #define SD_TM_AUTO_READ_4 0x06 | ||
289 | #define SD_TM_CMD_RSP 0x08 | ||
290 | #define SD_TM_AUTO_WRITE_1 0x09 | ||
291 | #define SD_TM_AUTO_WRITE_2 0x0A | ||
292 | #define SD_TM_NORMAL_READ 0x0C | ||
293 | #define SD_TM_AUTO_READ_1 0x0D | ||
294 | #define SD_TM_AUTO_READ_2 0x0E | ||
295 | #define SD_TM_AUTO_TUNING 0x0F | ||
296 | |||
297 | /* SD_VPTX_CTL / SD_VPRX_CTL */ | ||
298 | #define PHASE_CHANGE 0x80 | ||
299 | #define PHASE_NOT_RESET 0x40 | ||
300 | |||
301 | /* SD_DCMPS_TX_CTL / SD_DCMPS_RX_CTL */ | ||
302 | #define DCMPS_CHANGE 0x80 | ||
303 | #define DCMPS_CHANGE_DONE 0x40 | ||
304 | #define DCMPS_ERROR 0x20 | ||
305 | #define DCMPS_CURRENT_PHASE 0x1F | ||
306 | |||
307 | /* SD Configure 1 Register */ | ||
308 | #define SD_CLK_DIVIDE_0 0x00 | ||
309 | #define SD_CLK_DIVIDE_256 0xC0 | ||
310 | #define SD_CLK_DIVIDE_128 0x80 | ||
311 | #define SD_BUS_WIDTH_1BIT 0x00 | ||
312 | #define SD_BUS_WIDTH_4BIT 0x01 | ||
313 | #define SD_BUS_WIDTH_8BIT 0x02 | ||
314 | #define SD_ASYNC_FIFO_NOT_RST 0x10 | ||
315 | #define SD_20_MODE 0x00 | ||
316 | #define SD_DDR_MODE 0x04 | ||
317 | #define SD_30_MODE 0x08 | ||
318 | |||
319 | #define SD_CLK_DIVIDE_MASK 0xC0 | ||
320 | |||
321 | /* SD_CMD_STATE */ | ||
322 | #define SD_CMD_IDLE 0x80 | ||
323 | |||
324 | /* SD_DATA_STATE */ | ||
325 | #define SD_DATA_IDLE 0x80 | ||
326 | |||
327 | /* DCM_DRP_CTL */ | ||
328 | #define DCM_RESET 0x08 | ||
329 | #define DCM_LOCKED 0x04 | ||
330 | #define DCM_208M 0x00 | ||
331 | #define DCM_TX 0x01 | ||
332 | #define DCM_RX 0x02 | ||
333 | |||
334 | /* DCM_DRP_TRIG */ | ||
335 | #define DRP_START 0x80 | ||
336 | #define DRP_DONE 0x40 | ||
337 | |||
338 | /* DCM_DRP_CFG */ | ||
339 | #define DRP_WRITE 0x80 | ||
340 | #define DRP_READ 0x00 | ||
341 | #define DCM_WRITE_ADDRESS_50 0x50 | ||
342 | #define DCM_WRITE_ADDRESS_51 0x51 | ||
343 | #define DCM_READ_ADDRESS_00 0x00 | ||
344 | #define DCM_READ_ADDRESS_51 0x51 | ||
345 | |||
346 | /* IRQSTAT0 */ | ||
347 | #define DMA_DONE_INT 0x80 | ||
348 | #define SUSPEND_INT 0x40 | ||
349 | #define LINK_RDY_INT 0x20 | ||
350 | #define LINK_DOWN_INT 0x10 | ||
351 | |||
352 | /* DMACTL */ | ||
353 | #define DMA_RST 0x80 | ||
354 | #define DMA_BUSY 0x04 | ||
355 | #define DMA_DIR_TO_CARD 0x00 | ||
356 | #define DMA_DIR_FROM_CARD 0x02 | ||
357 | #define DMA_EN 0x01 | ||
358 | #define DMA_128 (0 << 4) | ||
359 | #define DMA_256 (1 << 4) | ||
360 | #define DMA_512 (2 << 4) | ||
361 | #define DMA_1024 (3 << 4) | ||
362 | #define DMA_PACK_SIZE_MASK 0x30 | ||
363 | |||
364 | /* SSC_CTL1 */ | ||
365 | #define SSC_RSTB 0x80 | ||
366 | #define SSC_8X_EN 0x40 | ||
367 | #define SSC_FIX_FRAC 0x20 | ||
368 | #define SSC_SEL_1M 0x00 | ||
369 | #define SSC_SEL_2M 0x08 | ||
370 | #define SSC_SEL_4M 0x10 | ||
371 | #define SSC_SEL_8M 0x18 | ||
372 | |||
373 | /* SSC_CTL2 */ | ||
374 | #define SSC_DEPTH_MASK 0x07 | ||
375 | #define SSC_DEPTH_DISALBE 0x00 | ||
376 | #define SSC_DEPTH_4M 0x01 | ||
377 | #define SSC_DEPTH_2M 0x02 | ||
378 | #define SSC_DEPTH_1M 0x03 | ||
379 | #define SSC_DEPTH_500K 0x04 | ||
380 | #define SSC_DEPTH_250K 0x05 | ||
381 | |||
382 | /* System Clock Control Register */ | ||
383 | #define CLK_LOW_FREQ 0x01 | ||
384 | |||
385 | /* System Clock Divider Register */ | ||
386 | #define CLK_DIV_1 0x01 | ||
387 | #define CLK_DIV_2 0x02 | ||
388 | #define CLK_DIV_4 0x03 | ||
389 | #define CLK_DIV_8 0x04 | ||
390 | |||
391 | /* MS_CFG */ | ||
392 | #define SAMPLE_TIME_RISING 0x00 | ||
393 | #define SAMPLE_TIME_FALLING 0x80 | ||
394 | #define PUSH_TIME_DEFAULT 0x00 | ||
395 | #define PUSH_TIME_ODD 0x40 | ||
396 | #define NO_EXTEND_TOGGLE 0x00 | ||
397 | #define EXTEND_TOGGLE_CHK 0x20 | ||
398 | #define MS_BUS_WIDTH_1 0x00 | ||
399 | #define MS_BUS_WIDTH_4 0x10 | ||
400 | #define MS_BUS_WIDTH_8 0x18 | ||
401 | #define MS_2K_SECTOR_MODE 0x04 | ||
402 | #define MS_512_SECTOR_MODE 0x00 | ||
403 | #define MS_TOGGLE_TIMEOUT_EN 0x00 | ||
404 | #define MS_TOGGLE_TIMEOUT_DISEN 0x01 | ||
405 | #define MS_NO_CHECK_INT 0x02 | ||
406 | |||
407 | /* MS_TRANS_CFG */ | ||
408 | #define WAIT_INT 0x80 | ||
409 | #define NO_WAIT_INT 0x00 | ||
410 | #define NO_AUTO_READ_INT_REG 0x00 | ||
411 | #define AUTO_READ_INT_REG 0x40 | ||
412 | #define MS_CRC16_ERR 0x20 | ||
413 | #define MS_RDY_TIMEOUT 0x10 | ||
414 | #define MS_INT_CMDNK 0x08 | ||
415 | #define MS_INT_BREQ 0x04 | ||
416 | #define MS_INT_ERR 0x02 | ||
417 | #define MS_INT_CED 0x01 | ||
418 | |||
419 | /* MS_TRANSFER */ | ||
420 | #define MS_TRANSFER_START 0x80 | ||
421 | #define MS_TRANSFER_END 0x40 | ||
422 | #define MS_TRANSFER_ERR 0x20 | ||
423 | #define MS_BS_STATE 0x10 | ||
424 | #define MS_TM_READ_BYTES 0x00 | ||
425 | #define MS_TM_NORMAL_READ 0x01 | ||
426 | #define MS_TM_WRITE_BYTES 0x04 | ||
427 | #define MS_TM_NORMAL_WRITE 0x05 | ||
428 | #define MS_TM_AUTO_READ 0x08 | ||
429 | #define MS_TM_AUTO_WRITE 0x0C | ||
430 | |||
431 | /* SD Configure 2 Register */ | ||
432 | #define SD_CALCULATE_CRC7 0x00 | ||
433 | #define SD_NO_CALCULATE_CRC7 0x80 | ||
434 | #define SD_CHECK_CRC16 0x00 | ||
435 | #define SD_NO_CHECK_CRC16 0x40 | ||
436 | #define SD_NO_CHECK_WAIT_CRC_TO 0x20 | ||
437 | #define SD_WAIT_BUSY_END 0x08 | ||
438 | #define SD_NO_WAIT_BUSY_END 0x00 | ||
439 | #define SD_CHECK_CRC7 0x00 | ||
440 | #define SD_NO_CHECK_CRC7 0x04 | ||
441 | #define SD_RSP_LEN_0 0x00 | ||
442 | #define SD_RSP_LEN_6 0x01 | ||
443 | #define SD_RSP_LEN_17 0x02 | ||
444 | /* SD/MMC Response Type Definition */ | ||
445 | #define SD_RSP_TYPE_R0 0x04 | ||
446 | #define SD_RSP_TYPE_R1 0x01 | ||
447 | #define SD_RSP_TYPE_R1b 0x09 | ||
448 | #define SD_RSP_TYPE_R2 0x02 | ||
449 | #define SD_RSP_TYPE_R3 0x05 | ||
450 | #define SD_RSP_TYPE_R4 0x05 | ||
451 | #define SD_RSP_TYPE_R5 0x01 | ||
452 | #define SD_RSP_TYPE_R6 0x01 | ||
453 | #define SD_RSP_TYPE_R7 0x01 | ||
454 | |||
455 | /* SD_CONFIURE3 */ | ||
456 | #define SD_RSP_80CLK_TIMEOUT_EN 0x01 | ||
457 | |||
458 | /* Card Transfer Reset Register */ | ||
459 | #define SPI_STOP 0x01 | ||
460 | #define XD_STOP 0x02 | ||
461 | #define SD_STOP 0x04 | ||
462 | #define MS_STOP 0x08 | ||
463 | #define SPI_CLR_ERR 0x10 | ||
464 | #define XD_CLR_ERR 0x20 | ||
465 | #define SD_CLR_ERR 0x40 | ||
466 | #define MS_CLR_ERR 0x80 | ||
467 | |||
468 | /* Card Data Source Register */ | ||
469 | #define PINGPONG_BUFFER 0x01 | ||
470 | #define RING_BUFFER 0x00 | ||
471 | |||
472 | /* Card Power Control Register */ | ||
473 | #define PMOS_STRG_MASK 0x10 | ||
474 | #define PMOS_STRG_800mA 0x10 | ||
475 | #define PMOS_STRG_400mA 0x00 | ||
476 | #define SD_POWER_OFF 0x03 | ||
477 | #define SD_PARTIAL_POWER_ON 0x01 | ||
478 | #define SD_POWER_ON 0x00 | ||
479 | #define SD_POWER_MASK 0x03 | ||
480 | #define MS_POWER_OFF 0x0C | ||
481 | #define MS_PARTIAL_POWER_ON 0x04 | ||
482 | #define MS_POWER_ON 0x00 | ||
483 | #define MS_POWER_MASK 0x0C | ||
484 | #define BPP_POWER_OFF 0x0F | ||
485 | #define BPP_POWER_5_PERCENT_ON 0x0E | ||
486 | #define BPP_POWER_10_PERCENT_ON 0x0C | ||
487 | #define BPP_POWER_15_PERCENT_ON 0x08 | ||
488 | #define BPP_POWER_ON 0x00 | ||
489 | #define BPP_POWER_MASK 0x0F | ||
490 | |||
491 | /* PWR_GATE_CTRL */ | ||
492 | #define PWR_GATE_EN 0x01 | ||
493 | #define LDO3318_PWR_MASK 0x06 | ||
494 | #define LDO_ON 0x00 | ||
495 | #define LDO_SUSPEND 0x04 | ||
496 | #define LDO_OFF 0x06 | ||
497 | |||
498 | /* CARD_CLK_SOURCE */ | ||
499 | #define CRC_FIX_CLK (0x00 << 0) | ||
500 | #define CRC_VAR_CLK0 (0x01 << 0) | ||
501 | #define CRC_VAR_CLK1 (0x02 << 0) | ||
502 | #define SD30_FIX_CLK (0x00 << 2) | ||
503 | #define SD30_VAR_CLK0 (0x01 << 2) | ||
504 | #define SD30_VAR_CLK1 (0x02 << 2) | ||
505 | #define SAMPLE_FIX_CLK (0x00 << 4) | ||
506 | #define SAMPLE_VAR_CLK0 (0x01 << 4) | ||
507 | #define SAMPLE_VAR_CLK1 (0x02 << 4) | ||
508 | |||
509 | #define MS_CFG 0xFD40 | ||
510 | #define MS_TPC 0xFD41 | ||
511 | #define MS_TRANS_CFG 0xFD42 | ||
512 | #define MS_TRANSFER 0xFD43 | ||
513 | #define MS_INT_REG 0xFD44 | ||
514 | #define MS_BYTE_CNT 0xFD45 | ||
515 | #define MS_SECTOR_CNT_L 0xFD46 | ||
516 | #define MS_SECTOR_CNT_H 0xFD47 | ||
517 | #define MS_DBUS_H 0xFD48 | ||
518 | |||
519 | #define SD_CFG1 0xFDA0 | ||
520 | #define SD_CFG2 0xFDA1 | ||
521 | #define SD_CFG3 0xFDA2 | ||
522 | #define SD_STAT1 0xFDA3 | ||
523 | #define SD_STAT2 0xFDA4 | ||
524 | #define SD_BUS_STAT 0xFDA5 | ||
525 | #define SD_PAD_CTL 0xFDA6 | ||
526 | #define SD_SAMPLE_POINT_CTL 0xFDA7 | ||
527 | #define SD_PUSH_POINT_CTL 0xFDA8 | ||
528 | #define SD_CMD0 0xFDA9 | ||
529 | #define SD_CMD1 0xFDAA | ||
530 | #define SD_CMD2 0xFDAB | ||
531 | #define SD_CMD3 0xFDAC | ||
532 | #define SD_CMD4 0xFDAD | ||
533 | #define SD_CMD5 0xFDAE | ||
534 | #define SD_BYTE_CNT_L 0xFDAF | ||
535 | #define SD_BYTE_CNT_H 0xFDB0 | ||
536 | #define SD_BLOCK_CNT_L 0xFDB1 | ||
537 | #define SD_BLOCK_CNT_H 0xFDB2 | ||
538 | #define SD_TRANSFER 0xFDB3 | ||
539 | #define SD_CMD_STATE 0xFDB5 | ||
540 | #define SD_DATA_STATE 0xFDB6 | ||
541 | |||
542 | #define SRCTL 0xFC13 | ||
543 | |||
544 | #define DCM_DRP_CTL 0xFC23 | ||
545 | #define DCM_DRP_TRIG 0xFC24 | ||
546 | #define DCM_DRP_CFG 0xFC25 | ||
547 | #define DCM_DRP_WR_DATA_L 0xFC26 | ||
548 | #define DCM_DRP_WR_DATA_H 0xFC27 | ||
549 | #define DCM_DRP_RD_DATA_L 0xFC28 | ||
550 | #define DCM_DRP_RD_DATA_H 0xFC29 | ||
551 | #define SD_VPCLK0_CTL 0xFC2A | ||
552 | #define SD_VPCLK1_CTL 0xFC2B | ||
553 | #define SD_DCMPS0_CTL 0xFC2C | ||
554 | #define SD_DCMPS1_CTL 0xFC2D | ||
555 | #define SD_VPTX_CTL SD_VPCLK0_CTL | ||
556 | #define SD_VPRX_CTL SD_VPCLK1_CTL | ||
557 | #define SD_DCMPS_TX_CTL SD_DCMPS0_CTL | ||
558 | #define SD_DCMPS_RX_CTL SD_DCMPS1_CTL | ||
559 | #define CARD_CLK_SOURCE 0xFC2E | ||
560 | |||
561 | #define CARD_PWR_CTL 0xFD50 | ||
562 | #define CARD_CLK_SWITCH 0xFD51 | ||
563 | #define CARD_SHARE_MODE 0xFD52 | ||
564 | #define CARD_DRIVE_SEL 0xFD53 | ||
565 | #define CARD_STOP 0xFD54 | ||
566 | #define CARD_OE 0xFD55 | ||
567 | #define CARD_AUTO_BLINK 0xFD56 | ||
568 | #define CARD_GPIO_DIR 0xFD57 | ||
569 | #define CARD_GPIO 0xFD58 | ||
570 | #define CARD_DATA_SOURCE 0xFD5B | ||
571 | #define CARD_SELECT 0xFD5C | ||
572 | #define SD30_DRIVE_SEL 0xFD5E | ||
573 | #define CARD_CLK_EN 0xFD69 | ||
574 | #define SDIO_CTRL 0xFD6B | ||
575 | #define CD_PAD_CTL 0xFD73 | ||
576 | |||
577 | #define FPDCTL 0xFC00 | ||
578 | #define PDINFO 0xFC01 | ||
579 | |||
580 | #define CLK_CTL 0xFC02 | ||
581 | #define CLK_DIV 0xFC03 | ||
582 | #define CLK_SEL 0xFC04 | ||
583 | |||
584 | #define SSC_DIV_N_0 0xFC0F | ||
585 | #define SSC_DIV_N_1 0xFC10 | ||
586 | #define SSC_CTL1 0xFC11 | ||
587 | #define SSC_CTL2 0xFC12 | ||
588 | |||
589 | #define RCCTL 0xFC14 | ||
590 | |||
591 | #define FPGA_PULL_CTL 0xFC1D | ||
592 | #define OLT_LED_CTL 0xFC1E | ||
593 | #define GPIO_CTL 0xFC1F | ||
594 | |||
595 | #define LDO_CTL 0xFC1E | ||
596 | #define SYS_VER 0xFC32 | ||
597 | |||
598 | #define CARD_PULL_CTL1 0xFD60 | ||
599 | #define CARD_PULL_CTL2 0xFD61 | ||
600 | #define CARD_PULL_CTL3 0xFD62 | ||
601 | #define CARD_PULL_CTL4 0xFD63 | ||
602 | #define CARD_PULL_CTL5 0xFD64 | ||
603 | #define CARD_PULL_CTL6 0xFD65 | ||
604 | |||
605 | /* PCI Express Related Registers */ | ||
606 | #define IRQEN0 0xFE20 | ||
607 | #define IRQSTAT0 0xFE21 | ||
608 | #define IRQEN1 0xFE22 | ||
609 | #define IRQSTAT1 0xFE23 | ||
610 | #define TLPRIEN 0xFE24 | ||
611 | #define TLPRISTAT 0xFE25 | ||
612 | #define TLPTIEN 0xFE26 | ||
613 | #define TLPTISTAT 0xFE27 | ||
614 | #define DMATC0 0xFE28 | ||
615 | #define DMATC1 0xFE29 | ||
616 | #define DMATC2 0xFE2A | ||
617 | #define DMATC3 0xFE2B | ||
618 | #define DMACTL 0xFE2C | ||
619 | #define BCTL 0xFE2D | ||
620 | #define RBBC0 0xFE2E | ||
621 | #define RBBC1 0xFE2F | ||
622 | #define RBDAT 0xFE30 | ||
623 | #define RBCTL 0xFE34 | ||
624 | #define CFGADDR0 0xFE35 | ||
625 | #define CFGADDR1 0xFE36 | ||
626 | #define CFGDATA0 0xFE37 | ||
627 | #define CFGDATA1 0xFE38 | ||
628 | #define CFGDATA2 0xFE39 | ||
629 | #define CFGDATA3 0xFE3A | ||
630 | #define CFGRWCTL 0xFE3B | ||
631 | #define PHYRWCTL 0xFE3C | ||
632 | #define PHYDATA0 0xFE3D | ||
633 | #define PHYDATA1 0xFE3E | ||
634 | #define PHYADDR 0xFE3F | ||
635 | #define MSGRXDATA0 0xFE40 | ||
636 | #define MSGRXDATA1 0xFE41 | ||
637 | #define MSGRXDATA2 0xFE42 | ||
638 | #define MSGRXDATA3 0xFE43 | ||
639 | #define MSGTXDATA0 0xFE44 | ||
640 | #define MSGTXDATA1 0xFE45 | ||
641 | #define MSGTXDATA2 0xFE46 | ||
642 | #define MSGTXDATA3 0xFE47 | ||
643 | #define MSGTXCTL 0xFE48 | ||
644 | #define PETXCFG 0xFE49 | ||
645 | |||
646 | #define CDRESUMECTL 0xFE52 | ||
647 | #define WAKE_SEL_CTL 0xFE54 | ||
648 | #define PME_FORCE_CTL 0xFE56 | ||
649 | #define ASPM_FORCE_CTL 0xFE57 | ||
650 | #define PM_CLK_FORCE_CTL 0xFE58 | ||
651 | #define PERST_GLITCH_WIDTH 0xFE5C | ||
652 | #define CHANGE_LINK_STATE 0xFE5B | ||
653 | #define RESET_LOAD_REG 0xFE5E | ||
654 | #define EFUSE_CONTENT 0xFE5F | ||
655 | #define HOST_SLEEP_STATE 0xFE60 | ||
656 | #define SDIO_CFG 0xFE70 | ||
657 | |||
658 | #define NFTS_TX_CTRL 0xFE72 | ||
659 | |||
660 | #define PWR_GATE_CTRL 0xFE75 | ||
661 | #define PWD_SUSPEND_EN 0xFE76 | ||
662 | #define LDO_PWR_SEL 0xFE78 | ||
663 | |||
664 | #define DUMMY_REG_RESET_0 0xFE90 | ||
665 | |||
666 | /* Memory mapping */ | ||
667 | #define SRAM_BASE 0xE600 | ||
668 | #define RBUF_BASE 0xF400 | ||
669 | #define PPBUF_BASE1 0xF800 | ||
670 | #define PPBUF_BASE2 0xFA00 | ||
671 | #define IMAGE_FLAG_ADDR0 0xCE80 | ||
672 | #define IMAGE_FLAG_ADDR1 0xCE81 | ||
673 | |||
674 | #define rtsx_pci_init_cmd(pcr) ((pcr)->ci = 0) | ||
675 | |||
676 | struct rtsx_pcr; | ||
677 | |||
678 | struct pcr_handle { | ||
679 | struct rtsx_pcr *pcr; | ||
680 | }; | ||
681 | |||
682 | struct pcr_ops { | ||
683 | int (*extra_init_hw)(struct rtsx_pcr *pcr); | ||
684 | int (*optimize_phy)(struct rtsx_pcr *pcr); | ||
685 | int (*turn_on_led)(struct rtsx_pcr *pcr); | ||
686 | int (*turn_off_led)(struct rtsx_pcr *pcr); | ||
687 | int (*enable_auto_blink)(struct rtsx_pcr *pcr); | ||
688 | int (*disable_auto_blink)(struct rtsx_pcr *pcr); | ||
689 | int (*card_power_on)(struct rtsx_pcr *pcr, int card); | ||
690 | int (*card_power_off)(struct rtsx_pcr *pcr, int card); | ||
691 | unsigned int (*cd_deglitch)(struct rtsx_pcr *pcr); | ||
692 | }; | ||
693 | |||
694 | enum PDEV_STAT {PDEV_STAT_IDLE, PDEV_STAT_RUN}; | ||
695 | |||
696 | struct rtsx_pcr { | ||
697 | struct pci_dev *pci; | ||
698 | unsigned int id; | ||
699 | |||
700 | /* pci resources */ | ||
701 | unsigned long addr; | ||
702 | void __iomem *remap_addr; | ||
703 | int irq; | ||
704 | |||
705 | /* host reserved buffer */ | ||
706 | void *rtsx_resv_buf; | ||
707 | dma_addr_t rtsx_resv_buf_addr; | ||
708 | |||
709 | void *host_cmds_ptr; | ||
710 | dma_addr_t host_cmds_addr; | ||
711 | int ci; | ||
712 | |||
713 | void *host_sg_tbl_ptr; | ||
714 | dma_addr_t host_sg_tbl_addr; | ||
715 | int sgi; | ||
716 | |||
717 | u32 bier; | ||
718 | char trans_result; | ||
719 | |||
720 | unsigned int card_inserted; | ||
721 | unsigned int card_removed; | ||
722 | |||
723 | struct delayed_work carddet_work; | ||
724 | struct delayed_work idle_work; | ||
725 | |||
726 | spinlock_t lock; | ||
727 | struct mutex pcr_mutex; | ||
728 | struct completion *done; | ||
729 | struct completion *finish_me; | ||
730 | |||
731 | unsigned int cur_clock; | ||
732 | bool ms_pmos; | ||
733 | bool remove_pci; | ||
734 | bool msi_en; | ||
735 | |||
736 | #define EXTRA_CAPS_SD_SDR50 (1 << 0) | ||
737 | #define EXTRA_CAPS_SD_SDR104 (1 << 1) | ||
738 | #define EXTRA_CAPS_SD_DDR50 (1 << 2) | ||
739 | #define EXTRA_CAPS_MMC_HSDDR (1 << 3) | ||
740 | #define EXTRA_CAPS_MMC_HS200 (1 << 4) | ||
741 | #define EXTRA_CAPS_MMC_8BIT (1 << 5) | ||
742 | u32 extra_caps; | ||
743 | |||
744 | #define IC_VER_A 0 | ||
745 | #define IC_VER_B 1 | ||
746 | #define IC_VER_C 2 | ||
747 | #define IC_VER_D 3 | ||
748 | u8 ic_version; | ||
749 | |||
750 | const u32 *sd_pull_ctl_enable_tbl; | ||
751 | const u32 *sd_pull_ctl_disable_tbl; | ||
752 | const u32 *ms_pull_ctl_enable_tbl; | ||
753 | const u32 *ms_pull_ctl_disable_tbl; | ||
754 | |||
755 | const struct pcr_ops *ops; | ||
756 | enum PDEV_STAT state; | ||
757 | |||
758 | int num_slots; | ||
759 | struct rtsx_slot *slots; | ||
760 | }; | ||
761 | |||
762 | #define CHK_PCI_PID(pcr, pid) ((pcr)->pci->device == (pid)) | ||
763 | #define PCI_VID(pcr) ((pcr)->pci->vendor) | ||
764 | #define PCI_PID(pcr) ((pcr)->pci->device) | ||
765 | |||
766 | void rtsx_pci_start_run(struct rtsx_pcr *pcr); | ||
767 | int rtsx_pci_write_register(struct rtsx_pcr *pcr, u16 addr, u8 mask, u8 data); | ||
768 | int rtsx_pci_read_register(struct rtsx_pcr *pcr, u16 addr, u8 *data); | ||
769 | int rtsx_pci_write_phy_register(struct rtsx_pcr *pcr, u8 addr, u16 val); | ||
770 | int rtsx_pci_read_phy_register(struct rtsx_pcr *pcr, u8 addr, u16 *val); | ||
771 | void rtsx_pci_stop_cmd(struct rtsx_pcr *pcr); | ||
772 | void rtsx_pci_add_cmd(struct rtsx_pcr *pcr, | ||
773 | u8 cmd_type, u16 reg_addr, u8 mask, u8 data); | ||
774 | void rtsx_pci_send_cmd_no_wait(struct rtsx_pcr *pcr); | ||
775 | int rtsx_pci_send_cmd(struct rtsx_pcr *pcr, int timeout); | ||
776 | int rtsx_pci_transfer_data(struct rtsx_pcr *pcr, struct scatterlist *sglist, | ||
777 | int num_sg, bool read, int timeout); | ||
778 | int rtsx_pci_read_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len); | ||
779 | int rtsx_pci_write_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len); | ||
780 | int rtsx_pci_card_pull_ctl_enable(struct rtsx_pcr *pcr, int card); | ||
781 | int rtsx_pci_card_pull_ctl_disable(struct rtsx_pcr *pcr, int card); | ||
782 | int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock, | ||
783 | u8 ssc_depth, bool initial_mode, bool double_clk, bool vpclk); | ||
784 | int rtsx_pci_card_power_on(struct rtsx_pcr *pcr, int card); | ||
785 | int rtsx_pci_card_power_off(struct rtsx_pcr *pcr, int card); | ||
786 | unsigned int rtsx_pci_card_exist(struct rtsx_pcr *pcr); | ||
787 | void rtsx_pci_complete_unfinished_transfer(struct rtsx_pcr *pcr); | ||
788 | |||
789 | static inline u8 *rtsx_pci_get_cmd_data(struct rtsx_pcr *pcr) | ||
790 | { | ||
791 | return (u8 *)(pcr->host_cmds_ptr); | ||
792 | } | ||
793 | |||
794 | #endif | ||
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index ce7e6671968b..0b5865c61efd 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -7,9 +7,27 @@ | |||
7 | 7 | ||
8 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); | 8 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); |
9 | 9 | ||
10 | /* | ||
11 | * Return values from addresss_space_operations.migratepage(): | ||
12 | * - negative errno on page migration failure; | ||
13 | * - zero on page migration success; | ||
14 | * | ||
15 | * The balloon page migration introduces this special case where a 'distinct' | ||
16 | * return code is used to flag a successful page migration to unmap_and_move(). | ||
17 | * This approach is necessary because page migration can race against balloon | ||
18 | * deflation procedure, and for such case we could introduce a nasty page leak | ||
19 | * if a successfully migrated balloon page gets released concurrently with | ||
20 | * migration's unmap_and_move() wrap-up steps. | ||
21 | */ | ||
22 | #define MIGRATEPAGE_SUCCESS 0 | ||
23 | #define MIGRATEPAGE_BALLOON_SUCCESS 1 /* special ret code for balloon page | ||
24 | * sucessful migration case. | ||
25 | */ | ||
26 | |||
10 | #ifdef CONFIG_MIGRATION | 27 | #ifdef CONFIG_MIGRATION |
11 | 28 | ||
12 | extern void putback_lru_pages(struct list_head *l); | 29 | extern void putback_lru_pages(struct list_head *l); |
30 | extern void putback_movable_pages(struct list_head *l); | ||
13 | extern int migrate_page(struct address_space *, | 31 | extern int migrate_page(struct address_space *, |
14 | struct page *, struct page *, enum migrate_mode); | 32 | struct page *, struct page *, enum migrate_mode); |
15 | extern int migrate_pages(struct list_head *l, new_page_t x, | 33 | extern int migrate_pages(struct list_head *l, new_page_t x, |
@@ -33,6 +51,7 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
33 | #else | 51 | #else |
34 | 52 | ||
35 | static inline void putback_lru_pages(struct list_head *l) {} | 53 | static inline void putback_lru_pages(struct list_head *l) {} |
54 | static inline void putback_movable_pages(struct list_head *l) {} | ||
36 | static inline int migrate_pages(struct list_head *l, new_page_t x, | 55 | static inline int migrate_pages(struct list_head *l, new_page_t x, |
37 | unsigned long private, bool offlining, | 56 | unsigned long private, bool offlining, |
38 | enum migrate_mode mode) { return -ENOSYS; } | 57 | enum migrate_mode mode) { return -ENOSYS; } |
diff --git a/include/linux/mm.h b/include/linux/mm.h index bcaab4e6fe91..4af4f0b1be4c 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1456,6 +1456,37 @@ extern unsigned long vm_mmap(struct file *, unsigned long, | |||
1456 | unsigned long, unsigned long, | 1456 | unsigned long, unsigned long, |
1457 | unsigned long, unsigned long); | 1457 | unsigned long, unsigned long); |
1458 | 1458 | ||
1459 | struct vm_unmapped_area_info { | ||
1460 | #define VM_UNMAPPED_AREA_TOPDOWN 1 | ||
1461 | unsigned long flags; | ||
1462 | unsigned long length; | ||
1463 | unsigned long low_limit; | ||
1464 | unsigned long high_limit; | ||
1465 | unsigned long align_mask; | ||
1466 | unsigned long align_offset; | ||
1467 | }; | ||
1468 | |||
1469 | extern unsigned long unmapped_area(struct vm_unmapped_area_info *info); | ||
1470 | extern unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info); | ||
1471 | |||
1472 | /* | ||
1473 | * Search for an unmapped address range. | ||
1474 | * | ||
1475 | * We are looking for a range that: | ||
1476 | * - does not intersect with any VMA; | ||
1477 | * - is contained within the [low_limit, high_limit) interval; | ||
1478 | * - is at least the desired size. | ||
1479 | * - satisfies (begin_addr & align_mask) == (align_offset & align_mask) | ||
1480 | */ | ||
1481 | static inline unsigned long | ||
1482 | vm_unmapped_area(struct vm_unmapped_area_info *info) | ||
1483 | { | ||
1484 | if (!(info->flags & VM_UNMAPPED_AREA_TOPDOWN)) | ||
1485 | return unmapped_area(info); | ||
1486 | else | ||
1487 | return unmapped_area_topdown(info); | ||
1488 | } | ||
1489 | |||
1459 | /* truncate.c */ | 1490 | /* truncate.c */ |
1460 | extern void truncate_inode_pages(struct address_space *, loff_t); | 1491 | extern void truncate_inode_pages(struct address_space *, loff_t); |
1461 | extern void truncate_inode_pages_range(struct address_space *, | 1492 | extern void truncate_inode_pages_range(struct address_space *, |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 31f8a3af7d94..7ade2731b5d6 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -224,7 +224,8 @@ struct vm_region { | |||
224 | * library, the executable area etc). | 224 | * library, the executable area etc). |
225 | */ | 225 | */ |
226 | struct vm_area_struct { | 226 | struct vm_area_struct { |
227 | struct mm_struct * vm_mm; /* The address space we belong to. */ | 227 | /* The first cache line has the info for VMA tree walking. */ |
228 | |||
228 | unsigned long vm_start; /* Our start address within vm_mm. */ | 229 | unsigned long vm_start; /* Our start address within vm_mm. */ |
229 | unsigned long vm_end; /* The first byte after our end address | 230 | unsigned long vm_end; /* The first byte after our end address |
230 | within vm_mm. */ | 231 | within vm_mm. */ |
@@ -232,11 +233,22 @@ struct vm_area_struct { | |||
232 | /* linked list of VM areas per task, sorted by address */ | 233 | /* linked list of VM areas per task, sorted by address */ |
233 | struct vm_area_struct *vm_next, *vm_prev; | 234 | struct vm_area_struct *vm_next, *vm_prev; |
234 | 235 | ||
236 | struct rb_node vm_rb; | ||
237 | |||
238 | /* | ||
239 | * Largest free memory gap in bytes to the left of this VMA. | ||
240 | * Either between this VMA and vma->vm_prev, or between one of the | ||
241 | * VMAs below us in the VMA rbtree and its ->vm_prev. This helps | ||
242 | * get_unmapped_area find a free area of the right size. | ||
243 | */ | ||
244 | unsigned long rb_subtree_gap; | ||
245 | |||
246 | /* Second cache line starts here. */ | ||
247 | |||
248 | struct mm_struct *vm_mm; /* The address space we belong to. */ | ||
235 | pgprot_t vm_page_prot; /* Access permissions of this VMA. */ | 249 | pgprot_t vm_page_prot; /* Access permissions of this VMA. */ |
236 | unsigned long vm_flags; /* Flags, see mm.h. */ | 250 | unsigned long vm_flags; /* Flags, see mm.h. */ |
237 | 251 | ||
238 | struct rb_node vm_rb; | ||
239 | |||
240 | /* | 252 | /* |
241 | * For areas with an address space and backing store, | 253 | * For areas with an address space and backing store, |
242 | * linkage into the address_space->i_mmap interval tree, or | 254 | * linkage into the address_space->i_mmap interval tree, or |
@@ -322,6 +334,7 @@ struct mm_struct { | |||
322 | unsigned long task_size; /* size of task vm space */ | 334 | unsigned long task_size; /* size of task vm space */ |
323 | unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ | 335 | unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ |
324 | unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */ | 336 | unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */ |
337 | unsigned long highest_vm_end; /* highest vma end address */ | ||
325 | pgd_t * pgd; | 338 | pgd_t * pgd; |
326 | atomic_t mm_users; /* How many users with user space? */ | 339 | atomic_t mm_users; /* How many users with user space? */ |
327 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ | 340 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ |
diff --git a/include/linux/mman.h b/include/linux/mman.h index d09dde1e57fb..9aa863da287f 100644 --- a/include/linux/mman.h +++ b/include/linux/mman.h | |||
@@ -11,6 +11,8 @@ extern int sysctl_overcommit_memory; | |||
11 | extern int sysctl_overcommit_ratio; | 11 | extern int sysctl_overcommit_ratio; |
12 | extern struct percpu_counter vm_committed_as; | 12 | extern struct percpu_counter vm_committed_as; |
13 | 13 | ||
14 | unsigned long vm_memory_committed(void); | ||
15 | |||
14 | static inline void vm_acct_memory(long pages) | 16 | static inline void vm_acct_memory(long pages) |
15 | { | 17 | { |
16 | percpu_counter_add(&vm_committed_as, pages); | 18 | percpu_counter_add(&vm_committed_as, pages); |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 943550dfe9ea..5c69315d60cc 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -85,6 +85,7 @@ struct mmc_ext_csd { | |||
85 | bool boot_ro_lockable; | 85 | bool boot_ro_lockable; |
86 | u8 raw_exception_status; /* 53 */ | 86 | u8 raw_exception_status; /* 53 */ |
87 | u8 raw_partition_support; /* 160 */ | 87 | u8 raw_partition_support; /* 160 */ |
88 | u8 raw_rpmb_size_mult; /* 168 */ | ||
88 | u8 raw_erased_mem_count; /* 181 */ | 89 | u8 raw_erased_mem_count; /* 181 */ |
89 | u8 raw_ext_csd_structure; /* 194 */ | 90 | u8 raw_ext_csd_structure; /* 194 */ |
90 | u8 raw_card_type; /* 196 */ | 91 | u8 raw_card_type; /* 196 */ |
@@ -206,6 +207,7 @@ struct mmc_part { | |||
206 | #define MMC_BLK_DATA_AREA_MAIN (1<<0) | 207 | #define MMC_BLK_DATA_AREA_MAIN (1<<0) |
207 | #define MMC_BLK_DATA_AREA_BOOT (1<<1) | 208 | #define MMC_BLK_DATA_AREA_BOOT (1<<1) |
208 | #define MMC_BLK_DATA_AREA_GP (1<<2) | 209 | #define MMC_BLK_DATA_AREA_GP (1<<2) |
210 | #define MMC_BLK_DATA_AREA_RPMB (1<<3) | ||
209 | }; | 211 | }; |
210 | 212 | ||
211 | /* | 213 | /* |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 9b9cdafc7737..5bf7c2274fcb 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -170,6 +170,8 @@ extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, | |||
170 | extern unsigned int mmc_calc_max_discard(struct mmc_card *card); | 170 | extern unsigned int mmc_calc_max_discard(struct mmc_card *card); |
171 | 171 | ||
172 | extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); | 172 | extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); |
173 | extern int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount, | ||
174 | bool is_rel_write); | ||
173 | extern int mmc_hw_reset(struct mmc_host *host); | 175 | extern int mmc_hw_reset(struct mmc_host *host); |
174 | extern int mmc_hw_reset_check(struct mmc_host *host); | 176 | extern int mmc_hw_reset_check(struct mmc_host *host); |
175 | extern int mmc_can_reset(struct mmc_card *card); | 177 | extern int mmc_can_reset(struct mmc_card *card); |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 96531664a061..34be4f47293c 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
@@ -229,8 +229,9 @@ struct dw_mci_board { | |||
229 | u32 quirks; /* Workaround / Quirk flags */ | 229 | u32 quirks; /* Workaround / Quirk flags */ |
230 | unsigned int bus_hz; /* Clock speed at the cclk_in pad */ | 230 | unsigned int bus_hz; /* Clock speed at the cclk_in pad */ |
231 | 231 | ||
232 | unsigned int caps; /* Capabilities */ | 232 | u32 caps; /* Capabilities */ |
233 | unsigned int caps2; /* More capabilities */ | 233 | u32 caps2; /* More capabilities */ |
234 | u32 pm_caps; /* PM capabilities */ | ||
234 | /* | 235 | /* |
235 | * Override fifo depth. If 0, autodetect it from the FIFOTH register, | 236 | * Override fifo depth. If 0, autodetect it from the FIFOTH register, |
236 | * but note that this may not be reliable after a bootloader has used | 237 | * but note that this may not be reliable after a bootloader has used |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 7abb0e1f7bda..61a10c17aabd 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -53,12 +53,12 @@ struct mmc_ios { | |||
53 | #define MMC_TIMING_LEGACY 0 | 53 | #define MMC_TIMING_LEGACY 0 |
54 | #define MMC_TIMING_MMC_HS 1 | 54 | #define MMC_TIMING_MMC_HS 1 |
55 | #define MMC_TIMING_SD_HS 2 | 55 | #define MMC_TIMING_SD_HS 2 |
56 | #define MMC_TIMING_UHS_SDR12 MMC_TIMING_LEGACY | 56 | #define MMC_TIMING_UHS_SDR12 3 |
57 | #define MMC_TIMING_UHS_SDR25 MMC_TIMING_SD_HS | 57 | #define MMC_TIMING_UHS_SDR25 4 |
58 | #define MMC_TIMING_UHS_SDR50 3 | 58 | #define MMC_TIMING_UHS_SDR50 5 |
59 | #define MMC_TIMING_UHS_SDR104 4 | 59 | #define MMC_TIMING_UHS_SDR104 6 |
60 | #define MMC_TIMING_UHS_DDR50 5 | 60 | #define MMC_TIMING_UHS_DDR50 7 |
61 | #define MMC_TIMING_MMC_HS200 6 | 61 | #define MMC_TIMING_MMC_HS200 8 |
62 | 62 | ||
63 | #define MMC_SDR_MODE 0 | 63 | #define MMC_SDR_MODE 0 |
64 | #define MMC_1_2V_DDR_MODE 1 | 64 | #define MMC_1_2V_DDR_MODE 1 |
@@ -136,6 +136,7 @@ struct mmc_host_ops { | |||
136 | void (*enable_preset_value)(struct mmc_host *host, bool enable); | 136 | void (*enable_preset_value)(struct mmc_host *host, bool enable); |
137 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); | 137 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); |
138 | void (*hw_reset)(struct mmc_host *host); | 138 | void (*hw_reset)(struct mmc_host *host); |
139 | void (*card_event)(struct mmc_host *host); | ||
139 | }; | 140 | }; |
140 | 141 | ||
141 | struct mmc_card; | 142 | struct mmc_card; |
@@ -211,7 +212,7 @@ struct mmc_host { | |||
211 | #define MMC_VDD_34_35 0x00400000 /* VDD voltage 3.4 ~ 3.5 */ | 212 | #define MMC_VDD_34_35 0x00400000 /* VDD voltage 3.4 ~ 3.5 */ |
212 | #define MMC_VDD_35_36 0x00800000 /* VDD voltage 3.5 ~ 3.6 */ | 213 | #define MMC_VDD_35_36 0x00800000 /* VDD voltage 3.5 ~ 3.6 */ |
213 | 214 | ||
214 | unsigned long caps; /* Host capabilities */ | 215 | u32 caps; /* Host capabilities */ |
215 | 216 | ||
216 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ | 217 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ |
217 | #define MMC_CAP_MMC_HIGHSPEED (1 << 1) /* Can do MMC high-speed timing */ | 218 | #define MMC_CAP_MMC_HIGHSPEED (1 << 1) /* Can do MMC high-speed timing */ |
@@ -241,7 +242,7 @@ struct mmc_host { | |||
241 | #define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ | 242 | #define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ |
242 | #define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */ | 243 | #define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */ |
243 | 244 | ||
244 | unsigned int caps2; /* More host capabilities */ | 245 | u32 caps2; /* More host capabilities */ |
245 | 246 | ||
246 | #define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ | 247 | #define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ |
247 | #define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ | 248 | #define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 01e4b394029b..94d532e41c61 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -286,6 +286,7 @@ struct _mmc_csd { | |||
286 | #define EXT_CSD_BKOPS_START 164 /* W */ | 286 | #define EXT_CSD_BKOPS_START 164 /* W */ |
287 | #define EXT_CSD_SANITIZE_START 165 /* W */ | 287 | #define EXT_CSD_SANITIZE_START 165 /* W */ |
288 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ | 288 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ |
289 | #define EXT_CSD_RPMB_MULT 168 /* RO */ | ||
289 | #define EXT_CSD_BOOT_WP 173 /* R/W */ | 290 | #define EXT_CSD_BOOT_WP 173 /* R/W */ |
290 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ | 291 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ |
291 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ | 292 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ |
@@ -339,6 +340,7 @@ struct _mmc_csd { | |||
339 | 340 | ||
340 | #define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) | 341 | #define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) |
341 | #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) | 342 | #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) |
343 | #define EXT_CSD_PART_CONFIG_ACC_RPMB (0x3) | ||
342 | #define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) | 344 | #define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) |
343 | 345 | ||
344 | #define EXT_CSD_PART_SUPPORT_PART_EN (0x1) | 346 | #define EXT_CSD_PART_SUPPORT_PART_EN (0x1) |
diff --git a/include/linux/mmc/mxs-mmc.h b/include/linux/mmc/mxs-mmc.h deleted file mode 100644 index 7c2ad3a7f2f3..000000000000 --- a/include/linux/mmc/mxs-mmc.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 __LINUX_MMC_MXS_MMC_H__ | ||
10 | #define __LINUX_MMC_MXS_MMC_H__ | ||
11 | |||
12 | struct mxs_mmc_platform_data { | ||
13 | int wp_gpio; /* write protect pin */ | ||
14 | unsigned int flags; | ||
15 | #define SLOTF_4_BIT_CAPABLE (1 << 0) | ||
16 | #define SLOTF_8_BIT_CAPABLE (1 << 1) | ||
17 | }; | ||
18 | |||
19 | #endif /* __LINUX_MMC_MXS_MMC_H__ */ | ||
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 1edcb4dad8c4..4bbc3301fbbf 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
@@ -92,6 +92,8 @@ struct sdhci_host { | |||
92 | 92 | ||
93 | #define SDHCI_QUIRK2_HOST_OFF_CARD_ON (1<<0) | 93 | #define SDHCI_QUIRK2_HOST_OFF_CARD_ON (1<<0) |
94 | #define SDHCI_QUIRK2_HOST_NO_CMD23 (1<<1) | 94 | #define SDHCI_QUIRK2_HOST_NO_CMD23 (1<<1) |
95 | /* The system physically doesn't support 1.8v, even if the host does */ | ||
96 | #define SDHCI_QUIRK2_NO_1_8_V (1<<2) | ||
95 | 97 | ||
96 | int irq; /* Device IRQ */ | 98 | int irq; /* Device IRQ */ |
97 | void __iomem *ioaddr; /* Mapped address */ | 99 | void __iomem *ioaddr; /* Mapped address */ |
@@ -158,8 +160,8 @@ struct sdhci_host { | |||
158 | 160 | ||
159 | struct timer_list timer; /* Timer for timeouts */ | 161 | struct timer_list timer; /* Timer for timeouts */ |
160 | 162 | ||
161 | unsigned int caps; /* Alternative CAPABILITY_0 */ | 163 | u32 caps; /* Alternative CAPABILITY_0 */ |
162 | unsigned int caps1; /* Alternative CAPABILITY_1 */ | 164 | u32 caps1; /* Alternative CAPABILITY_1 */ |
163 | 165 | ||
164 | unsigned int ocr_avail_sdio; /* OCR bit masks */ | 166 | unsigned int ocr_avail_sdio; /* OCR bit masks */ |
165 | unsigned int ocr_avail_sd; | 167 | unsigned int ocr_avail_sd; |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index a23923ba8263..0c0b1d608a69 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -63,10 +63,8 @@ enum { | |||
63 | 63 | ||
64 | #ifdef CONFIG_CMA | 64 | #ifdef CONFIG_CMA |
65 | # define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA) | 65 | # define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA) |
66 | # define cma_wmark_pages(zone) zone->min_cma_pages | ||
67 | #else | 66 | #else |
68 | # define is_migrate_cma(migratetype) false | 67 | # define is_migrate_cma(migratetype) false |
69 | # define cma_wmark_pages(zone) 0 | ||
70 | #endif | 68 | #endif |
71 | 69 | ||
72 | #define for_each_migratetype_order(order, type) \ | 70 | #define for_each_migratetype_order(order, type) \ |
@@ -383,13 +381,6 @@ struct zone { | |||
383 | /* see spanned/present_pages for more description */ | 381 | /* see spanned/present_pages for more description */ |
384 | seqlock_t span_seqlock; | 382 | seqlock_t span_seqlock; |
385 | #endif | 383 | #endif |
386 | #ifdef CONFIG_CMA | ||
387 | /* | ||
388 | * CMA needs to increase watermark levels during the allocation | ||
389 | * process to make sure that the system is not starved. | ||
390 | */ | ||
391 | unsigned long min_cma_pages; | ||
392 | #endif | ||
393 | struct free_area free_area[MAX_ORDER]; | 384 | struct free_area free_area[MAX_ORDER]; |
394 | 385 | ||
395 | #ifndef CONFIG_SPARSEMEM | 386 | #ifndef CONFIG_SPARSEMEM |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f8eda0276f03..a848ffc327f4 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1488,6 +1488,9 @@ struct napi_gro_cb { | |||
1488 | 1488 | ||
1489 | /* Used in ipv6_gro_receive() */ | 1489 | /* Used in ipv6_gro_receive() */ |
1490 | int proto; | 1490 | int proto; |
1491 | |||
1492 | /* used in skb_gro_receive() slow path */ | ||
1493 | struct sk_buff *last; | ||
1491 | }; | 1494 | }; |
1492 | 1495 | ||
1493 | #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) | 1496 | #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) |
diff --git a/include/linux/node.h b/include/linux/node.h index 624e53cecc02..2115ad5d6f19 100644 --- a/include/linux/node.h +++ b/include/linux/node.h | |||
@@ -27,10 +27,9 @@ struct node { | |||
27 | }; | 27 | }; |
28 | 28 | ||
29 | struct memory_block; | 29 | struct memory_block; |
30 | extern struct node node_devices[]; | 30 | extern struct node *node_devices[]; |
31 | typedef void (*node_registration_func_t)(struct node *); | 31 | typedef void (*node_registration_func_t)(struct node *); |
32 | 32 | ||
33 | extern int register_node(struct node *, int, struct node *); | ||
34 | extern void unregister_node(struct node *node); | 33 | extern void unregister_node(struct node *node); |
35 | #ifdef CONFIG_NUMA | 34 | #ifdef CONFIG_NUMA |
36 | extern int register_one_node(int nid); | 35 | extern int register_one_node(int nid); |
diff --git a/include/linux/of.h b/include/linux/of.h index b4e50d56fc74..60053bd7e79a 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -46,7 +46,7 @@ struct device_node { | |||
46 | const char *name; | 46 | const char *name; |
47 | const char *type; | 47 | const char *type; |
48 | phandle phandle; | 48 | phandle phandle; |
49 | char *full_name; | 49 | const char *full_name; |
50 | 50 | ||
51 | struct property *properties; | 51 | struct property *properties; |
52 | struct property *deadprops; /* removed properties */ | 52 | struct property *deadprops; /* removed properties */ |
@@ -60,7 +60,7 @@ struct device_node { | |||
60 | unsigned long _flags; | 60 | unsigned long _flags; |
61 | void *data; | 61 | void *data; |
62 | #if defined(CONFIG_SPARC) | 62 | #if defined(CONFIG_SPARC) |
63 | char *path_component_name; | 63 | const char *path_component_name; |
64 | unsigned int unique_id; | 64 | unsigned int unique_id; |
65 | struct of_irq_controller *irq_trans; | 65 | struct of_irq_controller *irq_trans; |
66 | #endif | 66 | #endif |
@@ -88,14 +88,14 @@ static inline void of_node_put(struct device_node *node) { } | |||
88 | #ifdef CONFIG_OF | 88 | #ifdef CONFIG_OF |
89 | 89 | ||
90 | /* Pointer for first entry in chain of all nodes. */ | 90 | /* Pointer for first entry in chain of all nodes. */ |
91 | extern struct device_node *allnodes; | 91 | extern struct device_node *of_allnodes; |
92 | extern struct device_node *of_chosen; | 92 | extern struct device_node *of_chosen; |
93 | extern struct device_node *of_aliases; | 93 | extern struct device_node *of_aliases; |
94 | extern rwlock_t devtree_lock; | 94 | extern rwlock_t devtree_lock; |
95 | 95 | ||
96 | static inline bool of_have_populated_dt(void) | 96 | static inline bool of_have_populated_dt(void) |
97 | { | 97 | { |
98 | return allnodes != NULL; | 98 | return of_allnodes != NULL; |
99 | } | 99 | } |
100 | 100 | ||
101 | static inline bool of_node_is_root(const struct device_node *node) | 101 | static inline bool of_node_is_root(const struct device_node *node) |
@@ -179,11 +179,22 @@ extern struct device_node *of_find_compatible_node(struct device_node *from, | |||
179 | #define for_each_compatible_node(dn, type, compatible) \ | 179 | #define for_each_compatible_node(dn, type, compatible) \ |
180 | for (dn = of_find_compatible_node(NULL, type, compatible); dn; \ | 180 | for (dn = of_find_compatible_node(NULL, type, compatible); dn; \ |
181 | dn = of_find_compatible_node(dn, type, compatible)) | 181 | dn = of_find_compatible_node(dn, type, compatible)) |
182 | extern struct device_node *of_find_matching_node(struct device_node *from, | 182 | extern struct device_node *of_find_matching_node_and_match( |
183 | const struct of_device_id *matches); | 183 | struct device_node *from, |
184 | const struct of_device_id *matches, | ||
185 | const struct of_device_id **match); | ||
186 | static inline struct device_node *of_find_matching_node( | ||
187 | struct device_node *from, | ||
188 | const struct of_device_id *matches) | ||
189 | { | ||
190 | return of_find_matching_node_and_match(from, matches, NULL); | ||
191 | } | ||
184 | #define for_each_matching_node(dn, matches) \ | 192 | #define for_each_matching_node(dn, matches) \ |
185 | for (dn = of_find_matching_node(NULL, matches); dn; \ | 193 | for (dn = of_find_matching_node(NULL, matches); dn; \ |
186 | dn = of_find_matching_node(dn, matches)) | 194 | dn = of_find_matching_node(dn, matches)) |
195 | #define for_each_matching_node_and_match(dn, matches, match) \ | ||
196 | for (dn = of_find_matching_node_and_match(NULL, matches, match); \ | ||
197 | dn; dn = of_find_matching_node_and_match(dn, matches, match)) | ||
187 | extern struct device_node *of_find_node_by_path(const char *path); | 198 | extern struct device_node *of_find_node_by_path(const char *path); |
188 | extern struct device_node *of_find_node_by_phandle(phandle handle); | 199 | extern struct device_node *of_find_node_by_phandle(phandle handle); |
189 | extern struct device_node *of_get_parent(const struct device_node *node); | 200 | extern struct device_node *of_get_parent(const struct device_node *node); |
@@ -223,6 +234,10 @@ extern struct device_node *of_find_node_with_property( | |||
223 | extern struct property *of_find_property(const struct device_node *np, | 234 | extern struct property *of_find_property(const struct device_node *np, |
224 | const char *name, | 235 | const char *name, |
225 | int *lenp); | 236 | int *lenp); |
237 | extern int of_property_read_u8_array(const struct device_node *np, | ||
238 | const char *propname, u8 *out_values, size_t sz); | ||
239 | extern int of_property_read_u16_array(const struct device_node *np, | ||
240 | const char *propname, u16 *out_values, size_t sz); | ||
226 | extern int of_property_read_u32_array(const struct device_node *np, | 241 | extern int of_property_read_u32_array(const struct device_node *np, |
227 | const char *propname, | 242 | const char *propname, |
228 | u32 *out_values, | 243 | u32 *out_values, |
@@ -255,7 +270,7 @@ extern int of_n_size_cells(struct device_node *np); | |||
255 | extern const struct of_device_id *of_match_node( | 270 | extern const struct of_device_id *of_match_node( |
256 | const struct of_device_id *matches, const struct device_node *node); | 271 | const struct of_device_id *matches, const struct device_node *node); |
257 | extern int of_modalias_node(struct device_node *node, char *modalias, int len); | 272 | extern int of_modalias_node(struct device_node *node, char *modalias, int len); |
258 | extern struct device_node *of_parse_phandle(struct device_node *np, | 273 | extern struct device_node *of_parse_phandle(const struct device_node *np, |
259 | const char *phandle_name, | 274 | const char *phandle_name, |
260 | int index); | 275 | int index); |
261 | extern int of_parse_phandle_with_args(struct device_node *np, | 276 | extern int of_parse_phandle_with_args(struct device_node *np, |
@@ -364,6 +379,18 @@ static inline struct device_node *of_find_compatible_node( | |||
364 | return NULL; | 379 | return NULL; |
365 | } | 380 | } |
366 | 381 | ||
382 | static inline int of_property_read_u8_array(const struct device_node *np, | ||
383 | const char *propname, u8 *out_values, size_t sz) | ||
384 | { | ||
385 | return -ENOSYS; | ||
386 | } | ||
387 | |||
388 | static inline int of_property_read_u16_array(const struct device_node *np, | ||
389 | const char *propname, u16 *out_values, size_t sz) | ||
390 | { | ||
391 | return -ENOSYS; | ||
392 | } | ||
393 | |||
367 | static inline int of_property_read_u32_array(const struct device_node *np, | 394 | static inline int of_property_read_u32_array(const struct device_node *np, |
368 | const char *propname, | 395 | const char *propname, |
369 | u32 *out_values, size_t sz) | 396 | u32 *out_values, size_t sz) |
@@ -411,7 +438,7 @@ static inline int of_property_match_string(struct device_node *np, | |||
411 | return -ENOSYS; | 438 | return -ENOSYS; |
412 | } | 439 | } |
413 | 440 | ||
414 | static inline struct device_node *of_parse_phandle(struct device_node *np, | 441 | static inline struct device_node *of_parse_phandle(const struct device_node *np, |
415 | const char *phandle_name, | 442 | const char *phandle_name, |
416 | int index) | 443 | int index) |
417 | { | 444 | { |
@@ -470,6 +497,20 @@ static inline bool of_property_read_bool(const struct device_node *np, | |||
470 | return prop ? true : false; | 497 | return prop ? true : false; |
471 | } | 498 | } |
472 | 499 | ||
500 | static inline int of_property_read_u8(const struct device_node *np, | ||
501 | const char *propname, | ||
502 | u8 *out_value) | ||
503 | { | ||
504 | return of_property_read_u8_array(np, propname, out_value, 1); | ||
505 | } | ||
506 | |||
507 | static inline int of_property_read_u16(const struct device_node *np, | ||
508 | const char *propname, | ||
509 | u16 *out_value) | ||
510 | { | ||
511 | return of_property_read_u16_array(np, propname, out_value, 1); | ||
512 | } | ||
513 | |||
473 | static inline int of_property_read_u32(const struct device_node *np, | 514 | static inline int of_property_read_u32(const struct device_node *np, |
474 | const char *propname, | 515 | const char *propname, |
475 | u32 *out_value) | 516 | u32 *out_value) |
diff --git a/include/linux/of_address.h b/include/linux/of_address.h index e20e3af68fb6..0506eb53519b 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h | |||
@@ -42,10 +42,12 @@ static inline struct device_node *of_find_matching_node_by_address( | |||
42 | { | 42 | { |
43 | return NULL; | 43 | return NULL; |
44 | } | 44 | } |
45 | #ifndef of_iomap | ||
45 | static inline void __iomem *of_iomap(struct device_node *device, int index) | 46 | static inline void __iomem *of_iomap(struct device_node *device, int index) |
46 | { | 47 | { |
47 | return NULL; | 48 | return NULL; |
48 | } | 49 | } |
50 | #endif | ||
49 | static inline const __be32 *of_get_address(struct device_node *dev, int index, | 51 | static inline const __be32 *of_get_address(struct device_node *dev, int index, |
50 | u64 *size, unsigned int *flags) | 52 | u64 *size, unsigned int *flags) |
51 | { | 53 | { |
diff --git a/include/linux/omap-iommu.h b/include/linux/omap-iommu.h new file mode 100644 index 000000000000..cac78de09c07 --- /dev/null +++ b/include/linux/omap-iommu.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * omap iommu: simple virtual address space management | ||
3 | * | ||
4 | * Copyright (C) 2008-2009 Nokia Corporation | ||
5 | * | ||
6 | * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef _INTEL_IOMMU_H_ | ||
14 | #define _INTEL_IOMMU_H_ | ||
15 | |||
16 | struct iovm_struct { | ||
17 | struct omap_iommu *iommu; /* iommu object which this belongs to */ | ||
18 | u32 da_start; /* area definition */ | ||
19 | u32 da_end; | ||
20 | u32 flags; /* IOVMF_: see below */ | ||
21 | struct list_head list; /* linked in ascending order */ | ||
22 | const struct sg_table *sgt; /* keep 'page' <-> 'da' mapping */ | ||
23 | void *va; /* mpu side mapped address */ | ||
24 | }; | ||
25 | |||
26 | #define MMU_RAM_ENDIAN_SHIFT 9 | ||
27 | #define MMU_RAM_ENDIAN_LITTLE (0 << MMU_RAM_ENDIAN_SHIFT) | ||
28 | #define MMU_RAM_ELSZ_8 (0 << MMU_RAM_ELSZ_SHIFT) | ||
29 | #define IOVMF_ENDIAN_LITTLE MMU_RAM_ENDIAN_LITTLE | ||
30 | #define MMU_RAM_ELSZ_SHIFT 7 | ||
31 | #define IOVMF_ELSZ_8 MMU_RAM_ELSZ_8 | ||
32 | |||
33 | struct iommu_domain; | ||
34 | |||
35 | extern struct iovm_struct *omap_find_iovm_area(struct device *dev, u32 da); | ||
36 | extern u32 | ||
37 | omap_iommu_vmap(struct iommu_domain *domain, struct device *dev, u32 da, | ||
38 | const struct sg_table *sgt, u32 flags); | ||
39 | extern struct sg_table *omap_iommu_vunmap(struct iommu_domain *domain, | ||
40 | struct device *dev, u32 da); | ||
41 | extern u32 | ||
42 | omap_iommu_vmalloc(struct iommu_domain *domain, struct device *dev, | ||
43 | u32 da, size_t bytes, u32 flags); | ||
44 | extern void | ||
45 | omap_iommu_vfree(struct iommu_domain *domain, struct device *dev, | ||
46 | const u32 da); | ||
47 | extern void *omap_da_to_va(struct device *dev, u32 da); | ||
48 | |||
49 | extern void omap_iommu_save_ctx(struct device *dev); | ||
50 | extern void omap_iommu_restore_ctx(struct device *dev); | ||
51 | |||
52 | #endif | ||
diff --git a/include/linux/oom.h b/include/linux/oom.h index fb9826847b89..da60007075b5 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
@@ -29,8 +29,23 @@ enum oom_scan_t { | |||
29 | OOM_SCAN_SELECT, /* always select this thread first */ | 29 | OOM_SCAN_SELECT, /* always select this thread first */ |
30 | }; | 30 | }; |
31 | 31 | ||
32 | extern void compare_swap_oom_score_adj(int old_val, int new_val); | 32 | /* Thread is the potential origin of an oom condition; kill first on oom */ |
33 | extern int test_set_oom_score_adj(int new_val); | 33 | #define OOM_FLAG_ORIGIN ((__force oom_flags_t)0x1) |
34 | |||
35 | static inline void set_current_oom_origin(void) | ||
36 | { | ||
37 | current->signal->oom_flags |= OOM_FLAG_ORIGIN; | ||
38 | } | ||
39 | |||
40 | static inline void clear_current_oom_origin(void) | ||
41 | { | ||
42 | current->signal->oom_flags &= ~OOM_FLAG_ORIGIN; | ||
43 | } | ||
44 | |||
45 | static inline bool oom_task_origin(const struct task_struct *p) | ||
46 | { | ||
47 | return !!(p->signal->oom_flags & OOM_FLAG_ORIGIN); | ||
48 | } | ||
34 | 49 | ||
35 | extern unsigned long oom_badness(struct task_struct *p, | 50 | extern unsigned long oom_badness(struct task_struct *p, |
36 | struct mem_cgroup *memcg, const nodemask_t *nodemask, | 51 | struct mem_cgroup *memcg, const nodemask_t *nodemask, |
@@ -49,8 +64,6 @@ extern void check_panic_on_oom(enum oom_constraint constraint, gfp_t gfp_mask, | |||
49 | extern enum oom_scan_t oom_scan_process_thread(struct task_struct *task, | 64 | extern enum oom_scan_t oom_scan_process_thread(struct task_struct *task, |
50 | unsigned long totalpages, const nodemask_t *nodemask, | 65 | unsigned long totalpages, const nodemask_t *nodemask, |
51 | bool force_kill); | 66 | bool force_kill); |
52 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, | ||
53 | int order); | ||
54 | 67 | ||
55 | extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, | 68 | extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, |
56 | int order, nodemask_t *mask, bool force_kill); | 69 | int order, nodemask_t *mask, bool force_kill); |
diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h index 76a9539cfd3f..a92061e08d48 100644 --- a/include/linux/page-isolation.h +++ b/include/linux/page-isolation.h | |||
@@ -2,7 +2,8 @@ | |||
2 | #define __LINUX_PAGEISOLATION_H | 2 | #define __LINUX_PAGEISOLATION_H |
3 | 3 | ||
4 | 4 | ||
5 | bool has_unmovable_pages(struct zone *zone, struct page *page, int count); | 5 | bool has_unmovable_pages(struct zone *zone, struct page *page, int count, |
6 | bool skip_hwpoisoned_pages); | ||
6 | void set_pageblock_migratetype(struct page *page, int migratetype); | 7 | void set_pageblock_migratetype(struct page *page, int migratetype); |
7 | int move_freepages_block(struct zone *zone, struct page *page, | 8 | int move_freepages_block(struct zone *zone, struct page *page, |
8 | int migratetype); | 9 | int migratetype); |
@@ -21,7 +22,7 @@ int move_freepages(struct zone *zone, | |||
21 | */ | 22 | */ |
22 | int | 23 | int |
23 | start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, | 24 | start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, |
24 | unsigned migratetype); | 25 | unsigned migratetype, bool skip_hwpoisoned_pages); |
25 | 26 | ||
26 | /* | 27 | /* |
27 | * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. | 28 | * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. |
@@ -34,12 +35,13 @@ undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, | |||
34 | /* | 35 | /* |
35 | * Test all pages in [start_pfn, end_pfn) are isolated or not. | 36 | * Test all pages in [start_pfn, end_pfn) are isolated or not. |
36 | */ | 37 | */ |
37 | int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn); | 38 | int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn, |
39 | bool skip_hwpoisoned_pages); | ||
38 | 40 | ||
39 | /* | 41 | /* |
40 | * Internal functions. Changes pageblock's migrate type. | 42 | * Internal functions. Changes pageblock's migrate type. |
41 | */ | 43 | */ |
42 | int set_migratetype_isolate(struct page *page); | 44 | int set_migratetype_isolate(struct page *page, bool skip_hwpoisoned_pages); |
43 | void unset_migratetype_isolate(struct page *page, unsigned migratetype); | 45 | void unset_migratetype_isolate(struct page *page, unsigned migratetype); |
44 | struct page *alloc_migrate_target(struct page *page, unsigned long private, | 46 | struct page *alloc_migrate_target(struct page *page, unsigned long private, |
45 | int **resultp); | 47 | int **resultp); |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index e42c762f0dc7..6da609d14c15 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -24,6 +24,7 @@ enum mapping_flags { | |||
24 | AS_ENOSPC = __GFP_BITS_SHIFT + 1, /* ENOSPC on async write */ | 24 | AS_ENOSPC = __GFP_BITS_SHIFT + 1, /* ENOSPC on async write */ |
25 | AS_MM_ALL_LOCKS = __GFP_BITS_SHIFT + 2, /* under mm_take_all_locks() */ | 25 | AS_MM_ALL_LOCKS = __GFP_BITS_SHIFT + 2, /* under mm_take_all_locks() */ |
26 | AS_UNEVICTABLE = __GFP_BITS_SHIFT + 3, /* e.g., ramdisk, SHM_LOCK */ | 26 | AS_UNEVICTABLE = __GFP_BITS_SHIFT + 3, /* e.g., ramdisk, SHM_LOCK */ |
27 | AS_BALLOON_MAP = __GFP_BITS_SHIFT + 4, /* balloon page special map */ | ||
27 | }; | 28 | }; |
28 | 29 | ||
29 | static inline void mapping_set_error(struct address_space *mapping, int error) | 30 | static inline void mapping_set_error(struct address_space *mapping, int error) |
@@ -53,6 +54,21 @@ static inline int mapping_unevictable(struct address_space *mapping) | |||
53 | return !!mapping; | 54 | return !!mapping; |
54 | } | 55 | } |
55 | 56 | ||
57 | static inline void mapping_set_balloon(struct address_space *mapping) | ||
58 | { | ||
59 | set_bit(AS_BALLOON_MAP, &mapping->flags); | ||
60 | } | ||
61 | |||
62 | static inline void mapping_clear_balloon(struct address_space *mapping) | ||
63 | { | ||
64 | clear_bit(AS_BALLOON_MAP, &mapping->flags); | ||
65 | } | ||
66 | |||
67 | static inline int mapping_balloon(struct address_space *mapping) | ||
68 | { | ||
69 | return mapping && test_bit(AS_BALLOON_MAP, &mapping->flags); | ||
70 | } | ||
71 | |||
56 | static inline gfp_t mapping_gfp_mask(struct address_space * mapping) | 72 | static inline gfp_t mapping_gfp_mask(struct address_space * mapping) |
57 | { | 73 | { |
58 | return (__force gfp_t)mapping->flags & __GFP_BITS_MASK; | 74 | return (__force gfp_t)mapping->flags & __GFP_BITS_MASK; |
diff --git a/include/linux/pci.h b/include/linux/pci.h index ee2179546c63..d03d2463efac 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -588,7 +588,7 @@ struct pci_driver { | |||
588 | * in a generic manner. | 588 | * in a generic manner. |
589 | */ | 589 | */ |
590 | #define DEFINE_PCI_DEVICE_TABLE(_table) \ | 590 | #define DEFINE_PCI_DEVICE_TABLE(_table) \ |
591 | const struct pci_device_id _table[] __devinitconst | 591 | const struct pci_device_id _table[] |
592 | 592 | ||
593 | /** | 593 | /** |
594 | * PCI_DEVICE - macro used to describe a specific pci device | 594 | * PCI_DEVICE - macro used to describe a specific pci device |
@@ -686,7 +686,7 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus, | |||
686 | int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int busmax); | 686 | int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int busmax); |
687 | int pci_bus_update_busn_res_end(struct pci_bus *b, int busmax); | 687 | int pci_bus_update_busn_res_end(struct pci_bus *b, int busmax); |
688 | void pci_bus_release_busn_res(struct pci_bus *b); | 688 | void pci_bus_release_busn_res(struct pci_bus *b); |
689 | struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus, | 689 | struct pci_bus *pci_scan_root_bus(struct device *parent, int bus, |
690 | struct pci_ops *ops, void *sysdata, | 690 | struct pci_ops *ops, void *sysdata, |
691 | struct list_head *resources); | 691 | struct list_head *resources); |
692 | struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, | 692 | struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, |
@@ -941,10 +941,8 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev); | |||
941 | 941 | ||
942 | /* Functions for PCI Hotplug drivers to use */ | 942 | /* Functions for PCI Hotplug drivers to use */ |
943 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); | 943 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); |
944 | #ifdef CONFIG_HOTPLUG | ||
945 | unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge); | 944 | unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge); |
946 | unsigned int pci_rescan_bus(struct pci_bus *bus); | 945 | unsigned int pci_rescan_bus(struct pci_bus *bus); |
947 | #endif | ||
948 | 946 | ||
949 | /* Vital product data routines */ | 947 | /* Vital product data routines */ |
950 | ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); | 948 | ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); |
@@ -1580,7 +1578,7 @@ extern int pci_pci_problems; | |||
1580 | 1578 | ||
1581 | extern unsigned long pci_cardbus_io_size; | 1579 | extern unsigned long pci_cardbus_io_size; |
1582 | extern unsigned long pci_cardbus_mem_size; | 1580 | extern unsigned long pci_cardbus_mem_size; |
1583 | extern u8 __devinitdata pci_dfl_cache_line_size; | 1581 | extern u8 pci_dfl_cache_line_size; |
1584 | extern u8 pci_cache_line_size; | 1582 | extern u8 pci_cache_line_size; |
1585 | 1583 | ||
1586 | extern unsigned long pci_hotplug_io_size; | 1584 | extern unsigned long pci_hotplug_io_size; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 9d36b829533a..0f8447376ddb 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1985,6 +1985,9 @@ | |||
1985 | #define PCI_DEVICE_ID_EXAR_XR17C152 0x0152 | 1985 | #define PCI_DEVICE_ID_EXAR_XR17C152 0x0152 |
1986 | #define PCI_DEVICE_ID_EXAR_XR17C154 0x0154 | 1986 | #define PCI_DEVICE_ID_EXAR_XR17C154 0x0154 |
1987 | #define PCI_DEVICE_ID_EXAR_XR17C158 0x0158 | 1987 | #define PCI_DEVICE_ID_EXAR_XR17C158 0x0158 |
1988 | #define PCI_DEVICE_ID_EXAR_XR17V352 0x0352 | ||
1989 | #define PCI_DEVICE_ID_EXAR_XR17V354 0x0354 | ||
1990 | #define PCI_DEVICE_ID_EXAR_XR17V358 0x0358 | ||
1988 | 1991 | ||
1989 | #define PCI_VENDOR_ID_MICROGATE 0x13c0 | 1992 | #define PCI_VENDOR_ID_MICROGATE 0x13c0 |
1990 | #define PCI_DEVICE_ID_MICROGATE_USC 0x0010 | 1993 | #define PCI_DEVICE_ID_MICROGATE_USC 0x0010 |
@@ -2323,6 +2326,8 @@ | |||
2323 | 2326 | ||
2324 | #define PCI_VENDOR_ID_TOPSPIN 0x1867 | 2327 | #define PCI_VENDOR_ID_TOPSPIN 0x1867 |
2325 | 2328 | ||
2329 | #define PCI_VENDOR_ID_COMMTECH 0x18f7 | ||
2330 | |||
2326 | #define PCI_VENDOR_ID_SILAN 0x1904 | 2331 | #define PCI_VENDOR_ID_SILAN 0x1904 |
2327 | 2332 | ||
2328 | #define PCI_VENDOR_ID_RENESAS 0x1912 | 2333 | #define PCI_VENDOR_ID_RENESAS 0x1912 |
diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h index 250a4acddb2b..bd1e86071e57 100644 --- a/include/linux/percpu-rwsem.h +++ b/include/linux/percpu-rwsem.h | |||
@@ -13,7 +13,7 @@ struct percpu_rw_semaphore { | |||
13 | }; | 13 | }; |
14 | 14 | ||
15 | #define light_mb() barrier() | 15 | #define light_mb() barrier() |
16 | #define heavy_mb() synchronize_sched() | 16 | #define heavy_mb() synchronize_sched_expedited() |
17 | 17 | ||
18 | static inline void percpu_down_read(struct percpu_rw_semaphore *p) | 18 | static inline void percpu_down_read(struct percpu_rw_semaphore *p) |
19 | { | 19 | { |
@@ -51,7 +51,7 @@ static inline void percpu_down_write(struct percpu_rw_semaphore *p) | |||
51 | { | 51 | { |
52 | mutex_lock(&p->mtx); | 52 | mutex_lock(&p->mtx); |
53 | p->locked = true; | 53 | p->locked = true; |
54 | synchronize_sched(); /* make sure that all readers exit the rcu_read_lock_sched region */ | 54 | synchronize_sched_expedited(); /* make sure that all readers exit the rcu_read_lock_sched region */ |
55 | while (__percpu_count(p->counters)) | 55 | while (__percpu_count(p->counters)) |
56 | msleep(1); | 56 | msleep(1); |
57 | heavy_mb(); /* C, between read of p->counter and write to data, paired with B */ | 57 | heavy_mb(); /* C, between read of p->counter and write to data, paired with B */ |
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index 4f0abb9f1c09..47a1bdd88878 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h | |||
@@ -46,11 +46,11 @@ | |||
46 | * @PIN_CONFIG_DRIVE_OPEN_SOURCE: the pin will be driven with open source | 46 | * @PIN_CONFIG_DRIVE_OPEN_SOURCE: the pin will be driven with open source |
47 | * (open emitter). Sending this config will enabale open drain mode, the | 47 | * (open emitter). Sending this config will enabale open drain mode, the |
48 | * argument is ignored. | 48 | * argument is ignored. |
49 | * @PIN_CONFIG_INPUT_SCHMITT_DISABLE: disable schmitt-trigger mode on the pin. | ||
49 | * @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in | 50 | * @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in |
50 | * schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis, | 51 | * schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis, |
51 | * the threshold value is given on a custom format as argument when | 52 | * the threshold value is given on a custom format as argument when |
52 | * setting pins to this mode. The argument zero turns the schmitt trigger | 53 | * setting pins to this mode. |
53 | * off. | ||
54 | * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode, | 54 | * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode, |
55 | * which means it will wait for signals to settle when reading inputs. The | 55 | * which means it will wait for signals to settle when reading inputs. The |
56 | * argument gives the debounce time on a custom format. Setting the | 56 | * argument gives the debounce time on a custom format. Setting the |
@@ -74,6 +74,7 @@ enum pin_config_param { | |||
74 | PIN_CONFIG_DRIVE_PUSH_PULL, | 74 | PIN_CONFIG_DRIVE_PUSH_PULL, |
75 | PIN_CONFIG_DRIVE_OPEN_DRAIN, | 75 | PIN_CONFIG_DRIVE_OPEN_DRAIN, |
76 | PIN_CONFIG_DRIVE_OPEN_SOURCE, | 76 | PIN_CONFIG_DRIVE_OPEN_SOURCE, |
77 | PIN_CONFIG_INPUT_SCHMITT_DISABLE, | ||
77 | PIN_CONFIG_INPUT_SCHMITT, | 78 | PIN_CONFIG_INPUT_SCHMITT, |
78 | PIN_CONFIG_INPUT_DEBOUNCE, | 79 | PIN_CONFIG_INPUT_DEBOUNCE, |
79 | PIN_CONFIG_POWER_SOURCE, | 80 | PIN_CONFIG_POWER_SOURCE, |
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 7d087f03e91e..04d6700d99af 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
@@ -134,6 +134,25 @@ extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev, | |||
134 | extern void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev, | 134 | extern void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev, |
135 | struct pinctrl_gpio_range *ranges, | 135 | struct pinctrl_gpio_range *ranges, |
136 | unsigned nranges); | 136 | unsigned nranges); |
137 | extern void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev, | ||
138 | struct pinctrl_gpio_range *range); | ||
139 | |||
140 | extern struct pinctrl_dev *pinctrl_find_and_add_gpio_range(const char *devname, | ||
141 | struct pinctrl_gpio_range *range); | ||
142 | extern struct pinctrl_gpio_range * | ||
143 | pinctrl_find_gpio_range_from_pin(struct pinctrl_dev *pctldev, | ||
144 | unsigned int pin); | ||
145 | |||
146 | #ifdef CONFIG_OF | ||
147 | extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np); | ||
148 | #else | ||
149 | static inline | ||
150 | struct pinctrl_dev *of_pinctrl_get(struct device_node *np) | ||
151 | { | ||
152 | return NULL; | ||
153 | } | ||
154 | #endif /* CONFIG_OF */ | ||
155 | |||
137 | extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); | 156 | extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); |
138 | extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); | 157 | extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); |
139 | #else | 158 | #else |
diff --git a/include/linux/platform_data/ad5449.h b/include/linux/platform_data/ad5449.h new file mode 100644 index 000000000000..bd712bd4b94e --- /dev/null +++ b/include/linux/platform_data/ad5449.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * AD5415, AD5426, AD5429, AD5432, AD5439, AD5443, AD5449 Digital to Analog | ||
3 | * Converter driver. | ||
4 | * | ||
5 | * Copyright 2012 Analog Devices Inc. | ||
6 | * Author: Lars-Peter Clausen <lars@metafoo.de> | ||
7 | * | ||
8 | * Licensed under the GPL-2. | ||
9 | */ | ||
10 | |||
11 | #ifndef __LINUX_PLATFORM_DATA_AD5449_H__ | ||
12 | #define __LINUX_PLATFORM_DATA_AD5449_H__ | ||
13 | |||
14 | /** | ||
15 | * enum ad5449_sdo_mode - AD5449 SDO pin configuration | ||
16 | * @AD5449_SDO_DRIVE_FULL: Drive the SDO pin with full strength. | ||
17 | * @AD5449_SDO_DRIVE_WEAK: Drive the SDO pin with not full strength. | ||
18 | * @AD5449_SDO_OPEN_DRAIN: Operate the SDO pin in open-drain mode. | ||
19 | * @AD5449_SDO_DISABLED: Disable the SDO pin, in this mode it is not possible to | ||
20 | * read back from the device. | ||
21 | */ | ||
22 | enum ad5449_sdo_mode { | ||
23 | AD5449_SDO_DRIVE_FULL = 0x0, | ||
24 | AD5449_SDO_DRIVE_WEAK = 0x1, | ||
25 | AD5449_SDO_OPEN_DRAIN = 0x2, | ||
26 | AD5449_SDO_DISABLED = 0x3, | ||
27 | }; | ||
28 | |||
29 | /** | ||
30 | * struct ad5449_platform_data - Platform data for the ad5449 DAC driver | ||
31 | * @sdo_mode: SDO pin mode | ||
32 | * @hardware_clear_to_midscale: Whether asserting the hardware CLR pin sets the | ||
33 | * outputs to midscale (true) or to zero scale(false). | ||
34 | */ | ||
35 | struct ad5449_platform_data { | ||
36 | enum ad5449_sdo_mode sdo_mode; | ||
37 | bool hardware_clear_to_midscale; | ||
38 | }; | ||
39 | |||
40 | #endif | ||
diff --git a/include/linux/platform_data/ad7298.h b/include/linux/platform_data/ad7298.h new file mode 100644 index 000000000000..fbf8adf1363a --- /dev/null +++ b/include/linux/platform_data/ad7298.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * AD7298 SPI ADC driver | ||
3 | * | ||
4 | * Copyright 2011 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2. | ||
7 | */ | ||
8 | |||
9 | #ifndef __LINUX_PLATFORM_DATA_AD7298_H__ | ||
10 | #define __LINUX_PLATFORM_DATA_AD7298_H__ | ||
11 | |||
12 | /** | ||
13 | * struct ad7298_platform_data - Platform data for the ad7298 ADC driver | ||
14 | * @ext_ref: Whether to use an external reference voltage. | ||
15 | **/ | ||
16 | struct ad7298_platform_data { | ||
17 | bool ext_ref; | ||
18 | }; | ||
19 | |||
20 | #endif /* IIO_ADC_AD7298_H_ */ | ||
diff --git a/include/linux/platform_data/ad7793.h b/include/linux/platform_data/ad7793.h new file mode 100644 index 000000000000..7ea6751aae6d --- /dev/null +++ b/include/linux/platform_data/ad7793.h | |||
@@ -0,0 +1,112 @@ | |||
1 | /* | ||
2 | * AD7792/AD7793 SPI ADC driver | ||
3 | * | ||
4 | * Copyright 2011 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2. | ||
7 | */ | ||
8 | #ifndef __LINUX_PLATFORM_DATA_AD7793_H__ | ||
9 | #define __LINUX_PLATFORM_DATA_AD7793_H__ | ||
10 | |||
11 | /** | ||
12 | * enum ad7793_clock_source - AD7793 clock source selection | ||
13 | * @AD7793_CLK_SRC_INT: Internal 64 kHz clock, not available at the CLK pin. | ||
14 | * @AD7793_CLK_SRC_INT_CO: Internal 64 kHz clock, available at the CLK pin. | ||
15 | * @AD7793_CLK_SRC_EXT: Use external clock. | ||
16 | * @AD7793_CLK_SRC_EXT_DIV2: Use external clock divided by 2. | ||
17 | */ | ||
18 | enum ad7793_clock_source { | ||
19 | AD7793_CLK_SRC_INT, | ||
20 | AD7793_CLK_SRC_INT_CO, | ||
21 | AD7793_CLK_SRC_EXT, | ||
22 | AD7793_CLK_SRC_EXT_DIV2, | ||
23 | }; | ||
24 | |||
25 | /** | ||
26 | * enum ad7793_bias_voltage - AD7793 bias voltage selection | ||
27 | * @AD7793_BIAS_VOLTAGE_DISABLED: Bias voltage generator disabled | ||
28 | * @AD7793_BIAS_VOLTAGE_AIN1: Bias voltage connected to AIN1(-). | ||
29 | * @AD7793_BIAS_VOLTAGE_AIN2: Bias voltage connected to AIN2(-). | ||
30 | * @AD7793_BIAS_VOLTAGE_AIN3: Bias voltage connected to AIN3(-). | ||
31 | * Only valid for AD7795/AD7796. | ||
32 | */ | ||
33 | enum ad7793_bias_voltage { | ||
34 | AD7793_BIAS_VOLTAGE_DISABLED, | ||
35 | AD7793_BIAS_VOLTAGE_AIN1, | ||
36 | AD7793_BIAS_VOLTAGE_AIN2, | ||
37 | AD7793_BIAS_VOLTAGE_AIN3, | ||
38 | }; | ||
39 | |||
40 | /** | ||
41 | * enum ad7793_refsel - AD7793 reference voltage selection | ||
42 | * @AD7793_REFSEL_REFIN1: External reference applied between REFIN1(+) | ||
43 | * and REFIN1(-). | ||
44 | * @AD7793_REFSEL_REFIN2: External reference applied between REFIN2(+) and | ||
45 | * and REFIN1(-). Only valid for AD7795/AD7796. | ||
46 | * @AD7793_REFSEL_INTERNAL: Internal 1.17 V reference. | ||
47 | */ | ||
48 | enum ad7793_refsel { | ||
49 | AD7793_REFSEL_REFIN1 = 0, | ||
50 | AD7793_REFSEL_REFIN2 = 1, | ||
51 | AD7793_REFSEL_INTERNAL = 2, | ||
52 | }; | ||
53 | |||
54 | /** | ||
55 | * enum ad7793_current_source_direction - AD7793 excitation current direction | ||
56 | * @AD7793_IEXEC1_IOUT1_IEXEC2_IOUT2: Current source IEXC1 connected to pin | ||
57 | * IOUT1, current source IEXC2 connected to pin IOUT2. | ||
58 | * @AD7793_IEXEC1_IOUT2_IEXEC2_IOUT1: Current source IEXC2 connected to pin | ||
59 | * IOUT1, current source IEXC1 connected to pin IOUT2. | ||
60 | * @AD7793_IEXEC1_IEXEC2_IOUT1: Both current sources connected to pin IOUT1. | ||
61 | * Only valid when the current sources are set to 10 uA or 210 uA. | ||
62 | * @AD7793_IEXEC1_IEXEC2_IOUT2: Both current sources connected to Pin IOUT2. | ||
63 | * Only valid when the current ources are set to 10 uA or 210 uA. | ||
64 | */ | ||
65 | enum ad7793_current_source_direction { | ||
66 | AD7793_IEXEC1_IOUT1_IEXEC2_IOUT2 = 0, | ||
67 | AD7793_IEXEC1_IOUT2_IEXEC2_IOUT1 = 1, | ||
68 | AD7793_IEXEC1_IEXEC2_IOUT1 = 2, | ||
69 | AD7793_IEXEC1_IEXEC2_IOUT2 = 3, | ||
70 | }; | ||
71 | |||
72 | /** | ||
73 | * enum ad7793_excitation_current - AD7793 excitation current selection | ||
74 | * @AD7793_IX_DISABLED: Excitation current Disabled. | ||
75 | * @AD7793_IX_10uA: Enable 10 micro-ampere excitation current. | ||
76 | * @AD7793_IX_210uA: Enable 210 micro-ampere excitation current. | ||
77 | * @AD7793_IX_1mA: Enable 1 milli-Ampere excitation current. | ||
78 | */ | ||
79 | enum ad7793_excitation_current { | ||
80 | AD7793_IX_DISABLED = 0, | ||
81 | AD7793_IX_10uA = 1, | ||
82 | AD7793_IX_210uA = 2, | ||
83 | AD7793_IX_1mA = 3, | ||
84 | }; | ||
85 | |||
86 | /** | ||
87 | * struct ad7793_platform_data - AD7793 platform data | ||
88 | * @clock_src: Clock source selection | ||
89 | * @burnout_current: If set to true the 100nA burnout current is enabled. | ||
90 | * @boost_enable: Enable boost for the bias voltage generator. | ||
91 | * @buffered: If set to true configure the device for buffered input mode. | ||
92 | * @unipolar: If set to true sample in unipolar mode, if set to false sample in | ||
93 | * bipolar mode. | ||
94 | * @refsel: Reference voltage selection | ||
95 | * @bias_voltage: Bias voltage selection | ||
96 | * @exitation_current: Excitation current selection | ||
97 | * @current_source_direction: Excitation current direction selection | ||
98 | */ | ||
99 | struct ad7793_platform_data { | ||
100 | enum ad7793_clock_source clock_src; | ||
101 | bool burnout_current; | ||
102 | bool boost_enable; | ||
103 | bool buffered; | ||
104 | bool unipolar; | ||
105 | |||
106 | enum ad7793_refsel refsel; | ||
107 | enum ad7793_bias_voltage bias_voltage; | ||
108 | enum ad7793_excitation_current exitation_current; | ||
109 | enum ad7793_current_source_direction current_source_direction; | ||
110 | }; | ||
111 | |||
112 | #endif /* IIO_ADC_AD7793_H_ */ | ||
diff --git a/include/linux/platform_data/ad7887.h b/include/linux/platform_data/ad7887.h new file mode 100644 index 000000000000..1e06eac3174d --- /dev/null +++ b/include/linux/platform_data/ad7887.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * AD7887 SPI ADC driver | ||
3 | * | ||
4 | * Copyright 2010 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2 or later. | ||
7 | */ | ||
8 | #ifndef IIO_ADC_AD7887_H_ | ||
9 | #define IIO_ADC_AD7887_H_ | ||
10 | |||
11 | /** | ||
12 | * struct ad7887_platform_data - AD7887 ADC driver platform data | ||
13 | * @en_dual: Whether to use dual channel mode. If set to true AIN1 becomes the | ||
14 | * second input channel, and Vref is internally connected to Vdd. If set to | ||
15 | * false the device is used in single channel mode and AIN1/Vref is used as | ||
16 | * VREF input. | ||
17 | * @use_onchip_ref: Whether to use the onchip reference. If set to true the | ||
18 | * internal 2.5V reference is used. If set to false a external reference is | ||
19 | * used. | ||
20 | */ | ||
21 | struct ad7887_platform_data { | ||
22 | bool en_dual; | ||
23 | bool use_onchip_ref; | ||
24 | }; | ||
25 | |||
26 | #endif /* IIO_ADC_AD7887_H_ */ | ||
diff --git a/include/linux/platform_data/ads7828.h b/include/linux/platform_data/ads7828.h new file mode 100644 index 000000000000..3245f45f9d77 --- /dev/null +++ b/include/linux/platform_data/ads7828.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * TI ADS7828 A/D Converter platform data definition | ||
3 | * | ||
4 | * Copyright (c) 2012 Savoir-faire Linux Inc. | ||
5 | * Vivien Didelot <vivien.didelot@savoirfairelinux.com> | ||
6 | * | ||
7 | * For further information, see the Documentation/hwmon/ads7828 file. | ||
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 version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef _PDATA_ADS7828_H | ||
15 | #define _PDATA_ADS7828_H | ||
16 | |||
17 | /** | ||
18 | * struct ads7828_platform_data - optional ADS7828 connectivity info | ||
19 | * @diff_input: Differential input mode. | ||
20 | * @ext_vref: Use an external voltage reference. | ||
21 | * @vref_mv: Voltage reference value, if external. | ||
22 | */ | ||
23 | struct ads7828_platform_data { | ||
24 | bool diff_input; | ||
25 | bool ext_vref; | ||
26 | unsigned int vref_mv; | ||
27 | }; | ||
28 | |||
29 | #endif /* _PDATA_ADS7828_H */ | ||
diff --git a/include/linux/platform_data/atmel.h b/include/linux/platform_data/atmel.h index b0f2c56a8ea2..6a293b7fff3b 100644 --- a/include/linux/platform_data/atmel.h +++ b/include/linux/platform_data/atmel.h | |||
@@ -8,6 +8,55 @@ | |||
8 | #define __ATMEL_H__ | 8 | #define __ATMEL_H__ |
9 | 9 | ||
10 | #include <linux/mtd/nand.h> | 10 | #include <linux/mtd/nand.h> |
11 | #include <linux/mtd/partitions.h> | ||
12 | #include <linux/device.h> | ||
13 | #include <linux/i2c.h> | ||
14 | #include <linux/leds.h> | ||
15 | #include <linux/spi/spi.h> | ||
16 | #include <linux/usb/atmel_usba_udc.h> | ||
17 | #include <linux/atmel-mci.h> | ||
18 | #include <sound/atmel-ac97c.h> | ||
19 | #include <linux/serial.h> | ||
20 | #include <linux/platform_data/macb.h> | ||
21 | |||
22 | /* | ||
23 | * at91: 6 USARTs and one DBGU port (SAM9260) | ||
24 | * avr32: 4 | ||
25 | */ | ||
26 | #define ATMEL_MAX_UART 7 | ||
27 | |||
28 | /* USB Device */ | ||
29 | struct at91_udc_data { | ||
30 | int vbus_pin; /* high == host powering us */ | ||
31 | u8 vbus_active_low; /* vbus polarity */ | ||
32 | u8 vbus_polled; /* Use polling, not interrupt */ | ||
33 | int pullup_pin; /* active == D+ pulled up */ | ||
34 | u8 pullup_active_low; /* true == pullup_pin is active low */ | ||
35 | }; | ||
36 | |||
37 | /* Compact Flash */ | ||
38 | struct at91_cf_data { | ||
39 | int irq_pin; /* I/O IRQ */ | ||
40 | int det_pin; /* Card detect */ | ||
41 | int vcc_pin; /* power switching */ | ||
42 | int rst_pin; /* card reset */ | ||
43 | u8 chipselect; /* EBI Chip Select number */ | ||
44 | u8 flags; | ||
45 | #define AT91_CF_TRUE_IDE 0x01 | ||
46 | #define AT91_IDE_SWAP_A0_A2 0x02 | ||
47 | }; | ||
48 | |||
49 | /* USB Host */ | ||
50 | #define AT91_MAX_USBH_PORTS 3 | ||
51 | struct at91_usbh_data { | ||
52 | int vbus_pin[AT91_MAX_USBH_PORTS]; /* port power-control pin */ | ||
53 | int overcurrent_pin[AT91_MAX_USBH_PORTS]; | ||
54 | u8 ports; /* number of ports on root hub */ | ||
55 | u8 overcurrent_supported; | ||
56 | u8 vbus_pin_active_low[AT91_MAX_USBH_PORTS]; | ||
57 | u8 overcurrent_status[AT91_MAX_USBH_PORTS]; | ||
58 | u8 overcurrent_changed[AT91_MAX_USBH_PORTS]; | ||
59 | }; | ||
11 | 60 | ||
12 | /* NAND / SmartMedia */ | 61 | /* NAND / SmartMedia */ |
13 | struct atmel_nand_data { | 62 | struct atmel_nand_data { |
@@ -24,4 +73,28 @@ struct atmel_nand_data { | |||
24 | unsigned int num_parts; | 73 | unsigned int num_parts; |
25 | }; | 74 | }; |
26 | 75 | ||
76 | /* Serial */ | ||
77 | struct atmel_uart_data { | ||
78 | int num; /* port num */ | ||
79 | short use_dma_tx; /* use transmit DMA? */ | ||
80 | short use_dma_rx; /* use receive DMA? */ | ||
81 | void __iomem *regs; /* virt. base address, if any */ | ||
82 | struct serial_rs485 rs485; /* rs485 settings */ | ||
83 | }; | ||
84 | |||
85 | /* Touchscreen Controller */ | ||
86 | struct at91_tsadcc_data { | ||
87 | unsigned int adc_clock; | ||
88 | u8 pendet_debounce; | ||
89 | u8 ts_sample_hold_time; | ||
90 | }; | ||
91 | |||
92 | /* CAN */ | ||
93 | struct at91_can_data { | ||
94 | void (*transceiver_switch)(int on); | ||
95 | }; | ||
96 | |||
97 | /* FIXME: this needs a better location, but gets stuff building again */ | ||
98 | extern int at91_suspend_entering_slow_clock(void); | ||
99 | |||
27 | #endif /* __ATMEL_H__ */ | 100 | #endif /* __ATMEL_H__ */ |
diff --git a/include/linux/platform_data/clk-integrator.h b/include/linux/platform_data/clk-integrator.h index 83fe9c283bb8..280edac9d0a5 100644 --- a/include/linux/platform_data/clk-integrator.h +++ b/include/linux/platform_data/clk-integrator.h | |||
@@ -1 +1,3 @@ | |||
1 | void integrator_clk_init(bool is_cp); | 1 | void integrator_clk_init(bool is_cp); |
2 | void integrator_impd1_clk_init(void __iomem *base, unsigned int id); | ||
3 | void integrator_impd1_clk_exit(unsigned int id); | ||
diff --git a/include/linux/platform_data/db8500_thermal.h b/include/linux/platform_data/db8500_thermal.h new file mode 100644 index 000000000000..3bf60902e902 --- /dev/null +++ b/include/linux/platform_data/db8500_thermal.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * db8500_thermal.h - DB8500 Thermal Management Implementation | ||
3 | * | ||
4 | * Copyright (C) 2012 ST-Ericsson | ||
5 | * Copyright (C) 2012 Linaro Ltd. | ||
6 | * | ||
7 | * Author: Hongbo Zhang <hongbo.zhang@linaro.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; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | */ | ||
19 | |||
20 | #ifndef _DB8500_THERMAL_H_ | ||
21 | #define _DB8500_THERMAL_H_ | ||
22 | |||
23 | #include <linux/thermal.h> | ||
24 | |||
25 | #define COOLING_DEV_MAX 8 | ||
26 | |||
27 | struct db8500_trip_point { | ||
28 | unsigned long temp; | ||
29 | enum thermal_trip_type type; | ||
30 | char cdev_name[COOLING_DEV_MAX][THERMAL_NAME_LENGTH]; | ||
31 | }; | ||
32 | |||
33 | struct db8500_thsens_platform_data { | ||
34 | struct db8500_trip_point trip_points[THERMAL_MAX_TRIPS]; | ||
35 | int num_trips; | ||
36 | }; | ||
37 | |||
38 | #endif /* _DB8500_THERMAL_H_ */ | ||
diff --git a/include/linux/platform_data/dmtimer-omap.h b/include/linux/platform_data/dmtimer-omap.h new file mode 100644 index 000000000000..a19b78d826e9 --- /dev/null +++ b/include/linux/platform_data/dmtimer-omap.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * DMTIMER platform data for TI OMAP platforms | ||
3 | * | ||
4 | * Copyright (C) 2012 Texas Instruments | ||
5 | * Author: Jon Hunter <jon-hunter@ti.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along with | ||
17 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #ifndef __PLATFORM_DATA_DMTIMER_OMAP_H__ | ||
21 | #define __PLATFORM_DATA_DMTIMER_OMAP_H__ | ||
22 | |||
23 | struct dmtimer_platform_data { | ||
24 | /* set_timer_src - Only used for OMAP1 devices */ | ||
25 | int (*set_timer_src)(struct platform_device *pdev, int source); | ||
26 | u32 timer_capability; | ||
27 | u32 timer_errata; | ||
28 | int (*get_context_loss_count)(struct device *); | ||
29 | }; | ||
30 | |||
31 | #endif /* __PLATFORM_DATA_DMTIMER_OMAP_H__ */ | ||
diff --git a/include/linux/platform_data/gpio-omap.h b/include/linux/platform_data/gpio-omap.h index e8741c2678d5..5d50b25a73d7 100644 --- a/include/linux/platform_data/gpio-omap.h +++ b/include/linux/platform_data/gpio-omap.h | |||
@@ -26,7 +26,6 @@ | |||
26 | 26 | ||
27 | #include <linux/io.h> | 27 | #include <linux/io.h> |
28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
29 | #include <mach/irqs.h> | ||
30 | 29 | ||
31 | #define OMAP1_MPUIO_BASE 0xfffb5000 | 30 | #define OMAP1_MPUIO_BASE 0xfffb5000 |
32 | 31 | ||
diff --git a/include/linux/platform_data/gpio-ts5500.h b/include/linux/platform_data/gpio-ts5500.h new file mode 100644 index 000000000000..b10d11c9bb49 --- /dev/null +++ b/include/linux/platform_data/gpio-ts5500.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * GPIO (DIO) header for Technologic Systems TS-5500 | ||
3 | * | ||
4 | * Copyright (c) 2012 Savoir-faire Linux Inc. | ||
5 | * Vivien Didelot <vivien.didelot@savoirfairelinux.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef _PDATA_GPIO_TS5500_H | ||
13 | #define _PDATA_GPIO_TS5500_H | ||
14 | |||
15 | /** | ||
16 | * struct ts5500_dio_platform_data - TS-5500 pin block configuration | ||
17 | * @base: The GPIO base number to use. | ||
18 | * @strap: The only pin connected to an interrupt in a block is input-only. | ||
19 | * If you need a bidirectional line which can trigger an IRQ, you | ||
20 | * may strap it with an in/out pin. This flag indicates this case. | ||
21 | */ | ||
22 | struct ts5500_dio_platform_data { | ||
23 | int base; | ||
24 | bool strap; | ||
25 | }; | ||
26 | |||
27 | #endif /* _PDATA_GPIO_TS5500_H */ | ||
diff --git a/include/linux/platform_data/iommu-omap.h b/include/linux/platform_data/iommu-omap.h new file mode 100644 index 000000000000..c677b9f2fefa --- /dev/null +++ b/include/linux/platform_data/iommu-omap.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * omap iommu: main structures | ||
3 | * | ||
4 | * Copyright (C) 2008-2009 Nokia Corporation | ||
5 | * | ||
6 | * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #define MMU_REG_SIZE 256 | ||
14 | |||
15 | /** | ||
16 | * struct iommu_arch_data - omap iommu private data | ||
17 | * @name: name of the iommu device | ||
18 | * @iommu_dev: handle of the iommu device | ||
19 | * | ||
20 | * This is an omap iommu private data object, which binds an iommu user | ||
21 | * to its iommu device. This object should be placed at the iommu user's | ||
22 | * dev_archdata so generic IOMMU API can be used without having to | ||
23 | * utilize omap-specific plumbing anymore. | ||
24 | */ | ||
25 | struct omap_iommu_arch_data { | ||
26 | const char *name; | ||
27 | struct omap_iommu *iommu_dev; | ||
28 | }; | ||
29 | |||
30 | /** | ||
31 | * struct omap_mmu_dev_attr - OMAP mmu device attributes for omap_hwmod | ||
32 | * @da_start: device address where the va space starts. | ||
33 | * @da_end: device address where the va space ends. | ||
34 | * @nr_tlb_entries: number of entries supported by the translation | ||
35 | * look-aside buffer (TLB). | ||
36 | */ | ||
37 | struct omap_mmu_dev_attr { | ||
38 | u32 da_start; | ||
39 | u32 da_end; | ||
40 | int nr_tlb_entries; | ||
41 | }; | ||
42 | |||
43 | struct iommu_platform_data { | ||
44 | const char *name; | ||
45 | const char *clk_name; | ||
46 | const int nr_tlb_entries; | ||
47 | u32 da_start; | ||
48 | u32 da_end; | ||
49 | }; | ||
diff --git a/include/linux/platform_data/leds-omap.h b/include/linux/platform_data/leds-omap.h new file mode 100644 index 000000000000..56c9b2a0ada5 --- /dev/null +++ b/include/linux/platform_data/leds-omap.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006 Samsung Electronics | ||
3 | * Kyungmin Park <kyungmin.park@samsung.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | #ifndef ASMARM_ARCH_LED_H | ||
10 | #define ASMARM_ARCH_LED_H | ||
11 | |||
12 | struct omap_led_config { | ||
13 | struct led_classdev cdev; | ||
14 | s16 gpio; | ||
15 | }; | ||
16 | |||
17 | struct omap_led_platform_data { | ||
18 | s16 nr_leds; | ||
19 | struct omap_led_config *leds; | ||
20 | }; | ||
21 | |||
22 | #endif | ||
diff --git a/include/linux/platform_data/mmc-omap.h b/include/linux/platform_data/mmc-omap.h new file mode 100644 index 000000000000..2bf1b30cb5dc --- /dev/null +++ b/include/linux/platform_data/mmc-omap.h | |||
@@ -0,0 +1,151 @@ | |||
1 | /* | ||
2 | * MMC definitions for OMAP2 | ||
3 | * | ||
4 | * Copyright (C) 2006 Nokia Corporation | ||
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 | |||
11 | #define OMAP_MMC_MAX_SLOTS 2 | ||
12 | |||
13 | /* | ||
14 | * struct omap_mmc_dev_attr.flags possibilities | ||
15 | * | ||
16 | * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can | ||
17 | * operate with either 1.8Vdc or 3.0Vdc card voltages; this flag | ||
18 | * should be set if this is the case. See for example Section 22.5.3 | ||
19 | * "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia | ||
20 | * Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R). | ||
21 | * | ||
22 | * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers | ||
23 | * don't work correctly on some MMC controller instances on some | ||
24 | * OMAP3 SoCs; this flag should be set if this is the case. See | ||
25 | * for example Advisory 2.1.1.128 "MMC: Multiple Block Read | ||
26 | * Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_ | ||
27 | * Revision F (October 2010) (SPRZ278F). | ||
28 | */ | ||
29 | #define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0) | ||
30 | #define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1) | ||
31 | |||
32 | struct mmc_card; | ||
33 | |||
34 | struct omap_mmc_dev_attr { | ||
35 | u8 flags; | ||
36 | }; | ||
37 | |||
38 | struct omap_mmc_platform_data { | ||
39 | /* back-link to device */ | ||
40 | struct device *dev; | ||
41 | |||
42 | /* number of slots per controller */ | ||
43 | unsigned nr_slots:2; | ||
44 | |||
45 | /* set if your board has components or wiring that limits the | ||
46 | * maximum frequency on the MMC bus */ | ||
47 | unsigned int max_freq; | ||
48 | |||
49 | /* switch the bus to a new slot */ | ||
50 | int (*switch_slot)(struct device *dev, int slot); | ||
51 | /* initialize board-specific MMC functionality, can be NULL if | ||
52 | * not supported */ | ||
53 | int (*init)(struct device *dev); | ||
54 | void (*cleanup)(struct device *dev); | ||
55 | void (*shutdown)(struct device *dev); | ||
56 | |||
57 | /* To handle board related suspend/resume functionality for MMC */ | ||
58 | int (*suspend)(struct device *dev, int slot); | ||
59 | int (*resume)(struct device *dev, int slot); | ||
60 | |||
61 | /* Return context loss count due to PM states changing */ | ||
62 | int (*get_context_loss_count)(struct device *dev); | ||
63 | |||
64 | /* Integrating attributes from the omap_hwmod layer */ | ||
65 | u8 controller_flags; | ||
66 | |||
67 | /* Register offset deviation */ | ||
68 | u16 reg_offset; | ||
69 | |||
70 | struct omap_mmc_slot_data { | ||
71 | |||
72 | /* | ||
73 | * 4/8 wires and any additional host capabilities | ||
74 | * need to OR'd all capabilities (ref. linux/mmc/host.h) | ||
75 | */ | ||
76 | u8 wires; /* Used for the MMC driver on omap1 and 2420 */ | ||
77 | u32 caps; /* Used for the MMC driver on 2430 and later */ | ||
78 | u32 pm_caps; /* PM capabilities of the mmc */ | ||
79 | |||
80 | /* | ||
81 | * nomux means "standard" muxing is wrong on this board, and | ||
82 | * that board-specific code handled it before common init logic. | ||
83 | */ | ||
84 | unsigned nomux:1; | ||
85 | |||
86 | /* switch pin can be for card detect (default) or card cover */ | ||
87 | unsigned cover:1; | ||
88 | |||
89 | /* use the internal clock */ | ||
90 | unsigned internal_clock:1; | ||
91 | |||
92 | /* nonremovable e.g. eMMC */ | ||
93 | unsigned nonremovable:1; | ||
94 | |||
95 | /* Try to sleep or power off when possible */ | ||
96 | unsigned power_saving:1; | ||
97 | |||
98 | /* If using power_saving and the MMC power is not to go off */ | ||
99 | unsigned no_off:1; | ||
100 | |||
101 | /* eMMC does not handle power off when not in sleep state */ | ||
102 | unsigned no_regulator_off_init:1; | ||
103 | |||
104 | /* Regulator off remapped to sleep */ | ||
105 | unsigned vcc_aux_disable_is_sleep:1; | ||
106 | |||
107 | /* we can put the features above into this variable */ | ||
108 | #define HSMMC_HAS_PBIAS (1 << 0) | ||
109 | #define HSMMC_HAS_UPDATED_RESET (1 << 1) | ||
110 | #define HSMMC_HAS_HSPE_SUPPORT (1 << 2) | ||
111 | #define MMC_OMAP7XX (1 << 3) | ||
112 | #define MMC_OMAP15XX (1 << 4) | ||
113 | #define MMC_OMAP16XX (1 << 5) | ||
114 | unsigned features; | ||
115 | |||
116 | int switch_pin; /* gpio (card detect) */ | ||
117 | int gpio_wp; /* gpio (write protect) */ | ||
118 | |||
119 | int (*set_bus_mode)(struct device *dev, int slot, int bus_mode); | ||
120 | int (*set_power)(struct device *dev, int slot, | ||
121 | int power_on, int vdd); | ||
122 | int (*get_ro)(struct device *dev, int slot); | ||
123 | void (*remux)(struct device *dev, int slot, int power_on); | ||
124 | /* Call back before enabling / disabling regulators */ | ||
125 | void (*before_set_reg)(struct device *dev, int slot, | ||
126 | int power_on, int vdd); | ||
127 | /* Call back after enabling / disabling regulators */ | ||
128 | void (*after_set_reg)(struct device *dev, int slot, | ||
129 | int power_on, int vdd); | ||
130 | /* if we have special card, init it using this callback */ | ||
131 | void (*init_card)(struct mmc_card *card); | ||
132 | |||
133 | /* return MMC cover switch state, can be NULL if not supported. | ||
134 | * | ||
135 | * possible return values: | ||
136 | * 0 - closed | ||
137 | * 1 - open | ||
138 | */ | ||
139 | int (*get_cover_state)(struct device *dev, int slot); | ||
140 | |||
141 | const char *name; | ||
142 | u32 ocr_mask; | ||
143 | |||
144 | /* Card detection IRQs */ | ||
145 | int card_detect_irq; | ||
146 | int (*card_detect)(struct device *dev, int slot); | ||
147 | |||
148 | unsigned int ban_openended:1; | ||
149 | |||
150 | } slots[OMAP_MMC_MAX_SLOTS]; | ||
151 | }; | ||
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h index 1a68c1e5fe53..24d32ca34bef 100644 --- a/include/linux/platform_data/mtd-nand-omap2.h +++ b/include/linux/platform_data/mtd-nand-omap2.h | |||
@@ -8,9 +8,13 @@ | |||
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <plat/gpmc.h> | 11 | #ifndef _MTD_NAND_OMAP2_H |
12 | #define _MTD_NAND_OMAP2_H | ||
13 | |||
12 | #include <linux/mtd/partitions.h> | 14 | #include <linux/mtd/partitions.h> |
13 | 15 | ||
16 | #define GPMC_BCH_NUM_REMAINDER 8 | ||
17 | |||
14 | enum nand_io { | 18 | enum nand_io { |
15 | NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */ | 19 | NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */ |
16 | NAND_OMAP_POLLED, /* polled mode, without prefetch */ | 20 | NAND_OMAP_POLLED, /* polled mode, without prefetch */ |
@@ -18,10 +22,38 @@ enum nand_io { | |||
18 | NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */ | 22 | NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */ |
19 | }; | 23 | }; |
20 | 24 | ||
25 | enum omap_ecc { | ||
26 | /* 1-bit ecc: stored at end of spare area */ | ||
27 | OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */ | ||
28 | OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */ | ||
29 | /* 1-bit ecc: stored at beginning of spare area as romcode */ | ||
30 | OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */ | ||
31 | OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */ | ||
32 | OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */ | ||
33 | }; | ||
34 | |||
35 | struct gpmc_nand_regs { | ||
36 | void __iomem *gpmc_status; | ||
37 | void __iomem *gpmc_nand_command; | ||
38 | void __iomem *gpmc_nand_address; | ||
39 | void __iomem *gpmc_nand_data; | ||
40 | void __iomem *gpmc_prefetch_config1; | ||
41 | void __iomem *gpmc_prefetch_config2; | ||
42 | void __iomem *gpmc_prefetch_control; | ||
43 | void __iomem *gpmc_prefetch_status; | ||
44 | void __iomem *gpmc_ecc_config; | ||
45 | void __iomem *gpmc_ecc_control; | ||
46 | void __iomem *gpmc_ecc_size_config; | ||
47 | void __iomem *gpmc_ecc1_result; | ||
48 | void __iomem *gpmc_bch_result0[GPMC_BCH_NUM_REMAINDER]; | ||
49 | void __iomem *gpmc_bch_result1[GPMC_BCH_NUM_REMAINDER]; | ||
50 | void __iomem *gpmc_bch_result2[GPMC_BCH_NUM_REMAINDER]; | ||
51 | void __iomem *gpmc_bch_result3[GPMC_BCH_NUM_REMAINDER]; | ||
52 | }; | ||
53 | |||
21 | struct omap_nand_platform_data { | 54 | struct omap_nand_platform_data { |
22 | int cs; | 55 | int cs; |
23 | struct mtd_partition *parts; | 56 | struct mtd_partition *parts; |
24 | struct gpmc_timings *gpmc_t; | ||
25 | int nr_parts; | 57 | int nr_parts; |
26 | bool dev_ready; | 58 | bool dev_ready; |
27 | enum nand_io xfer_type; | 59 | enum nand_io xfer_type; |
@@ -30,14 +62,4 @@ struct omap_nand_platform_data { | |||
30 | struct gpmc_nand_regs reg; | 62 | struct gpmc_nand_regs reg; |
31 | }; | 63 | }; |
32 | 64 | ||
33 | /* minimum size for IO mapping */ | ||
34 | #define NAND_IO_SIZE 4 | ||
35 | |||
36 | #if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE) | ||
37 | extern int gpmc_nand_init(struct omap_nand_platform_data *d); | ||
38 | #else | ||
39 | static inline int gpmc_nand_init(struct omap_nand_platform_data *d) | ||
40 | { | ||
41 | return 0; | ||
42 | } | ||
43 | #endif | 65 | #endif |
diff --git a/include/linux/platform_data/mtd-onenand-omap2.h b/include/linux/platform_data/mtd-onenand-omap2.h index 2858667d2e4f..685af7e8b120 100644 --- a/include/linux/platform_data/mtd-onenand-omap2.h +++ b/include/linux/platform_data/mtd-onenand-omap2.h | |||
@@ -9,17 +9,15 @@ | |||
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifndef __MTD_ONENAND_OMAP2_H | ||
13 | #define __MTD_ONENAND_OMAP2_H | ||
14 | |||
12 | #include <linux/mtd/mtd.h> | 15 | #include <linux/mtd/mtd.h> |
13 | #include <linux/mtd/partitions.h> | 16 | #include <linux/mtd/partitions.h> |
14 | 17 | ||
15 | #define ONENAND_SYNC_READ (1 << 0) | 18 | #define ONENAND_SYNC_READ (1 << 0) |
16 | #define ONENAND_SYNC_READWRITE (1 << 1) | 19 | #define ONENAND_SYNC_READWRITE (1 << 1) |
17 | 20 | #define ONENAND_IN_OMAP34XX (1 << 2) | |
18 | struct onenand_freq_info { | ||
19 | u16 maf_id; | ||
20 | u16 dev_id; | ||
21 | u16 ver_id; | ||
22 | }; | ||
23 | 21 | ||
24 | struct omap_onenand_platform_data { | 22 | struct omap_onenand_platform_data { |
25 | int cs; | 23 | int cs; |
@@ -27,27 +25,9 @@ struct omap_onenand_platform_data { | |||
27 | struct mtd_partition *parts; | 25 | struct mtd_partition *parts; |
28 | int nr_parts; | 26 | int nr_parts; |
29 | int (*onenand_setup)(void __iomem *, int *freq_ptr); | 27 | int (*onenand_setup)(void __iomem *, int *freq_ptr); |
30 | int (*get_freq)(const struct onenand_freq_info *freq_info, | ||
31 | bool *clk_dep); | ||
32 | int dma_channel; | 28 | int dma_channel; |
33 | u8 flags; | 29 | u8 flags; |
34 | u8 regulator_can_sleep; | 30 | u8 regulator_can_sleep; |
35 | u8 skip_initial_unlocking; | 31 | u8 skip_initial_unlocking; |
36 | }; | 32 | }; |
37 | |||
38 | #define ONENAND_MAX_PARTITIONS 8 | ||
39 | |||
40 | #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ | ||
41 | defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) | ||
42 | |||
43 | extern void gpmc_onenand_init(struct omap_onenand_platform_data *d); | ||
44 | |||
45 | #else | ||
46 | |||
47 | #define board_onenand_data NULL | ||
48 | |||
49 | static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d) | ||
50 | { | ||
51 | } | ||
52 | |||
53 | #endif | 33 | #endif |
diff --git a/include/linux/platform_data/omap-wd-timer.h b/include/linux/platform_data/omap-wd-timer.h new file mode 100644 index 000000000000..d75f5f802d98 --- /dev/null +++ b/include/linux/platform_data/omap-wd-timer.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * OMAP2+ WDTIMER-specific function prototypes | ||
3 | * | ||
4 | * Copyright (C) 2012 Texas Instruments, Inc. | ||
5 | * Paul Walmsley | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_PLATFORM_DATA_OMAP_WD_TIMER_H | ||
14 | #define __LINUX_PLATFORM_DATA_OMAP_WD_TIMER_H | ||
15 | |||
16 | #include <linux/types.h> | ||
17 | |||
18 | /* | ||
19 | * Standardized OMAP reset source bits | ||
20 | * | ||
21 | * This is a subset of the ones listed in arch/arm/mach-omap2/prm.h | ||
22 | * and are the only ones needed in the watchdog driver. | ||
23 | */ | ||
24 | #define OMAP_MPU_WD_RST_SRC_ID_SHIFT 3 | ||
25 | |||
26 | /** | ||
27 | * struct omap_wd_timer_platform_data - WDTIMER integration to the host SoC | ||
28 | * @read_reset_sources - fn ptr for the SoC to indicate the last reset cause | ||
29 | * | ||
30 | * The function pointed to by @read_reset_sources must return its data | ||
31 | * in a standard format - search for RST_SRC_ID_SHIFT in | ||
32 | * arch/arm/mach-omap2 | ||
33 | */ | ||
34 | struct omap_wd_timer_platform_data { | ||
35 | u32 (*read_reset_sources)(void); | ||
36 | }; | ||
37 | |||
38 | #endif | ||
diff --git a/include/linux/platform_data/omap_drm.h b/include/linux/platform_data/omap_drm.h index 3da73bdc2031..f4e4a237ebd2 100644 --- a/include/linux/platform_data/omap_drm.h +++ b/include/linux/platform_data/omap_drm.h | |||
@@ -46,6 +46,7 @@ struct omap_kms_platform_data { | |||
46 | }; | 46 | }; |
47 | 47 | ||
48 | struct omap_drm_platform_data { | 48 | struct omap_drm_platform_data { |
49 | uint32_t omaprev; | ||
49 | struct omap_kms_platform_data *kms_pdata; | 50 | struct omap_kms_platform_data *kms_pdata; |
50 | }; | 51 | }; |
51 | 52 | ||
diff --git a/include/linux/platform_data/pinctrl-coh901.h b/include/linux/platform_data/pinctrl-coh901.h index 30dea251b835..dfbc65d10484 100644 --- a/include/linux/platform_data/pinctrl-coh901.h +++ b/include/linux/platform_data/pinctrl-coh901.h | |||
@@ -13,14 +13,10 @@ | |||
13 | * struct u300_gpio_platform - U300 GPIO platform data | 13 | * struct u300_gpio_platform - U300 GPIO platform data |
14 | * @ports: number of GPIO block ports | 14 | * @ports: number of GPIO block ports |
15 | * @gpio_base: first GPIO number for this block (use a free range) | 15 | * @gpio_base: first GPIO number for this block (use a free range) |
16 | * @gpio_irq_base: first GPIO IRQ number for this block (use a free range) | ||
17 | * @pinctrl_device: pin control device to spawn as child | ||
18 | */ | 16 | */ |
19 | struct u300_gpio_platform { | 17 | struct u300_gpio_platform { |
20 | u8 ports; | 18 | u8 ports; |
21 | int gpio_base; | 19 | int gpio_base; |
22 | int gpio_irq_base; | ||
23 | struct platform_device *pinctrl_device; | ||
24 | }; | 20 | }; |
25 | 21 | ||
26 | #endif /* __MACH_U300_GPIO_U300_H */ | 22 | #endif /* __MACH_U300_GPIO_U300_H */ |
diff --git a/include/linux/platform_data/pinctrl-nomadik.h b/include/linux/platform_data/pinctrl-nomadik.h new file mode 100644 index 000000000000..f73b2f0c55b7 --- /dev/null +++ b/include/linux/platform_data/pinctrl-nomadik.h | |||
@@ -0,0 +1,266 @@ | |||
1 | /* | ||
2 | * Structures and registers for GPIO access in the Nomadik SoC | ||
3 | * | ||
4 | * Copyright (C) 2008 STMicroelectronics | ||
5 | * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com> | ||
6 | * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __PLAT_NOMADIK_GPIO | ||
14 | #define __PLAT_NOMADIK_GPIO | ||
15 | |||
16 | /* | ||
17 | * pin configurations are represented by 32-bit integers: | ||
18 | * | ||
19 | * bit 0.. 8 - Pin Number (512 Pins Maximum) | ||
20 | * bit 9..10 - Alternate Function Selection | ||
21 | * bit 11..12 - Pull up/down state | ||
22 | * bit 13 - Sleep mode behaviour | ||
23 | * bit 14 - Direction | ||
24 | * bit 15 - Value (if output) | ||
25 | * bit 16..18 - SLPM pull up/down state | ||
26 | * bit 19..20 - SLPM direction | ||
27 | * bit 21..22 - SLPM Value (if output) | ||
28 | * bit 23..25 - PDIS value (if input) | ||
29 | * bit 26 - Gpio mode | ||
30 | * bit 27 - Sleep mode | ||
31 | * | ||
32 | * to facilitate the definition, the following macros are provided | ||
33 | * | ||
34 | * PIN_CFG_DEFAULT - default config (0): | ||
35 | * pull up/down = disabled | ||
36 | * sleep mode = input/wakeup | ||
37 | * direction = input | ||
38 | * value = low | ||
39 | * SLPM direction = same as normal | ||
40 | * SLPM pull = same as normal | ||
41 | * SLPM value = same as normal | ||
42 | * | ||
43 | * PIN_CFG - default config with alternate function | ||
44 | */ | ||
45 | |||
46 | typedef unsigned long pin_cfg_t; | ||
47 | |||
48 | #define PIN_NUM_MASK 0x1ff | ||
49 | #define PIN_NUM(x) ((x) & PIN_NUM_MASK) | ||
50 | |||
51 | #define PIN_ALT_SHIFT 9 | ||
52 | #define PIN_ALT_MASK (0x3 << PIN_ALT_SHIFT) | ||
53 | #define PIN_ALT(x) (((x) & PIN_ALT_MASK) >> PIN_ALT_SHIFT) | ||
54 | #define PIN_GPIO (NMK_GPIO_ALT_GPIO << PIN_ALT_SHIFT) | ||
55 | #define PIN_ALT_A (NMK_GPIO_ALT_A << PIN_ALT_SHIFT) | ||
56 | #define PIN_ALT_B (NMK_GPIO_ALT_B << PIN_ALT_SHIFT) | ||
57 | #define PIN_ALT_C (NMK_GPIO_ALT_C << PIN_ALT_SHIFT) | ||
58 | |||
59 | #define PIN_PULL_SHIFT 11 | ||
60 | #define PIN_PULL_MASK (0x3 << PIN_PULL_SHIFT) | ||
61 | #define PIN_PULL(x) (((x) & PIN_PULL_MASK) >> PIN_PULL_SHIFT) | ||
62 | #define PIN_PULL_NONE (NMK_GPIO_PULL_NONE << PIN_PULL_SHIFT) | ||
63 | #define PIN_PULL_UP (NMK_GPIO_PULL_UP << PIN_PULL_SHIFT) | ||
64 | #define PIN_PULL_DOWN (NMK_GPIO_PULL_DOWN << PIN_PULL_SHIFT) | ||
65 | |||
66 | #define PIN_SLPM_SHIFT 13 | ||
67 | #define PIN_SLPM_MASK (0x1 << PIN_SLPM_SHIFT) | ||
68 | #define PIN_SLPM(x) (((x) & PIN_SLPM_MASK) >> PIN_SLPM_SHIFT) | ||
69 | #define PIN_SLPM_MAKE_INPUT (NMK_GPIO_SLPM_INPUT << PIN_SLPM_SHIFT) | ||
70 | #define PIN_SLPM_NOCHANGE (NMK_GPIO_SLPM_NOCHANGE << PIN_SLPM_SHIFT) | ||
71 | /* These two replace the above in DB8500v2+ */ | ||
72 | #define PIN_SLPM_WAKEUP_ENABLE (NMK_GPIO_SLPM_WAKEUP_ENABLE << PIN_SLPM_SHIFT) | ||
73 | #define PIN_SLPM_WAKEUP_DISABLE (NMK_GPIO_SLPM_WAKEUP_DISABLE << PIN_SLPM_SHIFT) | ||
74 | #define PIN_SLPM_USE_MUX_SETTINGS_IN_SLEEP PIN_SLPM_WAKEUP_DISABLE | ||
75 | |||
76 | #define PIN_SLPM_GPIO PIN_SLPM_WAKEUP_ENABLE /* In SLPM, pin is a gpio */ | ||
77 | #define PIN_SLPM_ALTFUNC PIN_SLPM_WAKEUP_DISABLE /* In SLPM, pin is altfunc */ | ||
78 | |||
79 | #define PIN_DIR_SHIFT 14 | ||
80 | #define PIN_DIR_MASK (0x1 << PIN_DIR_SHIFT) | ||
81 | #define PIN_DIR(x) (((x) & PIN_DIR_MASK) >> PIN_DIR_SHIFT) | ||
82 | #define PIN_DIR_INPUT (0 << PIN_DIR_SHIFT) | ||
83 | #define PIN_DIR_OUTPUT (1 << PIN_DIR_SHIFT) | ||
84 | |||
85 | #define PIN_VAL_SHIFT 15 | ||
86 | #define PIN_VAL_MASK (0x1 << PIN_VAL_SHIFT) | ||
87 | #define PIN_VAL(x) (((x) & PIN_VAL_MASK) >> PIN_VAL_SHIFT) | ||
88 | #define PIN_VAL_LOW (0 << PIN_VAL_SHIFT) | ||
89 | #define PIN_VAL_HIGH (1 << PIN_VAL_SHIFT) | ||
90 | |||
91 | #define PIN_SLPM_PULL_SHIFT 16 | ||
92 | #define PIN_SLPM_PULL_MASK (0x7 << PIN_SLPM_PULL_SHIFT) | ||
93 | #define PIN_SLPM_PULL(x) \ | ||
94 | (((x) & PIN_SLPM_PULL_MASK) >> PIN_SLPM_PULL_SHIFT) | ||
95 | #define PIN_SLPM_PULL_NONE \ | ||
96 | ((1 + NMK_GPIO_PULL_NONE) << PIN_SLPM_PULL_SHIFT) | ||
97 | #define PIN_SLPM_PULL_UP \ | ||
98 | ((1 + NMK_GPIO_PULL_UP) << PIN_SLPM_PULL_SHIFT) | ||
99 | #define PIN_SLPM_PULL_DOWN \ | ||
100 | ((1 + NMK_GPIO_PULL_DOWN) << PIN_SLPM_PULL_SHIFT) | ||
101 | |||
102 | #define PIN_SLPM_DIR_SHIFT 19 | ||
103 | #define PIN_SLPM_DIR_MASK (0x3 << PIN_SLPM_DIR_SHIFT) | ||
104 | #define PIN_SLPM_DIR(x) \ | ||
105 | (((x) & PIN_SLPM_DIR_MASK) >> PIN_SLPM_DIR_SHIFT) | ||
106 | #define PIN_SLPM_DIR_INPUT ((1 + 0) << PIN_SLPM_DIR_SHIFT) | ||
107 | #define PIN_SLPM_DIR_OUTPUT ((1 + 1) << PIN_SLPM_DIR_SHIFT) | ||
108 | |||
109 | #define PIN_SLPM_VAL_SHIFT 21 | ||
110 | #define PIN_SLPM_VAL_MASK (0x3 << PIN_SLPM_VAL_SHIFT) | ||
111 | #define PIN_SLPM_VAL(x) \ | ||
112 | (((x) & PIN_SLPM_VAL_MASK) >> PIN_SLPM_VAL_SHIFT) | ||
113 | #define PIN_SLPM_VAL_LOW ((1 + 0) << PIN_SLPM_VAL_SHIFT) | ||
114 | #define PIN_SLPM_VAL_HIGH ((1 + 1) << PIN_SLPM_VAL_SHIFT) | ||
115 | |||
116 | #define PIN_SLPM_PDIS_SHIFT 23 | ||
117 | #define PIN_SLPM_PDIS_MASK (0x3 << PIN_SLPM_PDIS_SHIFT) | ||
118 | #define PIN_SLPM_PDIS(x) \ | ||
119 | (((x) & PIN_SLPM_PDIS_MASK) >> PIN_SLPM_PDIS_SHIFT) | ||
120 | #define PIN_SLPM_PDIS_NO_CHANGE (0 << PIN_SLPM_PDIS_SHIFT) | ||
121 | #define PIN_SLPM_PDIS_DISABLED (1 << PIN_SLPM_PDIS_SHIFT) | ||
122 | #define PIN_SLPM_PDIS_ENABLED (2 << PIN_SLPM_PDIS_SHIFT) | ||
123 | |||
124 | #define PIN_LOWEMI_SHIFT 25 | ||
125 | #define PIN_LOWEMI_MASK (0x1 << PIN_LOWEMI_SHIFT) | ||
126 | #define PIN_LOWEMI(x) (((x) & PIN_LOWEMI_MASK) >> PIN_LOWEMI_SHIFT) | ||
127 | #define PIN_LOWEMI_DISABLED (0 << PIN_LOWEMI_SHIFT) | ||
128 | #define PIN_LOWEMI_ENABLED (1 << PIN_LOWEMI_SHIFT) | ||
129 | |||
130 | #define PIN_GPIOMODE_SHIFT 26 | ||
131 | #define PIN_GPIOMODE_MASK (0x1 << PIN_GPIOMODE_SHIFT) | ||
132 | #define PIN_GPIOMODE(x) (((x) & PIN_GPIOMODE_MASK) >> PIN_GPIOMODE_SHIFT) | ||
133 | #define PIN_GPIOMODE_DISABLED (0 << PIN_GPIOMODE_SHIFT) | ||
134 | #define PIN_GPIOMODE_ENABLED (1 << PIN_GPIOMODE_SHIFT) | ||
135 | |||
136 | #define PIN_SLEEPMODE_SHIFT 27 | ||
137 | #define PIN_SLEEPMODE_MASK (0x1 << PIN_SLEEPMODE_SHIFT) | ||
138 | #define PIN_SLEEPMODE(x) (((x) & PIN_SLEEPMODE_MASK) >> PIN_SLEEPMODE_SHIFT) | ||
139 | #define PIN_SLEEPMODE_DISABLED (0 << PIN_SLEEPMODE_SHIFT) | ||
140 | #define PIN_SLEEPMODE_ENABLED (1 << PIN_SLEEPMODE_SHIFT) | ||
141 | |||
142 | |||
143 | /* Shortcuts. Use these instead of separate DIR, PULL, and VAL. */ | ||
144 | #define PIN_INPUT_PULLDOWN (PIN_DIR_INPUT | PIN_PULL_DOWN) | ||
145 | #define PIN_INPUT_PULLUP (PIN_DIR_INPUT | PIN_PULL_UP) | ||
146 | #define PIN_INPUT_NOPULL (PIN_DIR_INPUT | PIN_PULL_NONE) | ||
147 | #define PIN_OUTPUT_LOW (PIN_DIR_OUTPUT | PIN_VAL_LOW) | ||
148 | #define PIN_OUTPUT_HIGH (PIN_DIR_OUTPUT | PIN_VAL_HIGH) | ||
149 | |||
150 | #define PIN_SLPM_INPUT_PULLDOWN (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_DOWN) | ||
151 | #define PIN_SLPM_INPUT_PULLUP (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_UP) | ||
152 | #define PIN_SLPM_INPUT_NOPULL (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_NONE) | ||
153 | #define PIN_SLPM_OUTPUT_LOW (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_LOW) | ||
154 | #define PIN_SLPM_OUTPUT_HIGH (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_HIGH) | ||
155 | |||
156 | #define PIN_CFG_DEFAULT (0) | ||
157 | |||
158 | #define PIN_CFG(num, alt) \ | ||
159 | (PIN_CFG_DEFAULT |\ | ||
160 | (PIN_NUM(num) | PIN_##alt)) | ||
161 | |||
162 | #define PIN_CFG_INPUT(num, alt, pull) \ | ||
163 | (PIN_CFG_DEFAULT |\ | ||
164 | (PIN_NUM(num) | PIN_##alt | PIN_INPUT_##pull)) | ||
165 | |||
166 | #define PIN_CFG_OUTPUT(num, alt, val) \ | ||
167 | (PIN_CFG_DEFAULT |\ | ||
168 | (PIN_NUM(num) | PIN_##alt | PIN_OUTPUT_##val)) | ||
169 | |||
170 | /* | ||
171 | * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving | ||
172 | * the "gpio" namespace for generic and cross-machine functions | ||
173 | */ | ||
174 | |||
175 | #define GPIO_BLOCK_SHIFT 5 | ||
176 | #define NMK_GPIO_PER_CHIP (1 << GPIO_BLOCK_SHIFT) | ||
177 | |||
178 | /* Register in the logic block */ | ||
179 | #define NMK_GPIO_DAT 0x00 | ||
180 | #define NMK_GPIO_DATS 0x04 | ||
181 | #define NMK_GPIO_DATC 0x08 | ||
182 | #define NMK_GPIO_PDIS 0x0c | ||
183 | #define NMK_GPIO_DIR 0x10 | ||
184 | #define NMK_GPIO_DIRS 0x14 | ||
185 | #define NMK_GPIO_DIRC 0x18 | ||
186 | #define NMK_GPIO_SLPC 0x1c | ||
187 | #define NMK_GPIO_AFSLA 0x20 | ||
188 | #define NMK_GPIO_AFSLB 0x24 | ||
189 | #define NMK_GPIO_LOWEMI 0x28 | ||
190 | |||
191 | #define NMK_GPIO_RIMSC 0x40 | ||
192 | #define NMK_GPIO_FIMSC 0x44 | ||
193 | #define NMK_GPIO_IS 0x48 | ||
194 | #define NMK_GPIO_IC 0x4c | ||
195 | #define NMK_GPIO_RWIMSC 0x50 | ||
196 | #define NMK_GPIO_FWIMSC 0x54 | ||
197 | #define NMK_GPIO_WKS 0x58 | ||
198 | /* These appear in DB8540 and later ASICs */ | ||
199 | #define NMK_GPIO_EDGELEVEL 0x5C | ||
200 | #define NMK_GPIO_LEVEL 0x60 | ||
201 | |||
202 | /* Alternate functions: function C is set in hw by setting both A and B */ | ||
203 | #define NMK_GPIO_ALT_GPIO 0 | ||
204 | #define NMK_GPIO_ALT_A 1 | ||
205 | #define NMK_GPIO_ALT_B 2 | ||
206 | #define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B) | ||
207 | |||
208 | #define NMK_GPIO_ALT_CX_SHIFT 2 | ||
209 | #define NMK_GPIO_ALT_C1 ((1<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) | ||
210 | #define NMK_GPIO_ALT_C2 ((2<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) | ||
211 | #define NMK_GPIO_ALT_C3 ((3<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) | ||
212 | #define NMK_GPIO_ALT_C4 ((4<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) | ||
213 | |||
214 | /* Pull up/down values */ | ||
215 | enum nmk_gpio_pull { | ||
216 | NMK_GPIO_PULL_NONE, | ||
217 | NMK_GPIO_PULL_UP, | ||
218 | NMK_GPIO_PULL_DOWN, | ||
219 | }; | ||
220 | |||
221 | /* Sleep mode */ | ||
222 | enum nmk_gpio_slpm { | ||
223 | NMK_GPIO_SLPM_INPUT, | ||
224 | NMK_GPIO_SLPM_WAKEUP_ENABLE = NMK_GPIO_SLPM_INPUT, | ||
225 | NMK_GPIO_SLPM_NOCHANGE, | ||
226 | NMK_GPIO_SLPM_WAKEUP_DISABLE = NMK_GPIO_SLPM_NOCHANGE, | ||
227 | }; | ||
228 | |||
229 | /* Older deprecated pin config API that should go away soon */ | ||
230 | extern int nmk_config_pin(pin_cfg_t cfg, bool sleep); | ||
231 | extern int nmk_config_pins(pin_cfg_t *cfgs, int num); | ||
232 | extern int nmk_config_pins_sleep(pin_cfg_t *cfgs, int num); | ||
233 | extern int nmk_gpio_set_slpm(int gpio, enum nmk_gpio_slpm mode); | ||
234 | extern int nmk_gpio_set_pull(int gpio, enum nmk_gpio_pull pull); | ||
235 | #ifdef CONFIG_PINCTRL_NOMADIK | ||
236 | extern int nmk_gpio_set_mode(int gpio, int gpio_mode); | ||
237 | #else | ||
238 | static inline int nmk_gpio_set_mode(int gpio, int gpio_mode) | ||
239 | { | ||
240 | return -ENODEV; | ||
241 | } | ||
242 | #endif | ||
243 | extern int nmk_gpio_get_mode(int gpio); | ||
244 | |||
245 | extern void nmk_gpio_wakeups_suspend(void); | ||
246 | extern void nmk_gpio_wakeups_resume(void); | ||
247 | |||
248 | extern void nmk_gpio_clocks_enable(void); | ||
249 | extern void nmk_gpio_clocks_disable(void); | ||
250 | |||
251 | extern void nmk_gpio_read_pull(int gpio_bank, u32 *pull_up); | ||
252 | |||
253 | /* | ||
254 | * Platform data to register a block: only the initial gpio/irq number. | ||
255 | */ | ||
256 | struct nmk_gpio_platform_data { | ||
257 | char *name; | ||
258 | int first_gpio; | ||
259 | int first_irq; | ||
260 | int num_gpio; | ||
261 | u32 (*get_secondary_status)(unsigned int bank); | ||
262 | void (*set_ioforce)(bool enable); | ||
263 | bool supports_sleepmode; | ||
264 | }; | ||
265 | |||
266 | #endif /* __PLAT_NOMADIK_GPIO */ | ||
diff --git a/include/linux/platform_data/pxa2xx_udc.h b/include/linux/platform_data/pxa2xx_udc.h new file mode 100644 index 000000000000..c6c5e98b5b82 --- /dev/null +++ b/include/linux/platform_data/pxa2xx_udc.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * This supports machine-specific differences in how the PXA2xx | ||
3 | * USB Device Controller (UDC) is wired. | ||
4 | * | ||
5 | * It is set in linux/arch/arm/mach-pxa/<machine>.c or in | ||
6 | * linux/arch/mach-ixp4xx/<machine>.c and used in | ||
7 | * the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c | ||
8 | */ | ||
9 | #ifndef PXA2XX_UDC_H | ||
10 | #define PXA2XX_UDC_H | ||
11 | |||
12 | struct pxa2xx_udc_mach_info { | ||
13 | int (*udc_is_connected)(void); /* do we see host? */ | ||
14 | void (*udc_command)(int cmd); | ||
15 | #define PXA2XX_UDC_CMD_CONNECT 0 /* let host see us */ | ||
16 | #define PXA2XX_UDC_CMD_DISCONNECT 1 /* so host won't see us */ | ||
17 | |||
18 | /* Boards following the design guidelines in the developer's manual, | ||
19 | * with on-chip GPIOs not Lubbock's weird hardware, can have a sane | ||
20 | * VBUS IRQ and omit the methods above. Store the GPIO number | ||
21 | * here. Note that sometimes the signals go through inverters... | ||
22 | */ | ||
23 | bool gpio_pullup_inverted; | ||
24 | int gpio_pullup; /* high == pullup activated */ | ||
25 | }; | ||
26 | |||
27 | #endif | ||
diff --git a/include/linux/platform_data/pxa_sdhci.h b/include/linux/platform_data/pxa_sdhci.h index 59acd987ed34..27d3156d093a 100644 --- a/include/linux/platform_data/pxa_sdhci.h +++ b/include/linux/platform_data/pxa_sdhci.h | |||
@@ -38,6 +38,7 @@ | |||
38 | * @max_speed: the maximum speed supported | 38 | * @max_speed: the maximum speed supported |
39 | * @host_caps: Standard MMC host capabilities bit field. | 39 | * @host_caps: Standard MMC host capabilities bit field. |
40 | * @quirks: quirks of platfrom | 40 | * @quirks: quirks of platfrom |
41 | * @quirks2: quirks2 of platfrom | ||
41 | * @pm_caps: pm_caps of platfrom | 42 | * @pm_caps: pm_caps of platfrom |
42 | */ | 43 | */ |
43 | struct sdhci_pxa_platdata { | 44 | struct sdhci_pxa_platdata { |
@@ -48,9 +49,10 @@ struct sdhci_pxa_platdata { | |||
48 | unsigned int ext_cd_gpio; | 49 | unsigned int ext_cd_gpio; |
49 | bool ext_cd_gpio_invert; | 50 | bool ext_cd_gpio_invert; |
50 | unsigned int max_speed; | 51 | unsigned int max_speed; |
51 | unsigned int host_caps; | 52 | u32 host_caps; |
52 | unsigned int host_caps2; | 53 | u32 host_caps2; |
53 | unsigned int quirks; | 54 | unsigned int quirks; |
55 | unsigned int quirks2; | ||
54 | unsigned int pm_caps; | 56 | unsigned int pm_caps; |
55 | }; | 57 | }; |
56 | 58 | ||
diff --git a/include/linux/platform_data/sa11x0-serial.h b/include/linux/platform_data/sa11x0-serial.h new file mode 100644 index 000000000000..4504d5d592f0 --- /dev/null +++ b/include/linux/platform_data/sa11x0-serial.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * Author: Nicolas Pitre | ||
3 | * | ||
4 | * Moved and changed lots, Russell King | ||
5 | * | ||
6 | * Low level machine dependent UART functions. | ||
7 | */ | ||
8 | #ifndef SA11X0_SERIAL_H | ||
9 | #define SA11X0_SERIAL_H | ||
10 | |||
11 | struct uart_port; | ||
12 | struct uart_info; | ||
13 | |||
14 | /* | ||
15 | * This is a temporary structure for registering these | ||
16 | * functions; it is intended to be discarded after boot. | ||
17 | */ | ||
18 | struct sa1100_port_fns { | ||
19 | void (*set_mctrl)(struct uart_port *, u_int); | ||
20 | u_int (*get_mctrl)(struct uart_port *); | ||
21 | void (*pm)(struct uart_port *, u_int, u_int); | ||
22 | int (*set_wake)(struct uart_port *, u_int); | ||
23 | }; | ||
24 | |||
25 | #ifdef CONFIG_SERIAL_SA1100 | ||
26 | void sa1100_register_uart_fns(struct sa1100_port_fns *fns); | ||
27 | void sa1100_register_uart(int idx, int port); | ||
28 | #else | ||
29 | #define sa1100_register_uart_fns(fns) do { } while (0) | ||
30 | #define sa1100_register_uart(idx,port) do { } while (0) | ||
31 | #endif | ||
32 | |||
33 | #endif | ||
diff --git a/include/linux/platform_data/uio_dmem_genirq.h b/include/linux/platform_data/uio_dmem_genirq.h new file mode 100644 index 000000000000..973c1bb32168 --- /dev/null +++ b/include/linux/platform_data/uio_dmem_genirq.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * include/linux/platform_data/uio_dmem_genirq.h | ||
3 | * | ||
4 | * Copyright (C) 2012 Damian Hobson-Garcia | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License as | ||
8 | * published by the Free Software Foundation version 2. | ||
9 | * | ||
10 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
11 | * kind, whether express or implied; without even the implied warranty | ||
12 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef _UIO_DMEM_GENIRQ_H | ||
17 | #define _UIO_DMEM_GENIRQ_H | ||
18 | |||
19 | #include <linux/uio_driver.h> | ||
20 | |||
21 | struct uio_dmem_genirq_pdata { | ||
22 | struct uio_info uioinfo; | ||
23 | unsigned int *dynamic_region_sizes; | ||
24 | unsigned int num_dynamic_regions; | ||
25 | }; | ||
26 | #endif /* _UIO_DMEM_GENIRQ_H */ | ||
diff --git a/include/linux/platform_data/usb-omap.h b/include/linux/platform_data/usb-omap.h new file mode 100644 index 000000000000..8570bcfe6311 --- /dev/null +++ b/include/linux/platform_data/usb-omap.h | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | * usb-omap.h - Platform data for the various OMAP USB IPs | ||
3 | * | ||
4 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com | ||
5 | * | ||
6 | * This software is distributed under the terms of the GNU General Public | ||
7 | * License ("GPL") version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
10 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
11 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
12 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
13 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
14 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
15 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
16 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
17 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
18 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
19 | * POSSIBILITY OF SUCH DAMAGE. | ||
20 | */ | ||
21 | |||
22 | #define OMAP3_HS_USB_PORTS 3 | ||
23 | |||
24 | enum usbhs_omap_port_mode { | ||
25 | OMAP_USBHS_PORT_MODE_UNUSED, | ||
26 | OMAP_EHCI_PORT_MODE_PHY, | ||
27 | OMAP_EHCI_PORT_MODE_TLL, | ||
28 | OMAP_EHCI_PORT_MODE_HSIC, | ||
29 | OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0, | ||
30 | OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM, | ||
31 | OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0, | ||
32 | OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM, | ||
33 | OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0, | ||
34 | OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM, | ||
35 | OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0, | ||
36 | OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM, | ||
37 | OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0, | ||
38 | OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM | ||
39 | }; | ||
40 | |||
41 | struct usbtll_omap_platform_data { | ||
42 | enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; | ||
43 | }; | ||
44 | |||
45 | struct ehci_hcd_omap_platform_data { | ||
46 | enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; | ||
47 | int reset_gpio_port[OMAP3_HS_USB_PORTS]; | ||
48 | struct regulator *regulator[OMAP3_HS_USB_PORTS]; | ||
49 | unsigned phy_reset:1; | ||
50 | }; | ||
51 | |||
52 | struct ohci_hcd_omap_platform_data { | ||
53 | enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; | ||
54 | unsigned es2_compatibility:1; | ||
55 | }; | ||
56 | |||
57 | struct usbhs_omap_platform_data { | ||
58 | enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; | ||
59 | |||
60 | struct ehci_hcd_omap_platform_data *ehci_data; | ||
61 | struct ohci_hcd_omap_platform_data *ohci_data; | ||
62 | }; | ||
63 | |||
64 | /*-------------------------------------------------------------------------*/ | ||
65 | |||
66 | struct omap_musb_board_data { | ||
67 | u8 interface_type; | ||
68 | u8 mode; | ||
69 | u16 power; | ||
70 | unsigned extvbus:1; | ||
71 | void (*set_phy_power)(u8 on); | ||
72 | void (*clear_irq)(void); | ||
73 | void (*set_mode)(u8 mode); | ||
74 | void (*reset)(void); | ||
75 | }; | ||
76 | |||
77 | enum musb_interface { | ||
78 | MUSB_INTERFACE_ULPI, | ||
79 | MUSB_INTERFACE_UTMI | ||
80 | }; | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 5711e9525a2a..a9ded9a3c175 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -55,6 +55,7 @@ extern int platform_add_devices(struct platform_device **, int); | |||
55 | 55 | ||
56 | struct platform_device_info { | 56 | struct platform_device_info { |
57 | struct device *parent; | 57 | struct device *parent; |
58 | struct acpi_dev_node acpi_node; | ||
58 | 59 | ||
59 | const char *name; | 60 | const char *name; |
60 | int id; | 61 | int id; |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 007e687c4f69..03d7bb145311 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -546,10 +546,9 @@ struct dev_pm_info { | |||
546 | unsigned long active_jiffies; | 546 | unsigned long active_jiffies; |
547 | unsigned long suspended_jiffies; | 547 | unsigned long suspended_jiffies; |
548 | unsigned long accounting_timestamp; | 548 | unsigned long accounting_timestamp; |
549 | struct dev_pm_qos_request *pq_req; | ||
550 | #endif | 549 | #endif |
551 | struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */ | 550 | struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */ |
552 | struct pm_qos_constraints *constraints; | 551 | struct dev_pm_qos *qos; |
553 | }; | 552 | }; |
554 | 553 | ||
555 | extern void update_pm_runtime_accounting(struct device *dev); | 554 | extern void update_pm_runtime_accounting(struct device *dev); |
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index 9924ea1f22e0..5a95013905c8 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h | |||
@@ -20,6 +20,13 @@ enum { | |||
20 | PM_QOS_NUM_CLASSES, | 20 | PM_QOS_NUM_CLASSES, |
21 | }; | 21 | }; |
22 | 22 | ||
23 | enum pm_qos_flags_status { | ||
24 | PM_QOS_FLAGS_UNDEFINED = -1, | ||
25 | PM_QOS_FLAGS_NONE, | ||
26 | PM_QOS_FLAGS_SOME, | ||
27 | PM_QOS_FLAGS_ALL, | ||
28 | }; | ||
29 | |||
23 | #define PM_QOS_DEFAULT_VALUE -1 | 30 | #define PM_QOS_DEFAULT_VALUE -1 |
24 | 31 | ||
25 | #define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) | 32 | #define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) |
@@ -27,14 +34,31 @@ enum { | |||
27 | #define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 | 34 | #define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 |
28 | #define PM_QOS_DEV_LAT_DEFAULT_VALUE 0 | 35 | #define PM_QOS_DEV_LAT_DEFAULT_VALUE 0 |
29 | 36 | ||
37 | #define PM_QOS_FLAG_NO_POWER_OFF (1 << 0) | ||
38 | #define PM_QOS_FLAG_REMOTE_WAKEUP (1 << 1) | ||
39 | |||
30 | struct pm_qos_request { | 40 | struct pm_qos_request { |
31 | struct plist_node node; | 41 | struct plist_node node; |
32 | int pm_qos_class; | 42 | int pm_qos_class; |
33 | struct delayed_work work; /* for pm_qos_update_request_timeout */ | 43 | struct delayed_work work; /* for pm_qos_update_request_timeout */ |
34 | }; | 44 | }; |
35 | 45 | ||
46 | struct pm_qos_flags_request { | ||
47 | struct list_head node; | ||
48 | s32 flags; /* Do not change to 64 bit */ | ||
49 | }; | ||
50 | |||
51 | enum dev_pm_qos_req_type { | ||
52 | DEV_PM_QOS_LATENCY = 1, | ||
53 | DEV_PM_QOS_FLAGS, | ||
54 | }; | ||
55 | |||
36 | struct dev_pm_qos_request { | 56 | struct dev_pm_qos_request { |
37 | struct plist_node node; | 57 | enum dev_pm_qos_req_type type; |
58 | union { | ||
59 | struct plist_node pnode; | ||
60 | struct pm_qos_flags_request flr; | ||
61 | } data; | ||
38 | struct device *dev; | 62 | struct device *dev; |
39 | }; | 63 | }; |
40 | 64 | ||
@@ -45,8 +69,8 @@ enum pm_qos_type { | |||
45 | }; | 69 | }; |
46 | 70 | ||
47 | /* | 71 | /* |
48 | * Note: The lockless read path depends on the CPU accessing | 72 | * Note: The lockless read path depends on the CPU accessing target_value |
49 | * target_value atomically. Atomic access is only guaranteed on all CPU | 73 | * or effective_flags atomically. Atomic access is only guaranteed on all CPU |
50 | * types linux supports for 32 bit quantites | 74 | * types linux supports for 32 bit quantites |
51 | */ | 75 | */ |
52 | struct pm_qos_constraints { | 76 | struct pm_qos_constraints { |
@@ -57,6 +81,18 @@ struct pm_qos_constraints { | |||
57 | struct blocking_notifier_head *notifiers; | 81 | struct blocking_notifier_head *notifiers; |
58 | }; | 82 | }; |
59 | 83 | ||
84 | struct pm_qos_flags { | ||
85 | struct list_head list; | ||
86 | s32 effective_flags; /* Do not change to 64 bit */ | ||
87 | }; | ||
88 | |||
89 | struct dev_pm_qos { | ||
90 | struct pm_qos_constraints latency; | ||
91 | struct pm_qos_flags flags; | ||
92 | struct dev_pm_qos_request *latency_req; | ||
93 | struct dev_pm_qos_request *flags_req; | ||
94 | }; | ||
95 | |||
60 | /* Action requested to pm_qos_update_target */ | 96 | /* Action requested to pm_qos_update_target */ |
61 | enum pm_qos_req_action { | 97 | enum pm_qos_req_action { |
62 | PM_QOS_ADD_REQ, /* Add a new request */ | 98 | PM_QOS_ADD_REQ, /* Add a new request */ |
@@ -71,6 +107,9 @@ static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req) | |||
71 | 107 | ||
72 | int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, | 108 | int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, |
73 | enum pm_qos_req_action action, int value); | 109 | enum pm_qos_req_action action, int value); |
110 | bool pm_qos_update_flags(struct pm_qos_flags *pqf, | ||
111 | struct pm_qos_flags_request *req, | ||
112 | enum pm_qos_req_action action, s32 val); | ||
74 | void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class, | 113 | void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class, |
75 | s32 value); | 114 | s32 value); |
76 | void pm_qos_update_request(struct pm_qos_request *req, | 115 | void pm_qos_update_request(struct pm_qos_request *req, |
@@ -86,10 +125,12 @@ int pm_qos_request_active(struct pm_qos_request *req); | |||
86 | s32 pm_qos_read_value(struct pm_qos_constraints *c); | 125 | s32 pm_qos_read_value(struct pm_qos_constraints *c); |
87 | 126 | ||
88 | #ifdef CONFIG_PM | 127 | #ifdef CONFIG_PM |
128 | enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, s32 mask); | ||
129 | enum pm_qos_flags_status dev_pm_qos_flags(struct device *dev, s32 mask); | ||
89 | s32 __dev_pm_qos_read_value(struct device *dev); | 130 | s32 __dev_pm_qos_read_value(struct device *dev); |
90 | s32 dev_pm_qos_read_value(struct device *dev); | 131 | s32 dev_pm_qos_read_value(struct device *dev); |
91 | int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req, | 132 | int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req, |
92 | s32 value); | 133 | enum dev_pm_qos_req_type type, s32 value); |
93 | int dev_pm_qos_update_request(struct dev_pm_qos_request *req, s32 new_value); | 134 | int dev_pm_qos_update_request(struct dev_pm_qos_request *req, s32 new_value); |
94 | int dev_pm_qos_remove_request(struct dev_pm_qos_request *req); | 135 | int dev_pm_qos_remove_request(struct dev_pm_qos_request *req); |
95 | int dev_pm_qos_add_notifier(struct device *dev, | 136 | int dev_pm_qos_add_notifier(struct device *dev, |
@@ -103,12 +144,19 @@ void dev_pm_qos_constraints_destroy(struct device *dev); | |||
103 | int dev_pm_qos_add_ancestor_request(struct device *dev, | 144 | int dev_pm_qos_add_ancestor_request(struct device *dev, |
104 | struct dev_pm_qos_request *req, s32 value); | 145 | struct dev_pm_qos_request *req, s32 value); |
105 | #else | 146 | #else |
147 | static inline enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, | ||
148 | s32 mask) | ||
149 | { return PM_QOS_FLAGS_UNDEFINED; } | ||
150 | static inline enum pm_qos_flags_status dev_pm_qos_flags(struct device *dev, | ||
151 | s32 mask) | ||
152 | { return PM_QOS_FLAGS_UNDEFINED; } | ||
106 | static inline s32 __dev_pm_qos_read_value(struct device *dev) | 153 | static inline s32 __dev_pm_qos_read_value(struct device *dev) |
107 | { return 0; } | 154 | { return 0; } |
108 | static inline s32 dev_pm_qos_read_value(struct device *dev) | 155 | static inline s32 dev_pm_qos_read_value(struct device *dev) |
109 | { return 0; } | 156 | { return 0; } |
110 | static inline int dev_pm_qos_add_request(struct device *dev, | 157 | static inline int dev_pm_qos_add_request(struct device *dev, |
111 | struct dev_pm_qos_request *req, | 158 | struct dev_pm_qos_request *req, |
159 | enum dev_pm_qos_req_type type, | ||
112 | s32 value) | 160 | s32 value) |
113 | { return 0; } | 161 | { return 0; } |
114 | static inline int dev_pm_qos_update_request(struct dev_pm_qos_request *req, | 162 | static inline int dev_pm_qos_update_request(struct dev_pm_qos_request *req, |
@@ -144,10 +192,31 @@ static inline int dev_pm_qos_add_ancestor_request(struct device *dev, | |||
144 | #ifdef CONFIG_PM_RUNTIME | 192 | #ifdef CONFIG_PM_RUNTIME |
145 | int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value); | 193 | int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value); |
146 | void dev_pm_qos_hide_latency_limit(struct device *dev); | 194 | void dev_pm_qos_hide_latency_limit(struct device *dev); |
195 | int dev_pm_qos_expose_flags(struct device *dev, s32 value); | ||
196 | void dev_pm_qos_hide_flags(struct device *dev); | ||
197 | int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set); | ||
198 | |||
199 | static inline s32 dev_pm_qos_requested_latency(struct device *dev) | ||
200 | { | ||
201 | return dev->power.qos->latency_req->data.pnode.prio; | ||
202 | } | ||
203 | |||
204 | static inline s32 dev_pm_qos_requested_flags(struct device *dev) | ||
205 | { | ||
206 | return dev->power.qos->flags_req->data.flr.flags; | ||
207 | } | ||
147 | #else | 208 | #else |
148 | static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) | 209 | static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) |
149 | { return 0; } | 210 | { return 0; } |
150 | static inline void dev_pm_qos_hide_latency_limit(struct device *dev) {} | 211 | static inline void dev_pm_qos_hide_latency_limit(struct device *dev) {} |
212 | static inline int dev_pm_qos_expose_flags(struct device *dev, s32 value) | ||
213 | { return 0; } | ||
214 | static inline void dev_pm_qos_hide_flags(struct device *dev) {} | ||
215 | static inline int dev_pm_qos_update_flags(struct device *dev, s32 m, bool set) | ||
216 | { return 0; } | ||
217 | |||
218 | static inline s32 dev_pm_qos_requested_latency(struct device *dev) { return 0; } | ||
219 | static inline s32 dev_pm_qos_requested_flags(struct device *dev) { return 0; } | ||
151 | #endif | 220 | #endif |
152 | 221 | ||
153 | #endif | 222 | #endif |
diff --git a/include/linux/pstore.h b/include/linux/pstore.h index ee3034a40884..1788909d9a99 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h | |||
@@ -50,16 +50,18 @@ struct pstore_info { | |||
50 | int (*open)(struct pstore_info *psi); | 50 | int (*open)(struct pstore_info *psi); |
51 | int (*close)(struct pstore_info *psi); | 51 | int (*close)(struct pstore_info *psi); |
52 | ssize_t (*read)(u64 *id, enum pstore_type_id *type, | 52 | ssize_t (*read)(u64 *id, enum pstore_type_id *type, |
53 | struct timespec *time, char **buf, | 53 | int *count, struct timespec *time, char **buf, |
54 | struct pstore_info *psi); | 54 | struct pstore_info *psi); |
55 | int (*write)(enum pstore_type_id type, | 55 | int (*write)(enum pstore_type_id type, |
56 | enum kmsg_dump_reason reason, u64 *id, | 56 | enum kmsg_dump_reason reason, u64 *id, |
57 | unsigned int part, size_t size, struct pstore_info *psi); | 57 | unsigned int part, int count, size_t size, |
58 | struct pstore_info *psi); | ||
58 | int (*write_buf)(enum pstore_type_id type, | 59 | int (*write_buf)(enum pstore_type_id type, |
59 | enum kmsg_dump_reason reason, u64 *id, | 60 | enum kmsg_dump_reason reason, u64 *id, |
60 | unsigned int part, const char *buf, size_t size, | 61 | unsigned int part, const char *buf, size_t size, |
61 | struct pstore_info *psi); | 62 | struct pstore_info *psi); |
62 | int (*erase)(enum pstore_type_id type, u64 id, | 63 | int (*erase)(enum pstore_type_id type, u64 id, |
64 | int count, struct timespec time, | ||
63 | struct pstore_info *psi); | 65 | struct pstore_info *psi); |
64 | void *data; | 66 | void *data; |
65 | }; | 67 | }; |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index e0f0fab20415..c92dd28eaa6c 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -286,23 +286,6 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
286 | &pos->member != (head); \ | 286 | &pos->member != (head); \ |
287 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member)) | 287 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member)) |
288 | 288 | ||
289 | |||
290 | /** | ||
291 | * list_for_each_continue_rcu | ||
292 | * @pos: the &struct list_head to use as a loop cursor. | ||
293 | * @head: the head for your list. | ||
294 | * | ||
295 | * Iterate over an rcu-protected list, continuing after current point. | ||
296 | * | ||
297 | * This list-traversal primitive may safely run concurrently with | ||
298 | * the _rcu list-mutation primitives such as list_add_rcu() | ||
299 | * as long as the traversal is guarded by rcu_read_lock(). | ||
300 | */ | ||
301 | #define list_for_each_continue_rcu(pos, head) \ | ||
302 | for ((pos) = rcu_dereference_raw(list_next_rcu(pos)); \ | ||
303 | (pos) != (head); \ | ||
304 | (pos) = rcu_dereference_raw(list_next_rcu(pos))) | ||
305 | |||
306 | /** | 289 | /** |
307 | * list_for_each_entry_continue_rcu - continue iteration over list of given type | 290 | * list_for_each_entry_continue_rcu - continue iteration over list of given type |
308 | * @pos: the type * to use as a loop cursor. | 291 | * @pos: the type * to use as a loop cursor. |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 7c968e4f929e..275aa3f1062d 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -90,6 +90,25 @@ extern void do_trace_rcu_torture_read(char *rcutorturename, | |||
90 | * that started after call_rcu() was invoked. RCU read-side critical | 90 | * that started after call_rcu() was invoked. RCU read-side critical |
91 | * sections are delimited by rcu_read_lock() and rcu_read_unlock(), | 91 | * sections are delimited by rcu_read_lock() and rcu_read_unlock(), |
92 | * and may be nested. | 92 | * and may be nested. |
93 | * | ||
94 | * Note that all CPUs must agree that the grace period extended beyond | ||
95 | * all pre-existing RCU read-side critical section. On systems with more | ||
96 | * than one CPU, this means that when "func()" is invoked, each CPU is | ||
97 | * guaranteed to have executed a full memory barrier since the end of its | ||
98 | * last RCU read-side critical section whose beginning preceded the call | ||
99 | * to call_rcu(). It also means that each CPU executing an RCU read-side | ||
100 | * critical section that continues beyond the start of "func()" must have | ||
101 | * executed a memory barrier after the call_rcu() but before the beginning | ||
102 | * of that RCU read-side critical section. Note that these guarantees | ||
103 | * include CPUs that are offline, idle, or executing in user mode, as | ||
104 | * well as CPUs that are executing in the kernel. | ||
105 | * | ||
106 | * Furthermore, if CPU A invoked call_rcu() and CPU B invoked the | ||
107 | * resulting RCU callback function "func()", then both CPU A and CPU B are | ||
108 | * guaranteed to execute a full memory barrier during the time interval | ||
109 | * between the call to call_rcu() and the invocation of "func()" -- even | ||
110 | * if CPU A and CPU B are the same CPU (but again only if the system has | ||
111 | * more than one CPU). | ||
93 | */ | 112 | */ |
94 | extern void call_rcu(struct rcu_head *head, | 113 | extern void call_rcu(struct rcu_head *head, |
95 | void (*func)(struct rcu_head *head)); | 114 | void (*func)(struct rcu_head *head)); |
@@ -118,6 +137,9 @@ extern void call_rcu(struct rcu_head *head, | |||
118 | * OR | 137 | * OR |
119 | * - rcu_read_lock_bh() and rcu_read_unlock_bh(), if in process context. | 138 | * - rcu_read_lock_bh() and rcu_read_unlock_bh(), if in process context. |
120 | * These may be nested. | 139 | * These may be nested. |
140 | * | ||
141 | * See the description of call_rcu() for more detailed information on | ||
142 | * memory ordering guarantees. | ||
121 | */ | 143 | */ |
122 | extern void call_rcu_bh(struct rcu_head *head, | 144 | extern void call_rcu_bh(struct rcu_head *head, |
123 | void (*func)(struct rcu_head *head)); | 145 | void (*func)(struct rcu_head *head)); |
@@ -137,6 +159,9 @@ extern void call_rcu_bh(struct rcu_head *head, | |||
137 | * OR | 159 | * OR |
138 | * anything that disables preemption. | 160 | * anything that disables preemption. |
139 | * These may be nested. | 161 | * These may be nested. |
162 | * | ||
163 | * See the description of call_rcu() for more detailed information on | ||
164 | * memory ordering guarantees. | ||
140 | */ | 165 | */ |
141 | extern void call_rcu_sched(struct rcu_head *head, | 166 | extern void call_rcu_sched(struct rcu_head *head, |
142 | void (*func)(struct rcu_head *rcu)); | 167 | void (*func)(struct rcu_head *rcu)); |
@@ -197,13 +222,13 @@ extern void rcu_user_enter(void); | |||
197 | extern void rcu_user_exit(void); | 222 | extern void rcu_user_exit(void); |
198 | extern void rcu_user_enter_after_irq(void); | 223 | extern void rcu_user_enter_after_irq(void); |
199 | extern void rcu_user_exit_after_irq(void); | 224 | extern void rcu_user_exit_after_irq(void); |
200 | extern void rcu_user_hooks_switch(struct task_struct *prev, | ||
201 | struct task_struct *next); | ||
202 | #else | 225 | #else |
203 | static inline void rcu_user_enter(void) { } | 226 | static inline void rcu_user_enter(void) { } |
204 | static inline void rcu_user_exit(void) { } | 227 | static inline void rcu_user_exit(void) { } |
205 | static inline void rcu_user_enter_after_irq(void) { } | 228 | static inline void rcu_user_enter_after_irq(void) { } |
206 | static inline void rcu_user_exit_after_irq(void) { } | 229 | static inline void rcu_user_exit_after_irq(void) { } |
230 | static inline void rcu_user_hooks_switch(struct task_struct *prev, | ||
231 | struct task_struct *next) { } | ||
207 | #endif /* CONFIG_RCU_USER_QS */ | 232 | #endif /* CONFIG_RCU_USER_QS */ |
208 | 233 | ||
209 | extern void exit_rcu(void); | 234 | extern void exit_rcu(void); |
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index e3bcc3f4dcb8..b7e95bf942c9 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -19,6 +19,7 @@ | |||
19 | struct module; | 19 | struct module; |
20 | struct device; | 20 | struct device; |
21 | struct i2c_client; | 21 | struct i2c_client; |
22 | struct irq_domain; | ||
22 | struct spi_device; | 23 | struct spi_device; |
23 | struct regmap; | 24 | struct regmap; |
24 | struct regmap_range_cfg; | 25 | struct regmap_range_cfg; |
@@ -54,6 +55,39 @@ enum regmap_endian { | |||
54 | }; | 55 | }; |
55 | 56 | ||
56 | /** | 57 | /** |
58 | * A register range, used for access related checks | ||
59 | * (readable/writeable/volatile/precious checks) | ||
60 | * | ||
61 | * @range_min: address of first register | ||
62 | * @range_max: address of last register | ||
63 | */ | ||
64 | struct regmap_range { | ||
65 | unsigned int range_min; | ||
66 | unsigned int range_max; | ||
67 | }; | ||
68 | |||
69 | /* | ||
70 | * A table of ranges including some yes ranges and some no ranges. | ||
71 | * If a register belongs to a no_range, the corresponding check function | ||
72 | * will return false. If a register belongs to a yes range, the corresponding | ||
73 | * check function will return true. "no_ranges" are searched first. | ||
74 | * | ||
75 | * @yes_ranges : pointer to an array of regmap ranges used as "yes ranges" | ||
76 | * @n_yes_ranges: size of the above array | ||
77 | * @no_ranges: pointer to an array of regmap ranges used as "no ranges" | ||
78 | * @n_no_ranges: size of the above array | ||
79 | */ | ||
80 | struct regmap_access_table { | ||
81 | const struct regmap_range *yes_ranges; | ||
82 | unsigned int n_yes_ranges; | ||
83 | const struct regmap_range *no_ranges; | ||
84 | unsigned int n_no_ranges; | ||
85 | }; | ||
86 | |||
87 | typedef void (*regmap_lock)(void *); | ||
88 | typedef void (*regmap_unlock)(void *); | ||
89 | |||
90 | /** | ||
57 | * Configuration for the register map of a device. | 91 | * Configuration for the register map of a device. |
58 | * | 92 | * |
59 | * @name: Optional name of the regmap. Useful when a device has multiple | 93 | * @name: Optional name of the regmap. Useful when a device has multiple |
@@ -67,16 +101,39 @@ enum regmap_endian { | |||
67 | * @val_bits: Number of bits in a register value, mandatory. | 101 | * @val_bits: Number of bits in a register value, mandatory. |
68 | * | 102 | * |
69 | * @writeable_reg: Optional callback returning true if the register | 103 | * @writeable_reg: Optional callback returning true if the register |
70 | * can be written to. | 104 | * can be written to. If this field is NULL but wr_table |
105 | * (see below) is not, the check is performed on such table | ||
106 | * (a register is writeable if it belongs to one of the ranges | ||
107 | * specified by wr_table). | ||
71 | * @readable_reg: Optional callback returning true if the register | 108 | * @readable_reg: Optional callback returning true if the register |
72 | * can be read from. | 109 | * can be read from. If this field is NULL but rd_table |
110 | * (see below) is not, the check is performed on such table | ||
111 | * (a register is readable if it belongs to one of the ranges | ||
112 | * specified by rd_table). | ||
73 | * @volatile_reg: Optional callback returning true if the register | 113 | * @volatile_reg: Optional callback returning true if the register |
74 | * value can't be cached. | 114 | * value can't be cached. If this field is NULL but |
115 | * volatile_table (see below) is not, the check is performed on | ||
116 | * such table (a register is volatile if it belongs to one of | ||
117 | * the ranges specified by volatile_table). | ||
75 | * @precious_reg: Optional callback returning true if the rgister | 118 | * @precious_reg: Optional callback returning true if the rgister |
76 | * should not be read outside of a call from the driver | 119 | * should not be read outside of a call from the driver |
77 | * (eg, a clear on read interrupt status register). | 120 | * (eg, a clear on read interrupt status register). If this |
121 | * field is NULL but precious_table (see below) is not, the | ||
122 | * check is performed on such table (a register is precious if | ||
123 | * it belongs to one of the ranges specified by precious_table). | ||
124 | * @lock: Optional lock callback (overrides regmap's default lock | ||
125 | * function, based on spinlock or mutex). | ||
126 | * @unlock: As above for unlocking. | ||
127 | * @lock_arg: this field is passed as the only argument of lock/unlock | ||
128 | * functions (ignored in case regular lock/unlock functions | ||
129 | * are not overridden). | ||
78 | * | 130 | * |
79 | * @max_register: Optional, specifies the maximum valid register index. | 131 | * @max_register: Optional, specifies the maximum valid register index. |
132 | * @wr_table: Optional, points to a struct regmap_access_table specifying | ||
133 | * valid ranges for write access. | ||
134 | * @rd_table: As above, for read access. | ||
135 | * @volatile_table: As above, for volatile registers. | ||
136 | * @precious_table: As above, for precious registers. | ||
80 | * @reg_defaults: Power on reset values for registers (for use with | 137 | * @reg_defaults: Power on reset values for registers (for use with |
81 | * register cache support). | 138 | * register cache support). |
82 | * @num_reg_defaults: Number of elements in reg_defaults. | 139 | * @num_reg_defaults: Number of elements in reg_defaults. |
@@ -116,8 +173,15 @@ struct regmap_config { | |||
116 | bool (*readable_reg)(struct device *dev, unsigned int reg); | 173 | bool (*readable_reg)(struct device *dev, unsigned int reg); |
117 | bool (*volatile_reg)(struct device *dev, unsigned int reg); | 174 | bool (*volatile_reg)(struct device *dev, unsigned int reg); |
118 | bool (*precious_reg)(struct device *dev, unsigned int reg); | 175 | bool (*precious_reg)(struct device *dev, unsigned int reg); |
176 | regmap_lock lock; | ||
177 | regmap_unlock unlock; | ||
178 | void *lock_arg; | ||
119 | 179 | ||
120 | unsigned int max_register; | 180 | unsigned int max_register; |
181 | const struct regmap_access_table *wr_table; | ||
182 | const struct regmap_access_table *rd_table; | ||
183 | const struct regmap_access_table *volatile_table; | ||
184 | const struct regmap_access_table *precious_table; | ||
121 | const struct reg_default *reg_defaults; | 185 | const struct reg_default *reg_defaults; |
122 | unsigned int num_reg_defaults; | 186 | unsigned int num_reg_defaults; |
123 | enum regcache_type cache_type; | 187 | enum regcache_type cache_type; |
@@ -133,7 +197,7 @@ struct regmap_config { | |||
133 | enum regmap_endian val_format_endian; | 197 | enum regmap_endian val_format_endian; |
134 | 198 | ||
135 | const struct regmap_range_cfg *ranges; | 199 | const struct regmap_range_cfg *ranges; |
136 | unsigned int n_ranges; | 200 | unsigned int num_ranges; |
137 | }; | 201 | }; |
138 | 202 | ||
139 | /** | 203 | /** |
@@ -142,6 +206,8 @@ struct regmap_config { | |||
142 | * 1. page selector register update; | 206 | * 1. page selector register update; |
143 | * 2. access through data window registers. | 207 | * 2. access through data window registers. |
144 | * | 208 | * |
209 | * @name: Descriptive name for diagnostics | ||
210 | * | ||
145 | * @range_min: Address of the lowest register address in virtual range. | 211 | * @range_min: Address of the lowest register address in virtual range. |
146 | * @range_max: Address of the highest register in virtual range. | 212 | * @range_max: Address of the highest register in virtual range. |
147 | * | 213 | * |
@@ -153,6 +219,8 @@ struct regmap_config { | |||
153 | * @window_len: Number of registers in data window. | 219 | * @window_len: Number of registers in data window. |
154 | */ | 220 | */ |
155 | struct regmap_range_cfg { | 221 | struct regmap_range_cfg { |
222 | const char *name; | ||
223 | |||
156 | /* Registers of virtual address range */ | 224 | /* Registers of virtual address range */ |
157 | unsigned int range_min; | 225 | unsigned int range_min; |
158 | unsigned int range_max; | 226 | unsigned int range_max; |
@@ -181,7 +249,9 @@ typedef void (*regmap_hw_free_context)(void *context); | |||
181 | * Description of a hardware bus for the register map infrastructure. | 249 | * Description of a hardware bus for the register map infrastructure. |
182 | * | 250 | * |
183 | * @fast_io: Register IO is fast. Use a spinlock instead of a mutex | 251 | * @fast_io: Register IO is fast. Use a spinlock instead of a mutex |
184 | * to perform locking. | 252 | * to perform locking. This field is ignored if custom lock/unlock |
253 | * functions are used (see fields lock/unlock of | ||
254 | * struct regmap_config). | ||
185 | * @write: Write operation. | 255 | * @write: Write operation. |
186 | * @gather_write: Write operation with split register/value, return -ENOTSUPP | 256 | * @gather_write: Write operation with split register/value, return -ENOTSUPP |
187 | * if not implemented on a given device. | 257 | * if not implemented on a given device. |
@@ -262,6 +332,16 @@ void regcache_mark_dirty(struct regmap *map); | |||
262 | int regmap_register_patch(struct regmap *map, const struct reg_default *regs, | 332 | int regmap_register_patch(struct regmap *map, const struct reg_default *regs, |
263 | int num_regs); | 333 | int num_regs); |
264 | 334 | ||
335 | static inline bool regmap_reg_in_range(unsigned int reg, | ||
336 | const struct regmap_range *range) | ||
337 | { | ||
338 | return reg >= range->range_min && reg <= range->range_max; | ||
339 | } | ||
340 | |||
341 | bool regmap_reg_in_ranges(unsigned int reg, | ||
342 | const struct regmap_range *ranges, | ||
343 | unsigned int nranges); | ||
344 | |||
265 | /** | 345 | /** |
266 | * Description of an IRQ for the generic regmap irq_chip. | 346 | * Description of an IRQ for the generic regmap irq_chip. |
267 | * | 347 | * |
@@ -317,6 +397,7 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, | |||
317 | void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); | 397 | void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); |
318 | int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data); | 398 | int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data); |
319 | int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq); | 399 | int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq); |
400 | struct irq_domain *regmap_irq_get_domain(struct regmap_irq_chip_data *data); | ||
320 | 401 | ||
321 | #else | 402 | #else |
322 | 403 | ||
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index 6c8835f74f79..519777e3fa01 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
@@ -159,13 +159,14 @@ int ring_buffer_record_is_on(struct ring_buffer *buffer); | |||
159 | void ring_buffer_record_disable_cpu(struct ring_buffer *buffer, int cpu); | 159 | void ring_buffer_record_disable_cpu(struct ring_buffer *buffer, int cpu); |
160 | void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu); | 160 | void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu); |
161 | 161 | ||
162 | unsigned long ring_buffer_oldest_event_ts(struct ring_buffer *buffer, int cpu); | 162 | u64 ring_buffer_oldest_event_ts(struct ring_buffer *buffer, int cpu); |
163 | unsigned long ring_buffer_bytes_cpu(struct ring_buffer *buffer, int cpu); | 163 | unsigned long ring_buffer_bytes_cpu(struct ring_buffer *buffer, int cpu); |
164 | unsigned long ring_buffer_entries(struct ring_buffer *buffer); | 164 | unsigned long ring_buffer_entries(struct ring_buffer *buffer); |
165 | unsigned long ring_buffer_overruns(struct ring_buffer *buffer); | 165 | unsigned long ring_buffer_overruns(struct ring_buffer *buffer); |
166 | unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); | 166 | unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); |
167 | unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); | 167 | unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); |
168 | unsigned long ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu); | 168 | unsigned long ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu); |
169 | unsigned long ring_buffer_dropped_events_cpu(struct ring_buffer *buffer, int cpu); | ||
169 | 170 | ||
170 | u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu); | 171 | u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu); |
171 | void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, | 172 | void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 0dd42a02df2e..b96ff1e43ada 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -109,6 +109,8 @@ extern void update_cpu_load_nohz(void); | |||
109 | 109 | ||
110 | extern unsigned long get_parent_ip(unsigned long addr); | 110 | extern unsigned long get_parent_ip(unsigned long addr); |
111 | 111 | ||
112 | extern void dump_cpu_task(int cpu); | ||
113 | |||
112 | struct seq_file; | 114 | struct seq_file; |
113 | struct cfs_rq; | 115 | struct cfs_rq; |
114 | struct task_group; | 116 | struct task_group; |
@@ -434,13 +436,28 @@ struct cpu_itimer { | |||
434 | }; | 436 | }; |
435 | 437 | ||
436 | /** | 438 | /** |
439 | * struct cputime - snaphsot of system and user cputime | ||
440 | * @utime: time spent in user mode | ||
441 | * @stime: time spent in system mode | ||
442 | * | ||
443 | * Gathers a generic snapshot of user and system time. | ||
444 | */ | ||
445 | struct cputime { | ||
446 | cputime_t utime; | ||
447 | cputime_t stime; | ||
448 | }; | ||
449 | |||
450 | /** | ||
437 | * struct task_cputime - collected CPU time counts | 451 | * struct task_cputime - collected CPU time counts |
438 | * @utime: time spent in user mode, in &cputime_t units | 452 | * @utime: time spent in user mode, in &cputime_t units |
439 | * @stime: time spent in kernel mode, in &cputime_t units | 453 | * @stime: time spent in kernel mode, in &cputime_t units |
440 | * @sum_exec_runtime: total time spent on the CPU, in nanoseconds | 454 | * @sum_exec_runtime: total time spent on the CPU, in nanoseconds |
441 | * | 455 | * |
442 | * This structure groups together three kinds of CPU time that are | 456 | * This is an extension of struct cputime that includes the total runtime |
443 | * tracked for threads and thread groups. Most things considering | 457 | * spent by the task from the scheduler point of view. |
458 | * | ||
459 | * As a result, this structure groups together three kinds of CPU time | ||
460 | * that are tracked for threads and thread groups. Most things considering | ||
444 | * CPU time want to group these counts together and treat all three | 461 | * CPU time want to group these counts together and treat all three |
445 | * of them in parallel. | 462 | * of them in parallel. |
446 | */ | 463 | */ |
@@ -581,7 +598,7 @@ struct signal_struct { | |||
581 | cputime_t gtime; | 598 | cputime_t gtime; |
582 | cputime_t cgtime; | 599 | cputime_t cgtime; |
583 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | 600 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING |
584 | cputime_t prev_utime, prev_stime; | 601 | struct cputime prev_cputime; |
585 | #endif | 602 | #endif |
586 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; | 603 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; |
587 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; | 604 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; |
@@ -631,9 +648,10 @@ struct signal_struct { | |||
631 | struct rw_semaphore group_rwsem; | 648 | struct rw_semaphore group_rwsem; |
632 | #endif | 649 | #endif |
633 | 650 | ||
634 | int oom_score_adj; /* OOM kill score adjustment */ | 651 | oom_flags_t oom_flags; |
635 | int oom_score_adj_min; /* OOM kill score adjustment minimum value. | 652 | short oom_score_adj; /* OOM kill score adjustment */ |
636 | * Only settable by CAP_SYS_RESOURCE. */ | 653 | short oom_score_adj_min; /* OOM kill score adjustment min value. |
654 | * Only settable by CAP_SYS_RESOURCE. */ | ||
637 | 655 | ||
638 | struct mutex cred_guard_mutex; /* guard against foreign influences on | 656 | struct mutex cred_guard_mutex; /* guard against foreign influences on |
639 | * credential calculations | 657 | * credential calculations |
@@ -1061,6 +1079,7 @@ struct sched_class { | |||
1061 | 1079 | ||
1062 | #ifdef CONFIG_SMP | 1080 | #ifdef CONFIG_SMP |
1063 | int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); | 1081 | int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); |
1082 | void (*migrate_task_rq)(struct task_struct *p, int next_cpu); | ||
1064 | 1083 | ||
1065 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); | 1084 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); |
1066 | void (*post_schedule) (struct rq *this_rq); | 1085 | void (*post_schedule) (struct rq *this_rq); |
@@ -1095,6 +1114,18 @@ struct load_weight { | |||
1095 | unsigned long weight, inv_weight; | 1114 | unsigned long weight, inv_weight; |
1096 | }; | 1115 | }; |
1097 | 1116 | ||
1117 | struct sched_avg { | ||
1118 | /* | ||
1119 | * These sums represent an infinite geometric series and so are bound | ||
1120 | * above by 1024/(1-y). Thus we only need a u32 to store them for for all | ||
1121 | * choices of y < 1-2^(-32)*1024. | ||
1122 | */ | ||
1123 | u32 runnable_avg_sum, runnable_avg_period; | ||
1124 | u64 last_runnable_update; | ||
1125 | s64 decay_count; | ||
1126 | unsigned long load_avg_contrib; | ||
1127 | }; | ||
1128 | |||
1098 | #ifdef CONFIG_SCHEDSTATS | 1129 | #ifdef CONFIG_SCHEDSTATS |
1099 | struct sched_statistics { | 1130 | struct sched_statistics { |
1100 | u64 wait_start; | 1131 | u64 wait_start; |
@@ -1155,6 +1186,15 @@ struct sched_entity { | |||
1155 | /* rq "owned" by this entity/group: */ | 1186 | /* rq "owned" by this entity/group: */ |
1156 | struct cfs_rq *my_q; | 1187 | struct cfs_rq *my_q; |
1157 | #endif | 1188 | #endif |
1189 | /* | ||
1190 | * Load-tracking only depends on SMP, FAIR_GROUP_SCHED dependency below may be | ||
1191 | * removed when useful for applications beyond shares distribution (e.g. | ||
1192 | * load-balance). | ||
1193 | */ | ||
1194 | #if defined(CONFIG_SMP) && defined(CONFIG_FAIR_GROUP_SCHED) | ||
1195 | /* Per-entity load-tracking */ | ||
1196 | struct sched_avg avg; | ||
1197 | #endif | ||
1158 | }; | 1198 | }; |
1159 | 1199 | ||
1160 | struct sched_rt_entity { | 1200 | struct sched_rt_entity { |
@@ -1318,7 +1358,7 @@ struct task_struct { | |||
1318 | cputime_t utime, stime, utimescaled, stimescaled; | 1358 | cputime_t utime, stime, utimescaled, stimescaled; |
1319 | cputime_t gtime; | 1359 | cputime_t gtime; |
1320 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | 1360 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING |
1321 | cputime_t prev_utime, prev_stime; | 1361 | struct cputime prev_cputime; |
1322 | #endif | 1362 | #endif |
1323 | unsigned long nvcsw, nivcsw; /* context switch counts */ | 1363 | unsigned long nvcsw, nivcsw; /* context switch counts */ |
1324 | struct timespec start_time; /* monotonic time */ | 1364 | struct timespec start_time; /* monotonic time */ |
@@ -1729,8 +1769,8 @@ static inline void put_task_struct(struct task_struct *t) | |||
1729 | __put_task_struct(t); | 1769 | __put_task_struct(t); |
1730 | } | 1770 | } |
1731 | 1771 | ||
1732 | extern void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st); | 1772 | extern void task_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st); |
1733 | extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st); | 1773 | extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st); |
1734 | 1774 | ||
1735 | /* | 1775 | /* |
1736 | * Per process flags | 1776 | * Per process flags |
@@ -1844,14 +1884,6 @@ static inline void rcu_copy_process(struct task_struct *p) | |||
1844 | 1884 | ||
1845 | #endif | 1885 | #endif |
1846 | 1886 | ||
1847 | static inline void rcu_switch(struct task_struct *prev, | ||
1848 | struct task_struct *next) | ||
1849 | { | ||
1850 | #ifdef CONFIG_RCU_USER_QS | ||
1851 | rcu_user_hooks_switch(prev, next); | ||
1852 | #endif | ||
1853 | } | ||
1854 | |||
1855 | static inline void tsk_restore_flags(struct task_struct *task, | 1887 | static inline void tsk_restore_flags(struct task_struct *task, |
1856 | unsigned long orig_flags, unsigned long flags) | 1888 | unsigned long orig_flags, unsigned long flags) |
1857 | { | 1889 | { |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index c174c90fb3fb..c490d20b3fb8 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -105,6 +105,8 @@ extern int early_serial_setup(struct uart_port *port); | |||
105 | 105 | ||
106 | extern int serial8250_find_port(struct uart_port *p); | 106 | extern int serial8250_find_port(struct uart_port *p); |
107 | extern int serial8250_find_port_for_earlycon(void); | 107 | extern int serial8250_find_port_for_earlycon(void); |
108 | extern unsigned int serial8250_early_in(struct uart_port *port, int offset); | ||
109 | extern void serial8250_early_out(struct uart_port *port, int offset, int value); | ||
108 | extern int setup_early_serial8250_console(char *cmdline); | 110 | extern int setup_early_serial8250_console(char *cmdline); |
109 | extern void serial8250_do_set_termios(struct uart_port *port, | 111 | extern void serial8250_do_set_termios(struct uart_port *port, |
110 | struct ktermios *termios, struct ktermios *old); | 112 | struct ktermios *termios, struct ktermios *old); |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 3c430228d232..c6690a2a27fb 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -46,6 +46,8 @@ struct uart_ops { | |||
46 | unsigned int (*get_mctrl)(struct uart_port *); | 46 | unsigned int (*get_mctrl)(struct uart_port *); |
47 | void (*stop_tx)(struct uart_port *); | 47 | void (*stop_tx)(struct uart_port *); |
48 | void (*start_tx)(struct uart_port *); | 48 | void (*start_tx)(struct uart_port *); |
49 | void (*throttle)(struct uart_port *); | ||
50 | void (*unthrottle)(struct uart_port *); | ||
49 | void (*send_xchar)(struct uart_port *, char ch); | 51 | void (*send_xchar)(struct uart_port *, char ch); |
50 | void (*stop_rx)(struct uart_port *); | 52 | void (*stop_rx)(struct uart_port *); |
51 | void (*enable_ms)(struct uart_port *); | 53 | void (*enable_ms)(struct uart_port *); |
@@ -163,6 +165,10 @@ struct uart_port { | |||
163 | #define UPF_BUGGY_UART ((__force upf_t) (1 << 14)) | 165 | #define UPF_BUGGY_UART ((__force upf_t) (1 << 14)) |
164 | #define UPF_NO_TXEN_TEST ((__force upf_t) (1 << 15)) | 166 | #define UPF_NO_TXEN_TEST ((__force upf_t) (1 << 15)) |
165 | #define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) | 167 | #define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) |
168 | /* Port has hardware-assisted h/w flow control (iow, auto-RTS *not* auto-CTS) */ | ||
169 | #define UPF_HARD_FLOW ((__force upf_t) (1 << 21)) | ||
170 | /* Port has hardware-assisted s/w flow control */ | ||
171 | #define UPF_SOFT_FLOW ((__force upf_t) (1 << 22)) | ||
166 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) | 172 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) |
167 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) | 173 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) |
168 | #define UPF_EXAR_EFR ((__force upf_t) (1 << 25)) | 174 | #define UPF_EXAR_EFR ((__force upf_t) (1 << 25)) |
diff --git a/include/linux/shm.h b/include/linux/shm.h index bcf8a6a3ec00..429c1995d756 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h | |||
@@ -29,6 +29,21 @@ struct shmid_kernel /* private to the kernel */ | |||
29 | #define SHM_HUGETLB 04000 /* segment will use huge TLB pages */ | 29 | #define SHM_HUGETLB 04000 /* segment will use huge TLB pages */ |
30 | #define SHM_NORESERVE 010000 /* don't check for reservations */ | 30 | #define SHM_NORESERVE 010000 /* don't check for reservations */ |
31 | 31 | ||
32 | /* Bits [26:31] are reserved */ | ||
33 | |||
34 | /* | ||
35 | * When SHM_HUGETLB is set bits [26:31] encode the log2 of the huge page size. | ||
36 | * This gives us 6 bits, which is enough until someone invents 128 bit address | ||
37 | * spaces. | ||
38 | * | ||
39 | * Assume these are all power of twos. | ||
40 | * When 0 use the default page size. | ||
41 | */ | ||
42 | #define SHM_HUGE_SHIFT 26 | ||
43 | #define SHM_HUGE_MASK 0x3f | ||
44 | #define SHM_HUGE_2MB (21 << SHM_HUGE_SHIFT) | ||
45 | #define SHM_HUGE_1GB (30 << SHM_HUGE_SHIFT) | ||
46 | |||
32 | #ifdef CONFIG_SYSVIPC | 47 | #ifdef CONFIG_SYSVIPC |
33 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr, | 48 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr, |
34 | unsigned long shmlba); | 49 | unsigned long shmlba); |
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index c64de9dd7631..2f694f3846a9 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
@@ -46,8 +46,9 @@ struct ads7846_platform_data { | |||
46 | u16 debounce_rep; /* additional consecutive good readings | 46 | u16 debounce_rep; /* additional consecutive good readings |
47 | * required after the first two */ | 47 | * required after the first two */ |
48 | int gpio_pendown; /* the GPIO used to decide the pendown | 48 | int gpio_pendown; /* the GPIO used to decide the pendown |
49 | * state if get_pendown_state == NULL | 49 | * state if get_pendown_state == NULL */ |
50 | */ | 50 | int gpio_pendown_debounce; /* platform specific debounce time for |
51 | * the gpio_pendown */ | ||
51 | int (*get_pendown_state)(void); | 52 | int (*get_pendown_state)(void); |
52 | int (*filter_init) (const struct ads7846_platform_data *pdata, | 53 | int (*filter_init) (const struct ads7846_platform_data *pdata, |
53 | void **filter_data); | 54 | void **filter_data); |
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 55a5c52cbb25..6eb691b08358 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
@@ -16,8 +16,10 @@ | |||
16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | * | 17 | * |
18 | * Copyright (C) IBM Corporation, 2006 | 18 | * Copyright (C) IBM Corporation, 2006 |
19 | * Copyright (C) Fujitsu, 2012 | ||
19 | * | 20 | * |
20 | * Author: Paul McKenney <paulmck@us.ibm.com> | 21 | * Author: Paul McKenney <paulmck@us.ibm.com> |
22 | * Lai Jiangshan <laijs@cn.fujitsu.com> | ||
21 | * | 23 | * |
22 | * For detailed explanation of Read-Copy Update mechanism see - | 24 | * For detailed explanation of Read-Copy Update mechanism see - |
23 | * Documentation/RCU/ *.txt | 25 | * Documentation/RCU/ *.txt |
@@ -40,6 +42,8 @@ struct rcu_batch { | |||
40 | struct rcu_head *head, **tail; | 42 | struct rcu_head *head, **tail; |
41 | }; | 43 | }; |
42 | 44 | ||
45 | #define RCU_BATCH_INIT(name) { NULL, &(name.head) } | ||
46 | |||
43 | struct srcu_struct { | 47 | struct srcu_struct { |
44 | unsigned completed; | 48 | unsigned completed; |
45 | struct srcu_struct_array __percpu *per_cpu_ref; | 49 | struct srcu_struct_array __percpu *per_cpu_ref; |
@@ -70,12 +74,42 @@ int __init_srcu_struct(struct srcu_struct *sp, const char *name, | |||
70 | __init_srcu_struct((sp), #sp, &__srcu_key); \ | 74 | __init_srcu_struct((sp), #sp, &__srcu_key); \ |
71 | }) | 75 | }) |
72 | 76 | ||
77 | #define __SRCU_DEP_MAP_INIT(srcu_name) .dep_map = { .name = #srcu_name }, | ||
73 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | 78 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ |
74 | 79 | ||
75 | int init_srcu_struct(struct srcu_struct *sp); | 80 | int init_srcu_struct(struct srcu_struct *sp); |
76 | 81 | ||
82 | #define __SRCU_DEP_MAP_INIT(srcu_name) | ||
77 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | 83 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ |
78 | 84 | ||
85 | void process_srcu(struct work_struct *work); | ||
86 | |||
87 | #define __SRCU_STRUCT_INIT(name) \ | ||
88 | { \ | ||
89 | .completed = -300, \ | ||
90 | .per_cpu_ref = &name##_srcu_array, \ | ||
91 | .queue_lock = __SPIN_LOCK_UNLOCKED(name.queue_lock), \ | ||
92 | .running = false, \ | ||
93 | .batch_queue = RCU_BATCH_INIT(name.batch_queue), \ | ||
94 | .batch_check0 = RCU_BATCH_INIT(name.batch_check0), \ | ||
95 | .batch_check1 = RCU_BATCH_INIT(name.batch_check1), \ | ||
96 | .batch_done = RCU_BATCH_INIT(name.batch_done), \ | ||
97 | .work = __DELAYED_WORK_INITIALIZER(name.work, process_srcu, 0),\ | ||
98 | __SRCU_DEP_MAP_INIT(name) \ | ||
99 | } | ||
100 | |||
101 | /* | ||
102 | * define and init a srcu struct at build time. | ||
103 | * dont't call init_srcu_struct() nor cleanup_srcu_struct() on it. | ||
104 | */ | ||
105 | #define DEFINE_SRCU(name) \ | ||
106 | static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\ | ||
107 | struct srcu_struct name = __SRCU_STRUCT_INIT(name); | ||
108 | |||
109 | #define DEFINE_STATIC_SRCU(name) \ | ||
110 | static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\ | ||
111 | static struct srcu_struct name = __SRCU_STRUCT_INIT(name); | ||
112 | |||
79 | /** | 113 | /** |
80 | * call_srcu() - Queue a callback for invocation after an SRCU grace period | 114 | * call_srcu() - Queue a callback for invocation after an SRCU grace period |
81 | * @sp: srcu_struct in queue the callback | 115 | * @sp: srcu_struct in queue the callback |
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 91b34812cd84..fe82022478e7 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -29,6 +29,32 @@ | |||
29 | #include <linux/device.h> | 29 | #include <linux/device.h> |
30 | #include <linux/workqueue.h> | 30 | #include <linux/workqueue.h> |
31 | 31 | ||
32 | #define THERMAL_TRIPS_NONE -1 | ||
33 | #define THERMAL_MAX_TRIPS 12 | ||
34 | #define THERMAL_NAME_LENGTH 20 | ||
35 | |||
36 | /* No upper/lower limit requirement */ | ||
37 | #define THERMAL_NO_LIMIT -1UL | ||
38 | |||
39 | /* Unit conversion macros */ | ||
40 | #define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \ | ||
41 | ((long)t-2732+5)/10 : ((long)t-2732-5)/10) | ||
42 | #define CELSIUS_TO_KELVIN(t) ((t)*10+2732) | ||
43 | |||
44 | /* Adding event notification support elements */ | ||
45 | #define THERMAL_GENL_FAMILY_NAME "thermal_event" | ||
46 | #define THERMAL_GENL_VERSION 0x01 | ||
47 | #define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group" | ||
48 | |||
49 | /* Default Thermal Governor */ | ||
50 | #if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE) | ||
51 | #define DEFAULT_THERMAL_GOVERNOR "step_wise" | ||
52 | #elif defined(CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE) | ||
53 | #define DEFAULT_THERMAL_GOVERNOR "fair_share" | ||
54 | #elif defined(CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE) | ||
55 | #define DEFAULT_THERMAL_GOVERNOR "user_space" | ||
56 | #endif | ||
57 | |||
32 | struct thermal_zone_device; | 58 | struct thermal_zone_device; |
33 | struct thermal_cooling_device; | 59 | struct thermal_cooling_device; |
34 | 60 | ||
@@ -50,6 +76,30 @@ enum thermal_trend { | |||
50 | THERMAL_TREND_DROPPING, /* temperature is dropping */ | 76 | THERMAL_TREND_DROPPING, /* temperature is dropping */ |
51 | }; | 77 | }; |
52 | 78 | ||
79 | /* Events supported by Thermal Netlink */ | ||
80 | enum events { | ||
81 | THERMAL_AUX0, | ||
82 | THERMAL_AUX1, | ||
83 | THERMAL_CRITICAL, | ||
84 | THERMAL_DEV_FAULT, | ||
85 | }; | ||
86 | |||
87 | /* attributes of thermal_genl_family */ | ||
88 | enum { | ||
89 | THERMAL_GENL_ATTR_UNSPEC, | ||
90 | THERMAL_GENL_ATTR_EVENT, | ||
91 | __THERMAL_GENL_ATTR_MAX, | ||
92 | }; | ||
93 | #define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1) | ||
94 | |||
95 | /* commands supported by the thermal_genl_family */ | ||
96 | enum { | ||
97 | THERMAL_GENL_CMD_UNSPEC, | ||
98 | THERMAL_GENL_CMD_EVENT, | ||
99 | __THERMAL_GENL_CMD_MAX, | ||
100 | }; | ||
101 | #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) | ||
102 | |||
53 | struct thermal_zone_device_ops { | 103 | struct thermal_zone_device_ops { |
54 | int (*bind) (struct thermal_zone_device *, | 104 | int (*bind) (struct thermal_zone_device *, |
55 | struct thermal_cooling_device *); | 105 | struct thermal_cooling_device *); |
@@ -83,11 +133,6 @@ struct thermal_cooling_device_ops { | |||
83 | int (*set_cur_state) (struct thermal_cooling_device *, unsigned long); | 133 | int (*set_cur_state) (struct thermal_cooling_device *, unsigned long); |
84 | }; | 134 | }; |
85 | 135 | ||
86 | #define THERMAL_NO_LIMIT -1UL /* no upper/lower limit requirement */ | ||
87 | |||
88 | #define THERMAL_TRIPS_NONE -1 | ||
89 | #define THERMAL_MAX_TRIPS 12 | ||
90 | #define THERMAL_NAME_LENGTH 20 | ||
91 | struct thermal_cooling_device { | 136 | struct thermal_cooling_device { |
92 | int id; | 137 | int id; |
93 | char type[THERMAL_NAME_LENGTH]; | 138 | char type[THERMAL_NAME_LENGTH]; |
@@ -100,10 +145,6 @@ struct thermal_cooling_device { | |||
100 | struct list_head node; | 145 | struct list_head node; |
101 | }; | 146 | }; |
102 | 147 | ||
103 | #define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \ | ||
104 | ((long)t-2732+5)/10 : ((long)t-2732-5)/10) | ||
105 | #define CELSIUS_TO_KELVIN(t) ((t)*10+2732) | ||
106 | |||
107 | struct thermal_attr { | 148 | struct thermal_attr { |
108 | struct device_attribute attr; | 149 | struct device_attribute attr; |
109 | char name[THERMAL_NAME_LENGTH]; | 150 | char name[THERMAL_NAME_LENGTH]; |
@@ -125,46 +166,61 @@ struct thermal_zone_device { | |||
125 | int passive; | 166 | int passive; |
126 | unsigned int forced_passive; | 167 | unsigned int forced_passive; |
127 | const struct thermal_zone_device_ops *ops; | 168 | const struct thermal_zone_device_ops *ops; |
169 | const struct thermal_zone_params *tzp; | ||
170 | struct thermal_governor *governor; | ||
128 | struct list_head thermal_instances; | 171 | struct list_head thermal_instances; |
129 | struct idr idr; | 172 | struct idr idr; |
130 | struct mutex lock; /* protect thermal_instances list */ | 173 | struct mutex lock; /* protect thermal_instances list */ |
131 | struct list_head node; | 174 | struct list_head node; |
132 | struct delayed_work poll_queue; | 175 | struct delayed_work poll_queue; |
133 | }; | 176 | }; |
134 | /* Adding event notification support elements */ | ||
135 | #define THERMAL_GENL_FAMILY_NAME "thermal_event" | ||
136 | #define THERMAL_GENL_VERSION 0x01 | ||
137 | #define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group" | ||
138 | 177 | ||
139 | enum events { | 178 | /* Structure that holds thermal governor information */ |
140 | THERMAL_AUX0, | 179 | struct thermal_governor { |
141 | THERMAL_AUX1, | 180 | char name[THERMAL_NAME_LENGTH]; |
142 | THERMAL_CRITICAL, | 181 | int (*throttle)(struct thermal_zone_device *tz, int trip); |
143 | THERMAL_DEV_FAULT, | 182 | struct list_head governor_list; |
183 | struct module *owner; | ||
144 | }; | 184 | }; |
145 | 185 | ||
146 | struct thermal_genl_event { | 186 | /* Structure that holds binding parameters for a zone */ |
147 | u32 orig; | 187 | struct thermal_bind_params { |
148 | enum events event; | 188 | struct thermal_cooling_device *cdev; |
189 | |||
190 | /* | ||
191 | * This is a measure of 'how effectively these devices can | ||
192 | * cool 'this' thermal zone. The shall be determined by platform | ||
193 | * characterization. This is on a 'percentage' scale. | ||
194 | * See Documentation/thermal/sysfs-api.txt for more information. | ||
195 | */ | ||
196 | int weight; | ||
197 | |||
198 | /* | ||
199 | * This is a bit mask that gives the binding relation between this | ||
200 | * thermal zone and cdev, for a particular trip point. | ||
201 | * See Documentation/thermal/sysfs-api.txt for more information. | ||
202 | */ | ||
203 | int trip_mask; | ||
204 | int (*match) (struct thermal_zone_device *tz, | ||
205 | struct thermal_cooling_device *cdev); | ||
149 | }; | 206 | }; |
150 | /* attributes of thermal_genl_family */ | 207 | |
151 | enum { | 208 | /* Structure to define Thermal Zone parameters */ |
152 | THERMAL_GENL_ATTR_UNSPEC, | 209 | struct thermal_zone_params { |
153 | THERMAL_GENL_ATTR_EVENT, | 210 | char governor_name[THERMAL_NAME_LENGTH]; |
154 | __THERMAL_GENL_ATTR_MAX, | 211 | int num_tbps; /* Number of tbp entries */ |
212 | struct thermal_bind_params *tbp; | ||
155 | }; | 213 | }; |
156 | #define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1) | ||
157 | 214 | ||
158 | /* commands supported by the thermal_genl_family */ | 215 | struct thermal_genl_event { |
159 | enum { | 216 | u32 orig; |
160 | THERMAL_GENL_CMD_UNSPEC, | 217 | enum events event; |
161 | THERMAL_GENL_CMD_EVENT, | ||
162 | __THERMAL_GENL_CMD_MAX, | ||
163 | }; | 218 | }; |
164 | #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) | ||
165 | 219 | ||
220 | /* Function declarations */ | ||
166 | struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, | 221 | struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, |
167 | void *, const struct thermal_zone_device_ops *, int, int); | 222 | void *, const struct thermal_zone_device_ops *, |
223 | const struct thermal_zone_params *, int, int); | ||
168 | void thermal_zone_device_unregister(struct thermal_zone_device *); | 224 | void thermal_zone_device_unregister(struct thermal_zone_device *); |
169 | 225 | ||
170 | int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, | 226 | int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, |
@@ -173,10 +229,20 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, | |||
173 | int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, | 229 | int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, |
174 | struct thermal_cooling_device *); | 230 | struct thermal_cooling_device *); |
175 | void thermal_zone_device_update(struct thermal_zone_device *); | 231 | void thermal_zone_device_update(struct thermal_zone_device *); |
232 | |||
176 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, | 233 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, |
177 | const struct thermal_cooling_device_ops *); | 234 | const struct thermal_cooling_device_ops *); |
178 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); | 235 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); |
179 | 236 | ||
237 | int get_tz_trend(struct thermal_zone_device *, int); | ||
238 | struct thermal_instance *get_thermal_instance(struct thermal_zone_device *, | ||
239 | struct thermal_cooling_device *, int); | ||
240 | void thermal_cdev_update(struct thermal_cooling_device *); | ||
241 | void notify_thermal_framework(struct thermal_zone_device *, int); | ||
242 | |||
243 | int thermal_register_governor(struct thermal_governor *); | ||
244 | void thermal_unregister_governor(struct thermal_governor *); | ||
245 | |||
180 | #ifdef CONFIG_NET | 246 | #ifdef CONFIG_NET |
181 | extern int thermal_generate_netlink_event(u32 orig, enum events event); | 247 | extern int thermal_generate_netlink_event(u32 orig, enum events event); |
182 | #else | 248 | #else |
diff --git a/include/linux/tick.h b/include/linux/tick.h index f37fceb69b73..1a6567b48492 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -142,4 +142,10 @@ static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; } | |||
142 | static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; } | 142 | static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; } |
143 | # endif /* !NO_HZ */ | 143 | # endif /* !NO_HZ */ |
144 | 144 | ||
145 | # ifdef CONFIG_CPU_IDLE_GOV_MENU | ||
146 | extern void menu_hrtimer_cancel(void); | ||
147 | # else | ||
148 | static inline void menu_hrtimer_cancel(void) {} | ||
149 | # endif /* CONFIG_CPU_IDLE_GOV_MENU */ | ||
150 | |||
145 | #endif | 151 | #endif |
diff --git a/include/linux/trace_clock.h b/include/linux/trace_clock.h index 4eb490237d4c..d563f37e1a1d 100644 --- a/include/linux/trace_clock.h +++ b/include/linux/trace_clock.h | |||
@@ -12,6 +12,8 @@ | |||
12 | #include <linux/compiler.h> | 12 | #include <linux/compiler.h> |
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | 14 | ||
15 | #include <asm/trace_clock.h> | ||
16 | |||
15 | extern u64 notrace trace_clock_local(void); | 17 | extern u64 notrace trace_clock_local(void); |
16 | extern u64 notrace trace_clock(void); | 18 | extern u64 notrace trace_clock(void); |
17 | extern u64 notrace trace_clock_global(void); | 19 | extern u64 notrace trace_clock_global(void); |
diff --git a/include/linux/tty.h b/include/linux/tty.h index f0b4eb47297c..8db1b569c37a 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -188,7 +188,9 @@ struct tty_port_operations { | |||
188 | }; | 188 | }; |
189 | 189 | ||
190 | struct tty_port { | 190 | struct tty_port { |
191 | struct tty_bufhead buf; /* Locked internally */ | ||
191 | struct tty_struct *tty; /* Back pointer */ | 192 | struct tty_struct *tty; /* Back pointer */ |
193 | struct tty_struct *itty; /* internal back ptr */ | ||
192 | const struct tty_port_operations *ops; /* Port operations */ | 194 | const struct tty_port_operations *ops; /* Port operations */ |
193 | spinlock_t lock; /* Lock protecting tty field */ | 195 | spinlock_t lock; /* Lock protecting tty field */ |
194 | int blocked_open; /* Waiting to open */ | 196 | int blocked_open; /* Waiting to open */ |
@@ -197,6 +199,9 @@ struct tty_port { | |||
197 | wait_queue_head_t close_wait; /* Close waiters */ | 199 | wait_queue_head_t close_wait; /* Close waiters */ |
198 | wait_queue_head_t delta_msr_wait; /* Modem status change */ | 200 | wait_queue_head_t delta_msr_wait; /* Modem status change */ |
199 | unsigned long flags; /* TTY flags ASY_*/ | 201 | unsigned long flags; /* TTY flags ASY_*/ |
202 | unsigned long iflags; /* TTYP_ internal flags */ | ||
203 | #define TTYP_FLUSHING 1 /* Flushing to ldisc in progress */ | ||
204 | #define TTYP_FLUSHPENDING 2 /* Queued buffer flush pending */ | ||
200 | unsigned char console:1; /* port is a console */ | 205 | unsigned char console:1; /* port is a console */ |
201 | struct mutex mutex; /* Locking */ | 206 | struct mutex mutex; /* Locking */ |
202 | struct mutex buf_mutex; /* Buffer alloc lock */ | 207 | struct mutex buf_mutex; /* Buffer alloc lock */ |
@@ -235,6 +240,7 @@ struct tty_struct { | |||
235 | struct mutex ldisc_mutex; | 240 | struct mutex ldisc_mutex; |
236 | struct tty_ldisc *ldisc; | 241 | struct tty_ldisc *ldisc; |
237 | 242 | ||
243 | struct mutex atomic_write_lock; | ||
238 | struct mutex legacy_mutex; | 244 | struct mutex legacy_mutex; |
239 | struct mutex termios_mutex; | 245 | struct mutex termios_mutex; |
240 | spinlock_t ctrl_lock; | 246 | spinlock_t ctrl_lock; |
@@ -254,7 +260,6 @@ struct tty_struct { | |||
254 | 260 | ||
255 | struct tty_struct *link; | 261 | struct tty_struct *link; |
256 | struct fasync_struct *fasync; | 262 | struct fasync_struct *fasync; |
257 | struct tty_bufhead buf; /* Locked internally */ | ||
258 | int alt_speed; /* For magic substitution of 38400 bps */ | 263 | int alt_speed; /* For magic substitution of 38400 bps */ |
259 | wait_queue_head_t write_wait; | 264 | wait_queue_head_t write_wait; |
260 | wait_queue_head_t read_wait; | 265 | wait_queue_head_t read_wait; |
@@ -265,37 +270,10 @@ struct tty_struct { | |||
265 | 270 | ||
266 | #define N_TTY_BUF_SIZE 4096 | 271 | #define N_TTY_BUF_SIZE 4096 |
267 | 272 | ||
268 | /* | ||
269 | * The following is data for the N_TTY line discipline. For | ||
270 | * historical reasons, this is included in the tty structure. | ||
271 | * Mostly locked by the BKL. | ||
272 | */ | ||
273 | unsigned int column; | ||
274 | unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1; | ||
275 | unsigned char closing:1; | 273 | unsigned char closing:1; |
276 | unsigned char echo_overrun:1; | ||
277 | unsigned short minimum_to_wake; | 274 | unsigned short minimum_to_wake; |
278 | unsigned long overrun_time; | ||
279 | int num_overrun; | ||
280 | unsigned long process_char_map[256/(8*sizeof(unsigned long))]; | ||
281 | char *read_buf; | ||
282 | int read_head; | ||
283 | int read_tail; | ||
284 | int read_cnt; | ||
285 | unsigned long read_flags[N_TTY_BUF_SIZE/(8*sizeof(unsigned long))]; | ||
286 | unsigned char *echo_buf; | ||
287 | unsigned int echo_pos; | ||
288 | unsigned int echo_cnt; | ||
289 | int canon_data; | ||
290 | unsigned long canon_head; | ||
291 | unsigned int canon_column; | ||
292 | struct mutex atomic_read_lock; | ||
293 | struct mutex atomic_write_lock; | ||
294 | struct mutex output_lock; | ||
295 | struct mutex echo_lock; | ||
296 | unsigned char *write_buf; | 275 | unsigned char *write_buf; |
297 | int write_cnt; | 276 | int write_cnt; |
298 | spinlock_t read_lock; | ||
299 | /* If the tty has a pending do_SAK, queue it here - akpm */ | 277 | /* If the tty has a pending do_SAK, queue it here - akpm */ |
300 | struct work_struct SAK_work; | 278 | struct work_struct SAK_work; |
301 | struct tty_port *port; | 279 | struct tty_port *port; |
@@ -335,8 +313,6 @@ struct tty_file_private { | |||
335 | #define TTY_PTY_LOCK 16 /* pty private */ | 313 | #define TTY_PTY_LOCK 16 /* pty private */ |
336 | #define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ | 314 | #define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ |
337 | #define TTY_HUPPED 18 /* Post driver->hangup() */ | 315 | #define TTY_HUPPED 18 /* Post driver->hangup() */ |
338 | #define TTY_FLUSHING 19 /* Flushing to ldisc in progress */ | ||
339 | #define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */ | ||
340 | #define TTY_HUPPING 21 /* ->hangup() in progress */ | 316 | #define TTY_HUPPING 21 /* ->hangup() in progress */ |
341 | 317 | ||
342 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) | 318 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) |
@@ -412,9 +388,9 @@ extern void disassociate_ctty(int priv); | |||
412 | extern void no_tty(void); | 388 | extern void no_tty(void); |
413 | extern void tty_flip_buffer_push(struct tty_struct *tty); | 389 | extern void tty_flip_buffer_push(struct tty_struct *tty); |
414 | extern void tty_flush_to_ldisc(struct tty_struct *tty); | 390 | extern void tty_flush_to_ldisc(struct tty_struct *tty); |
415 | extern void tty_buffer_free_all(struct tty_struct *tty); | 391 | extern void tty_buffer_free_all(struct tty_port *port); |
416 | extern void tty_buffer_flush(struct tty_struct *tty); | 392 | extern void tty_buffer_flush(struct tty_struct *tty); |
417 | extern void tty_buffer_init(struct tty_struct *tty); | 393 | extern void tty_buffer_init(struct tty_port *port); |
418 | extern speed_t tty_get_baud_rate(struct tty_struct *tty); | 394 | extern speed_t tty_get_baud_rate(struct tty_struct *tty); |
419 | extern speed_t tty_termios_baud_rate(struct ktermios *termios); | 395 | extern speed_t tty_termios_baud_rate(struct ktermios *termios); |
420 | extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); | 396 | extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); |
@@ -479,6 +455,7 @@ extern struct device *tty_port_register_device_attr(struct tty_port *port, | |||
479 | const struct attribute_group **attr_grp); | 455 | const struct attribute_group **attr_grp); |
480 | extern int tty_port_alloc_xmit_buf(struct tty_port *port); | 456 | extern int tty_port_alloc_xmit_buf(struct tty_port *port); |
481 | extern void tty_port_free_xmit_buf(struct tty_port *port); | 457 | extern void tty_port_free_xmit_buf(struct tty_port *port); |
458 | extern void tty_port_destroy(struct tty_port *port); | ||
482 | extern void tty_port_put(struct tty_port *port); | 459 | extern void tty_port_put(struct tty_port *port); |
483 | 460 | ||
484 | static inline struct tty_port *tty_port_get(struct tty_port *port) | 461 | static inline struct tty_port *tty_port_get(struct tty_port *port) |
@@ -535,7 +512,7 @@ extern void n_tty_inherit_ops(struct tty_ldisc_ops *ops); | |||
535 | /* tty_audit.c */ | 512 | /* tty_audit.c */ |
536 | #ifdef CONFIG_AUDIT | 513 | #ifdef CONFIG_AUDIT |
537 | extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, | 514 | extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, |
538 | size_t size); | 515 | size_t size, unsigned icanon); |
539 | extern void tty_audit_exit(void); | 516 | extern void tty_audit_exit(void); |
540 | extern void tty_audit_fork(struct signal_struct *sig); | 517 | extern void tty_audit_fork(struct signal_struct *sig); |
541 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); | 518 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); |
@@ -544,7 +521,7 @@ extern int tty_audit_push_task(struct task_struct *tsk, | |||
544 | kuid_t loginuid, u32 sessionid); | 521 | kuid_t loginuid, u32 sessionid); |
545 | #else | 522 | #else |
546 | static inline void tty_audit_add_data(struct tty_struct *tty, | 523 | static inline void tty_audit_add_data(struct tty_struct *tty, |
547 | unsigned char *data, size_t size) | 524 | unsigned char *data, size_t size, unsigned icanon) |
548 | { | 525 | { |
549 | } | 526 | } |
550 | static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch) | 527 | static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch) |
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index 9239d033a0a3..2002344ed36a 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h | |||
@@ -11,7 +11,7 @@ void tty_schedule_flip(struct tty_struct *tty); | |||
11 | static inline int tty_insert_flip_char(struct tty_struct *tty, | 11 | static inline int tty_insert_flip_char(struct tty_struct *tty, |
12 | unsigned char ch, char flag) | 12 | unsigned char ch, char flag) |
13 | { | 13 | { |
14 | struct tty_buffer *tb = tty->buf.tail; | 14 | struct tty_buffer *tb = tty->port->buf.tail; |
15 | if (tb && tb->used < tb->size) { | 15 | if (tb && tb->used < tb->size) { |
16 | tb->flag_buf_ptr[tb->used] = flag; | 16 | tb->flag_buf_ptr[tb->used] = flag; |
17 | tb->char_buf_ptr[tb->used++] = ch; | 17 | tb->char_buf_ptr[tb->used++] = ch; |
diff --git a/include/linux/types.h b/include/linux/types.h index 1cc0e4b9a048..4d118ba11349 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -156,6 +156,7 @@ typedef u32 dma_addr_t; | |||
156 | #endif | 156 | #endif |
157 | typedef unsigned __bitwise__ gfp_t; | 157 | typedef unsigned __bitwise__ gfp_t; |
158 | typedef unsigned __bitwise__ fmode_t; | 158 | typedef unsigned __bitwise__ fmode_t; |
159 | typedef unsigned __bitwise__ oom_flags_t; | ||
159 | 160 | ||
160 | #ifdef CONFIG_PHYS_ADDR_T_64BIT | 161 | #ifdef CONFIG_PHYS_ADDR_T_64BIT |
161 | typedef u64 phys_addr_t; | 162 | typedef u64 phys_addr_t; |
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index 24594571c5a3..4f628a6fc5b4 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h | |||
@@ -97,12 +97,12 @@ extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_con | |||
97 | extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); | 97 | extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
98 | extern int uprobe_mmap(struct vm_area_struct *vma); | 98 | extern int uprobe_mmap(struct vm_area_struct *vma); |
99 | extern void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end); | 99 | extern void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end); |
100 | extern void uprobe_start_dup_mmap(void); | ||
101 | extern void uprobe_end_dup_mmap(void); | ||
100 | extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); | 102 | extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); |
101 | extern void uprobe_free_utask(struct task_struct *t); | 103 | extern void uprobe_free_utask(struct task_struct *t); |
102 | extern void uprobe_copy_process(struct task_struct *t); | 104 | extern void uprobe_copy_process(struct task_struct *t); |
103 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); | 105 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); |
104 | extern void __weak arch_uprobe_enable_step(struct arch_uprobe *arch); | ||
105 | extern void __weak arch_uprobe_disable_step(struct arch_uprobe *arch); | ||
106 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); | 106 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); |
107 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); | 107 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); |
108 | extern void uprobe_notify_resume(struct pt_regs *regs); | 108 | extern void uprobe_notify_resume(struct pt_regs *regs); |
@@ -129,6 +129,12 @@ static inline void | |||
129 | uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end) | 129 | uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end) |
130 | { | 130 | { |
131 | } | 131 | } |
132 | static inline void uprobe_start_dup_mmap(void) | ||
133 | { | ||
134 | } | ||
135 | static inline void uprobe_end_dup_mmap(void) | ||
136 | { | ||
137 | } | ||
132 | static inline void | 138 | static inline void |
133 | uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm) | 139 | uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm) |
134 | { | 140 | { |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 10278d18709c..689b14b26c8d 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -482,6 +482,7 @@ struct usb3_lpm_parameters { | |||
482 | * @connect_time: time device was first connected | 482 | * @connect_time: time device was first connected |
483 | * @do_remote_wakeup: remote wakeup should be enabled | 483 | * @do_remote_wakeup: remote wakeup should be enabled |
484 | * @reset_resume: needs reset instead of resume | 484 | * @reset_resume: needs reset instead of resume |
485 | * @port_is_suspended: the upstream port is suspended (L2 or U3) | ||
485 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB | 486 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB |
486 | * specific data for the device. | 487 | * specific data for the device. |
487 | * @slot_id: Slot ID assigned by xHCI | 488 | * @slot_id: Slot ID assigned by xHCI |
@@ -560,6 +561,7 @@ struct usb_device { | |||
560 | 561 | ||
561 | unsigned do_remote_wakeup:1; | 562 | unsigned do_remote_wakeup:1; |
562 | unsigned reset_resume:1; | 563 | unsigned reset_resume:1; |
564 | unsigned port_is_suspended:1; | ||
563 | #endif | 565 | #endif |
564 | struct wusb_dev *wusb_dev; | 566 | struct wusb_dev *wusb_dev; |
565 | int slot_id; | 567 | int slot_id; |
@@ -588,8 +590,9 @@ extern struct usb_device *usb_hub_find_child(struct usb_device *hdev, | |||
588 | */ | 590 | */ |
589 | #define usb_hub_for_each_child(hdev, port1, child) \ | 591 | #define usb_hub_for_each_child(hdev, port1, child) \ |
590 | for (port1 = 1, child = usb_hub_find_child(hdev, port1); \ | 592 | for (port1 = 1, child = usb_hub_find_child(hdev, port1); \ |
591 | port1 <= hdev->maxchild; \ | 593 | port1 <= hdev->maxchild; \ |
592 | child = usb_hub_find_child(hdev, ++port1)) | 594 | child = usb_hub_find_child(hdev, ++port1)) \ |
595 | if (!child) continue; else | ||
593 | 596 | ||
594 | /* USB device locking */ | 597 | /* USB device locking */ |
595 | #define usb_lock_device(udev) device_lock(&(udev)->dev) | 598 | #define usb_lock_device(udev) device_lock(&(udev)->dev) |
@@ -805,6 +808,22 @@ static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size) | |||
805 | .bcdDevice_hi = (hi) | 808 | .bcdDevice_hi = (hi) |
806 | 809 | ||
807 | /** | 810 | /** |
811 | * USB_DEVICE_INTERFACE_CLASS - describe a usb device with a specific interface class | ||
812 | * @vend: the 16 bit USB Vendor ID | ||
813 | * @prod: the 16 bit USB Product ID | ||
814 | * @cl: bInterfaceClass value | ||
815 | * | ||
816 | * This macro is used to create a struct usb_device_id that matches a | ||
817 | * specific interface class of devices. | ||
818 | */ | ||
819 | #define USB_DEVICE_INTERFACE_CLASS(vend, prod, cl) \ | ||
820 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ | ||
821 | USB_DEVICE_ID_MATCH_INT_CLASS, \ | ||
822 | .idVendor = (vend), \ | ||
823 | .idProduct = (prod), \ | ||
824 | .bInterfaceClass = (cl) | ||
825 | |||
826 | /** | ||
808 | * USB_DEVICE_INTERFACE_PROTOCOL - describe a usb device with a specific interface protocol | 827 | * USB_DEVICE_INTERFACE_PROTOCOL - describe a usb device with a specific interface protocol |
809 | * @vend: the 16 bit USB Vendor ID | 828 | * @vend: the 16 bit USB Vendor ID |
810 | * @prod: the 16 bit USB Product ID | 829 | * @prod: the 16 bit USB Product ID |
@@ -1129,8 +1148,8 @@ extern int usb_disabled(void); | |||
1129 | * Note: URB_DIR_IN/OUT is automatically set in usb_submit_urb(). | 1148 | * Note: URB_DIR_IN/OUT is automatically set in usb_submit_urb(). |
1130 | */ | 1149 | */ |
1131 | #define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */ | 1150 | #define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */ |
1132 | #define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame | 1151 | #define URB_ISO_ASAP 0x0002 /* iso-only; use the first unexpired |
1133 | * ignored */ | 1152 | * slot in the schedule */ |
1134 | #define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ | 1153 | #define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ |
1135 | #define URB_NO_FSBR 0x0020 /* UHCI-specific */ | 1154 | #define URB_NO_FSBR 0x0020 /* UHCI-specific */ |
1136 | #define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ | 1155 | #define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ |
@@ -1309,15 +1328,20 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1309 | * the transfer interval in the endpoint descriptor is logarithmic. | 1328 | * the transfer interval in the endpoint descriptor is logarithmic. |
1310 | * Device drivers must convert that value to linear units themselves.) | 1329 | * Device drivers must convert that value to linear units themselves.) |
1311 | * | 1330 | * |
1312 | * Isochronous URBs normally use the URB_ISO_ASAP transfer flag, telling | 1331 | * If an isochronous endpoint queue isn't already running, the host |
1313 | * the host controller to schedule the transfer as soon as bandwidth | 1332 | * controller will schedule a new URB to start as soon as bandwidth |
1314 | * utilization allows, and then set start_frame to reflect the actual frame | 1333 | * utilization allows. If the queue is running then a new URB will be |
1315 | * selected during submission. Otherwise drivers must specify the start_frame | 1334 | * scheduled to start in the first transfer slot following the end of the |
1316 | * and handle the case where the transfer can't begin then. However, drivers | 1335 | * preceding URB, if that slot has not already expired. If the slot has |
1317 | * won't know how bandwidth is currently allocated, and while they can | 1336 | * expired (which can happen when IRQ delivery is delayed for a long time), |
1318 | * find the current frame using usb_get_current_frame_number () they can't | 1337 | * the scheduling behavior depends on the URB_ISO_ASAP flag. If the flag |
1319 | * know the range for that frame number. (Ranges for frame counter values | 1338 | * is clear then the URB will be scheduled to start in the expired slot, |
1320 | * are HC-specific, and can go from 256 to 65536 frames from "now".) | 1339 | * implying that some of its packets will not be transferred; if the flag |
1340 | * is set then the URB will be scheduled in the first unexpired slot, | ||
1341 | * breaking the queue's synchronization. Upon URB completion, the | ||
1342 | * start_frame field will be set to the (micro)frame number in which the | ||
1343 | * transfer was scheduled. Ranges for frame counter values are HC-specific | ||
1344 | * and can go from as low as 256 to as high as 65536 frames. | ||
1321 | * | 1345 | * |
1322 | * Isochronous URBs have a different data transfer model, in part because | 1346 | * Isochronous URBs have a different data transfer model, in part because |
1323 | * the quality of service is only "best effort". Callers provide specially | 1347 | * the quality of service is only "best effort". Callers provide specially |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index f8dda0621800..b09c37e04a91 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/version.h> | 38 | #include <linux/version.h> |
39 | #include <linux/usb/ch9.h> | 39 | #include <linux/usb/ch9.h> |
40 | #include <linux/usb/gadget.h> | 40 | #include <linux/usb/gadget.h> |
41 | #include <linux/log2.h> | ||
41 | 42 | ||
42 | /* | 43 | /* |
43 | * USB function drivers should return USB_GADGET_DELAYED_STATUS if they | 44 | * USB function drivers should return USB_GADGET_DELAYED_STATUS if they |
@@ -51,6 +52,7 @@ | |||
51 | /* big enough to hold our biggest descriptor */ | 52 | /* big enough to hold our biggest descriptor */ |
52 | #define USB_COMP_EP0_BUFSIZ 1024 | 53 | #define USB_COMP_EP0_BUFSIZ 1024 |
53 | 54 | ||
55 | #define USB_MS_TO_HS_INTERVAL(x) (ilog2((x * 1000 / 125)) + 1) | ||
54 | struct usb_configuration; | 56 | struct usb_configuration; |
55 | 57 | ||
56 | /** | 58 | /** |
@@ -117,7 +119,7 @@ struct usb_configuration; | |||
117 | struct usb_function { | 119 | struct usb_function { |
118 | const char *name; | 120 | const char *name; |
119 | struct usb_gadget_strings **strings; | 121 | struct usb_gadget_strings **strings; |
120 | struct usb_descriptor_header **descriptors; | 122 | struct usb_descriptor_header **fs_descriptors; |
121 | struct usb_descriptor_header **hs_descriptors; | 123 | struct usb_descriptor_header **hs_descriptors; |
122 | struct usb_descriptor_header **ss_descriptors; | 124 | struct usb_descriptor_header **ss_descriptors; |
123 | 125 | ||
diff --git a/include/linux/usb/ehci_pdriver.h b/include/linux/usb/ehci_pdriver.h index c9d09f8b7ff2..99238b096f7e 100644 --- a/include/linux/usb/ehci_pdriver.h +++ b/include/linux/usb/ehci_pdriver.h | |||
@@ -29,6 +29,8 @@ | |||
29 | * initialization. | 29 | * initialization. |
30 | * @port_power_off: set to 1 if the controller needs to be powered down | 30 | * @port_power_off: set to 1 if the controller needs to be powered down |
31 | * after initialization. | 31 | * after initialization. |
32 | * @no_io_watchdog: set to 1 if the controller does not need the I/O | ||
33 | * watchdog to run. | ||
32 | * | 34 | * |
33 | * These are general configuration options for the EHCI controller. All of | 35 | * These are general configuration options for the EHCI controller. All of |
34 | * these options are activating more or less workarounds for some hardware. | 36 | * these options are activating more or less workarounds for some hardware. |
@@ -39,8 +41,7 @@ struct usb_ehci_pdata { | |||
39 | unsigned has_synopsys_hc_bug:1; | 41 | unsigned has_synopsys_hc_bug:1; |
40 | unsigned big_endian_desc:1; | 42 | unsigned big_endian_desc:1; |
41 | unsigned big_endian_mmio:1; | 43 | unsigned big_endian_mmio:1; |
42 | unsigned port_power_on:1; | 44 | unsigned no_io_watchdog:1; |
43 | unsigned port_power_off:1; | ||
44 | 45 | ||
45 | /* Turn on all power and clocks */ | 46 | /* Turn on all power and clocks */ |
46 | int (*power_on)(struct platform_device *pdev); | 47 | int (*power_on)(struct platform_device *pdev); |
diff --git a/include/linux/usb/ezusb.h b/include/linux/usb/ezusb.h index fc618d8d1e92..639ee45779fb 100644 --- a/include/linux/usb/ezusb.h +++ b/include/linux/usb/ezusb.h | |||
@@ -1,16 +1,8 @@ | |||
1 | #ifndef __EZUSB_H | 1 | #ifndef __EZUSB_H |
2 | #define __EZUSB_H | 2 | #define __EZUSB_H |
3 | 3 | ||
4 | |||
5 | extern int ezusb_writememory(struct usb_device *dev, int address, | ||
6 | unsigned char *data, int length, __u8 bRequest); | ||
7 | |||
8 | extern int ezusb_fx1_set_reset(struct usb_device *dev, unsigned char reset_bit); | 4 | extern int ezusb_fx1_set_reset(struct usb_device *dev, unsigned char reset_bit); |
9 | extern int ezusb_fx2_set_reset(struct usb_device *dev, unsigned char reset_bit); | ||
10 | |||
11 | extern int ezusb_fx1_ihex_firmware_download(struct usb_device *dev, | 5 | extern int ezusb_fx1_ihex_firmware_download(struct usb_device *dev, |
12 | const char *firmware_path); | 6 | const char *firmware_path); |
13 | extern int ezusb_fx2_ihex_firmware_download(struct usb_device *dev, | ||
14 | const char *firmware_path); | ||
15 | 7 | ||
16 | #endif /* __EZUSB_H */ | 8 | #endif /* __EZUSB_H */ |
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 5b6e50888248..0af6569b8cc6 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -939,6 +939,13 @@ static inline void usb_free_descriptors(struct usb_descriptor_header **v) | |||
939 | kfree(v); | 939 | kfree(v); |
940 | } | 940 | } |
941 | 941 | ||
942 | struct usb_function; | ||
943 | int usb_assign_descriptors(struct usb_function *f, | ||
944 | struct usb_descriptor_header **fs, | ||
945 | struct usb_descriptor_header **hs, | ||
946 | struct usb_descriptor_header **ss); | ||
947 | void usb_free_all_descriptors(struct usb_function *f); | ||
948 | |||
942 | /*-------------------------------------------------------------------------*/ | 949 | /*-------------------------------------------------------------------------*/ |
943 | 950 | ||
944 | /* utility to simplify map/unmap of usb_requests to/from DMA */ | 951 | /* utility to simplify map/unmap of usb_requests to/from DMA */ |
diff --git a/include/linux/usb/ohci_pdriver.h b/include/linux/usb/ohci_pdriver.h index 74e7755168b7..012f2b7eb2b6 100644 --- a/include/linux/usb/ohci_pdriver.h +++ b/include/linux/usb/ohci_pdriver.h | |||
@@ -25,6 +25,7 @@ | |||
25 | * @big_endian_desc: BE descriptors | 25 | * @big_endian_desc: BE descriptors |
26 | * @big_endian_mmio: BE registers | 26 | * @big_endian_mmio: BE registers |
27 | * @no_big_frame_no: no big endian frame_no shift | 27 | * @no_big_frame_no: no big endian frame_no shift |
28 | * @num_ports: number of ports | ||
28 | * | 29 | * |
29 | * These are general configuration options for the OHCI controller. All of | 30 | * These are general configuration options for the OHCI controller. All of |
30 | * these options are activating more or less workarounds for some hardware. | 31 | * these options are activating more or less workarounds for some hardware. |
@@ -33,6 +34,7 @@ struct usb_ohci_pdata { | |||
33 | unsigned big_endian_desc:1; | 34 | unsigned big_endian_desc:1; |
34 | unsigned big_endian_mmio:1; | 35 | unsigned big_endian_mmio:1; |
35 | unsigned no_big_frame_no:1; | 36 | unsigned no_big_frame_no:1; |
37 | unsigned int num_ports; | ||
36 | 38 | ||
37 | /* Turn on all power and clocks */ | 39 | /* Turn on all power and clocks */ |
38 | int (*power_on)(struct platform_device *pdev); | 40 | int (*power_on)(struct platform_device *pdev); |
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index 06b5bae35b29..a29ae1eb9346 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #define __LINUX_USB_PHY_H | 10 | #define __LINUX_USB_PHY_H |
11 | 11 | ||
12 | #include <linux/notifier.h> | 12 | #include <linux/notifier.h> |
13 | #include <linux/usb.h> | ||
13 | 14 | ||
14 | enum usb_phy_events { | 15 | enum usb_phy_events { |
15 | USB_EVENT_NONE, /* no events or cable disconnected */ | 16 | USB_EVENT_NONE, /* no events or cable disconnected */ |
@@ -99,8 +100,10 @@ struct usb_phy { | |||
99 | int suspend); | 100 | int suspend); |
100 | 101 | ||
101 | /* notify phy connect status change */ | 102 | /* notify phy connect status change */ |
102 | int (*notify_connect)(struct usb_phy *x, int port); | 103 | int (*notify_connect)(struct usb_phy *x, |
103 | int (*notify_disconnect)(struct usb_phy *x, int port); | 104 | enum usb_device_speed speed); |
105 | int (*notify_disconnect)(struct usb_phy *x, | ||
106 | enum usb_device_speed speed); | ||
104 | }; | 107 | }; |
105 | 108 | ||
106 | 109 | ||
@@ -189,19 +192,19 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend) | |||
189 | } | 192 | } |
190 | 193 | ||
191 | static inline int | 194 | static inline int |
192 | usb_phy_notify_connect(struct usb_phy *x, int port) | 195 | usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed) |
193 | { | 196 | { |
194 | if (x->notify_connect) | 197 | if (x->notify_connect) |
195 | return x->notify_connect(x, port); | 198 | return x->notify_connect(x, speed); |
196 | else | 199 | else |
197 | return 0; | 200 | return 0; |
198 | } | 201 | } |
199 | 202 | ||
200 | static inline int | 203 | static inline int |
201 | usb_phy_notify_disconnect(struct usb_phy *x, int port) | 204 | usb_phy_notify_disconnect(struct usb_phy *x, enum usb_device_speed speed) |
202 | { | 205 | { |
203 | if (x->notify_disconnect) | 206 | if (x->notify_disconnect) |
204 | return x->notify_disconnect(x, port); | 207 | return x->notify_disconnect(x, speed); |
205 | else | 208 | else |
206 | return 0; | 209 | return 0; |
207 | } | 210 | } |
diff --git a/include/linux/vtime.h b/include/linux/vtime.h new file mode 100644 index 000000000000..ae30ab58431a --- /dev/null +++ b/include/linux/vtime.h | |||
@@ -0,0 +1,48 @@ | |||
1 | #ifndef _LINUX_KERNEL_VTIME_H | ||
2 | #define _LINUX_KERNEL_VTIME_H | ||
3 | |||
4 | struct task_struct; | ||
5 | |||
6 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
7 | extern void vtime_task_switch(struct task_struct *prev); | ||
8 | extern void vtime_account_system(struct task_struct *tsk); | ||
9 | extern void vtime_account_system_irqsafe(struct task_struct *tsk); | ||
10 | extern void vtime_account_idle(struct task_struct *tsk); | ||
11 | extern void vtime_account_user(struct task_struct *tsk); | ||
12 | extern void vtime_account(struct task_struct *tsk); | ||
13 | #else | ||
14 | static inline void vtime_task_switch(struct task_struct *prev) { } | ||
15 | static inline void vtime_account_system(struct task_struct *tsk) { } | ||
16 | static inline void vtime_account_system_irqsafe(struct task_struct *tsk) { } | ||
17 | static inline void vtime_account(struct task_struct *tsk) { } | ||
18 | #endif | ||
19 | |||
20 | #ifdef CONFIG_IRQ_TIME_ACCOUNTING | ||
21 | extern void irqtime_account_irq(struct task_struct *tsk); | ||
22 | #else | ||
23 | static inline void irqtime_account_irq(struct task_struct *tsk) { } | ||
24 | #endif | ||
25 | |||
26 | static inline void vtime_account_irq_enter(struct task_struct *tsk) | ||
27 | { | ||
28 | /* | ||
29 | * Hardirq can interrupt idle task anytime. So we need vtime_account() | ||
30 | * that performs the idle check in CONFIG_VIRT_CPU_ACCOUNTING. | ||
31 | * Softirq can also interrupt idle task directly if it calls | ||
32 | * local_bh_enable(). Such case probably don't exist but we never know. | ||
33 | * Ksoftirqd is not concerned because idle time is flushed on context | ||
34 | * switch. Softirqs in the end of hardirqs are also not a problem because | ||
35 | * the idle time is flushed on hardirq time already. | ||
36 | */ | ||
37 | vtime_account(tsk); | ||
38 | irqtime_account_irq(tsk); | ||
39 | } | ||
40 | |||
41 | static inline void vtime_account_irq_exit(struct task_struct *tsk) | ||
42 | { | ||
43 | /* On hard|softirq exit we always account to hard|softirq cputime */ | ||
44 | vtime_account_system(tsk); | ||
45 | irqtime_account_irq(tsk); | ||
46 | } | ||
47 | |||
48 | #endif /* _LINUX_KERNEL_VTIME_H */ | ||
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 50c3e8fa06a8..b82a83aba311 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -161,14 +161,7 @@ void __bdi_update_bandwidth(struct backing_dev_info *bdi, | |||
161 | unsigned long start_time); | 161 | unsigned long start_time); |
162 | 162 | ||
163 | void page_writeback_init(void); | 163 | void page_writeback_init(void); |
164 | void balance_dirty_pages_ratelimited_nr(struct address_space *mapping, | 164 | void balance_dirty_pages_ratelimited(struct address_space *mapping); |
165 | unsigned long nr_pages_dirtied); | ||
166 | |||
167 | static inline void | ||
168 | balance_dirty_pages_ratelimited(struct address_space *mapping) | ||
169 | { | ||
170 | balance_dirty_pages_ratelimited_nr(mapping, 1); | ||
171 | } | ||
172 | 165 | ||
173 | typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc, | 166 | typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc, |
174 | void *data); | 167 | void *data); |
diff --git a/include/media/adv7604.h b/include/media/adv7604.h index 171b957db743..dc004bc926c9 100644 --- a/include/media/adv7604.h +++ b/include/media/adv7604.h | |||
@@ -40,14 +40,6 @@ enum adv7604_op_ch_sel { | |||
40 | ADV7604_OP_CH_SEL_RBG = 5, | 40 | ADV7604_OP_CH_SEL_RBG = 5, |
41 | }; | 41 | }; |
42 | 42 | ||
43 | /* Primary mode (IO register 0x01, [3:0]) */ | ||
44 | enum adv7604_prim_mode { | ||
45 | ADV7604_PRIM_MODE_COMP = 1, | ||
46 | ADV7604_PRIM_MODE_RGB = 2, | ||
47 | ADV7604_PRIM_MODE_HDMI_COMP = 5, | ||
48 | ADV7604_PRIM_MODE_HDMI_GR = 6, | ||
49 | }; | ||
50 | |||
51 | /* Input Color Space (IO register 0x02, [7:4]) */ | 43 | /* Input Color Space (IO register 0x02, [7:4]) */ |
52 | enum adv7604_inp_color_space { | 44 | enum adv7604_inp_color_space { |
53 | ADV7604_INP_COLOR_SPACE_LIM_RGB = 0, | 45 | ADV7604_INP_COLOR_SPACE_LIM_RGB = 0, |
@@ -103,9 +95,6 @@ struct adv7604_platform_data { | |||
103 | /* Bus rotation and reordering */ | 95 | /* Bus rotation and reordering */ |
104 | enum adv7604_op_ch_sel op_ch_sel; | 96 | enum adv7604_op_ch_sel op_ch_sel; |
105 | 97 | ||
106 | /* Primary mode */ | ||
107 | enum adv7604_prim_mode prim_mode; | ||
108 | |||
109 | /* Select output format */ | 98 | /* Select output format */ |
110 | enum adv7604_op_format_sel op_format_sel; | 99 | enum adv7604_op_format_sel op_format_sel; |
111 | 100 | ||
@@ -142,6 +131,16 @@ struct adv7604_platform_data { | |||
142 | u8 i2c_vdp; | 131 | u8 i2c_vdp; |
143 | }; | 132 | }; |
144 | 133 | ||
134 | /* | ||
135 | * Mode of operation. | ||
136 | * This is used as the input argument of the s_routing video op. | ||
137 | */ | ||
138 | enum adv7604_mode { | ||
139 | ADV7604_MODE_COMP, | ||
140 | ADV7604_MODE_GR, | ||
141 | ADV7604_MODE_HDMI, | ||
142 | }; | ||
143 | |||
145 | #define V4L2_CID_ADV_RX_ANALOG_SAMPLING_PHASE (V4L2_CID_DV_CLASS_BASE + 0x1000) | 144 | #define V4L2_CID_ADV_RX_ANALOG_SAMPLING_PHASE (V4L2_CID_DV_CLASS_BASE + 0x1000) |
146 | #define V4L2_CID_ADV_RX_FREE_RUN_COLOR_MANUAL (V4L2_CID_DV_CLASS_BASE + 0x1001) | 145 | #define V4L2_CID_ADV_RX_FREE_RUN_COLOR_MANUAL (V4L2_CID_DV_CLASS_BASE + 0x1001) |
147 | #define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002) | 146 | #define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002) |
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h index 2760f4f4ae9b..1d04b6f0fbd4 100644 --- a/include/net/netprio_cgroup.h +++ b/include/net/netprio_cgroup.h | |||
@@ -27,7 +27,6 @@ struct netprio_map { | |||
27 | 27 | ||
28 | struct cgroup_netprio_state { | 28 | struct cgroup_netprio_state { |
29 | struct cgroup_subsys_state css; | 29 | struct cgroup_subsys_state css; |
30 | u32 prioidx; | ||
31 | }; | 30 | }; |
32 | 31 | ||
33 | extern void sock_update_netprioidx(struct sock *sk, struct task_struct *task); | 32 | extern void sock_update_netprioidx(struct sock *sk, struct task_struct *task); |
@@ -36,13 +35,12 @@ extern void sock_update_netprioidx(struct sock *sk, struct task_struct *task); | |||
36 | 35 | ||
37 | static inline u32 task_netprioidx(struct task_struct *p) | 36 | static inline u32 task_netprioidx(struct task_struct *p) |
38 | { | 37 | { |
39 | struct cgroup_netprio_state *state; | 38 | struct cgroup_subsys_state *css; |
40 | u32 idx; | 39 | u32 idx; |
41 | 40 | ||
42 | rcu_read_lock(); | 41 | rcu_read_lock(); |
43 | state = container_of(task_subsys_state(p, net_prio_subsys_id), | 42 | css = task_subsys_state(p, net_prio_subsys_id); |
44 | struct cgroup_netprio_state, css); | 43 | idx = css->cgroup->id; |
45 | idx = state->prioidx; | ||
46 | rcu_read_unlock(); | 44 | rcu_read_unlock(); |
47 | return idx; | 45 | return idx; |
48 | } | 46 | } |
@@ -57,8 +55,7 @@ static inline u32 task_netprioidx(struct task_struct *p) | |||
57 | rcu_read_lock(); | 55 | rcu_read_lock(); |
58 | css = task_subsys_state(p, net_prio_subsys_id); | 56 | css = task_subsys_state(p, net_prio_subsys_id); |
59 | if (css) | 57 | if (css) |
60 | idx = container_of(css, | 58 | idx = css->cgroup->id; |
61 | struct cgroup_netprio_state, css)->prioidx; | ||
62 | rcu_read_unlock(); | 59 | rcu_read_unlock(); |
63 | return idx; | 60 | return idx; |
64 | } | 61 | } |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 6feeccd83dd7..4af45e33105d 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -525,6 +525,7 @@ static inline __u32 cookie_v6_init_sequence(struct sock *sk, | |||
525 | extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, | 525 | extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, |
526 | int nonagle); | 526 | int nonagle); |
527 | extern bool tcp_may_send_now(struct sock *sk); | 527 | extern bool tcp_may_send_now(struct sock *sk); |
528 | extern int __tcp_retransmit_skb(struct sock *, struct sk_buff *); | ||
528 | extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); | 529 | extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); |
529 | extern void tcp_retransmit_timer(struct sock *sk); | 530 | extern void tcp_retransmit_timer(struct sock *sk); |
530 | extern void tcp_xmit_retransmit_queue(struct sock *); | 531 | extern void tcp_xmit_retransmit_queue(struct sock *); |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 6f0ba01afe73..63445ede48bb 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -1351,7 +1351,7 @@ struct xfrm6_tunnel { | |||
1351 | }; | 1351 | }; |
1352 | 1352 | ||
1353 | extern void xfrm_init(void); | 1353 | extern void xfrm_init(void); |
1354 | extern void xfrm4_init(int rt_hash_size); | 1354 | extern void xfrm4_init(void); |
1355 | extern int xfrm_state_init(struct net *net); | 1355 | extern int xfrm_state_init(struct net *net); |
1356 | extern void xfrm_state_fini(struct net *net); | 1356 | extern void xfrm_state_fini(struct net *net); |
1357 | extern void xfrm4_state_init(void); | 1357 | extern void xfrm4_state_init(void); |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 88fae8d20154..55367b04dc94 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -135,6 +135,8 @@ struct scsi_device { | |||
135 | * because we did a bus reset. */ | 135 | * because we did a bus reset. */ |
136 | unsigned use_10_for_rw:1; /* first try 10-byte read / write */ | 136 | unsigned use_10_for_rw:1; /* first try 10-byte read / write */ |
137 | unsigned use_10_for_ms:1; /* first try 10-byte mode sense/select */ | 137 | unsigned use_10_for_ms:1; /* first try 10-byte mode sense/select */ |
138 | unsigned no_report_opcodes:1; /* no REPORT SUPPORTED OPERATION CODES */ | ||
139 | unsigned no_write_same:1; /* no WRITE SAME command */ | ||
138 | unsigned skip_ms_page_8:1; /* do not use MODE SENSE page 0x08 */ | 140 | unsigned skip_ms_page_8:1; /* do not use MODE SENSE page 0x08 */ |
139 | unsigned skip_ms_page_3f:1; /* do not use MODE SENSE page 0x3f */ | 141 | unsigned skip_ms_page_3f:1; /* do not use MODE SENSE page 0x3f */ |
140 | unsigned skip_vpd_pages:1; /* do not read VPD pages */ | 142 | unsigned skip_vpd_pages:1; /* do not read VPD pages */ |
@@ -362,6 +364,8 @@ extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout, | |||
362 | int retries, struct scsi_sense_hdr *sshdr); | 364 | int retries, struct scsi_sense_hdr *sshdr); |
363 | extern int scsi_get_vpd_page(struct scsi_device *, u8 page, unsigned char *buf, | 365 | extern int scsi_get_vpd_page(struct scsi_device *, u8 page, unsigned char *buf, |
364 | int buf_len); | 366 | int buf_len); |
367 | extern int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, | ||
368 | unsigned int len, unsigned char opcode); | ||
365 | extern int scsi_device_set_state(struct scsi_device *sdev, | 369 | extern int scsi_device_set_state(struct scsi_device *sdev, |
366 | enum scsi_device_state state); | 370 | enum scsi_device_state state); |
367 | extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type, | 371 | extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type, |
diff --git a/include/trace/events/gfpflags.h b/include/trace/events/gfpflags.h index 9391706e9254..d6fd8e5b14b7 100644 --- a/include/trace/events/gfpflags.h +++ b/include/trace/events/gfpflags.h | |||
@@ -36,6 +36,7 @@ | |||
36 | {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \ | 36 | {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \ |
37 | {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"}, \ | 37 | {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"}, \ |
38 | {(unsigned long)__GFP_NOTRACK, "GFP_NOTRACK"}, \ | 38 | {(unsigned long)__GFP_NOTRACK, "GFP_NOTRACK"}, \ |
39 | {(unsigned long)__GFP_NO_KSWAPD, "GFP_NO_KSWAPD"}, \ | ||
39 | {(unsigned long)__GFP_OTHER_NODE, "GFP_OTHER_NODE"} \ | 40 | {(unsigned long)__GFP_OTHER_NODE, "GFP_OTHER_NODE"} \ |
40 | ) : "GFP_NOWAIT" | 41 | ) : "GFP_NOWAIT" |
41 | 42 | ||
diff --git a/include/trace/events/oom.h b/include/trace/events/oom.h index dd4ba3b92002..1e974983757e 100644 --- a/include/trace/events/oom.h +++ b/include/trace/events/oom.h | |||
@@ -14,7 +14,7 @@ TRACE_EVENT(oom_score_adj_update, | |||
14 | TP_STRUCT__entry( | 14 | TP_STRUCT__entry( |
15 | __field( pid_t, pid) | 15 | __field( pid_t, pid) |
16 | __array( char, comm, TASK_COMM_LEN ) | 16 | __array( char, comm, TASK_COMM_LEN ) |
17 | __field( int, oom_score_adj) | 17 | __field( short, oom_score_adj) |
18 | ), | 18 | ), |
19 | 19 | ||
20 | TP_fast_assign( | 20 | TP_fast_assign( |
@@ -23,7 +23,7 @@ TRACE_EVENT(oom_score_adj_update, | |||
23 | __entry->oom_score_adj = task->signal->oom_score_adj; | 23 | __entry->oom_score_adj = task->signal->oom_score_adj; |
24 | ), | 24 | ), |
25 | 25 | ||
26 | TP_printk("pid=%d comm=%s oom_score_adj=%d", | 26 | TP_printk("pid=%d comm=%s oom_score_adj=%hd", |
27 | __entry->pid, __entry->comm, __entry->oom_score_adj) | 27 | __entry->pid, __entry->comm, __entry->oom_score_adj) |
28 | ); | 28 | ); |
29 | 29 | ||
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h index 5bde94d8585b..d4f559b1ec34 100644 --- a/include/trace/events/rcu.h +++ b/include/trace/events/rcu.h | |||
@@ -549,6 +549,7 @@ TRACE_EVENT(rcu_torture_read, | |||
549 | * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit. | 549 | * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit. |
550 | * "Inc1": rcu_barrier_callback() piggyback check counter incremented. | 550 | * "Inc1": rcu_barrier_callback() piggyback check counter incremented. |
551 | * "Offline": rcu_barrier_callback() found offline CPU | 551 | * "Offline": rcu_barrier_callback() found offline CPU |
552 | * "OnlineNoCB": rcu_barrier_callback() found online no-CBs CPU. | ||
552 | * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks. | 553 | * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks. |
553 | * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks. | 554 | * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks. |
554 | * "IRQ": An rcu_barrier_callback() callback posted on remote CPU. | 555 | * "IRQ": An rcu_barrier_callback() callback posted on remote CPU. |
diff --git a/include/trace/events/task.h b/include/trace/events/task.h index b53add02e929..102a646e1996 100644 --- a/include/trace/events/task.h +++ b/include/trace/events/task.h | |||
@@ -15,7 +15,7 @@ TRACE_EVENT(task_newtask, | |||
15 | __field( pid_t, pid) | 15 | __field( pid_t, pid) |
16 | __array( char, comm, TASK_COMM_LEN) | 16 | __array( char, comm, TASK_COMM_LEN) |
17 | __field( unsigned long, clone_flags) | 17 | __field( unsigned long, clone_flags) |
18 | __field( int, oom_score_adj) | 18 | __field( short, oom_score_adj) |
19 | ), | 19 | ), |
20 | 20 | ||
21 | TP_fast_assign( | 21 | TP_fast_assign( |
@@ -25,7 +25,7 @@ TRACE_EVENT(task_newtask, | |||
25 | __entry->oom_score_adj = task->signal->oom_score_adj; | 25 | __entry->oom_score_adj = task->signal->oom_score_adj; |
26 | ), | 26 | ), |
27 | 27 | ||
28 | TP_printk("pid=%d comm=%s clone_flags=%lx oom_score_adj=%d", | 28 | TP_printk("pid=%d comm=%s clone_flags=%lx oom_score_adj=%hd", |
29 | __entry->pid, __entry->comm, | 29 | __entry->pid, __entry->comm, |
30 | __entry->clone_flags, __entry->oom_score_adj) | 30 | __entry->clone_flags, __entry->oom_score_adj) |
31 | ); | 31 | ); |
@@ -40,7 +40,7 @@ TRACE_EVENT(task_rename, | |||
40 | __field( pid_t, pid) | 40 | __field( pid_t, pid) |
41 | __array( char, oldcomm, TASK_COMM_LEN) | 41 | __array( char, oldcomm, TASK_COMM_LEN) |
42 | __array( char, newcomm, TASK_COMM_LEN) | 42 | __array( char, newcomm, TASK_COMM_LEN) |
43 | __field( int, oom_score_adj) | 43 | __field( short, oom_score_adj) |
44 | ), | 44 | ), |
45 | 45 | ||
46 | TP_fast_assign( | 46 | TP_fast_assign( |
@@ -50,7 +50,7 @@ TRACE_EVENT(task_rename, | |||
50 | __entry->oom_score_adj = task->signal->oom_score_adj; | 50 | __entry->oom_score_adj = task->signal->oom_score_adj; |
51 | ), | 51 | ), |
52 | 52 | ||
53 | TP_printk("pid=%d oldcomm=%s newcomm=%s oom_score_adj=%d", | 53 | TP_printk("pid=%d oldcomm=%s newcomm=%s oom_score_adj=%hd", |
54 | __entry->pid, __entry->oldcomm, | 54 | __entry->pid, __entry->oldcomm, |
55 | __entry->newcomm, __entry->oom_score_adj) | 55 | __entry->newcomm, __entry->oom_score_adj) |
56 | ); | 56 | ); |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index a763888a36f9..40dc5e8fe340 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -545,8 +545,7 @@ ftrace_raw_event_##call(void *__data, proto) \ | |||
545 | { assign; } \ | 545 | { assign; } \ |
546 | \ | 546 | \ |
547 | if (!filter_current_check_discard(buffer, event_call, entry, event)) \ | 547 | if (!filter_current_check_discard(buffer, event_call, entry, event)) \ |
548 | trace_nowake_buffer_unlock_commit(buffer, \ | 548 | trace_buffer_unlock_commit(buffer, event, irq_flags, pc); \ |
549 | event, irq_flags, pc); \ | ||
550 | } | 549 | } |
551 | /* | 550 | /* |
552 | * The ftrace_test_probe is compiled out, it is only here as a build time check | 551 | * The ftrace_test_probe is compiled out, it is only here as a build time check |
@@ -620,79 +619,6 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call | |||
620 | 619 | ||
621 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 620 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
622 | 621 | ||
623 | /* | ||
624 | * Define the insertion callback to perf events | ||
625 | * | ||
626 | * The job is very similar to ftrace_raw_event_<call> except that we don't | ||
627 | * insert in the ring buffer but in a perf counter. | ||
628 | * | ||
629 | * static void ftrace_perf_<call>(proto) | ||
630 | * { | ||
631 | * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; | ||
632 | * struct ftrace_event_call *event_call = &event_<call>; | ||
633 | * extern void perf_tp_event(int, u64, u64, void *, int); | ||
634 | * struct ftrace_raw_##call *entry; | ||
635 | * struct perf_trace_buf *trace_buf; | ||
636 | * u64 __addr = 0, __count = 1; | ||
637 | * unsigned long irq_flags; | ||
638 | * struct trace_entry *ent; | ||
639 | * int __entry_size; | ||
640 | * int __data_size; | ||
641 | * int __cpu | ||
642 | * int pc; | ||
643 | * | ||
644 | * pc = preempt_count(); | ||
645 | * | ||
646 | * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args); | ||
647 | * | ||
648 | * // Below we want to get the aligned size by taking into account | ||
649 | * // the u32 field that will later store the buffer size | ||
650 | * __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32), | ||
651 | * sizeof(u64)); | ||
652 | * __entry_size -= sizeof(u32); | ||
653 | * | ||
654 | * // Protect the non nmi buffer | ||
655 | * // This also protects the rcu read side | ||
656 | * local_irq_save(irq_flags); | ||
657 | * __cpu = smp_processor_id(); | ||
658 | * | ||
659 | * if (in_nmi()) | ||
660 | * trace_buf = rcu_dereference_sched(perf_trace_buf_nmi); | ||
661 | * else | ||
662 | * trace_buf = rcu_dereference_sched(perf_trace_buf); | ||
663 | * | ||
664 | * if (!trace_buf) | ||
665 | * goto end; | ||
666 | * | ||
667 | * trace_buf = per_cpu_ptr(trace_buf, __cpu); | ||
668 | * | ||
669 | * // Avoid recursion from perf that could mess up the buffer | ||
670 | * if (trace_buf->recursion++) | ||
671 | * goto end_recursion; | ||
672 | * | ||
673 | * raw_data = trace_buf->buf; | ||
674 | * | ||
675 | * // Make recursion update visible before entering perf_tp_event | ||
676 | * // so that we protect from perf recursions. | ||
677 | * | ||
678 | * barrier(); | ||
679 | * | ||
680 | * //zero dead bytes from alignment to avoid stack leak to userspace: | ||
681 | * *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; | ||
682 | * entry = (struct ftrace_raw_<call> *)raw_data; | ||
683 | * ent = &entry->ent; | ||
684 | * tracing_generic_entry_update(ent, irq_flags, pc); | ||
685 | * ent->type = event_call->id; | ||
686 | * | ||
687 | * <tstruct> <- do some jobs with dynamic arrays | ||
688 | * | ||
689 | * <assign> <- affect our values | ||
690 | * | ||
691 | * perf_tp_event(event_call->id, __addr, __count, entry, | ||
692 | * __entry_size); <- submit them to perf counter | ||
693 | * | ||
694 | * } | ||
695 | */ | ||
696 | 622 | ||
697 | #ifdef CONFIG_PERF_EVENTS | 623 | #ifdef CONFIG_PERF_EVENTS |
698 | 624 | ||
diff --git a/include/trace/syscall.h b/include/trace/syscall.h index 31966a4fb8cc..84bc4197e736 100644 --- a/include/trace/syscall.h +++ b/include/trace/syscall.h | |||
@@ -31,27 +31,4 @@ struct syscall_metadata { | |||
31 | struct ftrace_event_call *exit_event; | 31 | struct ftrace_event_call *exit_event; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | #ifdef CONFIG_FTRACE_SYSCALLS | ||
35 | extern unsigned long arch_syscall_addr(int nr); | ||
36 | extern int init_syscall_trace(struct ftrace_event_call *call); | ||
37 | |||
38 | extern int reg_event_syscall_enter(struct ftrace_event_call *call); | ||
39 | extern void unreg_event_syscall_enter(struct ftrace_event_call *call); | ||
40 | extern int reg_event_syscall_exit(struct ftrace_event_call *call); | ||
41 | extern void unreg_event_syscall_exit(struct ftrace_event_call *call); | ||
42 | extern int | ||
43 | ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s); | ||
44 | enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags, | ||
45 | struct trace_event *event); | ||
46 | enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags, | ||
47 | struct trace_event *event); | ||
48 | #endif | ||
49 | |||
50 | #ifdef CONFIG_PERF_EVENTS | ||
51 | int perf_sysenter_enable(struct ftrace_event_call *call); | ||
52 | void perf_sysenter_disable(struct ftrace_event_call *call); | ||
53 | int perf_sysexit_enable(struct ftrace_event_call *call); | ||
54 | void perf_sysexit_disable(struct ftrace_event_call *call); | ||
55 | #endif | ||
56 | |||
57 | #endif /* _TRACE_SYSCALL_H */ | 34 | #endif /* _TRACE_SYSCALL_H */ |
diff --git a/include/uapi/asm-generic/ioctls.h b/include/uapi/asm-generic/ioctls.h index 199975fac395..143dacbb7d9a 100644 --- a/include/uapi/asm-generic/ioctls.h +++ b/include/uapi/asm-generic/ioctls.h | |||
@@ -74,6 +74,9 @@ | |||
74 | #define TCSETXW 0x5435 | 74 | #define TCSETXW 0x5435 |
75 | #define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */ | 75 | #define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */ |
76 | #define TIOCVHANGUP 0x5437 | 76 | #define TIOCVHANGUP 0x5437 |
77 | #define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */ | ||
78 | #define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */ | ||
79 | #define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */ | ||
77 | 80 | ||
78 | #define FIONCLEX 0x5450 | 81 | #define FIONCLEX 0x5450 |
79 | #define FIOCLEX 0x5451 | 82 | #define FIOCLEX 0x5451 |
diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h index d030d2c2647a..4164529a94f9 100644 --- a/include/uapi/asm-generic/mman-common.h +++ b/include/uapi/asm-generic/mman-common.h | |||
@@ -55,4 +55,15 @@ | |||
55 | /* compatibility flags */ | 55 | /* compatibility flags */ |
56 | #define MAP_FILE 0 | 56 | #define MAP_FILE 0 |
57 | 57 | ||
58 | /* | ||
59 | * When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. | ||
60 | * This gives us 6 bits, which is enough until someone invents 128 bit address | ||
61 | * spaces. | ||
62 | * | ||
63 | * Assume these are all power of twos. | ||
64 | * When 0 use the default page size. | ||
65 | */ | ||
66 | #define MAP_HUGE_SHIFT 26 | ||
67 | #define MAP_HUGE_MASK 0x3f | ||
68 | |||
58 | #endif /* __ASM_GENERIC_MMAN_COMMON_H */ | 69 | #endif /* __ASM_GENERIC_MMAN_COMMON_H */ |
diff --git a/include/uapi/asm-generic/mman.h b/include/uapi/asm-generic/mman.h index 32c8bd6a196d..e9fe6fd2a074 100644 --- a/include/uapi/asm-generic/mman.h +++ b/include/uapi/asm-generic/mman.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ | 13 | #define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ |
14 | #define MAP_HUGETLB 0x40000 /* create a huge page mapping */ | 14 | #define MAP_HUGETLB 0x40000 /* create a huge page mapping */ |
15 | 15 | ||
16 | /* Bits [26:31] are reserved, see mman-common.h for MAP_HUGETLB usage */ | ||
17 | |||
16 | #define MCL_CURRENT 1 /* lock all current mappings */ | 18 | #define MCL_CURRENT 1 /* lock all current mappings */ |
17 | #define MCL_FUTURE 2 /* lock all future mappings */ | 19 | #define MCL_FUTURE 2 /* lock all future mappings */ |
18 | 20 | ||
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index e194387ef784..19e765fbfef7 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild | |||
@@ -415,3 +415,4 @@ header-y += wireless.h | |||
415 | header-y += x25.h | 415 | header-y += x25.h |
416 | header-y += xattr.h | 416 | header-y += xattr.h |
417 | header-y += xfrm.h | 417 | header-y += xfrm.h |
418 | header-y += hw_breakpoint.h | ||
diff --git a/include/uapi/linux/hw_breakpoint.h b/include/uapi/linux/hw_breakpoint.h new file mode 100644 index 000000000000..b04000a2296a --- /dev/null +++ b/include/uapi/linux/hw_breakpoint.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifndef _UAPI_LINUX_HW_BREAKPOINT_H | ||
2 | #define _UAPI_LINUX_HW_BREAKPOINT_H | ||
3 | |||
4 | enum { | ||
5 | HW_BREAKPOINT_LEN_1 = 1, | ||
6 | HW_BREAKPOINT_LEN_2 = 2, | ||
7 | HW_BREAKPOINT_LEN_4 = 4, | ||
8 | HW_BREAKPOINT_LEN_8 = 8, | ||
9 | }; | ||
10 | |||
11 | enum { | ||
12 | HW_BREAKPOINT_EMPTY = 0, | ||
13 | HW_BREAKPOINT_R = 1, | ||
14 | HW_BREAKPOINT_W = 2, | ||
15 | HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W, | ||
16 | HW_BREAKPOINT_X = 4, | ||
17 | HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X, | ||
18 | }; | ||
19 | |||
20 | enum bp_type_idx { | ||
21 | TYPE_INST = 0, | ||
22 | #ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS | ||
23 | TYPE_DATA = 0, | ||
24 | #else | ||
25 | TYPE_DATA = 1, | ||
26 | #endif | ||
27 | TYPE_MAX | ||
28 | }; | ||
29 | |||
30 | #endif /* _UAPI_LINUX_HW_BREAKPOINT_H */ | ||
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h index 7e1ab20adc03..78f99d97475b 100644 --- a/include/uapi/linux/serial_core.h +++ b/include/uapi/linux/serial_core.h | |||
@@ -49,7 +49,8 @@ | |||
49 | #define PORT_XR17D15X 21 /* Exar XR17D15x UART */ | 49 | #define PORT_XR17D15X 21 /* Exar XR17D15x UART */ |
50 | #define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */ | 50 | #define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */ |
51 | #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */ | 51 | #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */ |
52 | #define PORT_MAX_8250 23 /* max port ID */ | 52 | #define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */ |
53 | #define PORT_MAX_8250 24 /* max port ID */ | ||
53 | 54 | ||
54 | /* | 55 | /* |
55 | * ARM specific type numbers. These are not currently guaranteed | 56 | * ARM specific type numbers. These are not currently guaranteed |
@@ -215,5 +216,7 @@ | |||
215 | /* Energy Micro efm32 SoC */ | 216 | /* Energy Micro efm32 SoC */ |
216 | #define PORT_EFMUART 100 | 217 | #define PORT_EFMUART 100 |
217 | 218 | ||
219 | /* ARC (Synopsys) on-chip UART */ | ||
220 | #define PORT_ARC 101 | ||
218 | 221 | ||
219 | #endif /* _UAPILINUX_SERIAL_CORE_H */ | 222 | #endif /* _UAPILINUX_SERIAL_CORE_H */ |
diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h index 5ed325e88a81..e6322605b138 100644 --- a/include/uapi/linux/serial_reg.h +++ b/include/uapi/linux/serial_reg.h | |||
@@ -367,5 +367,23 @@ | |||
367 | #define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */ | 367 | #define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */ |
368 | #define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */ | 368 | #define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */ |
369 | 369 | ||
370 | /* | ||
371 | * These are definitions for the Exar XR17V35X and XR17(C|D)15X | ||
372 | */ | ||
373 | #define UART_EXAR_8XMODE 0x88 /* 8X sampling rate select */ | ||
374 | #define UART_EXAR_SLEEP 0x8b /* Sleep mode */ | ||
375 | #define UART_EXAR_DVID 0x8d /* Device identification */ | ||
376 | |||
377 | #define UART_EXAR_FCTR 0x08 /* Feature Control Register */ | ||
378 | #define UART_FCTR_EXAR_IRDA 0x08 /* IrDa data encode select */ | ||
379 | #define UART_FCTR_EXAR_485 0x10 /* Auto 485 half duplex dir ctl */ | ||
380 | #define UART_FCTR_EXAR_TRGA 0x00 /* FIFO trigger table A */ | ||
381 | #define UART_FCTR_EXAR_TRGB 0x60 /* FIFO trigger table B */ | ||
382 | #define UART_FCTR_EXAR_TRGC 0x80 /* FIFO trigger table C */ | ||
383 | #define UART_FCTR_EXAR_TRGD 0xc0 /* FIFO trigger table D programmable */ | ||
384 | |||
385 | #define UART_EXAR_TXTRG 0x0a /* Tx FIFO trigger level write-only */ | ||
386 | #define UART_EXAR_RXTRG 0x0b /* Rx FIFO trigger level write-only */ | ||
387 | |||
370 | #endif /* _LINUX_SERIAL_REG_H */ | 388 | #endif /* _LINUX_SERIAL_REG_H */ |
371 | 389 | ||
diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 3729173b7fbc..88c829466fc1 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h | |||
@@ -314,6 +314,19 @@ int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel); | |||
314 | int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel); | 314 | int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel); |
315 | void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel); | 315 | void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel); |
316 | 316 | ||
317 | enum omapdss_version { | ||
318 | OMAPDSS_VER_UNKNOWN = 0, | ||
319 | OMAPDSS_VER_OMAP24xx, | ||
320 | OMAPDSS_VER_OMAP34xx_ES1, /* OMAP3430 ES1.0, 2.0 */ | ||
321 | OMAPDSS_VER_OMAP34xx_ES3, /* OMAP3430 ES3.0+ */ | ||
322 | OMAPDSS_VER_OMAP3630, | ||
323 | OMAPDSS_VER_AM35xx, | ||
324 | OMAPDSS_VER_OMAP4430_ES1, /* OMAP4430 ES1.0 */ | ||
325 | OMAPDSS_VER_OMAP4430_ES2, /* OMAP4430 ES2.0, 2.1, 2.2 */ | ||
326 | OMAPDSS_VER_OMAP4, /* All other OMAP4s */ | ||
327 | OMAPDSS_VER_OMAP5, | ||
328 | }; | ||
329 | |||
317 | /* Board specific data */ | 330 | /* Board specific data */ |
318 | struct omap_dss_board_info { | 331 | struct omap_dss_board_info { |
319 | int (*get_context_loss_count)(struct device *dev); | 332 | int (*get_context_loss_count)(struct device *dev); |
@@ -323,6 +336,7 @@ struct omap_dss_board_info { | |||
323 | int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask); | 336 | int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask); |
324 | void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask); | 337 | void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask); |
325 | int (*set_min_bus_tput)(struct device *dev, unsigned long r); | 338 | int (*set_min_bus_tput)(struct device *dev, unsigned long r); |
339 | enum omapdss_version version; | ||
326 | }; | 340 | }; |
327 | 341 | ||
328 | /* Init with the board info */ | 342 | /* Init with the board info */ |
diff --git a/include/video/omapvrfb.h b/include/video/omapvrfb.h new file mode 100644 index 000000000000..bb0bd89f8bc6 --- /dev/null +++ b/include/video/omapvrfb.h | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | * VRFB Rotation Engine | ||
3 | * | ||
4 | * Copyright (C) 2009 Nokia Corporation | ||
5 | * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but | ||
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | * General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef __OMAP_VRFB_H__ | ||
22 | #define __OMAP_VRFB_H__ | ||
23 | |||
24 | #define OMAP_VRFB_LINE_LEN 2048 | ||
25 | |||
26 | struct vrfb { | ||
27 | u8 context; | ||
28 | void __iomem *vaddr[4]; | ||
29 | unsigned long paddr[4]; | ||
30 | u16 xres; | ||
31 | u16 yres; | ||
32 | u16 xoffset; | ||
33 | u16 yoffset; | ||
34 | u8 bytespp; | ||
35 | bool yuv_mode; | ||
36 | }; | ||
37 | |||
38 | #ifdef CONFIG_OMAP2_VRFB | ||
39 | extern bool omap_vrfb_supported(void); | ||
40 | extern int omap_vrfb_request_ctx(struct vrfb *vrfb); | ||
41 | extern void omap_vrfb_release_ctx(struct vrfb *vrfb); | ||
42 | extern void omap_vrfb_adjust_size(u16 *width, u16 *height, | ||
43 | u8 bytespp); | ||
44 | extern u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp); | ||
45 | extern u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp); | ||
46 | extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr, | ||
47 | u16 width, u16 height, | ||
48 | unsigned bytespp, bool yuv_mode); | ||
49 | extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot); | ||
50 | extern void omap_vrfb_restore_context(void); | ||
51 | |||
52 | #else | ||
53 | static inline bool omap_vrfb_supported(void) { return false; } | ||
54 | static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; } | ||
55 | static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {} | ||
56 | static inline void omap_vrfb_adjust_size(u16 *width, u16 *height, | ||
57 | u8 bytespp) {} | ||
58 | static inline u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp) | ||
59 | { return 0; } | ||
60 | static inline u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp) | ||
61 | { return 0; } | ||
62 | static inline void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr, | ||
63 | u16 width, u16 height, unsigned bytespp, bool yuv_mode) {} | ||
64 | static inline int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot) | ||
65 | { return 0; } | ||
66 | static inline void omap_vrfb_restore_context(void) {} | ||
67 | #endif | ||
68 | #endif /* __VRFB_H */ | ||