diff options
| author | Grant Likely <grant.likely@secretlab.ca> | 2012-02-22 20:36:17 -0500 |
|---|---|---|
| committer | Grant Likely <grant.likely@secretlab.ca> | 2012-02-22 20:36:17 -0500 |
| commit | daefd89efc279b142bbb054577c2d706da211723 (patch) | |
| tree | 2298056232548f6f22d7bbff2662a2bbf64520de /include/linux | |
| parent | 6e33aceda2d82126e9d08a39e21a15be0dd00a6c (diff) | |
| parent | f86bcc302a8c570dd0f5a50097a6af96a0e717c2 (diff) | |
Merge branch 'for_3.4/gpio/runtime-pm-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into gpio/next
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/device.h | 15 | ||||
| -rw-r--r-- | include/linux/freezer.h | 2 | ||||
| -rw-r--r-- | include/linux/fs.h | 2 | ||||
| -rw-r--r-- | include/linux/if_team.h | 10 | ||||
| -rw-r--r-- | include/linux/kexec.h | 2 | ||||
| -rw-r--r-- | include/linux/mfd/mcp.h | 12 | ||||
| -rw-r--r-- | include/linux/mfd/ucb1x00.h | 5 | ||||
| -rw-r--r-- | include/linux/migrate.h | 14 | ||||
| -rw-r--r-- | include/linux/migrate_mode.h | 16 | ||||
| -rw-r--r-- | include/linux/mlx4/device.h | 1 | ||||
| -rw-r--r-- | include/linux/mod_devicetable.h | 11 | ||||
| -rw-r--r-- | include/linux/mtd/mtd.h | 4 | ||||
| -rw-r--r-- | include/linux/quota.h | 6 | ||||
| -rw-r--r-- | include/linux/res_counter.h | 11 | ||||
| -rw-r--r-- | include/linux/sched.h | 4 | ||||
| -rw-r--r-- | include/linux/shmem_fs.h | 1 | ||||
| -rw-r--r-- | include/linux/snmp.h | 1 | ||||
| -rw-r--r-- | include/linux/suspend.h | 19 | ||||
| -rw-r--r-- | include/linux/swap.h | 2 | ||||
| -rw-r--r-- | include/linux/sysdev.h | 164 | ||||
| -rw-r--r-- | include/linux/thermal.h | 4 | ||||
| -rw-r--r-- | include/linux/usb.h | 1 | ||||
| -rw-r--r-- | include/linux/usb/langwell_otg.h | 139 |
23 files changed, 91 insertions, 355 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 5b3adb8f9588..b63fb393aa58 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -279,11 +279,11 @@ struct device *driver_find_device(struct device_driver *drv, | |||
| 279 | 279 | ||
| 280 | /** | 280 | /** |
| 281 | * struct subsys_interface - interfaces to device functions | 281 | * struct subsys_interface - interfaces to device functions |
| 282 | * @name name of the device function | 282 | * @name: name of the device function |
| 283 | * @subsystem subsytem of the devices to attach to | 283 | * @subsys: subsytem of the devices to attach to |
| 284 | * @node the list of functions registered at the subsystem | 284 | * @node: the list of functions registered at the subsystem |
| 285 | * @add device hookup to device function handler | 285 | * @add_dev: device hookup to device function handler |
| 286 | * @remove device hookup to device function handler | 286 | * @remove_dev: device hookup to device function handler |
| 287 | * | 287 | * |
| 288 | * Simple interfaces attached to a subsystem. Multiple interfaces can | 288 | * Simple interfaces attached to a subsystem. Multiple interfaces can |
| 289 | * attach to a subsystem and its devices. Unlike drivers, they do not | 289 | * attach to a subsystem and its devices. Unlike drivers, they do not |
| @@ -612,6 +612,7 @@ struct device_dma_parameters { | |||
| 612 | * @archdata: For arch-specific additions. | 612 | * @archdata: For arch-specific additions. |
| 613 | * @of_node: Associated device tree node. | 613 | * @of_node: Associated device tree node. |
| 614 | * @devt: For creating the sysfs "dev". | 614 | * @devt: For creating the sysfs "dev". |
| 615 | * @id: device instance | ||
| 615 | * @devres_lock: Spinlock to protect the resource of the device. | 616 | * @devres_lock: Spinlock to protect the resource of the device. |
| 616 | * @devres_head: The resources list of the device. | 617 | * @devres_head: The resources list of the device. |
| 617 | * @knode_class: The node used to add the device to the class list. | 618 | * @knode_class: The node used to add the device to the class list. |
| @@ -1003,6 +1004,10 @@ extern long sysfs_deprecated; | |||
| 1003 | * Each module may only use this macro once, and calling it replaces | 1004 | * Each module may only use this macro once, and calling it replaces |
| 1004 | * module_init() and module_exit(). | 1005 | * module_init() and module_exit(). |
| 1005 | * | 1006 | * |
| 1007 | * @__driver: driver name | ||
| 1008 | * @__register: register function for this driver type | ||
| 1009 | * @__unregister: unregister function for this driver type | ||
| 1010 | * | ||
| 1006 | * Use this macro to construct bus specific macros for registering | 1011 | * Use this macro to construct bus specific macros for registering |
| 1007 | * drivers, and do not use it on its own. | 1012 | * drivers, and do not use it on its own. |
| 1008 | */ | 1013 | */ |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index 0ab54e16a91f..d09af4b67cf1 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
| @@ -39,6 +39,7 @@ extern bool __refrigerator(bool check_kthr_stop); | |||
| 39 | extern int freeze_processes(void); | 39 | extern int freeze_processes(void); |
| 40 | extern int freeze_kernel_threads(void); | 40 | extern int freeze_kernel_threads(void); |
| 41 | extern void thaw_processes(void); | 41 | extern void thaw_processes(void); |
| 42 | extern void thaw_kernel_threads(void); | ||
| 42 | 43 | ||
| 43 | static inline bool try_to_freeze(void) | 44 | static inline bool try_to_freeze(void) |
| 44 | { | 45 | { |
| @@ -174,6 +175,7 @@ static inline bool __refrigerator(bool check_kthr_stop) { return false; } | |||
| 174 | static inline int freeze_processes(void) { return -ENOSYS; } | 175 | static inline int freeze_processes(void) { return -ENOSYS; } |
| 175 | static inline int freeze_kernel_threads(void) { return -ENOSYS; } | 176 | static inline int freeze_kernel_threads(void) { return -ENOSYS; } |
| 176 | static inline void thaw_processes(void) {} | 177 | static inline void thaw_processes(void) {} |
| 178 | static inline void thaw_kernel_threads(void) {} | ||
| 177 | 179 | ||
| 178 | static inline bool try_to_freeze(void) { return false; } | 180 | static inline bool try_to_freeze(void) { return false; } |
| 179 | 181 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 0244082d42c5..386da09f229d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -396,6 +396,7 @@ struct inodes_stat_t { | |||
| 396 | #include <linux/rculist_bl.h> | 396 | #include <linux/rculist_bl.h> |
| 397 | #include <linux/atomic.h> | 397 | #include <linux/atomic.h> |
| 398 | #include <linux/shrinker.h> | 398 | #include <linux/shrinker.h> |
| 399 | #include <linux/migrate_mode.h> | ||
| 399 | 400 | ||
| 400 | #include <asm/byteorder.h> | 401 | #include <asm/byteorder.h> |
| 401 | 402 | ||
| @@ -526,7 +527,6 @@ enum positive_aop_returns { | |||
| 526 | struct page; | 527 | struct page; |
| 527 | struct address_space; | 528 | struct address_space; |
| 528 | struct writeback_control; | 529 | struct writeback_control; |
| 529 | enum migrate_mode; | ||
| 530 | 530 | ||
| 531 | struct iov_iter { | 531 | struct iov_iter { |
| 532 | const struct iovec *iov; | 532 | const struct iovec *iov; |
diff --git a/include/linux/if_team.h b/include/linux/if_team.h index 828181fbad5d..58404b0c5010 100644 --- a/include/linux/if_team.h +++ b/include/linux/if_team.h | |||
| @@ -46,6 +46,10 @@ struct team_port { | |||
| 46 | u32 speed; | 46 | u32 speed; |
| 47 | u8 duplex; | 47 | u8 duplex; |
| 48 | 48 | ||
| 49 | /* Custom gennetlink interface related flags */ | ||
| 50 | bool changed; | ||
| 51 | bool removed; | ||
| 52 | |||
| 49 | struct rcu_head rcu; | 53 | struct rcu_head rcu; |
| 50 | }; | 54 | }; |
| 51 | 55 | ||
| @@ -72,6 +76,10 @@ struct team_option { | |||
| 72 | enum team_option_type type; | 76 | enum team_option_type type; |
| 73 | int (*getter)(struct team *team, void *arg); | 77 | int (*getter)(struct team *team, void *arg); |
| 74 | int (*setter)(struct team *team, void *arg); | 78 | int (*setter)(struct team *team, void *arg); |
| 79 | |||
| 80 | /* Custom gennetlink interface related flags */ | ||
| 81 | bool changed; | ||
| 82 | bool removed; | ||
| 75 | }; | 83 | }; |
| 76 | 84 | ||
| 77 | struct team_mode { | 85 | struct team_mode { |
| @@ -207,6 +215,7 @@ enum { | |||
| 207 | TEAM_ATTR_OPTION_CHANGED, /* flag */ | 215 | TEAM_ATTR_OPTION_CHANGED, /* flag */ |
| 208 | TEAM_ATTR_OPTION_TYPE, /* u8 */ | 216 | TEAM_ATTR_OPTION_TYPE, /* u8 */ |
| 209 | TEAM_ATTR_OPTION_DATA, /* dynamic */ | 217 | TEAM_ATTR_OPTION_DATA, /* dynamic */ |
| 218 | TEAM_ATTR_OPTION_REMOVED, /* flag */ | ||
| 210 | 219 | ||
| 211 | __TEAM_ATTR_OPTION_MAX, | 220 | __TEAM_ATTR_OPTION_MAX, |
| 212 | TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1, | 221 | TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1, |
| @@ -227,6 +236,7 @@ enum { | |||
| 227 | TEAM_ATTR_PORT_LINKUP, /* flag */ | 236 | TEAM_ATTR_PORT_LINKUP, /* flag */ |
| 228 | TEAM_ATTR_PORT_SPEED, /* u32 */ | 237 | TEAM_ATTR_PORT_SPEED, /* u32 */ |
| 229 | TEAM_ATTR_PORT_DUPLEX, /* u8 */ | 238 | TEAM_ATTR_PORT_DUPLEX, /* u8 */ |
| 239 | TEAM_ATTR_PORT_REMOVED, /* flag */ | ||
| 230 | 240 | ||
| 231 | __TEAM_ATTR_PORT_MAX, | 241 | __TEAM_ATTR_PORT_MAX, |
| 232 | TEAM_ATTR_PORT_MAX = __TEAM_ATTR_PORT_MAX - 1, | 242 | TEAM_ATTR_PORT_MAX = __TEAM_ATTR_PORT_MAX - 1, |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 2fa0901219d4..0d7d6a1b172f 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
| @@ -50,9 +50,11 @@ | |||
| 50 | * note header. For kdump, the code in vmcore.c runs in the context | 50 | * note header. For kdump, the code in vmcore.c runs in the context |
| 51 | * of the second kernel to combine them into one note. | 51 | * of the second kernel to combine them into one note. |
| 52 | */ | 52 | */ |
| 53 | #ifndef KEXEC_NOTE_BYTES | ||
| 53 | #define KEXEC_NOTE_BYTES ( (KEXEC_NOTE_HEAD_BYTES * 2) + \ | 54 | #define KEXEC_NOTE_BYTES ( (KEXEC_NOTE_HEAD_BYTES * 2) + \ |
| 54 | KEXEC_CORE_NOTE_NAME_BYTES + \ | 55 | KEXEC_CORE_NOTE_NAME_BYTES + \ |
| 55 | KEXEC_CORE_NOTE_DESC_BYTES ) | 56 | KEXEC_CORE_NOTE_DESC_BYTES ) |
| 57 | #endif | ||
| 56 | 58 | ||
| 57 | /* | 59 | /* |
| 58 | * This structure is used to hold the arguments that are used when loading | 60 | * This structure is used to hold the arguments that are used when loading |
diff --git a/include/linux/mfd/mcp.h b/include/linux/mfd/mcp.h index 1515e64e3663..f88c1cc0cb0f 100644 --- a/include/linux/mfd/mcp.h +++ b/include/linux/mfd/mcp.h | |||
| @@ -10,7 +10,6 @@ | |||
| 10 | #ifndef MCP_H | 10 | #ifndef MCP_H |
| 11 | #define MCP_H | 11 | #define MCP_H |
| 12 | 12 | ||
| 13 | #include <linux/mod_devicetable.h> | ||
| 14 | #include <mach/dma.h> | 13 | #include <mach/dma.h> |
| 15 | 14 | ||
| 16 | struct mcp_ops; | 15 | struct mcp_ops; |
| @@ -27,7 +26,7 @@ struct mcp { | |||
| 27 | dma_device_t dma_telco_rd; | 26 | dma_device_t dma_telco_rd; |
| 28 | dma_device_t dma_telco_wr; | 27 | dma_device_t dma_telco_wr; |
| 29 | struct device attached_device; | 28 | struct device attached_device; |
| 30 | const char *codec; | 29 | int gpio_base; |
| 31 | }; | 30 | }; |
| 32 | 31 | ||
| 33 | struct mcp_ops { | 32 | struct mcp_ops { |
| @@ -45,11 +44,10 @@ void mcp_reg_write(struct mcp *, unsigned int, unsigned int); | |||
| 45 | unsigned int mcp_reg_read(struct mcp *, unsigned int); | 44 | unsigned int mcp_reg_read(struct mcp *, unsigned int); |
| 46 | void mcp_enable(struct mcp *); | 45 | void mcp_enable(struct mcp *); |
| 47 | void mcp_disable(struct mcp *); | 46 | void mcp_disable(struct mcp *); |
| 48 | const struct mcp_device_id *mcp_get_device_id(const struct mcp *mcp); | ||
| 49 | #define mcp_get_sclk_rate(mcp) ((mcp)->sclk_rate) | 47 | #define mcp_get_sclk_rate(mcp) ((mcp)->sclk_rate) |
| 50 | 48 | ||
| 51 | struct mcp *mcp_host_alloc(struct device *, size_t); | 49 | struct mcp *mcp_host_alloc(struct device *, size_t); |
| 52 | int mcp_host_register(struct mcp *, void *); | 50 | int mcp_host_register(struct mcp *); |
| 53 | void mcp_host_unregister(struct mcp *); | 51 | void mcp_host_unregister(struct mcp *); |
| 54 | 52 | ||
| 55 | struct mcp_driver { | 53 | struct mcp_driver { |
| @@ -58,7 +56,6 @@ struct mcp_driver { | |||
| 58 | void (*remove)(struct mcp *); | 56 | void (*remove)(struct mcp *); |
| 59 | int (*suspend)(struct mcp *, pm_message_t); | 57 | int (*suspend)(struct mcp *, pm_message_t); |
| 60 | int (*resume)(struct mcp *); | 58 | int (*resume)(struct mcp *); |
| 61 | const struct mcp_device_id *id_table; | ||
| 62 | }; | 59 | }; |
| 63 | 60 | ||
| 64 | int mcp_driver_register(struct mcp_driver *); | 61 | int mcp_driver_register(struct mcp_driver *); |
| @@ -67,6 +64,9 @@ void mcp_driver_unregister(struct mcp_driver *); | |||
| 67 | #define mcp_get_drvdata(mcp) dev_get_drvdata(&(mcp)->attached_device) | 64 | #define mcp_get_drvdata(mcp) dev_get_drvdata(&(mcp)->attached_device) |
| 68 | #define mcp_set_drvdata(mcp,d) dev_set_drvdata(&(mcp)->attached_device, d) | 65 | #define mcp_set_drvdata(mcp,d) dev_set_drvdata(&(mcp)->attached_device, d) |
| 69 | 66 | ||
| 70 | #define mcp_priv(mcp) ((void *)((mcp)+1)) | 67 | static inline void *mcp_priv(struct mcp *mcp) |
| 68 | { | ||
| 69 | return mcp + 1; | ||
| 70 | } | ||
| 71 | 71 | ||
| 72 | #endif | 72 | #endif |
diff --git a/include/linux/mfd/ucb1x00.h b/include/linux/mfd/ucb1x00.h index bc19e5fb7ea8..4321f044d1e4 100644 --- a/include/linux/mfd/ucb1x00.h +++ b/include/linux/mfd/ucb1x00.h | |||
| @@ -104,9 +104,6 @@ | |||
| 104 | #define UCB_MODE_DYN_VFLAG_ENA (1 << 12) | 104 | #define UCB_MODE_DYN_VFLAG_ENA (1 << 12) |
| 105 | #define UCB_MODE_AUD_OFF_CAN (1 << 13) | 105 | #define UCB_MODE_AUD_OFF_CAN (1 << 13) |
| 106 | 106 | ||
| 107 | struct ucb1x00_plat_data { | ||
| 108 | int gpio_base; | ||
| 109 | }; | ||
| 110 | 107 | ||
| 111 | struct ucb1x00_irq { | 108 | struct ucb1x00_irq { |
| 112 | void *devid; | 109 | void *devid; |
| @@ -119,7 +116,7 @@ struct ucb1x00 { | |||
| 119 | unsigned int irq; | 116 | unsigned int irq; |
| 120 | struct semaphore adc_sem; | 117 | struct semaphore adc_sem; |
| 121 | spinlock_t io_lock; | 118 | spinlock_t io_lock; |
| 122 | const struct mcp_device_id *id; | 119 | u16 id; |
| 123 | u16 io_dir; | 120 | u16 io_dir; |
| 124 | u16 io_out; | 121 | u16 io_out; |
| 125 | u16 adc_cr; | 122 | u16 adc_cr; |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index eaf867412f7a..05ed2828a553 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
| @@ -3,22 +3,10 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
| 5 | #include <linux/mempolicy.h> | 5 | #include <linux/mempolicy.h> |
| 6 | #include <linux/migrate_mode.h> | ||
| 6 | 7 | ||
| 7 | 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 **); |
| 8 | 9 | ||
| 9 | /* | ||
| 10 | * MIGRATE_ASYNC means never block | ||
| 11 | * MIGRATE_SYNC_LIGHT in the current implementation means to allow blocking | ||
| 12 | * on most operations but not ->writepage as the potential stall time | ||
| 13 | * is too significant | ||
| 14 | * MIGRATE_SYNC will block when migrating pages | ||
| 15 | */ | ||
| 16 | enum migrate_mode { | ||
| 17 | MIGRATE_ASYNC, | ||
| 18 | MIGRATE_SYNC_LIGHT, | ||
| 19 | MIGRATE_SYNC, | ||
| 20 | }; | ||
| 21 | |||
| 22 | #ifdef CONFIG_MIGRATION | 10 | #ifdef CONFIG_MIGRATION |
| 23 | #define PAGE_MIGRATION 1 | 11 | #define PAGE_MIGRATION 1 |
| 24 | 12 | ||
diff --git a/include/linux/migrate_mode.h b/include/linux/migrate_mode.h new file mode 100644 index 000000000000..ebf3d89a3919 --- /dev/null +++ b/include/linux/migrate_mode.h | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #ifndef MIGRATE_MODE_H_INCLUDED | ||
| 2 | #define MIGRATE_MODE_H_INCLUDED | ||
| 3 | /* | ||
| 4 | * MIGRATE_ASYNC means never block | ||
| 5 | * MIGRATE_SYNC_LIGHT in the current implementation means to allow blocking | ||
| 6 | * on most operations but not ->writepage as the potential stall time | ||
| 7 | * is too significant | ||
| 8 | * MIGRATE_SYNC will block when migrating pages | ||
| 9 | */ | ||
| 10 | enum migrate_mode { | ||
| 11 | MIGRATE_ASYNC, | ||
| 12 | MIGRATE_SYNC_LIGHT, | ||
| 13 | MIGRATE_SYNC, | ||
| 14 | }; | ||
| 15 | |||
| 16 | #endif /* MIGRATE_MODE_H_INCLUDED */ | ||
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 5c4fe8e5bfe5..aea61905499b 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -621,6 +621,7 @@ void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac); | |||
| 621 | int mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac); | 621 | int mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac); |
| 622 | int mlx4_get_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn); | 622 | int mlx4_get_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn); |
| 623 | void mlx4_put_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int qpn); | 623 | void mlx4_put_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int qpn); |
| 624 | void mlx4_set_stats_bitmap(struct mlx4_dev *dev, u64 *stats_bitmap); | ||
| 624 | 625 | ||
| 625 | int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); | 626 | int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); |
| 626 | int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); | 627 | int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index b29e7f6f8fa5..83ac0713ed0a 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -436,17 +436,6 @@ struct spi_device_id { | |||
| 436 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | 436 | __attribute__((aligned(sizeof(kernel_ulong_t)))); |
| 437 | }; | 437 | }; |
| 438 | 438 | ||
| 439 | /* mcp */ | ||
| 440 | |||
| 441 | #define MCP_NAME_SIZE 20 | ||
| 442 | #define MCP_MODULE_PREFIX "mcp:" | ||
| 443 | |||
| 444 | struct mcp_device_id { | ||
| 445 | char name[MCP_NAME_SIZE]; | ||
| 446 | kernel_ulong_t driver_data /* Data private to the driver */ | ||
| 447 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 448 | }; | ||
| 449 | |||
| 450 | /* dmi */ | 439 | /* dmi */ |
| 451 | enum dmi_field { | 440 | enum dmi_field { |
| 452 | DMI_NONE, | 441 | DMI_NONE, |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 1a81fde8f333..221295208fd0 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -441,7 +441,7 @@ static inline void mtd_resume(struct mtd_info *mtd) | |||
| 441 | static inline int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs) | 441 | static inline int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs) |
| 442 | { | 442 | { |
| 443 | if (!mtd->block_isbad) | 443 | if (!mtd->block_isbad) |
| 444 | return -EOPNOTSUPP; | 444 | return 0; |
| 445 | return mtd->block_isbad(mtd, ofs); | 445 | return mtd->block_isbad(mtd, ofs); |
| 446 | } | 446 | } |
| 447 | 447 | ||
| @@ -489,7 +489,7 @@ static inline int mtd_has_oob(const struct mtd_info *mtd) | |||
| 489 | 489 | ||
| 490 | static inline int mtd_can_have_bb(const struct mtd_info *mtd) | 490 | static inline int mtd_can_have_bb(const struct mtd_info *mtd) |
| 491 | { | 491 | { |
| 492 | return !!mtd->block_isbad; | 492 | return 0; |
| 493 | } | 493 | } |
| 494 | 494 | ||
| 495 | /* Kernel-side ioctl definitions */ | 495 | /* Kernel-side ioctl definitions */ |
diff --git a/include/linux/quota.h b/include/linux/quota.h index cb7855699037..c09fa042b5ea 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
| @@ -230,7 +230,11 @@ struct mem_dqinfo { | |||
| 230 | struct super_block; | 230 | struct super_block; |
| 231 | 231 | ||
| 232 | #define DQF_MASK 0xffff /* Mask for format specific flags */ | 232 | #define DQF_MASK 0xffff /* Mask for format specific flags */ |
| 233 | #define DQF_INFO_DIRTY_B 16 | 233 | #define DQF_GETINFO_MASK 0x1ffff /* Mask for flags passed to userspace */ |
| 234 | #define DQF_SETINFO_MASK 0xffff /* Mask for flags modifiable from userspace */ | ||
| 235 | #define DQF_SYS_FILE_B 16 | ||
| 236 | #define DQF_SYS_FILE (1 << DQF_SYS_FILE_B) /* Quota file stored as system file */ | ||
| 237 | #define DQF_INFO_DIRTY_B 31 | ||
| 234 | #define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */ | 238 | #define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */ |
| 235 | 239 | ||
| 236 | extern void mark_info_dirty(struct super_block *sb, int type); | 240 | extern void mark_info_dirty(struct super_block *sb, int type); |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index c9d625ca659e..da81af086eaf 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
| @@ -109,12 +109,18 @@ void res_counter_init(struct res_counter *counter, struct res_counter *parent); | |||
| 109 | * | 109 | * |
| 110 | * returns 0 on success and <0 if the counter->usage will exceed the | 110 | * returns 0 on success and <0 if the counter->usage will exceed the |
| 111 | * counter->limit _locked call expects the counter->lock to be taken | 111 | * counter->limit _locked call expects the counter->lock to be taken |
| 112 | * | ||
| 113 | * charge_nofail works the same, except that it charges the resource | ||
| 114 | * counter unconditionally, and returns < 0 if the after the current | ||
| 115 | * charge we are over limit. | ||
| 112 | */ | 116 | */ |
| 113 | 117 | ||
| 114 | int __must_check res_counter_charge_locked(struct res_counter *counter, | 118 | int __must_check res_counter_charge_locked(struct res_counter *counter, |
| 115 | unsigned long val); | 119 | unsigned long val); |
| 116 | int __must_check res_counter_charge(struct res_counter *counter, | 120 | int __must_check res_counter_charge(struct res_counter *counter, |
| 117 | unsigned long val, struct res_counter **limit_fail_at); | 121 | unsigned long val, struct res_counter **limit_fail_at); |
| 122 | int __must_check res_counter_charge_nofail(struct res_counter *counter, | ||
| 123 | unsigned long val, struct res_counter **limit_fail_at); | ||
| 118 | 124 | ||
| 119 | /* | 125 | /* |
| 120 | * uncharge - tell that some portion of the resource is released | 126 | * uncharge - tell that some portion of the resource is released |
| @@ -142,7 +148,10 @@ static inline unsigned long long res_counter_margin(struct res_counter *cnt) | |||
| 142 | unsigned long flags; | 148 | unsigned long flags; |
| 143 | 149 | ||
| 144 | spin_lock_irqsave(&cnt->lock, flags); | 150 | spin_lock_irqsave(&cnt->lock, flags); |
| 145 | margin = cnt->limit - cnt->usage; | 151 | if (cnt->limit > cnt->usage) |
| 152 | margin = cnt->limit - cnt->usage; | ||
| 153 | else | ||
| 154 | margin = 0; | ||
| 146 | spin_unlock_irqrestore(&cnt->lock, flags); | 155 | spin_unlock_irqrestore(&cnt->lock, flags); |
| 147 | return margin; | 156 | return margin; |
| 148 | } | 157 | } |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 4032ec1cf836..2234985a5e65 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -2088,9 +2088,9 @@ extern int sched_setscheduler_nocheck(struct task_struct *, int, | |||
| 2088 | extern struct task_struct *idle_task(int cpu); | 2088 | extern struct task_struct *idle_task(int cpu); |
| 2089 | /** | 2089 | /** |
| 2090 | * is_idle_task - is the specified task an idle task? | 2090 | * is_idle_task - is the specified task an idle task? |
| 2091 | * @tsk: the task in question. | 2091 | * @p: the task in question. |
| 2092 | */ | 2092 | */ |
| 2093 | static inline bool is_idle_task(struct task_struct *p) | 2093 | static inline bool is_idle_task(const struct task_struct *p) |
| 2094 | { | 2094 | { |
| 2095 | return p->pid == 0; | 2095 | return p->pid == 0; |
| 2096 | } | 2096 | } |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index e4c711c6f321..79ab2555b3b0 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
| @@ -48,6 +48,7 @@ extern struct file *shmem_file_setup(const char *name, | |||
| 48 | loff_t size, unsigned long flags); | 48 | loff_t size, unsigned long flags); |
| 49 | extern int shmem_zero_setup(struct vm_area_struct *); | 49 | extern int shmem_zero_setup(struct vm_area_struct *); |
| 50 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); | 50 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); |
| 51 | extern void shmem_unlock_mapping(struct address_space *mapping); | ||
| 51 | extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, | 52 | extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, |
| 52 | pgoff_t index, gfp_t gfp_mask); | 53 | pgoff_t index, gfp_t gfp_mask); |
| 53 | extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end); | 54 | extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end); |
diff --git a/include/linux/snmp.h b/include/linux/snmp.h index e16557a357e5..c1241c428179 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
| @@ -192,7 +192,6 @@ enum | |||
| 192 | LINUX_MIB_TCPPARTIALUNDO, /* TCPPartialUndo */ | 192 | LINUX_MIB_TCPPARTIALUNDO, /* TCPPartialUndo */ |
| 193 | LINUX_MIB_TCPDSACKUNDO, /* TCPDSACKUndo */ | 193 | LINUX_MIB_TCPDSACKUNDO, /* TCPDSACKUndo */ |
| 194 | LINUX_MIB_TCPLOSSUNDO, /* TCPLossUndo */ | 194 | LINUX_MIB_TCPLOSSUNDO, /* TCPLossUndo */ |
| 195 | LINUX_MIB_TCPLOSS, /* TCPLoss */ | ||
| 196 | LINUX_MIB_TCPLOSTRETRANSMIT, /* TCPLostRetransmit */ | 195 | LINUX_MIB_TCPLOSTRETRANSMIT, /* TCPLostRetransmit */ |
| 197 | LINUX_MIB_TCPRENOFAILURES, /* TCPRenoFailures */ | 196 | LINUX_MIB_TCPRENOFAILURES, /* TCPRenoFailures */ |
| 198 | LINUX_MIB_TCPSACKFAILURES, /* TCPSackFailures */ | 197 | LINUX_MIB_TCPSACKFAILURES, /* TCPSackFailures */ |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 95040cc33107..91784a4f8608 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
| @@ -357,14 +357,29 @@ extern bool pm_save_wakeup_count(unsigned int count); | |||
| 357 | 357 | ||
| 358 | static inline void lock_system_sleep(void) | 358 | static inline void lock_system_sleep(void) |
| 359 | { | 359 | { |
| 360 | freezer_do_not_count(); | 360 | current->flags |= PF_FREEZER_SKIP; |
| 361 | mutex_lock(&pm_mutex); | 361 | mutex_lock(&pm_mutex); |
| 362 | } | 362 | } |
| 363 | 363 | ||
| 364 | static inline void unlock_system_sleep(void) | 364 | static inline void unlock_system_sleep(void) |
| 365 | { | 365 | { |
| 366 | /* | ||
| 367 | * Don't use freezer_count() because we don't want the call to | ||
| 368 | * try_to_freeze() here. | ||
| 369 | * | ||
| 370 | * Reason: | ||
| 371 | * Fundamentally, we just don't need it, because freezing condition | ||
| 372 | * doesn't come into effect until we release the pm_mutex lock, | ||
| 373 | * since the freezer always works with pm_mutex held. | ||
| 374 | * | ||
| 375 | * More importantly, in the case of hibernation, | ||
| 376 | * unlock_system_sleep() gets called in snapshot_read() and | ||
| 377 | * snapshot_write() when the freezing condition is still in effect. | ||
| 378 | * Which means, if we use try_to_freeze() here, it would make them | ||
| 379 | * enter the refrigerator, thus causing hibernation to lockup. | ||
| 380 | */ | ||
| 381 | current->flags &= ~PF_FREEZER_SKIP; | ||
| 366 | mutex_unlock(&pm_mutex); | 382 | mutex_unlock(&pm_mutex); |
| 367 | freezer_count(); | ||
| 368 | } | 383 | } |
| 369 | 384 | ||
| 370 | #else /* !CONFIG_PM_SLEEP */ | 385 | #else /* !CONFIG_PM_SLEEP */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 06061a7f8e69..3e60228e7299 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -273,7 +273,7 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) | |||
| 273 | #endif | 273 | #endif |
| 274 | 274 | ||
| 275 | extern int page_evictable(struct page *page, struct vm_area_struct *vma); | 275 | extern int page_evictable(struct page *page, struct vm_area_struct *vma); |
| 276 | extern void scan_mapping_unevictable_pages(struct address_space *); | 276 | extern void check_move_unevictable_pages(struct page **, int nr_pages); |
| 277 | 277 | ||
| 278 | extern unsigned long scan_unevictable_pages; | 278 | extern unsigned long scan_unevictable_pages; |
| 279 | extern int scan_unevictable_handler(struct ctl_table *, int, | 279 | extern int scan_unevictable_handler(struct ctl_table *, int, |
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h deleted file mode 100644 index 20f63d3e6144..000000000000 --- a/include/linux/sysdev.h +++ /dev/null | |||
| @@ -1,164 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * System devices follow a slightly different driver model. | ||
| 3 | * They don't need to do dynammic driver binding, can't be probed, | ||
| 4 | * and don't reside on any type of peripheral bus. | ||
| 5 | * So, we represent and treat them a little differently. | ||
| 6 | * | ||
| 7 | * We still have a notion of a driver for a system device, because we still | ||
| 8 | * want to perform basic operations on these devices. | ||
| 9 | * | ||
| 10 | * We also support auxiliary drivers binding to devices of a certain class. | ||
| 11 | * | ||
| 12 | * This allows configurable drivers to register themselves for devices of | ||
| 13 | * a certain type. And, it allows class definitions to reside in generic | ||
| 14 | * code while arch-specific code can register specific drivers. | ||
| 15 | * | ||
| 16 | * Auxiliary drivers registered with a NULL cls are registered as drivers | ||
| 17 | * for all system devices, and get notification calls for each device. | ||
| 18 | */ | ||
| 19 | |||
| 20 | |||
| 21 | #ifndef _SYSDEV_H_ | ||
| 22 | #define _SYSDEV_H_ | ||
| 23 | |||
| 24 | #include <linux/kobject.h> | ||
| 25 | #include <linux/pm.h> | ||
| 26 | |||
| 27 | |||
| 28 | struct sys_device; | ||
| 29 | struct sysdev_class_attribute; | ||
| 30 | |||
| 31 | struct sysdev_class { | ||
| 32 | const char *name; | ||
| 33 | struct list_head drivers; | ||
| 34 | struct sysdev_class_attribute **attrs; | ||
| 35 | struct kset kset; | ||
| 36 | }; | ||
| 37 | |||
| 38 | struct sysdev_class_attribute { | ||
| 39 | struct attribute attr; | ||
| 40 | ssize_t (*show)(struct sysdev_class *, struct sysdev_class_attribute *, | ||
| 41 | char *); | ||
| 42 | ssize_t (*store)(struct sysdev_class *, struct sysdev_class_attribute *, | ||
| 43 | const char *, size_t); | ||
| 44 | }; | ||
| 45 | |||
| 46 | #define _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ | ||
| 47 | { \ | ||
| 48 | .attr = {.name = __stringify(_name), .mode = _mode }, \ | ||
| 49 | .show = _show, \ | ||
| 50 | .store = _store, \ | ||
| 51 | } | ||
| 52 | |||
| 53 | #define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ | ||
| 54 | struct sysdev_class_attribute attr_##_name = \ | ||
| 55 | _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) | ||
| 56 | |||
| 57 | |||
| 58 | extern int sysdev_class_register(struct sysdev_class *); | ||
| 59 | extern void sysdev_class_unregister(struct sysdev_class *); | ||
| 60 | |||
| 61 | extern int sysdev_class_create_file(struct sysdev_class *, | ||
| 62 | struct sysdev_class_attribute *); | ||
| 63 | extern void sysdev_class_remove_file(struct sysdev_class *, | ||
| 64 | struct sysdev_class_attribute *); | ||
| 65 | /** | ||
| 66 | * Auxiliary system device drivers. | ||
| 67 | */ | ||
| 68 | |||
| 69 | struct sysdev_driver { | ||
| 70 | struct list_head entry; | ||
| 71 | int (*add)(struct sys_device *); | ||
| 72 | int (*remove)(struct sys_device *); | ||
| 73 | }; | ||
| 74 | |||
| 75 | |||
| 76 | extern int sysdev_driver_register(struct sysdev_class *, struct sysdev_driver *); | ||
| 77 | extern void sysdev_driver_unregister(struct sysdev_class *, struct sysdev_driver *); | ||
| 78 | |||
| 79 | |||
| 80 | /** | ||
| 81 | * sys_devices can be simplified a lot from regular devices, because they're | ||
| 82 | * simply not as versatile. | ||
| 83 | */ | ||
| 84 | |||
| 85 | struct sys_device { | ||
| 86 | u32 id; | ||
| 87 | struct sysdev_class * cls; | ||
| 88 | struct kobject kobj; | ||
| 89 | }; | ||
| 90 | |||
| 91 | extern int sysdev_register(struct sys_device *); | ||
| 92 | extern void sysdev_unregister(struct sys_device *); | ||
| 93 | |||
| 94 | |||
| 95 | struct sysdev_attribute { | ||
| 96 | struct attribute attr; | ||
| 97 | ssize_t (*show)(struct sys_device *, struct sysdev_attribute *, char *); | ||
| 98 | ssize_t (*store)(struct sys_device *, struct sysdev_attribute *, | ||
| 99 | const char *, size_t); | ||
| 100 | }; | ||
| 101 | |||
| 102 | |||
| 103 | #define _SYSDEV_ATTR(_name, _mode, _show, _store) \ | ||
| 104 | { \ | ||
| 105 | .attr = { .name = __stringify(_name), .mode = _mode }, \ | ||
| 106 | .show = _show, \ | ||
| 107 | .store = _store, \ | ||
| 108 | } | ||
| 109 | |||
| 110 | #define SYSDEV_ATTR(_name, _mode, _show, _store) \ | ||
| 111 | struct sysdev_attribute attr_##_name = \ | ||
| 112 | _SYSDEV_ATTR(_name, _mode, _show, _store); | ||
| 113 | |||
| 114 | extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *); | ||
| 115 | extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *); | ||
| 116 | |||
| 117 | /* Create/remove NULL terminated attribute list */ | ||
| 118 | static inline int | ||
| 119 | sysdev_create_files(struct sys_device *d, struct sysdev_attribute **a) | ||
| 120 | { | ||
| 121 | return sysfs_create_files(&d->kobj, (const struct attribute **)a); | ||
| 122 | } | ||
| 123 | |||
| 124 | static inline void | ||
| 125 | sysdev_remove_files(struct sys_device *d, struct sysdev_attribute **a) | ||
| 126 | { | ||
| 127 | return sysfs_remove_files(&d->kobj, (const struct attribute **)a); | ||
| 128 | } | ||
| 129 | |||
| 130 | struct sysdev_ext_attribute { | ||
| 131 | struct sysdev_attribute attr; | ||
| 132 | void *var; | ||
| 133 | }; | ||
| 134 | |||
| 135 | /* | ||
| 136 | * Support for simple variable sysdev attributes. | ||
| 137 | * The pointer to the variable is stored in a sysdev_ext_attribute | ||
| 138 | */ | ||
| 139 | |||
| 140 | /* Add more types as needed */ | ||
| 141 | |||
| 142 | extern ssize_t sysdev_show_ulong(struct sys_device *, struct sysdev_attribute *, | ||
| 143 | char *); | ||
| 144 | extern ssize_t sysdev_store_ulong(struct sys_device *, | ||
| 145 | struct sysdev_attribute *, const char *, size_t); | ||
| 146 | extern ssize_t sysdev_show_int(struct sys_device *, struct sysdev_attribute *, | ||
| 147 | char *); | ||
| 148 | extern ssize_t sysdev_store_int(struct sys_device *, | ||
| 149 | struct sysdev_attribute *, const char *, size_t); | ||
| 150 | |||
| 151 | #define _SYSDEV_ULONG_ATTR(_name, _mode, _var) \ | ||
| 152 | { _SYSDEV_ATTR(_name, _mode, sysdev_show_ulong, sysdev_store_ulong), \ | ||
| 153 | &(_var) } | ||
| 154 | #define SYSDEV_ULONG_ATTR(_name, _mode, _var) \ | ||
| 155 | struct sysdev_ext_attribute attr_##_name = \ | ||
| 156 | _SYSDEV_ULONG_ATTR(_name, _mode, _var); | ||
| 157 | #define _SYSDEV_INT_ATTR(_name, _mode, _var) \ | ||
| 158 | { _SYSDEV_ATTR(_name, _mode, sysdev_show_int, sysdev_store_int), \ | ||
| 159 | &(_var) } | ||
| 160 | #define SYSDEV_INT_ATTR(_name, _mode, _var) \ | ||
| 161 | struct sysdev_ext_attribute attr_##_name = \ | ||
| 162 | _SYSDEV_INT_ATTR(_name, _mode, _var); | ||
| 163 | |||
| 164 | #endif /* _SYSDEV_H_ */ | ||
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 47b4a27e6e97..796f1ff0388c 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
| @@ -152,9 +152,9 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, | |||
| 152 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); | 152 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); |
| 153 | 153 | ||
| 154 | #ifdef CONFIG_NET | 154 | #ifdef CONFIG_NET |
| 155 | extern int generate_netlink_event(u32 orig, enum events event); | 155 | extern int thermal_generate_netlink_event(u32 orig, enum events event); |
| 156 | #else | 156 | #else |
| 157 | static inline int generate_netlink_event(u32 orig, enum events event) | 157 | static inline int thermal_generate_netlink_event(u32 orig, enum events event) |
| 158 | { | 158 | { |
| 159 | return 0; | 159 | return 0; |
| 160 | } | 160 | } |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 27a4e16d2bf1..69d845739bc2 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -1073,6 +1073,7 @@ typedef void (*usb_complete_t)(struct urb *); | |||
| 1073 | * which the host controller driver should use in preference to the | 1073 | * which the host controller driver should use in preference to the |
| 1074 | * transfer_buffer. | 1074 | * transfer_buffer. |
| 1075 | * @sg: scatter gather buffer list | 1075 | * @sg: scatter gather buffer list |
| 1076 | * @num_mapped_sgs: (internal) number of mapped sg entries | ||
| 1076 | * @num_sgs: number of entries in the sg list | 1077 | * @num_sgs: number of entries in the sg list |
| 1077 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may | 1078 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may |
| 1078 | * be broken up into chunks according to the current maximum packet | 1079 | * be broken up into chunks according to the current maximum packet |
diff --git a/include/linux/usb/langwell_otg.h b/include/linux/usb/langwell_otg.h deleted file mode 100644 index 51f17b16d312..000000000000 --- a/include/linux/usb/langwell_otg.h +++ /dev/null | |||
| @@ -1,139 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Intel Langwell USB OTG transceiver driver | ||
| 3 | * Copyright (C) 2008 - 2010, Intel Corporation. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms and conditions of the GNU General Public License, | ||
| 7 | * version 2, as published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along with | ||
| 15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
| 16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 17 | * | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __LANGWELL_OTG_H | ||
| 21 | #define __LANGWELL_OTG_H | ||
| 22 | |||
| 23 | #include <linux/usb/intel_mid_otg.h> | ||
| 24 | |||
| 25 | #define CI_USBCMD 0x30 | ||
| 26 | # define USBCMD_RST BIT(1) | ||
| 27 | # define USBCMD_RS BIT(0) | ||
| 28 | #define CI_USBSTS 0x34 | ||
| 29 | # define USBSTS_SLI BIT(8) | ||
| 30 | # define USBSTS_URI BIT(6) | ||
| 31 | # define USBSTS_PCI BIT(2) | ||
| 32 | #define CI_PORTSC1 0x74 | ||
| 33 | # define PORTSC_PP BIT(12) | ||
| 34 | # define PORTSC_LS (BIT(11) | BIT(10)) | ||
| 35 | # define PORTSC_SUSP BIT(7) | ||
| 36 | # define PORTSC_CCS BIT(0) | ||
| 37 | #define CI_HOSTPC1 0xb4 | ||
| 38 | # define HOSTPC1_PHCD BIT(22) | ||
| 39 | #define CI_OTGSC 0xf4 | ||
| 40 | # define OTGSC_DPIE BIT(30) | ||
| 41 | # define OTGSC_1MSE BIT(29) | ||
| 42 | # define OTGSC_BSEIE BIT(28) | ||
| 43 | # define OTGSC_BSVIE BIT(27) | ||
| 44 | # define OTGSC_ASVIE BIT(26) | ||
| 45 | # define OTGSC_AVVIE BIT(25) | ||
| 46 | # define OTGSC_IDIE BIT(24) | ||
| 47 | # define OTGSC_DPIS BIT(22) | ||
| 48 | # define OTGSC_1MSS BIT(21) | ||
| 49 | # define OTGSC_BSEIS BIT(20) | ||
| 50 | # define OTGSC_BSVIS BIT(19) | ||
| 51 | # define OTGSC_ASVIS BIT(18) | ||
| 52 | # define OTGSC_AVVIS BIT(17) | ||
| 53 | # define OTGSC_IDIS BIT(16) | ||
| 54 | # define OTGSC_DPS BIT(14) | ||
| 55 | # define OTGSC_1MST BIT(13) | ||
| 56 | # define OTGSC_BSE BIT(12) | ||
| 57 | # define OTGSC_BSV BIT(11) | ||
| 58 | # define OTGSC_ASV BIT(10) | ||
| 59 | # define OTGSC_AVV BIT(9) | ||
| 60 | # define OTGSC_ID BIT(8) | ||
| 61 | # define OTGSC_HABA BIT(7) | ||
| 62 | # define OTGSC_HADP BIT(6) | ||
| 63 | # define OTGSC_IDPU BIT(5) | ||
| 64 | # define OTGSC_DP BIT(4) | ||
| 65 | # define OTGSC_OT BIT(3) | ||
| 66 | # define OTGSC_HAAR BIT(2) | ||
| 67 | # define OTGSC_VC BIT(1) | ||
| 68 | # define OTGSC_VD BIT(0) | ||
| 69 | # define OTGSC_INTEN_MASK (0x7f << 24) | ||
| 70 | # define OTGSC_INT_MASK (0x5f << 24) | ||
| 71 | # define OTGSC_INTSTS_MASK (0x7f << 16) | ||
| 72 | #define CI_USBMODE 0xf8 | ||
| 73 | # define USBMODE_CM (BIT(1) | BIT(0)) | ||
| 74 | # define USBMODE_IDLE 0 | ||
| 75 | # define USBMODE_DEVICE 0x2 | ||
| 76 | # define USBMODE_HOST 0x3 | ||
| 77 | #define USBCFG_ADDR 0xff10801c | ||
| 78 | #define USBCFG_LEN 4 | ||
| 79 | # define USBCFG_VBUSVAL BIT(14) | ||
| 80 | # define USBCFG_AVALID BIT(13) | ||
| 81 | # define USBCFG_BVALID BIT(12) | ||
| 82 | # define USBCFG_SESEND BIT(11) | ||
| 83 | |||
| 84 | #define INTR_DUMMY_MASK (USBSTS_SLI | USBSTS_URI | USBSTS_PCI) | ||
| 85 | |||
| 86 | enum langwell_otg_timer_type { | ||
| 87 | TA_WAIT_VRISE_TMR, | ||
| 88 | TA_WAIT_BCON_TMR, | ||
| 89 | TA_AIDL_BDIS_TMR, | ||
| 90 | TB_ASE0_BRST_TMR, | ||
| 91 | TB_SE0_SRP_TMR, | ||
| 92 | TB_SRP_INIT_TMR, | ||
| 93 | TB_SRP_FAIL_TMR, | ||
| 94 | TB_BUS_SUSPEND_TMR | ||
| 95 | }; | ||
| 96 | |||
| 97 | #define TA_WAIT_VRISE 100 | ||
| 98 | #define TA_WAIT_BCON 30000 | ||
| 99 | #define TA_AIDL_BDIS 15000 | ||
| 100 | #define TB_ASE0_BRST 5000 | ||
| 101 | #define TB_SE0_SRP 2 | ||
| 102 | #define TB_SRP_INIT 100 | ||
| 103 | #define TB_SRP_FAIL 5500 | ||
| 104 | #define TB_BUS_SUSPEND 500 | ||
| 105 | |||
| 106 | struct langwell_otg_timer { | ||
| 107 | unsigned long expires; /* Number of count increase to timeout */ | ||
| 108 | unsigned long count; /* Tick counter */ | ||
| 109 | void (*function)(unsigned long); /* Timeout function */ | ||
| 110 | unsigned long data; /* Data passed to function */ | ||
| 111 | struct list_head list; | ||
| 112 | }; | ||
| 113 | |||
| 114 | struct langwell_otg { | ||
| 115 | struct intel_mid_otg_xceiv iotg; | ||
| 116 | struct device *dev; | ||
| 117 | |||
| 118 | void __iomem *usbcfg; /* SCCBUSB config Reg */ | ||
| 119 | |||
| 120 | unsigned region; | ||
| 121 | unsigned cfg_region; | ||
| 122 | |||
| 123 | struct work_struct work; | ||
| 124 | struct workqueue_struct *qwork; | ||
| 125 | struct timer_list hsm_timer; | ||
| 126 | |||
| 127 | spinlock_t lock; | ||
| 128 | spinlock_t wq_lock; | ||
| 129 | |||
| 130 | struct notifier_block iotg_notifier; | ||
| 131 | }; | ||
| 132 | |||
| 133 | static inline | ||
| 134 | struct langwell_otg *mid_xceiv_to_lnw(struct intel_mid_otg_xceiv *iotg) | ||
| 135 | { | ||
| 136 | return container_of(iotg, struct langwell_otg, iotg); | ||
| 137 | } | ||
| 138 | |||
| 139 | #endif /* __LANGWELL_OTG_H__ */ | ||
