diff options
Diffstat (limited to 'include/linux')
225 files changed, 6044 insertions, 1572 deletions
diff --git a/include/linux/acct.h b/include/linux/acct.h index 3e4737fa6cce..d537aa0ec414 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h | |||
| @@ -146,6 +146,9 @@ extern void acct_exit_ns(struct pid_namespace *); | |||
| 146 | * | 146 | * |
| 147 | */ | 147 | */ |
| 148 | 148 | ||
| 149 | #undef ACCT_VERSION | ||
| 150 | #undef AHZ | ||
| 151 | |||
| 149 | #ifdef CONFIG_BSD_PROCESS_ACCT_V3 | 152 | #ifdef CONFIG_BSD_PROCESS_ACCT_V3 |
| 150 | #define ACCT_VERSION 3 | 153 | #define ACCT_VERSION 3 |
| 151 | #define AHZ 100 | 154 | #define AHZ 100 |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 6001b4da39dd..3f968665899b 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -302,10 +302,19 @@ extern bool osc_sb_apei_support_acked; | |||
| 302 | OSC_PCI_EXPRESS_PME_CONTROL | \ | 302 | OSC_PCI_EXPRESS_PME_CONTROL | \ |
| 303 | OSC_PCI_EXPRESS_AER_CONTROL | \ | 303 | OSC_PCI_EXPRESS_AER_CONTROL | \ |
| 304 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL) | 304 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL) |
| 305 | |||
| 306 | #define OSC_PCI_NATIVE_HOTPLUG (OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | \ | ||
| 307 | OSC_SHPC_NATIVE_HP_CONTROL) | ||
| 308 | |||
| 305 | extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, | 309 | extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, |
| 306 | u32 *mask, u32 req); | 310 | u32 *mask, u32 req); |
| 307 | extern void acpi_early_init(void); | 311 | extern void acpi_early_init(void); |
| 308 | 312 | ||
| 313 | extern int acpi_nvs_register(__u64 start, __u64 size); | ||
| 314 | |||
| 315 | extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *), | ||
| 316 | void *data); | ||
| 317 | |||
| 309 | #else /* !CONFIG_ACPI */ | 318 | #else /* !CONFIG_ACPI */ |
| 310 | 319 | ||
| 311 | #define acpi_disabled 1 | 320 | #define acpi_disabled 1 |
| @@ -348,15 +357,18 @@ static inline int acpi_table_parse(char *id, | |||
| 348 | { | 357 | { |
| 349 | return -1; | 358 | return -1; |
| 350 | } | 359 | } |
| 351 | #endif /* !CONFIG_ACPI */ | ||
| 352 | 360 | ||
| 353 | #ifdef CONFIG_ACPI_SLEEP | 361 | static inline int acpi_nvs_register(__u64 start, __u64 size) |
| 354 | int suspend_nvs_register(unsigned long start, unsigned long size); | ||
| 355 | #else | ||
| 356 | static inline int suspend_nvs_register(unsigned long a, unsigned long b) | ||
| 357 | { | 362 | { |
| 358 | return 0; | 363 | return 0; |
| 359 | } | 364 | } |
| 360 | #endif | 365 | |
| 366 | static inline int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *), | ||
| 367 | void *data) | ||
| 368 | { | ||
| 369 | return 0; | ||
| 370 | } | ||
| 371 | |||
| 372 | #endif /* !CONFIG_ACPI */ | ||
| 361 | 373 | ||
| 362 | #endif /*_LINUX_ACPI_H*/ | 374 | #endif /*_LINUX_ACPI_H*/ |
diff --git a/include/linux/acpi_io.h b/include/linux/acpi_io.h index 4afd7102459d..b0ffa219993e 100644 --- a/include/linux/acpi_io.h +++ b/include/linux/acpi_io.h | |||
| @@ -12,4 +12,7 @@ static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, | |||
| 12 | 12 | ||
| 13 | void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size); | 13 | void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size); |
| 14 | 14 | ||
| 15 | int acpi_os_map_generic_address(struct acpi_generic_address *addr); | ||
| 16 | void acpi_os_unmap_generic_address(struct acpi_generic_address *addr); | ||
| 17 | |||
| 15 | #endif | 18 | #endif |
diff --git a/include/linux/ahci_platform.h b/include/linux/ahci_platform.h index be3d9a77d6ed..73a25005d88a 100644 --- a/include/linux/ahci_platform.h +++ b/include/linux/ahci_platform.h | |||
| @@ -23,6 +23,8 @@ struct ata_port_info; | |||
| 23 | struct ahci_platform_data { | 23 | struct ahci_platform_data { |
| 24 | int (*init)(struct device *dev, void __iomem *addr); | 24 | int (*init)(struct device *dev, void __iomem *addr); |
| 25 | void (*exit)(struct device *dev); | 25 | void (*exit)(struct device *dev); |
| 26 | int (*suspend)(struct device *dev); | ||
| 27 | int (*resume)(struct device *dev); | ||
| 26 | const struct ata_port_info *ata_port_info; | 28 | const struct ata_port_info *ata_port_info; |
| 27 | unsigned int force_port_map; | 29 | unsigned int force_port_map; |
| 28 | unsigned int mask_port_map; | 30 | unsigned int mask_port_map; |
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h index 21114810c7c0..0101e9c17fa1 100644 --- a/include/linux/amba/mmci.h +++ b/include/linux/amba/mmci.h | |||
| @@ -30,6 +30,7 @@ struct dma_chan; | |||
| 30 | * @cd_invert: true if the gpio_cd pin value is active low | 30 | * @cd_invert: true if the gpio_cd pin value is active low |
| 31 | * @capabilities: the capabilities of the block as implemented in | 31 | * @capabilities: the capabilities of the block as implemented in |
| 32 | * this platform, signify anything MMC_CAP_* from mmc/host.h | 32 | * this platform, signify anything MMC_CAP_* from mmc/host.h |
| 33 | * @capabilities2: more capabilities, MMC_CAP2_* from mmc/host.h | ||
| 33 | * @dma_filter: function used to select an appropriate RX and TX | 34 | * @dma_filter: function used to select an appropriate RX and TX |
| 34 | * DMA channel to be used for DMA, if and only if you're deploying the | 35 | * DMA channel to be used for DMA, if and only if you're deploying the |
| 35 | * generic DMA engine | 36 | * generic DMA engine |
| @@ -52,6 +53,7 @@ struct mmci_platform_data { | |||
| 52 | int gpio_cd; | 53 | int gpio_cd; |
| 53 | bool cd_invert; | 54 | bool cd_invert; |
| 54 | unsigned long capabilities; | 55 | unsigned long capabilities; |
| 56 | unsigned long capabilities2; | ||
| 55 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); | 57 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); |
| 56 | void *dma_rx_param; | 58 | void *dma_rx_param; |
| 57 | void *dma_tx_param; | 59 | void *dma_tx_param; |
diff --git a/include/linux/amba/pl061.h b/include/linux/amba/pl061.h index 2412af944f1f..fb83c0453489 100644 --- a/include/linux/amba/pl061.h +++ b/include/linux/amba/pl061.h | |||
| @@ -7,7 +7,7 @@ struct pl061_platform_data { | |||
| 7 | unsigned gpio_base; | 7 | unsigned gpio_base; |
| 8 | 8 | ||
| 9 | /* number of the first IRQ. | 9 | /* number of the first IRQ. |
| 10 | * If the IRQ functionality in not desired this must be set to NO_IRQ. | 10 | * If the IRQ functionality in not desired this must be set to 0. |
| 11 | */ | 11 | */ |
| 12 | unsigned irq_base; | 12 | unsigned irq_base; |
| 13 | 13 | ||
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h index 9eabffbc4e50..033f6aa670de 100644 --- a/include/linux/amba/pl08x.h +++ b/include/linux/amba/pl08x.h | |||
| @@ -134,7 +134,7 @@ struct pl08x_txd { | |||
| 134 | struct dma_async_tx_descriptor tx; | 134 | struct dma_async_tx_descriptor tx; |
| 135 | struct list_head node; | 135 | struct list_head node; |
| 136 | struct list_head dsg_list; | 136 | struct list_head dsg_list; |
| 137 | enum dma_data_direction direction; | 137 | enum dma_transfer_direction direction; |
| 138 | dma_addr_t llis_bus; | 138 | dma_addr_t llis_bus; |
| 139 | struct pl08x_lli *llis_va; | 139 | struct pl08x_lli *llis_va; |
| 140 | /* Default cctl value for LLIs */ | 140 | /* Default cctl value for LLIs */ |
| @@ -197,7 +197,7 @@ struct pl08x_dma_chan { | |||
| 197 | dma_addr_t dst_addr; | 197 | dma_addr_t dst_addr; |
| 198 | u32 src_cctl; | 198 | u32 src_cctl; |
| 199 | u32 dst_cctl; | 199 | u32 dst_cctl; |
| 200 | enum dma_data_direction runtime_direction; | 200 | enum dma_transfer_direction runtime_direction; |
| 201 | dma_cookie_t lc; | 201 | dma_cookie_t lc; |
| 202 | struct list_head pend_list; | 202 | struct list_head pend_list; |
| 203 | struct pl08x_txd *at; | 203 | struct pl08x_txd *at; |
diff --git a/include/linux/amba/pl330.h b/include/linux/amba/pl330.h index d12f077a6daf..12e023c19ac1 100644 --- a/include/linux/amba/pl330.h +++ b/include/linux/amba/pl330.h | |||
| @@ -12,17 +12,9 @@ | |||
| 12 | #ifndef __AMBA_PL330_H_ | 12 | #ifndef __AMBA_PL330_H_ |
| 13 | #define __AMBA_PL330_H_ | 13 | #define __AMBA_PL330_H_ |
| 14 | 14 | ||
| 15 | #include <linux/dmaengine.h> | ||
| 15 | #include <asm/hardware/pl330.h> | 16 | #include <asm/hardware/pl330.h> |
| 16 | 17 | ||
| 17 | struct dma_pl330_peri { | ||
| 18 | /* | ||
| 19 | * Peri_Req i/f of the DMAC that is | ||
| 20 | * peripheral could be reached from. | ||
| 21 | */ | ||
| 22 | u8 peri_id; /* specific dma id */ | ||
| 23 | enum pl330_reqtype rqtype; | ||
| 24 | }; | ||
| 25 | |||
| 26 | struct dma_pl330_platdata { | 18 | struct dma_pl330_platdata { |
| 27 | /* | 19 | /* |
| 28 | * Number of valid peripherals connected to DMAC. | 20 | * Number of valid peripherals connected to DMAC. |
| @@ -33,9 +25,12 @@ struct dma_pl330_platdata { | |||
| 33 | */ | 25 | */ |
| 34 | u8 nr_valid_peri; | 26 | u8 nr_valid_peri; |
| 35 | /* Array of valid peripherals */ | 27 | /* Array of valid peripherals */ |
| 36 | struct dma_pl330_peri *peri; | 28 | u8 *peri_id; |
| 29 | /* Operational capabilities */ | ||
| 30 | dma_cap_mask_t cap_mask; | ||
| 37 | /* Bytes to allocate for MC buffer */ | 31 | /* Bytes to allocate for MC buffer */ |
| 38 | unsigned mcbuf_sz; | 32 | unsigned mcbuf_sz; |
| 39 | }; | 33 | }; |
| 40 | 34 | ||
| 35 | extern bool pl330_filter(struct dma_chan *chan, void *param); | ||
| 41 | #endif /* __AMBA_PL330_H_ */ | 36 | #endif /* __AMBA_PL330_H_ */ |
diff --git a/include/linux/amd-iommu.h b/include/linux/amd-iommu.h index a6863a2dec1f..ef00610837d4 100644 --- a/include/linux/amd-iommu.h +++ b/include/linux/amd-iommu.h | |||
| @@ -20,12 +20,148 @@ | |||
| 20 | #ifndef _ASM_X86_AMD_IOMMU_H | 20 | #ifndef _ASM_X86_AMD_IOMMU_H |
| 21 | #define _ASM_X86_AMD_IOMMU_H | 21 | #define _ASM_X86_AMD_IOMMU_H |
| 22 | 22 | ||
| 23 | #include <linux/irqreturn.h> | 23 | #include <linux/types.h> |
| 24 | 24 | ||
| 25 | #ifdef CONFIG_AMD_IOMMU | 25 | #ifdef CONFIG_AMD_IOMMU |
| 26 | 26 | ||
| 27 | struct task_struct; | ||
| 28 | struct pci_dev; | ||
| 29 | |||
| 27 | extern int amd_iommu_detect(void); | 30 | extern int amd_iommu_detect(void); |
| 28 | 31 | ||
| 32 | |||
| 33 | /** | ||
| 34 | * amd_iommu_enable_device_erratum() - Enable erratum workaround for device | ||
| 35 | * in the IOMMUv2 driver | ||
| 36 | * @pdev: The PCI device the workaround is necessary for | ||
| 37 | * @erratum: The erratum workaround to enable | ||
| 38 | * | ||
| 39 | * The function needs to be called before amd_iommu_init_device(). | ||
| 40 | * Possible values for the erratum number are for now: | ||
| 41 | * - AMD_PRI_DEV_ERRATUM_ENABLE_RESET - Reset PRI capability when PRI | ||
| 42 | * is enabled | ||
| 43 | * - AMD_PRI_DEV_ERRATUM_LIMIT_REQ_ONE - Limit number of outstanding PRI | ||
| 44 | * requests to one | ||
| 45 | */ | ||
| 46 | #define AMD_PRI_DEV_ERRATUM_ENABLE_RESET 0 | ||
| 47 | #define AMD_PRI_DEV_ERRATUM_LIMIT_REQ_ONE 1 | ||
| 48 | |||
| 49 | extern void amd_iommu_enable_device_erratum(struct pci_dev *pdev, u32 erratum); | ||
| 50 | |||
| 51 | /** | ||
| 52 | * amd_iommu_init_device() - Init device for use with IOMMUv2 driver | ||
| 53 | * @pdev: The PCI device to initialize | ||
| 54 | * @pasids: Number of PASIDs to support for this device | ||
| 55 | * | ||
| 56 | * This function does all setup for the device pdev so that it can be | ||
| 57 | * used with IOMMUv2. | ||
| 58 | * Returns 0 on success or negative value on error. | ||
| 59 | */ | ||
| 60 | extern int amd_iommu_init_device(struct pci_dev *pdev, int pasids); | ||
| 61 | |||
| 62 | /** | ||
| 63 | * amd_iommu_free_device() - Free all IOMMUv2 related device resources | ||
| 64 | * and disable IOMMUv2 usage for this device | ||
| 65 | * @pdev: The PCI device to disable IOMMUv2 usage for' | ||
| 66 | */ | ||
| 67 | extern void amd_iommu_free_device(struct pci_dev *pdev); | ||
| 68 | |||
| 69 | /** | ||
| 70 | * amd_iommu_bind_pasid() - Bind a given task to a PASID on a device | ||
| 71 | * @pdev: The PCI device to bind the task to | ||
| 72 | * @pasid: The PASID on the device the task should be bound to | ||
| 73 | * @task: the task to bind | ||
| 74 | * | ||
| 75 | * The function returns 0 on success or a negative value on error. | ||
| 76 | */ | ||
| 77 | extern int amd_iommu_bind_pasid(struct pci_dev *pdev, int pasid, | ||
| 78 | struct task_struct *task); | ||
| 79 | |||
| 80 | /** | ||
| 81 | * amd_iommu_unbind_pasid() - Unbind a PASID from its task on | ||
| 82 | * a device | ||
| 83 | * @pdev: The device of the PASID | ||
| 84 | * @pasid: The PASID to unbind | ||
| 85 | * | ||
| 86 | * When this function returns the device is no longer using the PASID | ||
| 87 | * and the PASID is no longer bound to its task. | ||
| 88 | */ | ||
| 89 | extern void amd_iommu_unbind_pasid(struct pci_dev *pdev, int pasid); | ||
| 90 | |||
| 91 | /** | ||
| 92 | * amd_iommu_set_invalid_ppr_cb() - Register a call-back for failed | ||
| 93 | * PRI requests | ||
| 94 | * @pdev: The PCI device the call-back should be registered for | ||
| 95 | * @cb: The call-back function | ||
| 96 | * | ||
| 97 | * The IOMMUv2 driver invokes this call-back when it is unable to | ||
| 98 | * successfully handle a PRI request. The device driver can then decide | ||
| 99 | * which PRI response the device should see. Possible return values for | ||
| 100 | * the call-back are: | ||
| 101 | * | ||
| 102 | * - AMD_IOMMU_INV_PRI_RSP_SUCCESS - Send SUCCESS back to the device | ||
| 103 | * - AMD_IOMMU_INV_PRI_RSP_INVALID - Send INVALID back to the device | ||
| 104 | * - AMD_IOMMU_INV_PRI_RSP_FAIL - Send Failure back to the device, | ||
| 105 | * the device is required to disable | ||
| 106 | * PRI when it receives this response | ||
| 107 | * | ||
| 108 | * The function returns 0 on success or negative value on error. | ||
| 109 | */ | ||
| 110 | #define AMD_IOMMU_INV_PRI_RSP_SUCCESS 0 | ||
| 111 | #define AMD_IOMMU_INV_PRI_RSP_INVALID 1 | ||
| 112 | #define AMD_IOMMU_INV_PRI_RSP_FAIL 2 | ||
| 113 | |||
| 114 | typedef int (*amd_iommu_invalid_ppr_cb)(struct pci_dev *pdev, | ||
| 115 | int pasid, | ||
| 116 | unsigned long address, | ||
| 117 | u16); | ||
| 118 | |||
| 119 | extern int amd_iommu_set_invalid_ppr_cb(struct pci_dev *pdev, | ||
| 120 | amd_iommu_invalid_ppr_cb cb); | ||
| 121 | |||
| 122 | /** | ||
| 123 | * amd_iommu_device_info() - Get information about IOMMUv2 support of a | ||
| 124 | * PCI device | ||
| 125 | * @pdev: PCI device to query information from | ||
| 126 | * @info: A pointer to an amd_iommu_device_info structure which will contain | ||
| 127 | * the information about the PCI device | ||
| 128 | * | ||
| 129 | * Returns 0 on success, negative value on error | ||
| 130 | */ | ||
| 131 | |||
| 132 | #define AMD_IOMMU_DEVICE_FLAG_ATS_SUP 0x1 /* ATS feature supported */ | ||
| 133 | #define AMD_IOMMU_DEVICE_FLAG_PRI_SUP 0x2 /* PRI feature supported */ | ||
| 134 | #define AMD_IOMMU_DEVICE_FLAG_PASID_SUP 0x4 /* PASID context supported */ | ||
| 135 | #define AMD_IOMMU_DEVICE_FLAG_EXEC_SUP 0x8 /* Device may request execution | ||
| 136 | on memory pages */ | ||
| 137 | #define AMD_IOMMU_DEVICE_FLAG_PRIV_SUP 0x10 /* Device may request | ||
| 138 | super-user privileges */ | ||
| 139 | |||
| 140 | struct amd_iommu_device_info { | ||
| 141 | int max_pasids; | ||
| 142 | u32 flags; | ||
| 143 | }; | ||
| 144 | |||
| 145 | extern int amd_iommu_device_info(struct pci_dev *pdev, | ||
| 146 | struct amd_iommu_device_info *info); | ||
| 147 | |||
| 148 | /** | ||
| 149 | * amd_iommu_set_invalidate_ctx_cb() - Register a call-back for invalidating | ||
| 150 | * a pasid context. This call-back is | ||
| 151 | * invoked when the IOMMUv2 driver needs to | ||
| 152 | * invalidate a PASID context, for example | ||
| 153 | * because the task that is bound to that | ||
| 154 | * context is about to exit. | ||
| 155 | * | ||
| 156 | * @pdev: The PCI device the call-back should be registered for | ||
| 157 | * @cb: The call-back function | ||
| 158 | */ | ||
| 159 | |||
| 160 | typedef void (*amd_iommu_invalidate_ctx)(struct pci_dev *pdev, int pasid); | ||
| 161 | |||
| 162 | extern int amd_iommu_set_invalidate_ctx_cb(struct pci_dev *pdev, | ||
| 163 | amd_iommu_invalidate_ctx cb); | ||
| 164 | |||
| 29 | #else | 165 | #else |
| 30 | 166 | ||
| 31 | static inline int amd_iommu_detect(void) { return -ENODEV; } | 167 | static inline int amd_iommu_detect(void) { return -ENODEV; } |
diff --git a/include/linux/ata_platform.h b/include/linux/ata_platform.h index 9a26c83a2c9e..b856a2a590d9 100644 --- a/include/linux/ata_platform.h +++ b/include/linux/ata_platform.h | |||
| @@ -27,10 +27,7 @@ extern int __devexit __pata_platform_remove(struct device *dev); | |||
| 27 | /* | 27 | /* |
| 28 | * Marvell SATA private data | 28 | * Marvell SATA private data |
| 29 | */ | 29 | */ |
| 30 | struct mbus_dram_target_info; | ||
| 31 | |||
| 32 | struct mv_sata_platform_data { | 30 | struct mv_sata_platform_data { |
| 33 | struct mbus_dram_target_info *dram; | ||
| 34 | int n_ports; /* number of sata ports */ | 31 | int n_ports; /* number of sata ports */ |
| 35 | }; | 32 | }; |
| 36 | 33 | ||
diff --git a/include/linux/audit.h b/include/linux/audit.h index 426ab9f4dd85..9ff7a2c48b50 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | 26 | ||
| 27 | #include <linux/types.h> | 27 | #include <linux/types.h> |
| 28 | #include <linux/elf-em.h> | 28 | #include <linux/elf-em.h> |
| 29 | #include <linux/ptrace.h> | ||
| 29 | 30 | ||
| 30 | /* The netlink messages for the audit system is divided into blocks: | 31 | /* The netlink messages for the audit system is divided into blocks: |
| 31 | * 1000 - 1099 are for commanding the audit system | 32 | * 1000 - 1099 are for commanding the audit system |
| @@ -181,6 +182,40 @@ | |||
| 181 | * AUDIT_UNUSED_BITS is updated if need be. */ | 182 | * AUDIT_UNUSED_BITS is updated if need be. */ |
| 182 | #define AUDIT_UNUSED_BITS 0x07FFFC00 | 183 | #define AUDIT_UNUSED_BITS 0x07FFFC00 |
| 183 | 184 | ||
| 185 | /* AUDIT_FIELD_COMPARE rule list */ | ||
| 186 | #define AUDIT_COMPARE_UID_TO_OBJ_UID 1 | ||
| 187 | #define AUDIT_COMPARE_GID_TO_OBJ_GID 2 | ||
| 188 | #define AUDIT_COMPARE_EUID_TO_OBJ_UID 3 | ||
| 189 | #define AUDIT_COMPARE_EGID_TO_OBJ_GID 4 | ||
| 190 | #define AUDIT_COMPARE_AUID_TO_OBJ_UID 5 | ||
| 191 | #define AUDIT_COMPARE_SUID_TO_OBJ_UID 6 | ||
| 192 | #define AUDIT_COMPARE_SGID_TO_OBJ_GID 7 | ||
| 193 | #define AUDIT_COMPARE_FSUID_TO_OBJ_UID 8 | ||
| 194 | #define AUDIT_COMPARE_FSGID_TO_OBJ_GID 9 | ||
| 195 | |||
| 196 | #define AUDIT_COMPARE_UID_TO_AUID 10 | ||
| 197 | #define AUDIT_COMPARE_UID_TO_EUID 11 | ||
| 198 | #define AUDIT_COMPARE_UID_TO_FSUID 12 | ||
| 199 | #define AUDIT_COMPARE_UID_TO_SUID 13 | ||
| 200 | |||
| 201 | #define AUDIT_COMPARE_AUID_TO_FSUID 14 | ||
| 202 | #define AUDIT_COMPARE_AUID_TO_SUID 15 | ||
| 203 | #define AUDIT_COMPARE_AUID_TO_EUID 16 | ||
| 204 | |||
| 205 | #define AUDIT_COMPARE_EUID_TO_SUID 17 | ||
| 206 | #define AUDIT_COMPARE_EUID_TO_FSUID 18 | ||
| 207 | |||
| 208 | #define AUDIT_COMPARE_SUID_TO_FSUID 19 | ||
| 209 | |||
| 210 | #define AUDIT_COMPARE_GID_TO_EGID 20 | ||
| 211 | #define AUDIT_COMPARE_GID_TO_FSGID 21 | ||
| 212 | #define AUDIT_COMPARE_GID_TO_SGID 22 | ||
| 213 | |||
| 214 | #define AUDIT_COMPARE_EGID_TO_FSGID 23 | ||
| 215 | #define AUDIT_COMPARE_EGID_TO_SGID 24 | ||
| 216 | #define AUDIT_COMPARE_SGID_TO_FSGID 25 | ||
| 217 | |||
| 218 | #define AUDIT_MAX_FIELD_COMPARE AUDIT_COMPARE_SGID_TO_FSGID | ||
| 184 | 219 | ||
| 185 | /* Rule fields */ | 220 | /* Rule fields */ |
| 186 | /* These are useful when checking the | 221 | /* These are useful when checking the |
| @@ -222,6 +257,9 @@ | |||
| 222 | #define AUDIT_PERM 106 | 257 | #define AUDIT_PERM 106 |
| 223 | #define AUDIT_DIR 107 | 258 | #define AUDIT_DIR 107 |
| 224 | #define AUDIT_FILETYPE 108 | 259 | #define AUDIT_FILETYPE 108 |
| 260 | #define AUDIT_OBJ_UID 109 | ||
| 261 | #define AUDIT_OBJ_GID 110 | ||
| 262 | #define AUDIT_FIELD_COMPARE 111 | ||
| 225 | 263 | ||
| 226 | #define AUDIT_ARG0 200 | 264 | #define AUDIT_ARG0 200 |
| 227 | #define AUDIT_ARG1 (AUDIT_ARG0+1) | 265 | #define AUDIT_ARG1 (AUDIT_ARG0+1) |
| @@ -408,28 +446,24 @@ struct audit_field { | |||
| 408 | void *lsm_rule; | 446 | void *lsm_rule; |
| 409 | }; | 447 | }; |
| 410 | 448 | ||
| 411 | #define AUDITSC_INVALID 0 | ||
| 412 | #define AUDITSC_SUCCESS 1 | ||
| 413 | #define AUDITSC_FAILURE 2 | ||
| 414 | #define AUDITSC_RESULT(x) ( ((long)(x))<0?AUDITSC_FAILURE:AUDITSC_SUCCESS ) | ||
| 415 | extern int __init audit_register_class(int class, unsigned *list); | 449 | extern int __init audit_register_class(int class, unsigned *list); |
| 416 | extern int audit_classify_syscall(int abi, unsigned syscall); | 450 | extern int audit_classify_syscall(int abi, unsigned syscall); |
| 417 | extern int audit_classify_arch(int arch); | 451 | extern int audit_classify_arch(int arch); |
| 418 | #ifdef CONFIG_AUDITSYSCALL | 452 | #ifdef CONFIG_AUDITSYSCALL |
| 419 | /* These are defined in auditsc.c */ | 453 | /* These are defined in auditsc.c */ |
| 420 | /* Public API */ | 454 | /* Public API */ |
| 421 | extern void audit_finish_fork(struct task_struct *child); | ||
| 422 | extern int audit_alloc(struct task_struct *task); | 455 | extern int audit_alloc(struct task_struct *task); |
| 423 | extern void audit_free(struct task_struct *task); | 456 | extern void __audit_free(struct task_struct *task); |
| 424 | extern void audit_syscall_entry(int arch, | 457 | extern void __audit_syscall_entry(int arch, |
| 425 | int major, unsigned long a0, unsigned long a1, | 458 | int major, unsigned long a0, unsigned long a1, |
| 426 | unsigned long a2, unsigned long a3); | 459 | unsigned long a2, unsigned long a3); |
| 427 | extern void audit_syscall_exit(int failed, long return_code); | 460 | extern void __audit_syscall_exit(int ret_success, long ret_value); |
| 428 | extern void __audit_getname(const char *name); | 461 | extern void __audit_getname(const char *name); |
| 429 | extern void audit_putname(const char *name); | 462 | extern void audit_putname(const char *name); |
| 430 | extern void __audit_inode(const char *name, const struct dentry *dentry); | 463 | extern void __audit_inode(const char *name, const struct dentry *dentry); |
| 431 | extern void __audit_inode_child(const struct dentry *dentry, | 464 | extern void __audit_inode_child(const struct dentry *dentry, |
| 432 | const struct inode *parent); | 465 | const struct inode *parent); |
| 466 | extern void __audit_seccomp(unsigned long syscall); | ||
| 433 | extern void __audit_ptrace(struct task_struct *t); | 467 | extern void __audit_ptrace(struct task_struct *t); |
| 434 | 468 | ||
| 435 | static inline int audit_dummy_context(void) | 469 | static inline int audit_dummy_context(void) |
| @@ -437,6 +471,27 @@ static inline int audit_dummy_context(void) | |||
| 437 | void *p = current->audit_context; | 471 | void *p = current->audit_context; |
| 438 | return !p || *(int *)p; | 472 | return !p || *(int *)p; |
| 439 | } | 473 | } |
| 474 | static inline void audit_free(struct task_struct *task) | ||
| 475 | { | ||
| 476 | if (unlikely(task->audit_context)) | ||
| 477 | __audit_free(task); | ||
| 478 | } | ||
| 479 | static inline void audit_syscall_entry(int arch, int major, unsigned long a0, | ||
| 480 | unsigned long a1, unsigned long a2, | ||
| 481 | unsigned long a3) | ||
| 482 | { | ||
| 483 | if (unlikely(!audit_dummy_context())) | ||
| 484 | __audit_syscall_entry(arch, major, a0, a1, a2, a3); | ||
| 485 | } | ||
| 486 | static inline void audit_syscall_exit(void *pt_regs) | ||
| 487 | { | ||
| 488 | if (unlikely(current->audit_context)) { | ||
| 489 | int success = is_syscall_success(pt_regs); | ||
| 490 | int return_code = regs_return_value(pt_regs); | ||
| 491 | |||
| 492 | __audit_syscall_exit(success, return_code); | ||
| 493 | } | ||
| 494 | } | ||
| 440 | static inline void audit_getname(const char *name) | 495 | static inline void audit_getname(const char *name) |
| 441 | { | 496 | { |
| 442 | if (unlikely(!audit_dummy_context())) | 497 | if (unlikely(!audit_dummy_context())) |
| @@ -453,6 +508,12 @@ static inline void audit_inode_child(const struct dentry *dentry, | |||
| 453 | } | 508 | } |
| 454 | void audit_core_dumps(long signr); | 509 | void audit_core_dumps(long signr); |
| 455 | 510 | ||
| 511 | static inline void audit_seccomp(unsigned long syscall) | ||
| 512 | { | ||
| 513 | if (unlikely(!audit_dummy_context())) | ||
| 514 | __audit_seccomp(syscall); | ||
| 515 | } | ||
| 516 | |||
| 456 | static inline void audit_ptrace(struct task_struct *t) | 517 | static inline void audit_ptrace(struct task_struct *t) |
| 457 | { | 518 | { |
| 458 | if (unlikely(!audit_dummy_context())) | 519 | if (unlikely(!audit_dummy_context())) |
| @@ -463,17 +524,16 @@ static inline void audit_ptrace(struct task_struct *t) | |||
| 463 | extern unsigned int audit_serial(void); | 524 | extern unsigned int audit_serial(void); |
| 464 | extern int auditsc_get_stamp(struct audit_context *ctx, | 525 | extern int auditsc_get_stamp(struct audit_context *ctx, |
| 465 | struct timespec *t, unsigned int *serial); | 526 | struct timespec *t, unsigned int *serial); |
| 466 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); | 527 | extern int audit_set_loginuid(uid_t loginuid); |
| 467 | #define audit_get_loginuid(t) ((t)->loginuid) | 528 | #define audit_get_loginuid(t) ((t)->loginuid) |
| 468 | #define audit_get_sessionid(t) ((t)->sessionid) | 529 | #define audit_get_sessionid(t) ((t)->sessionid) |
| 469 | extern void audit_log_task_context(struct audit_buffer *ab); | 530 | extern void audit_log_task_context(struct audit_buffer *ab); |
| 470 | extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); | 531 | extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); |
| 471 | extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode); | 532 | extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode); |
| 472 | extern int audit_bprm(struct linux_binprm *bprm); | 533 | extern int __audit_bprm(struct linux_binprm *bprm); |
| 473 | extern void audit_socketcall(int nargs, unsigned long *args); | 534 | extern void __audit_socketcall(int nargs, unsigned long *args); |
| 474 | extern int audit_sockaddr(int len, void *addr); | 535 | extern int __audit_sockaddr(int len, void *addr); |
| 475 | extern void __audit_fd_pair(int fd1, int fd2); | 536 | extern void __audit_fd_pair(int fd1, int fd2); |
| 476 | extern int audit_set_macxattr(const char *name); | ||
| 477 | extern void __audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr); | 537 | extern void __audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr); |
| 478 | extern void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout); | 538 | extern void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout); |
| 479 | extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification); | 539 | extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification); |
| @@ -499,6 +559,23 @@ static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid | |||
| 499 | if (unlikely(!audit_dummy_context())) | 559 | if (unlikely(!audit_dummy_context())) |
| 500 | __audit_ipc_set_perm(qbytes, uid, gid, mode); | 560 | __audit_ipc_set_perm(qbytes, uid, gid, mode); |
| 501 | } | 561 | } |
| 562 | static inline int audit_bprm(struct linux_binprm *bprm) | ||
| 563 | { | ||
| 564 | if (unlikely(!audit_dummy_context())) | ||
| 565 | return __audit_bprm(bprm); | ||
| 566 | return 0; | ||
| 567 | } | ||
| 568 | static inline void audit_socketcall(int nargs, unsigned long *args) | ||
| 569 | { | ||
| 570 | if (unlikely(!audit_dummy_context())) | ||
| 571 | __audit_socketcall(nargs, args); | ||
| 572 | } | ||
| 573 | static inline int audit_sockaddr(int len, void *addr) | ||
| 574 | { | ||
| 575 | if (unlikely(!audit_dummy_context())) | ||
| 576 | return __audit_sockaddr(len, addr); | ||
| 577 | return 0; | ||
| 578 | } | ||
| 502 | static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr) | 579 | static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr) |
| 503 | { | 580 | { |
| 504 | if (unlikely(!audit_dummy_context())) | 581 | if (unlikely(!audit_dummy_context())) |
| @@ -544,12 +621,11 @@ static inline void audit_mmap_fd(int fd, int flags) | |||
| 544 | 621 | ||
| 545 | extern int audit_n_rules; | 622 | extern int audit_n_rules; |
| 546 | extern int audit_signals; | 623 | extern int audit_signals; |
| 547 | #else | 624 | #else /* CONFIG_AUDITSYSCALL */ |
| 548 | #define audit_finish_fork(t) | ||
| 549 | #define audit_alloc(t) ({ 0; }) | 625 | #define audit_alloc(t) ({ 0; }) |
| 550 | #define audit_free(t) do { ; } while (0) | 626 | #define audit_free(t) do { ; } while (0) |
| 551 | #define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0) | 627 | #define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0) |
| 552 | #define audit_syscall_exit(f,r) do { ; } while (0) | 628 | #define audit_syscall_exit(r) do { ; } while (0) |
| 553 | #define audit_dummy_context() 1 | 629 | #define audit_dummy_context() 1 |
| 554 | #define audit_getname(n) do { ; } while (0) | 630 | #define audit_getname(n) do { ; } while (0) |
| 555 | #define audit_putname(n) do { ; } while (0) | 631 | #define audit_putname(n) do { ; } while (0) |
| @@ -558,6 +634,7 @@ extern int audit_signals; | |||
| 558 | #define audit_inode(n,d) do { (void)(d); } while (0) | 634 | #define audit_inode(n,d) do { (void)(d); } while (0) |
| 559 | #define audit_inode_child(i,p) do { ; } while (0) | 635 | #define audit_inode_child(i,p) do { ; } while (0) |
| 560 | #define audit_core_dumps(i) do { ; } while (0) | 636 | #define audit_core_dumps(i) do { ; } while (0) |
| 637 | #define audit_seccomp(i) do { ; } while (0) | ||
| 561 | #define auditsc_get_stamp(c,t,s) (0) | 638 | #define auditsc_get_stamp(c,t,s) (0) |
| 562 | #define audit_get_loginuid(t) (-1) | 639 | #define audit_get_loginuid(t) (-1) |
| 563 | #define audit_get_sessionid(t) (-1) | 640 | #define audit_get_sessionid(t) (-1) |
| @@ -568,7 +645,6 @@ extern int audit_signals; | |||
| 568 | #define audit_socketcall(n,a) ((void)0) | 645 | #define audit_socketcall(n,a) ((void)0) |
| 569 | #define audit_fd_pair(n,a) ((void)0) | 646 | #define audit_fd_pair(n,a) ((void)0) |
| 570 | #define audit_sockaddr(len, addr) ({ 0; }) | 647 | #define audit_sockaddr(len, addr) ({ 0; }) |
| 571 | #define audit_set_macxattr(n) do { ; } while (0) | ||
| 572 | #define audit_mq_open(o,m,a) ((void)0) | 648 | #define audit_mq_open(o,m,a) ((void)0) |
| 573 | #define audit_mq_sendrecv(d,l,p,t) ((void)0) | 649 | #define audit_mq_sendrecv(d,l,p,t) ((void)0) |
| 574 | #define audit_mq_notify(d,n) ((void)0) | 650 | #define audit_mq_notify(d,n) ((void)0) |
| @@ -579,7 +655,7 @@ extern int audit_signals; | |||
| 579 | #define audit_ptrace(t) ((void)0) | 655 | #define audit_ptrace(t) ((void)0) |
| 580 | #define audit_n_rules 0 | 656 | #define audit_n_rules 0 |
| 581 | #define audit_signals 0 | 657 | #define audit_signals 0 |
| 582 | #endif | 658 | #endif /* CONFIG_AUDITSYSCALL */ |
| 583 | 659 | ||
| 584 | #ifdef CONFIG_AUDIT | 660 | #ifdef CONFIG_AUDIT |
| 585 | /* These are defined in audit.c */ | 661 | /* These are defined in audit.c */ |
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index f4b8346b1a33..83c209f39493 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
| @@ -162,7 +162,7 @@ struct bcma_driver { | |||
| 162 | 162 | ||
| 163 | int (*probe)(struct bcma_device *dev); | 163 | int (*probe)(struct bcma_device *dev); |
| 164 | void (*remove)(struct bcma_device *dev); | 164 | void (*remove)(struct bcma_device *dev); |
| 165 | int (*suspend)(struct bcma_device *dev, pm_message_t state); | 165 | int (*suspend)(struct bcma_device *dev); |
| 166 | int (*resume)(struct bcma_device *dev); | 166 | int (*resume)(struct bcma_device *dev); |
| 167 | void (*shutdown)(struct bcma_device *dev); | 167 | void (*shutdown)(struct bcma_device *dev); |
| 168 | 168 | ||
diff --git a/include/linux/bio.h b/include/linux/bio.h index 847994aef0e9..129a9c097958 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
| @@ -515,24 +515,64 @@ extern void bio_integrity_init(void); | |||
| 515 | 515 | ||
| 516 | #else /* CONFIG_BLK_DEV_INTEGRITY */ | 516 | #else /* CONFIG_BLK_DEV_INTEGRITY */ |
| 517 | 517 | ||
| 518 | #define bio_integrity(a) (0) | 518 | static inline int bio_integrity(struct bio *bio) |
| 519 | #define bioset_integrity_create(a, b) (0) | 519 | { |
| 520 | #define bio_integrity_prep(a) (0) | 520 | return 0; |
| 521 | #define bio_integrity_enabled(a) (0) | 521 | } |
| 522 | |||
| 523 | static inline int bio_integrity_enabled(struct bio *bio) | ||
| 524 | { | ||
| 525 | return 0; | ||
| 526 | } | ||
| 527 | |||
| 528 | static inline int bioset_integrity_create(struct bio_set *bs, int pool_size) | ||
| 529 | { | ||
| 530 | return 0; | ||
| 531 | } | ||
| 532 | |||
| 533 | static inline void bioset_integrity_free (struct bio_set *bs) | ||
| 534 | { | ||
| 535 | return; | ||
| 536 | } | ||
| 537 | |||
| 538 | static inline int bio_integrity_prep(struct bio *bio) | ||
| 539 | { | ||
| 540 | return 0; | ||
| 541 | } | ||
| 542 | |||
| 543 | static inline void bio_integrity_free(struct bio *bio, struct bio_set *bs) | ||
| 544 | { | ||
| 545 | return; | ||
| 546 | } | ||
| 547 | |||
| 522 | static inline int bio_integrity_clone(struct bio *bio, struct bio *bio_src, | 548 | static inline int bio_integrity_clone(struct bio *bio, struct bio *bio_src, |
| 523 | gfp_t gfp_mask, struct bio_set *bs) | 549 | gfp_t gfp_mask, struct bio_set *bs) |
| 524 | { | 550 | { |
| 525 | return 0; | 551 | return 0; |
| 526 | } | 552 | } |
| 527 | #define bioset_integrity_free(a) do { } while (0) | 553 | |
| 528 | #define bio_integrity_free(a, b) do { } while (0) | 554 | static inline void bio_integrity_split(struct bio *bio, struct bio_pair *bp, |
| 529 | #define bio_integrity_endio(a, b) do { } while (0) | 555 | int sectors) |
| 530 | #define bio_integrity_advance(a, b) do { } while (0) | 556 | { |
| 531 | #define bio_integrity_trim(a, b, c) do { } while (0) | 557 | return; |
| 532 | #define bio_integrity_split(a, b, c) do { } while (0) | 558 | } |
| 533 | #define bio_integrity_set_tag(a, b, c) do { } while (0) | 559 | |
| 534 | #define bio_integrity_get_tag(a, b, c) do { } while (0) | 560 | static inline void bio_integrity_advance(struct bio *bio, |
| 535 | #define bio_integrity_init(a) do { } while (0) | 561 | unsigned int bytes_done) |
| 562 | { | ||
| 563 | return; | ||
| 564 | } | ||
| 565 | |||
| 566 | static inline void bio_integrity_trim(struct bio *bio, unsigned int offset, | ||
| 567 | unsigned int sectors) | ||
| 568 | { | ||
| 569 | return; | ||
| 570 | } | ||
| 571 | |||
| 572 | static inline void bio_integrity_init(void) | ||
| 573 | { | ||
| 574 | return; | ||
| 575 | } | ||
| 536 | 576 | ||
| 537 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ | 577 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ |
| 538 | 578 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 94acd8172b5b..6c6a1f008065 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -111,10 +111,14 @@ struct request { | |||
| 111 | * Three pointers are available for the IO schedulers, if they need | 111 | * Three pointers are available for the IO schedulers, if they need |
| 112 | * more they have to dynamically allocate it. Flush requests are | 112 | * more they have to dynamically allocate it. Flush requests are |
| 113 | * never put on the IO scheduler. So let the flush fields share | 113 | * never put on the IO scheduler. So let the flush fields share |
| 114 | * space with the three elevator_private pointers. | 114 | * space with the elevator data. |
| 115 | */ | 115 | */ |
| 116 | union { | 116 | union { |
| 117 | void *elevator_private[3]; | 117 | struct { |
| 118 | struct io_cq *icq; | ||
| 119 | void *priv[2]; | ||
| 120 | } elv; | ||
| 121 | |||
| 118 | struct { | 122 | struct { |
| 119 | unsigned int seq; | 123 | unsigned int seq; |
| 120 | struct list_head list; | 124 | struct list_head list; |
| @@ -311,6 +315,12 @@ struct request_queue { | |||
| 311 | unsigned long queue_flags; | 315 | unsigned long queue_flags; |
| 312 | 316 | ||
| 313 | /* | 317 | /* |
| 318 | * ida allocated id for this queue. Used to index queues from | ||
| 319 | * ioctx. | ||
| 320 | */ | ||
| 321 | int id; | ||
| 322 | |||
| 323 | /* | ||
| 314 | * queue needs bounce pages for pages above this limit | 324 | * queue needs bounce pages for pages above this limit |
| 315 | */ | 325 | */ |
| 316 | gfp_t bounce_gfp; | 326 | gfp_t bounce_gfp; |
| @@ -351,6 +361,8 @@ struct request_queue { | |||
| 351 | struct timer_list timeout; | 361 | struct timer_list timeout; |
| 352 | struct list_head timeout_list; | 362 | struct list_head timeout_list; |
| 353 | 363 | ||
| 364 | struct list_head icq_list; | ||
| 365 | |||
| 354 | struct queue_limits limits; | 366 | struct queue_limits limits; |
| 355 | 367 | ||
| 356 | /* | 368 | /* |
| @@ -387,6 +399,9 @@ struct request_queue { | |||
| 387 | /* Throttle data */ | 399 | /* Throttle data */ |
| 388 | struct throtl_data *td; | 400 | struct throtl_data *td; |
| 389 | #endif | 401 | #endif |
| 402 | #ifdef CONFIG_LOCKDEP | ||
| 403 | int ioc_release_depth; | ||
| 404 | #endif | ||
| 390 | }; | 405 | }; |
| 391 | 406 | ||
| 392 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ | 407 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ |
| @@ -481,6 +496,7 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q) | |||
| 481 | 496 | ||
| 482 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) | 497 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) |
| 483 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 498 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
| 499 | #define blk_queue_dead(q) test_bit(QUEUE_FLAG_DEAD, &(q)->queue_flags) | ||
| 484 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) | 500 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) |
| 485 | #define blk_queue_noxmerges(q) \ | 501 | #define blk_queue_noxmerges(q) \ |
| 486 | test_bit(QUEUE_FLAG_NOXMERGES, &(q)->queue_flags) | 502 | test_bit(QUEUE_FLAG_NOXMERGES, &(q)->queue_flags) |
| @@ -660,7 +676,6 @@ extern void __blk_put_request(struct request_queue *, struct request *); | |||
| 660 | extern struct request *blk_get_request(struct request_queue *, int, gfp_t); | 676 | extern struct request *blk_get_request(struct request_queue *, int, gfp_t); |
| 661 | extern struct request *blk_make_request(struct request_queue *, struct bio *, | 677 | extern struct request *blk_make_request(struct request_queue *, struct bio *, |
| 662 | gfp_t); | 678 | gfp_t); |
| 663 | extern void blk_insert_request(struct request_queue *, struct request *, int, void *); | ||
| 664 | extern void blk_requeue_request(struct request_queue *, struct request *); | 679 | extern void blk_requeue_request(struct request_queue *, struct request *); |
| 665 | extern void blk_add_request_payload(struct request *rq, struct page *page, | 680 | extern void blk_add_request_payload(struct request *rq, struct page *page, |
| 666 | unsigned int len); | 681 | unsigned int len); |
| @@ -675,6 +690,9 @@ extern int blk_insert_cloned_request(struct request_queue *q, | |||
| 675 | struct request *rq); | 690 | struct request *rq); |
| 676 | extern void blk_delay_queue(struct request_queue *, unsigned long); | 691 | extern void blk_delay_queue(struct request_queue *, unsigned long); |
| 677 | extern void blk_recount_segments(struct request_queue *, struct bio *); | 692 | extern void blk_recount_segments(struct request_queue *, struct bio *); |
| 693 | extern int scsi_verify_blk_ioctl(struct block_device *, unsigned int); | ||
| 694 | extern int scsi_cmd_blk_ioctl(struct block_device *, fmode_t, | ||
| 695 | unsigned int, void __user *); | ||
| 678 | extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t, | 696 | extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t, |
| 679 | unsigned int, void __user *); | 697 | unsigned int, void __user *); |
| 680 | extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t, | 698 | extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t, |
| @@ -826,6 +844,7 @@ extern void blk_queue_io_min(struct request_queue *q, unsigned int min); | |||
| 826 | extern void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt); | 844 | extern void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt); |
| 827 | extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); | 845 | extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); |
| 828 | extern void blk_set_default_limits(struct queue_limits *lim); | 846 | extern void blk_set_default_limits(struct queue_limits *lim); |
| 847 | extern void blk_set_stacking_limits(struct queue_limits *lim); | ||
| 829 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, | 848 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, |
| 830 | sector_t offset); | 849 | sector_t offset); |
| 831 | extern int bdev_stack_limits(struct queue_limits *t, struct block_device *bdev, | 850 | extern int bdev_stack_limits(struct queue_limits *t, struct block_device *bdev, |
| @@ -856,7 +875,7 @@ extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatte | |||
| 856 | extern void blk_dump_rq_flags(struct request *, char *); | 875 | extern void blk_dump_rq_flags(struct request *, char *); |
| 857 | extern long nr_blockdev_pages(void); | 876 | extern long nr_blockdev_pages(void); |
| 858 | 877 | ||
| 859 | int blk_get_queue(struct request_queue *); | 878 | bool __must_check blk_get_queue(struct request_queue *); |
| 860 | struct request_queue *blk_alloc_queue(gfp_t); | 879 | struct request_queue *blk_alloc_queue(gfp_t); |
| 861 | struct request_queue *blk_alloc_queue_node(gfp_t, int); | 880 | struct request_queue *blk_alloc_queue_node(gfp_t, int); |
| 862 | extern void blk_put_queue(struct request_queue *); | 881 | extern void blk_put_queue(struct request_queue *); |
| @@ -1279,19 +1298,70 @@ queue_max_integrity_segments(struct request_queue *q) | |||
| 1279 | 1298 | ||
| 1280 | #else /* CONFIG_BLK_DEV_INTEGRITY */ | 1299 | #else /* CONFIG_BLK_DEV_INTEGRITY */ |
| 1281 | 1300 | ||
| 1282 | #define blk_integrity_rq(rq) (0) | 1301 | struct bio; |
| 1283 | #define blk_rq_count_integrity_sg(a, b) (0) | 1302 | struct block_device; |
| 1284 | #define blk_rq_map_integrity_sg(a, b, c) (0) | 1303 | struct gendisk; |
| 1285 | #define bdev_get_integrity(a) (0) | 1304 | struct blk_integrity; |
| 1286 | #define blk_get_integrity(a) (0) | 1305 | |
| 1287 | #define blk_integrity_compare(a, b) (0) | 1306 | static inline int blk_integrity_rq(struct request *rq) |
| 1288 | #define blk_integrity_register(a, b) (0) | 1307 | { |
| 1289 | #define blk_integrity_unregister(a) do { } while (0) | 1308 | return 0; |
| 1290 | #define blk_queue_max_integrity_segments(a, b) do { } while (0) | 1309 | } |
| 1291 | #define queue_max_integrity_segments(a) (0) | 1310 | static inline int blk_rq_count_integrity_sg(struct request_queue *q, |
| 1292 | #define blk_integrity_merge_rq(a, b, c) (0) | 1311 | struct bio *b) |
| 1293 | #define blk_integrity_merge_bio(a, b, c) (0) | 1312 | { |
| 1294 | #define blk_integrity_is_initialized(a) (0) | 1313 | return 0; |
| 1314 | } | ||
| 1315 | static inline int blk_rq_map_integrity_sg(struct request_queue *q, | ||
| 1316 | struct bio *b, | ||
| 1317 | struct scatterlist *s) | ||
| 1318 | { | ||
| 1319 | return 0; | ||
| 1320 | } | ||
| 1321 | static inline struct blk_integrity *bdev_get_integrity(struct block_device *b) | ||
| 1322 | { | ||
| 1323 | return 0; | ||
| 1324 | } | ||
| 1325 | static inline struct blk_integrity *blk_get_integrity(struct gendisk *disk) | ||
| 1326 | { | ||
| 1327 | return NULL; | ||
| 1328 | } | ||
| 1329 | static inline int blk_integrity_compare(struct gendisk *a, struct gendisk *b) | ||
| 1330 | { | ||
| 1331 | return 0; | ||
| 1332 | } | ||
| 1333 | static inline int blk_integrity_register(struct gendisk *d, | ||
| 1334 | struct blk_integrity *b) | ||
| 1335 | { | ||
| 1336 | return 0; | ||
| 1337 | } | ||
| 1338 | static inline void blk_integrity_unregister(struct gendisk *d) | ||
| 1339 | { | ||
| 1340 | } | ||
| 1341 | static inline void blk_queue_max_integrity_segments(struct request_queue *q, | ||
| 1342 | unsigned int segs) | ||
| 1343 | { | ||
| 1344 | } | ||
| 1345 | static inline unsigned short queue_max_integrity_segments(struct request_queue *q) | ||
| 1346 | { | ||
| 1347 | return 0; | ||
| 1348 | } | ||
| 1349 | static inline int blk_integrity_merge_rq(struct request_queue *rq, | ||
| 1350 | struct request *r1, | ||
| 1351 | struct request *r2) | ||
| 1352 | { | ||
| 1353 | return 0; | ||
| 1354 | } | ||
| 1355 | static inline int blk_integrity_merge_bio(struct request_queue *rq, | ||
| 1356 | struct request *r, | ||
| 1357 | struct bio *b) | ||
| 1358 | { | ||
| 1359 | return 0; | ||
| 1360 | } | ||
| 1361 | static inline bool blk_integrity_is_initialized(struct gendisk *g) | ||
| 1362 | { | ||
| 1363 | return 0; | ||
| 1364 | } | ||
| 1295 | 1365 | ||
| 1296 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ | 1366 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ |
| 1297 | 1367 | ||
diff --git a/include/linux/capability.h b/include/linux/capability.h index a63d13d84ad8..12d52dedb229 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
| @@ -380,7 +380,6 @@ struct user_namespace; | |||
| 380 | struct user_namespace *current_user_ns(void); | 380 | struct user_namespace *current_user_ns(void); |
| 381 | 381 | ||
| 382 | extern const kernel_cap_t __cap_empty_set; | 382 | extern const kernel_cap_t __cap_empty_set; |
| 383 | extern const kernel_cap_t __cap_full_set; | ||
| 384 | extern const kernel_cap_t __cap_init_eff_set; | 383 | extern const kernel_cap_t __cap_init_eff_set; |
| 385 | 384 | ||
| 386 | /* | 385 | /* |
| @@ -544,9 +543,10 @@ extern bool has_capability(struct task_struct *t, int cap); | |||
| 544 | extern bool has_ns_capability(struct task_struct *t, | 543 | extern bool has_ns_capability(struct task_struct *t, |
| 545 | struct user_namespace *ns, int cap); | 544 | struct user_namespace *ns, int cap); |
| 546 | extern bool has_capability_noaudit(struct task_struct *t, int cap); | 545 | extern bool has_capability_noaudit(struct task_struct *t, int cap); |
| 546 | extern bool has_ns_capability_noaudit(struct task_struct *t, | ||
| 547 | struct user_namespace *ns, int cap); | ||
| 547 | extern bool capable(int cap); | 548 | extern bool capable(int cap); |
| 548 | extern bool ns_capable(struct user_namespace *ns, int cap); | 549 | extern bool ns_capable(struct user_namespace *ns, int cap); |
| 549 | extern bool task_ns_capable(struct task_struct *t, int cap); | ||
| 550 | extern bool nsown_capable(int cap); | 550 | extern bool nsown_capable(int cap); |
| 551 | 551 | ||
| 552 | /* audit system wants to get cap info from files as well */ | 552 | /* audit system wants to get cap info from files as well */ |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index a17becc36ca1..e9b602151caf 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -457,6 +457,28 @@ void cgroup_exclude_rmdir(struct cgroup_subsys_state *css); | |||
| 457 | void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css); | 457 | void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css); |
| 458 | 458 | ||
| 459 | /* | 459 | /* |
| 460 | * Control Group taskset, used to pass around set of tasks to cgroup_subsys | ||
| 461 | * methods. | ||
| 462 | */ | ||
| 463 | struct cgroup_taskset; | ||
| 464 | struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset); | ||
| 465 | struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset); | ||
| 466 | struct cgroup *cgroup_taskset_cur_cgroup(struct cgroup_taskset *tset); | ||
| 467 | int cgroup_taskset_size(struct cgroup_taskset *tset); | ||
| 468 | |||
| 469 | /** | ||
| 470 | * cgroup_taskset_for_each - iterate cgroup_taskset | ||
| 471 | * @task: the loop cursor | ||
| 472 | * @skip_cgrp: skip if task's cgroup matches this, %NULL to iterate through all | ||
| 473 | * @tset: taskset to iterate | ||
| 474 | */ | ||
| 475 | #define cgroup_taskset_for_each(task, skip_cgrp, tset) \ | ||
| 476 | for ((task) = cgroup_taskset_first((tset)); (task); \ | ||
| 477 | (task) = cgroup_taskset_next((tset))) \ | ||
| 478 | if (!(skip_cgrp) || \ | ||
| 479 | cgroup_taskset_cur_cgroup((tset)) != (skip_cgrp)) | ||
| 480 | |||
| 481 | /* | ||
| 460 | * Control Group subsystem type. | 482 | * Control Group subsystem type. |
| 461 | * See Documentation/cgroups/cgroups.txt for details | 483 | * See Documentation/cgroups/cgroups.txt for details |
| 462 | */ | 484 | */ |
| @@ -467,14 +489,11 @@ struct cgroup_subsys { | |||
| 467 | int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 489 | int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
| 468 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 490 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
| 469 | int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 491 | int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
| 470 | struct task_struct *tsk); | 492 | struct cgroup_taskset *tset); |
| 471 | int (*can_attach_task)(struct cgroup *cgrp, struct task_struct *tsk); | ||
| 472 | void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 493 | void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
| 473 | struct task_struct *tsk); | 494 | struct cgroup_taskset *tset); |
| 474 | void (*pre_attach)(struct cgroup *cgrp); | ||
| 475 | void (*attach_task)(struct cgroup *cgrp, struct task_struct *tsk); | ||
| 476 | void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 495 | void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
| 477 | struct cgroup *old_cgrp, struct task_struct *tsk); | 496 | struct cgroup_taskset *tset); |
| 478 | void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); | 497 | void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); |
| 479 | void (*exit)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 498 | void (*exit)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
| 480 | struct cgroup *old_cgrp, struct task_struct *task); | 499 | struct cgroup *old_cgrp, struct task_struct *task); |
diff --git a/include/linux/clk.h b/include/linux/clk.h index 7213b52b2c0e..b9d46fa154b4 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
| @@ -107,6 +107,28 @@ static inline void clk_unprepare(struct clk *clk) | |||
| 107 | } | 107 | } |
| 108 | #endif | 108 | #endif |
| 109 | 109 | ||
| 110 | /* clk_prepare_enable helps cases using clk_enable in non-atomic context. */ | ||
| 111 | static inline int clk_prepare_enable(struct clk *clk) | ||
| 112 | { | ||
| 113 | int ret; | ||
| 114 | |||
| 115 | ret = clk_prepare(clk); | ||
| 116 | if (ret) | ||
| 117 | return ret; | ||
| 118 | ret = clk_enable(clk); | ||
| 119 | if (ret) | ||
| 120 | clk_unprepare(clk); | ||
| 121 | |||
| 122 | return ret; | ||
| 123 | } | ||
| 124 | |||
| 125 | /* clk_disable_unprepare helps cases using clk_disable in non-atomic context. */ | ||
| 126 | static inline void clk_disable_unprepare(struct clk *clk) | ||
| 127 | { | ||
| 128 | clk_disable(clk); | ||
| 129 | clk_unprepare(clk); | ||
| 130 | } | ||
| 131 | |||
| 110 | /** | 132 | /** |
| 111 | * clk_get_rate - obtain the current clock rate (in Hz) for a clock source. | 133 | * clk_get_rate - obtain the current clock rate (in Hz) for a clock source. |
| 112 | * This is only valid once the clock source has been enabled. | 134 | * This is only valid once the clock source has been enabled. |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 59e4028e833d..3fd17c249221 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
| @@ -50,6 +50,11 @@ | |||
| 50 | # define inline inline __attribute__((always_inline)) | 50 | # define inline inline __attribute__((always_inline)) |
| 51 | # define __inline__ __inline__ __attribute__((always_inline)) | 51 | # define __inline__ __inline__ __attribute__((always_inline)) |
| 52 | # define __inline __inline __attribute__((always_inline)) | 52 | # define __inline __inline __attribute__((always_inline)) |
| 53 | #else | ||
| 54 | /* A lot of inline functions can cause havoc with function tracing */ | ||
| 55 | # define inline inline notrace | ||
| 56 | # define __inline__ __inline__ notrace | ||
| 57 | # define __inline __inline notrace | ||
| 53 | #endif | 58 | #endif |
| 54 | 59 | ||
| 55 | #define __deprecated __attribute__((deprecated)) | 60 | #define __deprecated __attribute__((deprecated)) |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index dfadc96e9d63..2f4079175afb 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | the kernel context */ | 29 | the kernel context */ |
| 30 | #define __cold __attribute__((__cold__)) | 30 | #define __cold __attribute__((__cold__)) |
| 31 | 31 | ||
| 32 | #define __linktime_error(message) __attribute__((__error__(message))) | ||
| 32 | 33 | ||
| 33 | #if __GNUC_MINOR__ >= 5 | 34 | #if __GNUC_MINOR__ >= 5 |
| 34 | /* | 35 | /* |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 320d6c94ff84..4a243546d142 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -293,7 +293,9 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 293 | #ifndef __compiletime_error | 293 | #ifndef __compiletime_error |
| 294 | # define __compiletime_error(message) | 294 | # define __compiletime_error(message) |
| 295 | #endif | 295 | #endif |
| 296 | 296 | #ifndef __linktime_error | |
| 297 | # define __linktime_error(message) | ||
| 298 | #endif | ||
| 297 | /* | 299 | /* |
| 298 | * Prevent the compiler from merging or refetching accesses. The compiler | 300 | * Prevent the compiler from merging or refetching accesses. The compiler |
| 299 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), | 301 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), |
diff --git a/include/linux/console.h b/include/linux/console.h index 7453cfd593c8..7201ce4280ca 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
| @@ -152,7 +152,7 @@ extern int braille_register_console(struct console *, int index, | |||
| 152 | char *console_options, char *braille_options); | 152 | char *console_options, char *braille_options); |
| 153 | extern int braille_unregister_console(struct console *); | 153 | extern int braille_unregister_console(struct console *); |
| 154 | extern void console_sysfs_notify(void); | 154 | extern void console_sysfs_notify(void); |
| 155 | extern int console_suspend_enabled; | 155 | extern bool console_suspend_enabled; |
| 156 | 156 | ||
| 157 | /* Suspend and resume console messages over PM events */ | 157 | /* Suspend and resume console messages over PM events */ |
| 158 | extern void suspend_console(void); | 158 | extern void suspend_console(void); |
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 23f81de51829..712abcc205ae 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
| @@ -186,7 +186,14 @@ struct cpuidle_governor { | |||
| 186 | extern int cpuidle_register_governor(struct cpuidle_governor *gov); | 186 | extern int cpuidle_register_governor(struct cpuidle_governor *gov); |
| 187 | extern void cpuidle_unregister_governor(struct cpuidle_governor *gov); | 187 | extern void cpuidle_unregister_governor(struct cpuidle_governor *gov); |
| 188 | 188 | ||
| 189 | #ifdef CONFIG_INTEL_IDLE | ||
| 190 | extern int intel_idle_cpu_init(int cpu); | ||
| 189 | #else | 191 | #else |
| 192 | static inline int intel_idle_cpu_init(int cpu) { return -1; } | ||
| 193 | #endif | ||
| 194 | |||
| 195 | #else | ||
| 196 | static inline int intel_idle_cpu_init(int cpu) { return -1; } | ||
| 190 | 197 | ||
| 191 | static inline int cpuidle_register_governor(struct cpuidle_governor *gov) | 198 | static inline int cpuidle_register_governor(struct cpuidle_governor *gov) |
| 192 | {return 0;} | 199 | {return 0;} |
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index 5c4abce94ad1..b936763f2236 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <linux/kexec.h> | 5 | #include <linux/kexec.h> |
| 6 | #include <linux/device.h> | 6 | #include <linux/device.h> |
| 7 | #include <linux/proc_fs.h> | 7 | #include <linux/proc_fs.h> |
| 8 | #include <linux/elf.h> | ||
| 8 | 9 | ||
| 9 | #define ELFCORE_ADDR_MAX (-1ULL) | 10 | #define ELFCORE_ADDR_MAX (-1ULL) |
| 10 | #define ELFCORE_ADDR_ERR (-2ULL) | 11 | #define ELFCORE_ADDR_ERR (-2ULL) |
diff --git a/include/linux/cred.h b/include/linux/cred.h index 40308969ed00..adadf71a7327 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
| @@ -358,10 +358,12 @@ static inline void put_cred(const struct cred *_cred) | |||
| 358 | #define current_security() (current_cred_xxx(security)) | 358 | #define current_security() (current_cred_xxx(security)) |
| 359 | 359 | ||
| 360 | #ifdef CONFIG_USER_NS | 360 | #ifdef CONFIG_USER_NS |
| 361 | #define current_user_ns() (current_cred_xxx(user_ns)) | 361 | #define current_user_ns() (current_cred_xxx(user_ns)) |
| 362 | #define task_user_ns(task) (task_cred_xxx((task), user_ns)) | ||
| 362 | #else | 363 | #else |
| 363 | extern struct user_namespace init_user_ns; | 364 | extern struct user_namespace init_user_ns; |
| 364 | #define current_user_ns() (&init_user_ns) | 365 | #define current_user_ns() (&init_user_ns) |
| 366 | #define task_user_ns(task) (&init_user_ns) | ||
| 365 | #endif | 367 | #endif |
| 366 | 368 | ||
| 367 | 369 | ||
diff --git a/include/linux/cuda.h b/include/linux/cuda.h index 6a3e6385d3f3..9f9865ff781e 100644 --- a/include/linux/cuda.h +++ b/include/linux/cuda.h | |||
| @@ -5,6 +5,9 @@ | |||
| 5 | * Copyright (C) 1996 Paul Mackerras. | 5 | * Copyright (C) 1996 Paul Mackerras. |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #ifndef _LINUX_CUDA_H | ||
| 9 | #define _LINUX_CUDA_H | ||
| 10 | |||
| 8 | /* CUDA commands (2nd byte) */ | 11 | /* CUDA commands (2nd byte) */ |
| 9 | #define CUDA_WARM_START 0 | 12 | #define CUDA_WARM_START 0 |
| 10 | #define CUDA_AUTOPOLL 1 | 13 | #define CUDA_AUTOPOLL 1 |
| @@ -34,3 +37,5 @@ extern int cuda_request(struct adb_request *req, | |||
| 34 | extern void cuda_poll(void); | 37 | extern void cuda_poll(void); |
| 35 | 38 | ||
| 36 | #endif /* __KERNEL */ | 39 | #endif /* __KERNEL */ |
| 40 | |||
| 41 | #endif /* _LINUX_CUDA_H */ | ||
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index ed9f74f6c519..d64a55b23afd 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -203,6 +203,7 @@ struct dentry_operations { | |||
| 203 | 203 | ||
| 204 | #define DCACHE_CANT_MOUNT 0x0100 | 204 | #define DCACHE_CANT_MOUNT 0x0100 |
| 205 | #define DCACHE_GENOCIDE 0x0200 | 205 | #define DCACHE_GENOCIDE 0x0200 |
| 206 | #define DCACHE_SHRINK_LIST 0x0400 | ||
| 206 | 207 | ||
| 207 | #define DCACHE_NFSFS_RENAMED 0x1000 | 208 | #define DCACHE_NFSFS_RENAMED 0x1000 |
| 208 | /* this dentry has been "silly renamed" and has to be deleted on the last | 209 | /* this dentry has been "silly renamed" and has to be deleted on the last |
| @@ -241,6 +242,7 @@ extern struct dentry * d_alloc(struct dentry *, const struct qstr *); | |||
| 241 | extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *); | 242 | extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *); |
| 242 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); | 243 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); |
| 243 | extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *); | 244 | extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *); |
| 245 | extern struct dentry *d_find_any_alias(struct inode *inode); | ||
| 244 | extern struct dentry * d_obtain_alias(struct inode *); | 246 | extern struct dentry * d_obtain_alias(struct inode *); |
| 245 | extern void shrink_dcache_sb(struct super_block *); | 247 | extern void shrink_dcache_sb(struct super_block *); |
| 246 | extern void shrink_dcache_parent(struct dentry *); | 248 | extern void shrink_dcache_parent(struct dentry *); |
| @@ -249,6 +251,7 @@ extern int d_invalidate(struct dentry *); | |||
| 249 | 251 | ||
| 250 | /* only used at mount-time */ | 252 | /* only used at mount-time */ |
| 251 | extern struct dentry * d_alloc_root(struct inode *); | 253 | extern struct dentry * d_alloc_root(struct inode *); |
| 254 | extern struct dentry * d_make_root(struct inode *); | ||
| 252 | 255 | ||
| 253 | /* <clickety>-<click> the ramfs-type tree */ | 256 | /* <clickety>-<click> the ramfs-type tree */ |
| 254 | extern void d_genocide(struct dentry *); | 257 | extern void d_genocide(struct dentry *); |
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/digsig.h b/include/linux/digsig.h new file mode 100644 index 000000000000..b01558b15814 --- /dev/null +++ b/include/linux/digsig.h | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2011 Nokia Corporation | ||
| 3 | * Copyright (C) 2011 Intel Corporation | ||
| 4 | * | ||
| 5 | * Author: | ||
| 6 | * Dmitry Kasatkin <dmitry.kasatkin@nokia.com> | ||
| 7 | * <dmitry.kasatkin@intel.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation, version 2 of the License. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _DIGSIG_H | ||
| 16 | #define _DIGSIG_H | ||
| 17 | |||
| 18 | #include <linux/key.h> | ||
| 19 | |||
| 20 | enum pubkey_algo { | ||
| 21 | PUBKEY_ALGO_RSA, | ||
| 22 | PUBKEY_ALGO_MAX, | ||
| 23 | }; | ||
| 24 | |||
| 25 | enum digest_algo { | ||
| 26 | DIGEST_ALGO_SHA1, | ||
| 27 | DIGEST_ALGO_SHA256, | ||
| 28 | DIGEST_ALGO_MAX | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct pubkey_hdr { | ||
| 32 | uint8_t version; /* key format version */ | ||
| 33 | time_t timestamp; /* key made, always 0 for now */ | ||
| 34 | uint8_t algo; | ||
| 35 | uint8_t nmpi; | ||
| 36 | char mpi[0]; | ||
| 37 | } __packed; | ||
| 38 | |||
| 39 | struct signature_hdr { | ||
| 40 | uint8_t version; /* signature format version */ | ||
| 41 | time_t timestamp; /* signature made */ | ||
| 42 | uint8_t algo; | ||
| 43 | uint8_t hash; | ||
| 44 | uint8_t keyid[8]; | ||
| 45 | uint8_t nmpi; | ||
| 46 | char mpi[0]; | ||
| 47 | } __packed; | ||
| 48 | |||
| 49 | #if defined(CONFIG_SIGNATURE) || defined(CONFIG_SIGNATURE_MODULE) | ||
| 50 | |||
| 51 | int digsig_verify(struct key *keyring, const char *sig, int siglen, | ||
| 52 | const char *digest, int digestlen); | ||
| 53 | |||
| 54 | #else | ||
| 55 | |||
| 56 | static inline int digsig_verify(struct key *keyring, const char *sig, | ||
| 57 | int siglen, const char *digest, int digestlen) | ||
| 58 | { | ||
| 59 | return -EOPNOTSUPP; | ||
| 60 | } | ||
| 61 | |||
| 62 | #endif /* CONFIG_SIGNATURE */ | ||
| 63 | |||
| 64 | #endif /* _DIGSIG_H */ | ||
diff --git a/include/linux/display.h b/include/linux/display.h deleted file mode 100644 index 3bf70d639728..000000000000 --- a/include/linux/display.h +++ /dev/null | |||
| @@ -1,61 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2006 James Simmons <jsimmons@infradead.org> | ||
| 3 | * | ||
| 4 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or (at | ||
| 9 | * your option) any later version. | ||
| 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 | */ | ||
| 22 | |||
| 23 | #ifndef _LINUX_DISPLAY_H | ||
| 24 | #define _LINUX_DISPLAY_H | ||
| 25 | |||
| 26 | #include <linux/device.h> | ||
| 27 | |||
| 28 | struct display_device; | ||
| 29 | |||
| 30 | /* This structure defines all the properties of a Display. */ | ||
| 31 | struct display_driver { | ||
| 32 | int (*set_contrast)(struct display_device *, unsigned int); | ||
| 33 | int (*get_contrast)(struct display_device *); | ||
| 34 | void (*suspend)(struct display_device *, pm_message_t state); | ||
| 35 | void (*resume)(struct display_device *); | ||
| 36 | int (*probe)(struct display_device *, void *); | ||
| 37 | int (*remove)(struct display_device *); | ||
| 38 | int max_contrast; | ||
| 39 | }; | ||
| 40 | |||
| 41 | struct display_device { | ||
| 42 | struct module *owner; /* Owner module */ | ||
| 43 | struct display_driver *driver; | ||
| 44 | struct device *parent; /* This is the parent */ | ||
| 45 | struct device *dev; /* This is this display device */ | ||
| 46 | struct mutex lock; | ||
| 47 | void *priv_data; | ||
| 48 | char type[16]; | ||
| 49 | char *name; | ||
| 50 | int idx; | ||
| 51 | }; | ||
| 52 | |||
| 53 | extern struct display_device *display_device_register(struct display_driver *driver, | ||
| 54 | struct device *dev, void *devdata); | ||
| 55 | extern void display_device_unregister(struct display_device *dev); | ||
| 56 | |||
| 57 | extern int probe_edid(struct display_device *dev, void *devdata); | ||
| 58 | |||
| 59 | #define to_display_device(obj) container_of(obj, struct display_device, class_dev) | ||
| 60 | |||
| 61 | #endif | ||
diff --git a/include/linux/dlm.h b/include/linux/dlm.h index d4e02f5353a0..6c7f6e9546c7 100644 --- a/include/linux/dlm.h +++ b/include/linux/dlm.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | ******************************************************************************* | 2 | ******************************************************************************* |
| 3 | ** | 3 | ** |
| 4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | 4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
| 5 | ** Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. | 5 | ** Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved. |
| 6 | ** | 6 | ** |
| 7 | ** This copyrighted material is made available to anyone wishing to use, | 7 | ** This copyrighted material is made available to anyone wishing to use, |
| 8 | ** modify, copy, or redistribute it subject to the terms and conditions | 8 | ** modify, copy, or redistribute it subject to the terms and conditions |
| @@ -74,15 +74,76 @@ struct dlm_lksb { | |||
| 74 | 74 | ||
| 75 | #ifdef __KERNEL__ | 75 | #ifdef __KERNEL__ |
| 76 | 76 | ||
| 77 | struct dlm_slot { | ||
| 78 | int nodeid; /* 1 to MAX_INT */ | ||
| 79 | int slot; /* 1 to MAX_INT */ | ||
| 80 | }; | ||
| 81 | |||
| 82 | /* | ||
| 83 | * recover_prep: called before the dlm begins lock recovery. | ||
| 84 | * Notfies lockspace user that locks from failed members will be granted. | ||
| 85 | * recover_slot: called after recover_prep and before recover_done. | ||
| 86 | * Identifies a failed lockspace member. | ||
| 87 | * recover_done: called after the dlm completes lock recovery. | ||
| 88 | * Identifies lockspace members and lockspace generation number. | ||
| 89 | */ | ||
| 90 | |||
| 91 | struct dlm_lockspace_ops { | ||
| 92 | void (*recover_prep) (void *ops_arg); | ||
| 93 | void (*recover_slot) (void *ops_arg, struct dlm_slot *slot); | ||
| 94 | void (*recover_done) (void *ops_arg, struct dlm_slot *slots, | ||
| 95 | int num_slots, int our_slot, uint32_t generation); | ||
| 96 | }; | ||
| 97 | |||
| 77 | /* | 98 | /* |
| 78 | * dlm_new_lockspace | 99 | * dlm_new_lockspace |
| 79 | * | 100 | * |
| 80 | * Starts a lockspace with the given name. If the named lockspace exists in | 101 | * Create/join a lockspace. |
| 81 | * the cluster, the calling node joins it. | 102 | * |
| 103 | * name: lockspace name, null terminated, up to DLM_LOCKSPACE_LEN (not | ||
| 104 | * including terminating null). | ||
| 105 | * | ||
| 106 | * cluster: cluster name, null terminated, up to DLM_LOCKSPACE_LEN (not | ||
| 107 | * including terminating null). Optional. When cluster is null, it | ||
| 108 | * is not used. When set, dlm_new_lockspace() returns -EBADR if cluster | ||
| 109 | * is not equal to the dlm cluster name. | ||
| 110 | * | ||
| 111 | * flags: | ||
| 112 | * DLM_LSFL_NODIR | ||
| 113 | * The dlm should not use a resource directory, but statically assign | ||
| 114 | * resource mastery to nodes based on the name hash that is otherwise | ||
| 115 | * used to select the directory node. Must be the same on all nodes. | ||
| 116 | * DLM_LSFL_TIMEWARN | ||
| 117 | * The dlm should emit netlink messages if locks have been waiting | ||
| 118 | * for a configurable amount of time. (Unused.) | ||
| 119 | * DLM_LSFL_FS | ||
| 120 | * The lockspace user is in the kernel (i.e. filesystem). Enables | ||
| 121 | * direct bast/cast callbacks. | ||
| 122 | * DLM_LSFL_NEWEXCL | ||
| 123 | * dlm_new_lockspace() should return -EEXIST if the lockspace exists. | ||
| 124 | * | ||
| 125 | * lvblen: length of lvb in bytes. Must be multiple of 8. | ||
| 126 | * dlm_new_lockspace() returns an error if this does not match | ||
| 127 | * what other nodes are using. | ||
| 128 | * | ||
| 129 | * ops: callbacks that indicate lockspace recovery points so the | ||
| 130 | * caller can coordinate its recovery and know lockspace members. | ||
| 131 | * This is only used by the initial dlm_new_lockspace() call. | ||
| 132 | * Optional. | ||
| 133 | * | ||
| 134 | * ops_arg: arg for ops callbacks. | ||
| 135 | * | ||
| 136 | * ops_result: tells caller if the ops callbacks (if provided) will | ||
| 137 | * be used or not. 0: will be used, -EXXX will not be used. | ||
| 138 | * -EOPNOTSUPP: the dlm does not have recovery_callbacks enabled. | ||
| 139 | * | ||
| 140 | * lockspace: handle for dlm functions | ||
| 82 | */ | 141 | */ |
| 83 | 142 | ||
| 84 | int dlm_new_lockspace(const char *name, int namelen, | 143 | int dlm_new_lockspace(const char *name, const char *cluster, |
| 85 | dlm_lockspace_t **lockspace, uint32_t flags, int lvblen); | 144 | uint32_t flags, int lvblen, |
| 145 | const struct dlm_lockspace_ops *ops, void *ops_arg, | ||
| 146 | int *ops_result, dlm_lockspace_t **lockspace); | ||
| 86 | 147 | ||
| 87 | /* | 148 | /* |
| 88 | * dlm_release_lockspace | 149 | * dlm_release_lockspace |
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h new file mode 100644 index 000000000000..f8ac076afa52 --- /dev/null +++ b/include/linux/dma-buf.h | |||
| @@ -0,0 +1,176 @@ | |||
| 1 | /* | ||
| 2 | * Header file for dma buffer sharing framework. | ||
| 3 | * | ||
| 4 | * Copyright(C) 2011 Linaro Limited. All rights reserved. | ||
| 5 | * Author: Sumit Semwal <sumit.semwal@ti.com> | ||
| 6 | * | ||
| 7 | * Many thanks to linaro-mm-sig list, and specially | ||
| 8 | * Arnd Bergmann <arnd@arndb.de>, Rob Clark <rob@ti.com> and | ||
| 9 | * Daniel Vetter <daniel@ffwll.ch> for their support in creation and | ||
| 10 | * refining of this idea. | ||
| 11 | * | ||
| 12 | * This program is free software; you can redistribute it and/or modify it | ||
| 13 | * under the terms of the GNU General Public License version 2 as published by | ||
| 14 | * the Free Software Foundation. | ||
| 15 | * | ||
| 16 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 17 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 18 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 19 | * more details. | ||
| 20 | * | ||
| 21 | * You should have received a copy of the GNU General Public License along with | ||
| 22 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 23 | */ | ||
| 24 | #ifndef __DMA_BUF_H__ | ||
| 25 | #define __DMA_BUF_H__ | ||
| 26 | |||
| 27 | #include <linux/file.h> | ||
| 28 | #include <linux/err.h> | ||
| 29 | #include <linux/device.h> | ||
| 30 | #include <linux/scatterlist.h> | ||
| 31 | #include <linux/list.h> | ||
| 32 | #include <linux/dma-mapping.h> | ||
| 33 | |||
| 34 | struct dma_buf; | ||
| 35 | struct dma_buf_attachment; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * struct dma_buf_ops - operations possible on struct dma_buf | ||
| 39 | * @attach: [optional] allows different devices to 'attach' themselves to the | ||
| 40 | * given buffer. It might return -EBUSY to signal that backing storage | ||
| 41 | * is already allocated and incompatible with the requirements | ||
| 42 | * of requesting device. | ||
| 43 | * @detach: [optional] detach a given device from this buffer. | ||
| 44 | * @map_dma_buf: returns list of scatter pages allocated, increases usecount | ||
| 45 | * of the buffer. Requires atleast one attach to be called | ||
| 46 | * before. Returned sg list should already be mapped into | ||
| 47 | * _device_ address space. This call may sleep. May also return | ||
| 48 | * -EINTR. Should return -EINVAL if attach hasn't been called yet. | ||
| 49 | * @unmap_dma_buf: decreases usecount of buffer, might deallocate scatter | ||
| 50 | * pages. | ||
| 51 | * @release: release this buffer; to be called after the last dma_buf_put. | ||
| 52 | */ | ||
| 53 | struct dma_buf_ops { | ||
| 54 | int (*attach)(struct dma_buf *, struct device *, | ||
| 55 | struct dma_buf_attachment *); | ||
| 56 | |||
| 57 | void (*detach)(struct dma_buf *, struct dma_buf_attachment *); | ||
| 58 | |||
| 59 | /* For {map,unmap}_dma_buf below, any specific buffer attributes | ||
| 60 | * required should get added to device_dma_parameters accessible | ||
| 61 | * via dev->dma_params. | ||
| 62 | */ | ||
| 63 | struct sg_table * (*map_dma_buf)(struct dma_buf_attachment *, | ||
| 64 | enum dma_data_direction); | ||
| 65 | void (*unmap_dma_buf)(struct dma_buf_attachment *, | ||
| 66 | struct sg_table *); | ||
| 67 | /* TODO: Add try_map_dma_buf version, to return immed with -EBUSY | ||
| 68 | * if the call would block. | ||
| 69 | */ | ||
| 70 | |||
| 71 | /* after final dma_buf_put() */ | ||
| 72 | void (*release)(struct dma_buf *); | ||
| 73 | |||
| 74 | }; | ||
| 75 | |||
| 76 | /** | ||
| 77 | * struct dma_buf - shared buffer object | ||
| 78 | * @size: size of the buffer | ||
| 79 | * @file: file pointer used for sharing buffers across, and for refcounting. | ||
| 80 | * @attachments: list of dma_buf_attachment that denotes all devices attached. | ||
| 81 | * @ops: dma_buf_ops associated with this buffer object. | ||
| 82 | * @priv: exporter specific private data for this buffer object. | ||
| 83 | */ | ||
| 84 | struct dma_buf { | ||
| 85 | size_t size; | ||
| 86 | struct file *file; | ||
| 87 | struct list_head attachments; | ||
| 88 | const struct dma_buf_ops *ops; | ||
| 89 | /* mutex to serialize list manipulation and other ops */ | ||
| 90 | struct mutex lock; | ||
| 91 | void *priv; | ||
| 92 | }; | ||
| 93 | |||
| 94 | /** | ||
| 95 | * struct dma_buf_attachment - holds device-buffer attachment data | ||
| 96 | * @dmabuf: buffer for this attachment. | ||
| 97 | * @dev: device attached to the buffer. | ||
| 98 | * @node: list of dma_buf_attachment. | ||
| 99 | * @priv: exporter specific attachment data. | ||
| 100 | * | ||
| 101 | * This structure holds the attachment information between the dma_buf buffer | ||
| 102 | * and its user device(s). The list contains one attachment struct per device | ||
| 103 | * attached to the buffer. | ||
| 104 | */ | ||
| 105 | struct dma_buf_attachment { | ||
| 106 | struct dma_buf *dmabuf; | ||
| 107 | struct device *dev; | ||
| 108 | struct list_head node; | ||
| 109 | void *priv; | ||
| 110 | }; | ||
| 111 | |||
| 112 | #ifdef CONFIG_DMA_SHARED_BUFFER | ||
| 113 | struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, | ||
| 114 | struct device *dev); | ||
| 115 | void dma_buf_detach(struct dma_buf *dmabuf, | ||
| 116 | struct dma_buf_attachment *dmabuf_attach); | ||
| 117 | struct dma_buf *dma_buf_export(void *priv, struct dma_buf_ops *ops, | ||
| 118 | size_t size, int flags); | ||
| 119 | int dma_buf_fd(struct dma_buf *dmabuf); | ||
| 120 | struct dma_buf *dma_buf_get(int fd); | ||
| 121 | void dma_buf_put(struct dma_buf *dmabuf); | ||
| 122 | |||
| 123 | struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *, | ||
| 124 | enum dma_data_direction); | ||
| 125 | void dma_buf_unmap_attachment(struct dma_buf_attachment *, struct sg_table *); | ||
| 126 | #else | ||
| 127 | |||
| 128 | static inline struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, | ||
| 129 | struct device *dev) | ||
| 130 | { | ||
| 131 | return ERR_PTR(-ENODEV); | ||
| 132 | } | ||
| 133 | |||
| 134 | static inline void dma_buf_detach(struct dma_buf *dmabuf, | ||
| 135 | struct dma_buf_attachment *dmabuf_attach) | ||
| 136 | { | ||
| 137 | return; | ||
| 138 | } | ||
| 139 | |||
| 140 | static inline struct dma_buf *dma_buf_export(void *priv, | ||
| 141 | struct dma_buf_ops *ops, | ||
| 142 | size_t size, int flags) | ||
| 143 | { | ||
| 144 | return ERR_PTR(-ENODEV); | ||
| 145 | } | ||
| 146 | |||
| 147 | static inline int dma_buf_fd(struct dma_buf *dmabuf) | ||
| 148 | { | ||
| 149 | return -ENODEV; | ||
| 150 | } | ||
| 151 | |||
| 152 | static inline struct dma_buf *dma_buf_get(int fd) | ||
| 153 | { | ||
| 154 | return ERR_PTR(-ENODEV); | ||
| 155 | } | ||
| 156 | |||
| 157 | static inline void dma_buf_put(struct dma_buf *dmabuf) | ||
| 158 | { | ||
| 159 | return; | ||
| 160 | } | ||
| 161 | |||
| 162 | static inline struct sg_table *dma_buf_map_attachment( | ||
| 163 | struct dma_buf_attachment *attach, enum dma_data_direction write) | ||
| 164 | { | ||
| 165 | return ERR_PTR(-ENODEV); | ||
| 166 | } | ||
| 167 | |||
| 168 | static inline void dma_buf_unmap_attachment(struct dma_buf_attachment *attach, | ||
| 169 | struct sg_table *sg) | ||
| 170 | { | ||
| 171 | return; | ||
| 172 | } | ||
| 173 | |||
| 174 | #endif /* CONFIG_DMA_SHARED_BUFFER */ | ||
| 175 | |||
| 176 | #endif /* __DMA_BUF_H__ */ | ||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 75f53f874b24..679b349d9b66 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | 23 | ||
| 24 | #include <linux/device.h> | 24 | #include <linux/device.h> |
| 25 | #include <linux/uio.h> | 25 | #include <linux/uio.h> |
| 26 | #include <linux/dma-direction.h> | ||
| 27 | #include <linux/scatterlist.h> | 26 | #include <linux/scatterlist.h> |
| 28 | #include <linux/bitmap.h> | 27 | #include <linux/bitmap.h> |
| 29 | #include <asm/page.h> | 28 | #include <asm/page.h> |
| @@ -72,11 +71,93 @@ enum dma_transaction_type { | |||
| 72 | DMA_ASYNC_TX, | 71 | DMA_ASYNC_TX, |
| 73 | DMA_SLAVE, | 72 | DMA_SLAVE, |
| 74 | DMA_CYCLIC, | 73 | DMA_CYCLIC, |
| 74 | DMA_INTERLEAVE, | ||
| 75 | /* last transaction type for creation of the capabilities mask */ | ||
| 76 | DMA_TX_TYPE_END, | ||
| 75 | }; | 77 | }; |
| 76 | 78 | ||
| 77 | /* last transaction type for creation of the capabilities mask */ | 79 | /** |
| 78 | #define DMA_TX_TYPE_END (DMA_CYCLIC + 1) | 80 | * enum dma_transfer_direction - dma transfer mode and direction indicator |
| 81 | * @DMA_MEM_TO_MEM: Async/Memcpy mode | ||
| 82 | * @DMA_MEM_TO_DEV: Slave mode & From Memory to Device | ||
| 83 | * @DMA_DEV_TO_MEM: Slave mode & From Device to Memory | ||
| 84 | * @DMA_DEV_TO_DEV: Slave mode & From Device to Device | ||
| 85 | */ | ||
| 86 | enum dma_transfer_direction { | ||
| 87 | DMA_MEM_TO_MEM, | ||
| 88 | DMA_MEM_TO_DEV, | ||
| 89 | DMA_DEV_TO_MEM, | ||
| 90 | DMA_DEV_TO_DEV, | ||
| 91 | DMA_TRANS_NONE, | ||
| 92 | }; | ||
| 93 | |||
| 94 | /** | ||
| 95 | * Interleaved Transfer Request | ||
| 96 | * ---------------------------- | ||
| 97 | * A chunk is collection of contiguous bytes to be transfered. | ||
| 98 | * The gap(in bytes) between two chunks is called inter-chunk-gap(ICG). | ||
| 99 | * ICGs may or maynot change between chunks. | ||
| 100 | * A FRAME is the smallest series of contiguous {chunk,icg} pairs, | ||
| 101 | * that when repeated an integral number of times, specifies the transfer. | ||
| 102 | * A transfer template is specification of a Frame, the number of times | ||
| 103 | * it is to be repeated and other per-transfer attributes. | ||
| 104 | * | ||
| 105 | * Practically, a client driver would have ready a template for each | ||
| 106 | * type of transfer it is going to need during its lifetime and | ||
| 107 | * set only 'src_start' and 'dst_start' before submitting the requests. | ||
| 108 | * | ||
| 109 | * | ||
| 110 | * | Frame-1 | Frame-2 | ~ | Frame-'numf' | | ||
| 111 | * |====....==.===...=...|====....==.===...=...| ~ |====....==.===...=...| | ||
| 112 | * | ||
| 113 | * == Chunk size | ||
| 114 | * ... ICG | ||
| 115 | */ | ||
| 116 | |||
| 117 | /** | ||
| 118 | * struct data_chunk - Element of scatter-gather list that makes a frame. | ||
| 119 | * @size: Number of bytes to read from source. | ||
| 120 | * size_dst := fn(op, size_src), so doesn't mean much for destination. | ||
| 121 | * @icg: Number of bytes to jump after last src/dst address of this | ||
| 122 | * chunk and before first src/dst address for next chunk. | ||
| 123 | * Ignored for dst(assumed 0), if dst_inc is true and dst_sgl is false. | ||
| 124 | * Ignored for src(assumed 0), if src_inc is true and src_sgl is false. | ||
| 125 | */ | ||
| 126 | struct data_chunk { | ||
| 127 | size_t size; | ||
| 128 | size_t icg; | ||
| 129 | }; | ||
| 79 | 130 | ||
| 131 | /** | ||
| 132 | * struct dma_interleaved_template - Template to convey DMAC the transfer pattern | ||
| 133 | * and attributes. | ||
| 134 | * @src_start: Bus address of source for the first chunk. | ||
| 135 | * @dst_start: Bus address of destination for the first chunk. | ||
| 136 | * @dir: Specifies the type of Source and Destination. | ||
| 137 | * @src_inc: If the source address increments after reading from it. | ||
| 138 | * @dst_inc: If the destination address increments after writing to it. | ||
| 139 | * @src_sgl: If the 'icg' of sgl[] applies to Source (scattered read). | ||
| 140 | * Otherwise, source is read contiguously (icg ignored). | ||
| 141 | * Ignored if src_inc is false. | ||
| 142 | * @dst_sgl: If the 'icg' of sgl[] applies to Destination (scattered write). | ||
| 143 | * Otherwise, destination is filled contiguously (icg ignored). | ||
| 144 | * Ignored if dst_inc is false. | ||
| 145 | * @numf: Number of frames in this template. | ||
| 146 | * @frame_size: Number of chunks in a frame i.e, size of sgl[]. | ||
| 147 | * @sgl: Array of {chunk,icg} pairs that make up a frame. | ||
| 148 | */ | ||
| 149 | struct dma_interleaved_template { | ||
| 150 | dma_addr_t src_start; | ||
| 151 | dma_addr_t dst_start; | ||
| 152 | enum dma_transfer_direction dir; | ||
| 153 | bool src_inc; | ||
| 154 | bool dst_inc; | ||
| 155 | bool src_sgl; | ||
| 156 | bool dst_sgl; | ||
| 157 | size_t numf; | ||
| 158 | size_t frame_size; | ||
| 159 | struct data_chunk sgl[0]; | ||
| 160 | }; | ||
| 80 | 161 | ||
| 81 | /** | 162 | /** |
| 82 | * enum dma_ctrl_flags - DMA flags to augment operation preparation, | 163 | * enum dma_ctrl_flags - DMA flags to augment operation preparation, |
| @@ -269,7 +350,7 @@ enum dma_slave_buswidth { | |||
| 269 | * struct, if applicable. | 350 | * struct, if applicable. |
| 270 | */ | 351 | */ |
| 271 | struct dma_slave_config { | 352 | struct dma_slave_config { |
| 272 | enum dma_data_direction direction; | 353 | enum dma_transfer_direction direction; |
| 273 | dma_addr_t src_addr; | 354 | dma_addr_t src_addr; |
| 274 | dma_addr_t dst_addr; | 355 | dma_addr_t dst_addr; |
| 275 | enum dma_slave_buswidth src_addr_width; | 356 | enum dma_slave_buswidth src_addr_width; |
| @@ -433,6 +514,7 @@ struct dma_tx_state { | |||
| 433 | * @device_prep_dma_cyclic: prepare a cyclic dma operation suitable for audio. | 514 | * @device_prep_dma_cyclic: prepare a cyclic dma operation suitable for audio. |
| 434 | * The function takes a buffer of size buf_len. The callback function will | 515 | * The function takes a buffer of size buf_len. The callback function will |
| 435 | * be called after period_len bytes have been transferred. | 516 | * be called after period_len bytes have been transferred. |
| 517 | * @device_prep_interleaved_dma: Transfer expression in a generic way. | ||
| 436 | * @device_control: manipulate all pending operations on a channel, returns | 518 | * @device_control: manipulate all pending operations on a channel, returns |
| 437 | * zero or error code | 519 | * zero or error code |
| 438 | * @device_tx_status: poll for transaction completion, the optional | 520 | * @device_tx_status: poll for transaction completion, the optional |
| @@ -492,11 +574,14 @@ struct dma_device { | |||
| 492 | 574 | ||
| 493 | struct dma_async_tx_descriptor *(*device_prep_slave_sg)( | 575 | struct dma_async_tx_descriptor *(*device_prep_slave_sg)( |
| 494 | struct dma_chan *chan, struct scatterlist *sgl, | 576 | struct dma_chan *chan, struct scatterlist *sgl, |
| 495 | unsigned int sg_len, enum dma_data_direction direction, | 577 | unsigned int sg_len, enum dma_transfer_direction direction, |
| 496 | unsigned long flags); | 578 | unsigned long flags); |
| 497 | struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)( | 579 | struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)( |
| 498 | struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, | 580 | struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, |
| 499 | size_t period_len, enum dma_data_direction direction); | 581 | size_t period_len, enum dma_transfer_direction direction); |
| 582 | struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)( | ||
| 583 | struct dma_chan *chan, struct dma_interleaved_template *xt, | ||
| 584 | unsigned long flags); | ||
| 500 | int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd, | 585 | int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd, |
| 501 | unsigned long arg); | 586 | unsigned long arg); |
| 502 | 587 | ||
| @@ -522,7 +607,7 @@ static inline int dmaengine_slave_config(struct dma_chan *chan, | |||
| 522 | 607 | ||
| 523 | static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single( | 608 | static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single( |
| 524 | struct dma_chan *chan, void *buf, size_t len, | 609 | struct dma_chan *chan, void *buf, size_t len, |
| 525 | enum dma_data_direction dir, unsigned long flags) | 610 | enum dma_transfer_direction dir, unsigned long flags) |
| 526 | { | 611 | { |
| 527 | struct scatterlist sg; | 612 | struct scatterlist sg; |
| 528 | sg_init_one(&sg, buf, len); | 613 | sg_init_one(&sg, buf, len); |
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index 1b1094c35e4f..cb4428ab81ed 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h | |||
| @@ -72,7 +72,7 @@ typedef enum fe_caps { | |||
| 72 | 72 | ||
| 73 | struct dvb_frontend_info { | 73 | struct dvb_frontend_info { |
| 74 | char name[128]; | 74 | char name[128]; |
| 75 | fe_type_t type; | 75 | fe_type_t type; /* DEPRECATED. Use DTV_ENUM_DELSYS instead */ |
| 76 | __u32 frequency_min; | 76 | __u32 frequency_min; |
| 77 | __u32 frequency_max; | 77 | __u32 frequency_max; |
| 78 | __u32 frequency_stepsize; | 78 | __u32 frequency_stepsize; |
| @@ -181,6 +181,7 @@ typedef enum fe_transmit_mode { | |||
| 181 | TRANSMISSION_MODE_32K, | 181 | TRANSMISSION_MODE_32K, |
| 182 | } fe_transmit_mode_t; | 182 | } fe_transmit_mode_t; |
| 183 | 183 | ||
| 184 | #if defined(__DVB_CORE__) || !defined (__KERNEL__) | ||
| 184 | typedef enum fe_bandwidth { | 185 | typedef enum fe_bandwidth { |
| 185 | BANDWIDTH_8_MHZ, | 186 | BANDWIDTH_8_MHZ, |
| 186 | BANDWIDTH_7_MHZ, | 187 | BANDWIDTH_7_MHZ, |
| @@ -190,7 +191,7 @@ typedef enum fe_bandwidth { | |||
| 190 | BANDWIDTH_10_MHZ, | 191 | BANDWIDTH_10_MHZ, |
| 191 | BANDWIDTH_1_712_MHZ, | 192 | BANDWIDTH_1_712_MHZ, |
| 192 | } fe_bandwidth_t; | 193 | } fe_bandwidth_t; |
| 193 | 194 | #endif | |
| 194 | 195 | ||
| 195 | typedef enum fe_guard_interval { | 196 | typedef enum fe_guard_interval { |
| 196 | GUARD_INTERVAL_1_32, | 197 | GUARD_INTERVAL_1_32, |
| @@ -213,6 +214,7 @@ typedef enum fe_hierarchy { | |||
| 213 | } fe_hierarchy_t; | 214 | } fe_hierarchy_t; |
| 214 | 215 | ||
| 215 | 216 | ||
| 217 | #if defined(__DVB_CORE__) || !defined (__KERNEL__) | ||
| 216 | struct dvb_qpsk_parameters { | 218 | struct dvb_qpsk_parameters { |
| 217 | __u32 symbol_rate; /* symbol rate in Symbols per second */ | 219 | __u32 symbol_rate; /* symbol rate in Symbols per second */ |
| 218 | fe_code_rate_t fec_inner; /* forward error correction (see above) */ | 220 | fe_code_rate_t fec_inner; /* forward error correction (see above) */ |
| @@ -251,11 +253,11 @@ struct dvb_frontend_parameters { | |||
| 251 | } u; | 253 | } u; |
| 252 | }; | 254 | }; |
| 253 | 255 | ||
| 254 | |||
| 255 | struct dvb_frontend_event { | 256 | struct dvb_frontend_event { |
| 256 | fe_status_t status; | 257 | fe_status_t status; |
| 257 | struct dvb_frontend_parameters parameters; | 258 | struct dvb_frontend_parameters parameters; |
| 258 | }; | 259 | }; |
| 260 | #endif | ||
| 259 | 261 | ||
| 260 | /* S2API Commands */ | 262 | /* S2API Commands */ |
| 261 | #define DTV_UNDEFINED 0 | 263 | #define DTV_UNDEFINED 0 |
| @@ -316,7 +318,9 @@ struct dvb_frontend_event { | |||
| 316 | 318 | ||
| 317 | #define DTV_DVBT2_PLP_ID 43 | 319 | #define DTV_DVBT2_PLP_ID 43 |
| 318 | 320 | ||
| 319 | #define DTV_MAX_COMMAND DTV_DVBT2_PLP_ID | 321 | #define DTV_ENUM_DELSYS 44 |
| 322 | |||
| 323 | #define DTV_MAX_COMMAND DTV_ENUM_DELSYS | ||
| 320 | 324 | ||
| 321 | typedef enum fe_pilot { | 325 | typedef enum fe_pilot { |
| 322 | PILOT_ON, | 326 | PILOT_ON, |
| @@ -333,7 +337,7 @@ typedef enum fe_rolloff { | |||
| 333 | 337 | ||
| 334 | typedef enum fe_delivery_system { | 338 | typedef enum fe_delivery_system { |
| 335 | SYS_UNDEFINED, | 339 | SYS_UNDEFINED, |
| 336 | SYS_DVBC_ANNEX_AC, | 340 | SYS_DVBC_ANNEX_A, |
| 337 | SYS_DVBC_ANNEX_B, | 341 | SYS_DVBC_ANNEX_B, |
| 338 | SYS_DVBT, | 342 | SYS_DVBT, |
| 339 | SYS_DSS, | 343 | SYS_DSS, |
| @@ -350,8 +354,13 @@ typedef enum fe_delivery_system { | |||
| 350 | SYS_DAB, | 354 | SYS_DAB, |
| 351 | SYS_DVBT2, | 355 | SYS_DVBT2, |
| 352 | SYS_TURBO, | 356 | SYS_TURBO, |
| 357 | SYS_DVBC_ANNEX_C, | ||
| 353 | } fe_delivery_system_t; | 358 | } fe_delivery_system_t; |
| 354 | 359 | ||
| 360 | |||
| 361 | #define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A | ||
| 362 | |||
| 363 | |||
| 355 | struct dtv_cmds_h { | 364 | struct dtv_cmds_h { |
| 356 | char *name; /* A display name for debugging purposes */ | 365 | char *name; /* A display name for debugging purposes */ |
| 357 | 366 | ||
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h index 66594b1d5d7b..0559e2bd38f9 100644 --- a/include/linux/dvb/version.h +++ b/include/linux/dvb/version.h | |||
| @@ -24,6 +24,6 @@ | |||
| 24 | #define _DVBVERSION_H_ | 24 | #define _DVBVERSION_H_ |
| 25 | 25 | ||
| 26 | #define DVB_API_VERSION 5 | 26 | #define DVB_API_VERSION 5 |
| 27 | #define DVB_API_VERSION_MINOR 4 | 27 | #define DVB_API_VERSION_MINOR 5 |
| 28 | 28 | ||
| 29 | #endif /*_DVBVERSION_H_*/ | 29 | #endif /*_DVBVERSION_H_*/ |
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h index 4bfe0a2f7d50..f2c64f92c4a0 100644 --- a/include/linux/dw_dmac.h +++ b/include/linux/dw_dmac.h | |||
| @@ -127,7 +127,7 @@ struct dw_cyclic_desc { | |||
| 127 | 127 | ||
| 128 | struct dw_cyclic_desc *dw_dma_cyclic_prep(struct dma_chan *chan, | 128 | struct dw_cyclic_desc *dw_dma_cyclic_prep(struct dma_chan *chan, |
| 129 | dma_addr_t buf_addr, size_t buf_len, size_t period_len, | 129 | dma_addr_t buf_addr, size_t buf_len, size_t period_len, |
| 130 | enum dma_data_direction direction); | 130 | enum dma_transfer_direction direction); |
| 131 | void dw_dma_cyclic_free(struct dma_chan *chan); | 131 | void dw_dma_cyclic_free(struct dma_chan *chan); |
| 132 | int dw_dma_cyclic_start(struct dma_chan *chan); | 132 | int dw_dma_cyclic_start(struct dma_chan *chan); |
| 133 | void dw_dma_cyclic_stop(struct dma_chan *chan); | 133 | void dw_dma_cyclic_stop(struct dma_chan *chan); |
diff --git a/include/linux/efi.h b/include/linux/efi.h index 2362a0bc7f0d..37c300712e02 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
| @@ -109,6 +109,14 @@ typedef struct { | |||
| 109 | u32 imagesize; | 109 | u32 imagesize; |
| 110 | } efi_capsule_header_t; | 110 | } efi_capsule_header_t; |
| 111 | 111 | ||
| 112 | /* | ||
| 113 | * Allocation types for calls to boottime->allocate_pages. | ||
| 114 | */ | ||
| 115 | #define EFI_ALLOCATE_ANY_PAGES 0 | ||
| 116 | #define EFI_ALLOCATE_MAX_ADDRESS 1 | ||
| 117 | #define EFI_ALLOCATE_ADDRESS 2 | ||
| 118 | #define EFI_MAX_ALLOCATE_TYPE 3 | ||
| 119 | |||
| 112 | typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg); | 120 | typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg); |
| 113 | 121 | ||
| 114 | /* | 122 | /* |
| @@ -139,6 +147,57 @@ typedef struct { | |||
| 139 | } efi_time_cap_t; | 147 | } efi_time_cap_t; |
| 140 | 148 | ||
| 141 | /* | 149 | /* |
| 150 | * EFI Boot Services table | ||
| 151 | */ | ||
| 152 | typedef struct { | ||
| 153 | efi_table_hdr_t hdr; | ||
| 154 | void *raise_tpl; | ||
| 155 | void *restore_tpl; | ||
| 156 | void *allocate_pages; | ||
| 157 | void *free_pages; | ||
| 158 | void *get_memory_map; | ||
| 159 | void *allocate_pool; | ||
| 160 | void *free_pool; | ||
| 161 | void *create_event; | ||
| 162 | void *set_timer; | ||
| 163 | void *wait_for_event; | ||
| 164 | void *signal_event; | ||
| 165 | void *close_event; | ||
| 166 | void *check_event; | ||
| 167 | void *install_protocol_interface; | ||
| 168 | void *reinstall_protocol_interface; | ||
| 169 | void *uninstall_protocol_interface; | ||
| 170 | void *handle_protocol; | ||
| 171 | void *__reserved; | ||
| 172 | void *register_protocol_notify; | ||
| 173 | void *locate_handle; | ||
| 174 | void *locate_device_path; | ||
| 175 | void *install_configuration_table; | ||
| 176 | void *load_image; | ||
| 177 | void *start_image; | ||
| 178 | void *exit; | ||
| 179 | void *unload_image; | ||
| 180 | void *exit_boot_services; | ||
| 181 | void *get_next_monotonic_count; | ||
| 182 | void *stall; | ||
| 183 | void *set_watchdog_timer; | ||
| 184 | void *connect_controller; | ||
| 185 | void *disconnect_controller; | ||
| 186 | void *open_protocol; | ||
| 187 | void *close_protocol; | ||
| 188 | void *open_protocol_information; | ||
| 189 | void *protocols_per_handle; | ||
| 190 | void *locate_handle_buffer; | ||
| 191 | void *locate_protocol; | ||
| 192 | void *install_multiple_protocol_interfaces; | ||
| 193 | void *uninstall_multiple_protocol_interfaces; | ||
| 194 | void *calculate_crc32; | ||
| 195 | void *copy_mem; | ||
| 196 | void *set_mem; | ||
| 197 | void *create_event_ex; | ||
| 198 | } efi_boot_services_t; | ||
| 199 | |||
| 200 | /* | ||
| 142 | * Types and defines for EFI ResetSystem | 201 | * Types and defines for EFI ResetSystem |
| 143 | */ | 202 | */ |
| 144 | #define EFI_RESET_COLD 0 | 203 | #define EFI_RESET_COLD 0 |
| @@ -236,6 +295,24 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules, | |||
| 236 | #define LINUX_EFI_CRASH_GUID \ | 295 | #define LINUX_EFI_CRASH_GUID \ |
| 237 | EFI_GUID( 0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0 ) | 296 | EFI_GUID( 0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0 ) |
| 238 | 297 | ||
| 298 | #define LOADED_IMAGE_PROTOCOL_GUID \ | ||
| 299 | EFI_GUID( 0x5b1b31a1, 0x9562, 0x11d2, 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b ) | ||
| 300 | |||
| 301 | #define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ | ||
| 302 | EFI_GUID( 0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a ) | ||
| 303 | |||
| 304 | #define EFI_UGA_PROTOCOL_GUID \ | ||
| 305 | EFI_GUID( 0x982c298b, 0xf4fa, 0x41cb, 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 ) | ||
| 306 | |||
| 307 | #define EFI_PCI_IO_PROTOCOL_GUID \ | ||
| 308 | EFI_GUID( 0x4cf5b200, 0x68b8, 0x4ca5, 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a ) | ||
| 309 | |||
| 310 | #define EFI_FILE_INFO_ID \ | ||
| 311 | EFI_GUID( 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b ) | ||
| 312 | |||
| 313 | #define EFI_FILE_SYSTEM_GUID \ | ||
| 314 | EFI_GUID( 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b ) | ||
| 315 | |||
| 239 | typedef struct { | 316 | typedef struct { |
| 240 | efi_guid_t guid; | 317 | efi_guid_t guid; |
| 241 | unsigned long table; | 318 | unsigned long table; |
| @@ -261,7 +338,7 @@ typedef struct { | |||
| 261 | unsigned long stderr_handle; | 338 | unsigned long stderr_handle; |
| 262 | unsigned long stderr; | 339 | unsigned long stderr; |
| 263 | efi_runtime_services_t *runtime; | 340 | efi_runtime_services_t *runtime; |
| 264 | unsigned long boottime; | 341 | efi_boot_services_t *boottime; |
| 265 | unsigned long nr_tables; | 342 | unsigned long nr_tables; |
| 266 | unsigned long tables; | 343 | unsigned long tables; |
| 267 | } efi_system_table_t; | 344 | } efi_system_table_t; |
| @@ -275,6 +352,56 @@ struct efi_memory_map { | |||
| 275 | unsigned long desc_size; | 352 | unsigned long desc_size; |
| 276 | }; | 353 | }; |
| 277 | 354 | ||
| 355 | typedef struct { | ||
| 356 | u32 revision; | ||
| 357 | void *parent_handle; | ||
| 358 | efi_system_table_t *system_table; | ||
| 359 | void *device_handle; | ||
| 360 | void *file_path; | ||
| 361 | void *reserved; | ||
| 362 | u32 load_options_size; | ||
| 363 | void *load_options; | ||
| 364 | void *image_base; | ||
| 365 | __aligned_u64 image_size; | ||
| 366 | unsigned int image_code_type; | ||
| 367 | unsigned int image_data_type; | ||
| 368 | unsigned long unload; | ||
| 369 | } efi_loaded_image_t; | ||
| 370 | |||
| 371 | typedef struct { | ||
| 372 | u64 revision; | ||
| 373 | void *open_volume; | ||
| 374 | } efi_file_io_interface_t; | ||
| 375 | |||
| 376 | typedef struct { | ||
| 377 | u64 size; | ||
| 378 | u64 file_size; | ||
| 379 | u64 phys_size; | ||
| 380 | efi_time_t create_time; | ||
| 381 | efi_time_t last_access_time; | ||
| 382 | efi_time_t modification_time; | ||
| 383 | __aligned_u64 attribute; | ||
| 384 | efi_char16_t filename[1]; | ||
| 385 | } efi_file_info_t; | ||
| 386 | |||
| 387 | typedef struct { | ||
| 388 | u64 revision; | ||
| 389 | void *open; | ||
| 390 | void *close; | ||
| 391 | void *delete; | ||
| 392 | void *read; | ||
| 393 | void *write; | ||
| 394 | void *get_position; | ||
| 395 | void *set_position; | ||
| 396 | void *get_info; | ||
| 397 | void *set_info; | ||
| 398 | void *flush; | ||
| 399 | } efi_file_handle_t; | ||
| 400 | |||
| 401 | #define EFI_FILE_MODE_READ 0x0000000000000001 | ||
| 402 | #define EFI_FILE_MODE_WRITE 0x0000000000000002 | ||
| 403 | #define EFI_FILE_MODE_CREATE 0x8000000000000000 | ||
| 404 | |||
| 278 | #define EFI_INVALID_TABLE_ADDR (~0UL) | 405 | #define EFI_INVALID_TABLE_ADDR (~0UL) |
| 279 | 406 | ||
| 280 | /* | 407 | /* |
| @@ -385,6 +512,13 @@ extern int __init efi_setup_pcdp_console(char *); | |||
| 385 | #define EFI_VARIABLE_RUNTIME_ACCESS 0x0000000000000004 | 512 | #define EFI_VARIABLE_RUNTIME_ACCESS 0x0000000000000004 |
| 386 | 513 | ||
| 387 | /* | 514 | /* |
| 515 | * The type of search to perform when calling boottime->locate_handle | ||
| 516 | */ | ||
| 517 | #define EFI_LOCATE_ALL_HANDLES 0 | ||
| 518 | #define EFI_LOCATE_BY_REGISTER_NOTIFY 1 | ||
| 519 | #define EFI_LOCATE_BY_PROTOCOL 2 | ||
| 520 | |||
| 521 | /* | ||
| 388 | * EFI Device Path information | 522 | * EFI Device Path information |
| 389 | */ | 523 | */ |
| 390 | #define EFI_DEV_HW 0x01 | 524 | #define EFI_DEV_HW 0x01 |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 1d0f7a2ff73b..c24f3d7fbf1e 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
| @@ -5,6 +5,8 @@ | |||
| 5 | 5 | ||
| 6 | #ifdef CONFIG_BLOCK | 6 | #ifdef CONFIG_BLOCK |
| 7 | 7 | ||
| 8 | struct io_cq; | ||
| 9 | |||
| 8 | typedef int (elevator_merge_fn) (struct request_queue *, struct request **, | 10 | typedef int (elevator_merge_fn) (struct request_queue *, struct request **, |
| 9 | struct bio *); | 11 | struct bio *); |
| 10 | 12 | ||
| @@ -24,6 +26,8 @@ typedef struct request *(elevator_request_list_fn) (struct request_queue *, stru | |||
| 24 | typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *); | 26 | typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *); |
| 25 | typedef int (elevator_may_queue_fn) (struct request_queue *, int); | 27 | typedef int (elevator_may_queue_fn) (struct request_queue *, int); |
| 26 | 28 | ||
| 29 | typedef void (elevator_init_icq_fn) (struct io_cq *); | ||
| 30 | typedef void (elevator_exit_icq_fn) (struct io_cq *); | ||
| 27 | typedef int (elevator_set_req_fn) (struct request_queue *, struct request *, gfp_t); | 31 | typedef int (elevator_set_req_fn) (struct request_queue *, struct request *, gfp_t); |
| 28 | typedef void (elevator_put_req_fn) (struct request *); | 32 | typedef void (elevator_put_req_fn) (struct request *); |
| 29 | typedef void (elevator_activate_req_fn) (struct request_queue *, struct request *); | 33 | typedef void (elevator_activate_req_fn) (struct request_queue *, struct request *); |
| @@ -56,6 +60,9 @@ struct elevator_ops | |||
| 56 | elevator_request_list_fn *elevator_former_req_fn; | 60 | elevator_request_list_fn *elevator_former_req_fn; |
| 57 | elevator_request_list_fn *elevator_latter_req_fn; | 61 | elevator_request_list_fn *elevator_latter_req_fn; |
| 58 | 62 | ||
| 63 | elevator_init_icq_fn *elevator_init_icq_fn; /* see iocontext.h */ | ||
| 64 | elevator_exit_icq_fn *elevator_exit_icq_fn; /* ditto */ | ||
| 65 | |||
| 59 | elevator_set_req_fn *elevator_set_req_fn; | 66 | elevator_set_req_fn *elevator_set_req_fn; |
| 60 | elevator_put_req_fn *elevator_put_req_fn; | 67 | elevator_put_req_fn *elevator_put_req_fn; |
| 61 | 68 | ||
| @@ -63,7 +70,6 @@ struct elevator_ops | |||
| 63 | 70 | ||
| 64 | elevator_init_fn *elevator_init_fn; | 71 | elevator_init_fn *elevator_init_fn; |
| 65 | elevator_exit_fn *elevator_exit_fn; | 72 | elevator_exit_fn *elevator_exit_fn; |
| 66 | void (*trim)(struct io_context *); | ||
| 67 | }; | 73 | }; |
| 68 | 74 | ||
| 69 | #define ELV_NAME_MAX (16) | 75 | #define ELV_NAME_MAX (16) |
| @@ -79,11 +85,20 @@ struct elv_fs_entry { | |||
| 79 | */ | 85 | */ |
| 80 | struct elevator_type | 86 | struct elevator_type |
| 81 | { | 87 | { |
| 82 | struct list_head list; | 88 | /* managed by elevator core */ |
| 89 | struct kmem_cache *icq_cache; | ||
| 90 | |||
| 91 | /* fields provided by elevator implementation */ | ||
| 83 | struct elevator_ops ops; | 92 | struct elevator_ops ops; |
| 93 | size_t icq_size; /* see iocontext.h */ | ||
| 94 | size_t icq_align; /* ditto */ | ||
| 84 | struct elv_fs_entry *elevator_attrs; | 95 | struct elv_fs_entry *elevator_attrs; |
| 85 | char elevator_name[ELV_NAME_MAX]; | 96 | char elevator_name[ELV_NAME_MAX]; |
| 86 | struct module *elevator_owner; | 97 | struct module *elevator_owner; |
| 98 | |||
| 99 | /* managed by elevator core */ | ||
| 100 | char icq_cache_name[ELV_NAME_MAX + 5]; /* elvname + "_io_cq" */ | ||
| 101 | struct list_head list; | ||
| 87 | }; | 102 | }; |
| 88 | 103 | ||
| 89 | /* | 104 | /* |
| @@ -91,10 +106,9 @@ struct elevator_type | |||
| 91 | */ | 106 | */ |
| 92 | struct elevator_queue | 107 | struct elevator_queue |
| 93 | { | 108 | { |
| 94 | struct elevator_ops *ops; | 109 | struct elevator_type *type; |
| 95 | void *elevator_data; | 110 | void *elevator_data; |
| 96 | struct kobject kobj; | 111 | struct kobject kobj; |
| 97 | struct elevator_type *elevator_type; | ||
| 98 | struct mutex sysfs_lock; | 112 | struct mutex sysfs_lock; |
| 99 | struct hlist_head *hash; | 113 | struct hlist_head *hash; |
| 100 | unsigned int registered:1; | 114 | unsigned int registered:1; |
| @@ -129,7 +143,7 @@ extern void elv_drain_elevator(struct request_queue *); | |||
| 129 | /* | 143 | /* |
| 130 | * io scheduler registration | 144 | * io scheduler registration |
| 131 | */ | 145 | */ |
| 132 | extern void elv_register(struct elevator_type *); | 146 | extern int elv_register(struct elevator_type *); |
| 133 | extern void elv_unregister(struct elevator_type *); | 147 | extern void elv_unregister(struct elevator_type *); |
| 134 | 148 | ||
| 135 | /* | 149 | /* |
| @@ -197,22 +211,5 @@ enum { | |||
| 197 | INIT_LIST_HEAD(&(rq)->csd.list); \ | 211 | INIT_LIST_HEAD(&(rq)->csd.list); \ |
| 198 | } while (0) | 212 | } while (0) |
| 199 | 213 | ||
| 200 | /* | ||
| 201 | * io context count accounting | ||
| 202 | */ | ||
| 203 | #define elv_ioc_count_mod(name, __val) this_cpu_add(name, __val) | ||
| 204 | #define elv_ioc_count_inc(name) this_cpu_inc(name) | ||
| 205 | #define elv_ioc_count_dec(name) this_cpu_dec(name) | ||
| 206 | |||
| 207 | #define elv_ioc_count_read(name) \ | ||
| 208 | ({ \ | ||
| 209 | unsigned long __val = 0; \ | ||
| 210 | int __cpu; \ | ||
| 211 | smp_wmb(); \ | ||
| 212 | for_each_possible_cpu(__cpu) \ | ||
| 213 | __val += per_cpu(name, __cpu); \ | ||
| 214 | __val; \ | ||
| 215 | }) | ||
| 216 | |||
| 217 | #endif /* CONFIG_BLOCK */ | 214 | #endif /* CONFIG_BLOCK */ |
| 218 | #endif | 215 | #endif |
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h index 18bea78fe47b..8e2b7bac4378 100644 --- a/include/linux/elf-em.h +++ b/include/linux/elf-em.h | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #define EM_H8_300 46 /* Renesas H8/300,300H,H8S */ | 33 | #define EM_H8_300 46 /* Renesas H8/300,300H,H8S */ |
| 34 | #define EM_MN10300 89 /* Panasonic/MEI MN10300, AM33 */ | 34 | #define EM_MN10300 89 /* Panasonic/MEI MN10300, AM33 */ |
| 35 | #define EM_BLACKFIN 106 /* ADI Blackfin Processor */ | 35 | #define EM_BLACKFIN 106 /* ADI Blackfin Processor */ |
| 36 | #define EM_TI_C6000 140 /* TI C6X DSPs */ | ||
| 36 | #define EM_FRV 0x5441 /* Fujitsu FR-V */ | 37 | #define EM_FRV 0x5441 /* Fujitsu FR-V */ |
| 37 | #define EM_AVR32 0x18ad /* Atmel AVR32 */ | 38 | #define EM_AVR32 0x18ad /* Atmel AVR32 */ |
| 38 | 39 | ||
diff --git a/include/linux/elf.h b/include/linux/elf.h index 31f0508d7da7..999b4f52e8e5 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
| @@ -7,15 +7,6 @@ | |||
| 7 | #include <asm/elf.h> | 7 | #include <asm/elf.h> |
| 8 | #endif | 8 | #endif |
| 9 | 9 | ||
| 10 | struct file; | ||
| 11 | |||
| 12 | #ifndef elf_read_implies_exec | ||
| 13 | /* Executables for which elf_read_implies_exec() returns TRUE will | ||
| 14 | have the READ_IMPLIES_EXEC personality flag set automatically. | ||
| 15 | Override in asm/elf.h as needed. */ | ||
| 16 | # define elf_read_implies_exec(ex, have_pt_gnu_stack) 0 | ||
| 17 | #endif | ||
| 18 | |||
| 19 | /* 32-bit ELF base types. */ | 10 | /* 32-bit ELF base types. */ |
| 20 | typedef __u32 Elf32_Addr; | 11 | typedef __u32 Elf32_Addr; |
| 21 | typedef __u16 Elf32_Half; | 12 | typedef __u16 Elf32_Half; |
| @@ -414,6 +405,13 @@ typedef struct elf64_note { | |||
| 414 | } Elf64_Nhdr; | 405 | } Elf64_Nhdr; |
| 415 | 406 | ||
| 416 | #ifdef __KERNEL__ | 407 | #ifdef __KERNEL__ |
| 408 | #ifndef elf_read_implies_exec | ||
| 409 | /* Executables for which elf_read_implies_exec() returns TRUE will | ||
| 410 | have the READ_IMPLIES_EXEC personality flag set automatically. | ||
| 411 | Override in asm/elf.h as needed. */ | ||
| 412 | # define elf_read_implies_exec(ex, have_pt_gnu_stack) 0 | ||
| 413 | #endif | ||
| 414 | |||
| 417 | #if ELF_CLASS == ELFCLASS32 | 415 | #if ELF_CLASS == ELFCLASS32 |
| 418 | 416 | ||
| 419 | extern Elf32_Dyn _DYNAMIC []; | 417 | extern Elf32_Dyn _DYNAMIC []; |
| @@ -437,6 +435,8 @@ extern Elf64_Dyn _DYNAMIC []; | |||
| 437 | #endif | 435 | #endif |
| 438 | 436 | ||
| 439 | /* Optional callbacks to write extra ELF notes. */ | 437 | /* Optional callbacks to write extra ELF notes. */ |
| 438 | struct file; | ||
| 439 | |||
| 440 | #ifndef ARCH_HAVE_EXTRA_ELF_NOTES | 440 | #ifndef ARCH_HAVE_EXTRA_ELF_NOTES |
| 441 | static inline int elf_coredump_extra_notes_size(void) { return 0; } | 441 | static inline int elf_coredump_extra_notes_size(void) { return 0; } |
| 442 | static inline int elf_coredump_extra_notes_write(struct file *file, | 442 | static inline int elf_coredump_extra_notes_write(struct file *file, |
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h index f362733186a5..657ab55beda0 100644 --- a/include/linux/eventpoll.h +++ b/include/linux/eventpoll.h | |||
| @@ -61,6 +61,7 @@ struct file; | |||
| 61 | static inline void eventpoll_init_file(struct file *file) | 61 | static inline void eventpoll_init_file(struct file *file) |
| 62 | { | 62 | { |
| 63 | INIT_LIST_HEAD(&file->f_ep_links); | 63 | INIT_LIST_HEAD(&file->f_ep_links); |
| 64 | INIT_LIST_HEAD(&file->f_tfile_llink); | ||
| 64 | } | 65 | } |
| 65 | 66 | ||
| 66 | 67 | ||
diff --git a/include/linux/fb.h b/include/linux/fb.h index 1d6836c498dd..c18122f40543 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
| @@ -45,6 +45,7 @@ | |||
| 45 | #define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */ | 45 | #define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */ |
| 46 | #define FB_TYPE_TEXT 3 /* Text/attributes */ | 46 | #define FB_TYPE_TEXT 3 /* Text/attributes */ |
| 47 | #define FB_TYPE_VGA_PLANES 4 /* EGA/VGA planes */ | 47 | #define FB_TYPE_VGA_PLANES 4 /* EGA/VGA planes */ |
| 48 | #define FB_TYPE_FOURCC 5 /* Type identified by a V4L2 FOURCC */ | ||
| 48 | 49 | ||
| 49 | #define FB_AUX_TEXT_MDA 0 /* Monochrome text */ | 50 | #define FB_AUX_TEXT_MDA 0 /* Monochrome text */ |
| 50 | #define FB_AUX_TEXT_CGA 1 /* CGA/EGA/VGA Color text */ | 51 | #define FB_AUX_TEXT_CGA 1 /* CGA/EGA/VGA Color text */ |
| @@ -69,6 +70,7 @@ | |||
| 69 | #define FB_VISUAL_PSEUDOCOLOR 3 /* Pseudo color (like atari) */ | 70 | #define FB_VISUAL_PSEUDOCOLOR 3 /* Pseudo color (like atari) */ |
| 70 | #define FB_VISUAL_DIRECTCOLOR 4 /* Direct color */ | 71 | #define FB_VISUAL_DIRECTCOLOR 4 /* Direct color */ |
| 71 | #define FB_VISUAL_STATIC_PSEUDOCOLOR 5 /* Pseudo color readonly */ | 72 | #define FB_VISUAL_STATIC_PSEUDOCOLOR 5 /* Pseudo color readonly */ |
| 73 | #define FB_VISUAL_FOURCC 6 /* Visual identified by a V4L2 FOURCC */ | ||
| 72 | 74 | ||
| 73 | #define FB_ACCEL_NONE 0 /* no hardware accelerator */ | 75 | #define FB_ACCEL_NONE 0 /* no hardware accelerator */ |
| 74 | #define FB_ACCEL_ATARIBLITT 1 /* Atari Blitter */ | 76 | #define FB_ACCEL_ATARIBLITT 1 /* Atari Blitter */ |
| @@ -154,6 +156,8 @@ | |||
| 154 | 156 | ||
| 155 | #define FB_ACCEL_PUV3_UNIGFX 0xa0 /* PKUnity-v3 Unigfx */ | 157 | #define FB_ACCEL_PUV3_UNIGFX 0xa0 /* PKUnity-v3 Unigfx */ |
| 156 | 158 | ||
| 159 | #define FB_CAP_FOURCC 1 /* Device supports FOURCC-based formats */ | ||
| 160 | |||
| 157 | struct fb_fix_screeninfo { | 161 | struct fb_fix_screeninfo { |
| 158 | char id[16]; /* identification string eg "TT Builtin" */ | 162 | char id[16]; /* identification string eg "TT Builtin" */ |
| 159 | unsigned long smem_start; /* Start of frame buffer mem */ | 163 | unsigned long smem_start; /* Start of frame buffer mem */ |
| @@ -171,7 +175,8 @@ struct fb_fix_screeninfo { | |||
| 171 | __u32 mmio_len; /* Length of Memory Mapped I/O */ | 175 | __u32 mmio_len; /* Length of Memory Mapped I/O */ |
| 172 | __u32 accel; /* Indicate to driver which */ | 176 | __u32 accel; /* Indicate to driver which */ |
| 173 | /* specific chip/card we have */ | 177 | /* specific chip/card we have */ |
| 174 | __u16 reserved[3]; /* Reserved for future compatibility */ | 178 | __u16 capabilities; /* see FB_CAP_* */ |
| 179 | __u16 reserved[2]; /* Reserved for future compatibility */ | ||
| 175 | }; | 180 | }; |
| 176 | 181 | ||
| 177 | /* Interpretation of offset for color fields: All offsets are from the right, | 182 | /* Interpretation of offset for color fields: All offsets are from the right, |
| @@ -246,8 +251,8 @@ struct fb_var_screeninfo { | |||
| 246 | __u32 yoffset; /* resolution */ | 251 | __u32 yoffset; /* resolution */ |
| 247 | 252 | ||
| 248 | __u32 bits_per_pixel; /* guess what */ | 253 | __u32 bits_per_pixel; /* guess what */ |
| 249 | __u32 grayscale; /* != 0 Graylevels instead of colors */ | 254 | __u32 grayscale; /* 0 = color, 1 = grayscale, */ |
| 250 | 255 | /* >1 = FOURCC */ | |
| 251 | struct fb_bitfield red; /* bitfield in fb mem if true color, */ | 256 | struct fb_bitfield red; /* bitfield in fb mem if true color, */ |
| 252 | struct fb_bitfield green; /* else only length is significant */ | 257 | struct fb_bitfield green; /* else only length is significant */ |
| 253 | struct fb_bitfield blue; | 258 | struct fb_bitfield blue; |
| @@ -273,7 +278,8 @@ struct fb_var_screeninfo { | |||
| 273 | __u32 sync; /* see FB_SYNC_* */ | 278 | __u32 sync; /* see FB_SYNC_* */ |
| 274 | __u32 vmode; /* see FB_VMODE_* */ | 279 | __u32 vmode; /* see FB_VMODE_* */ |
| 275 | __u32 rotate; /* angle we rotate counter clockwise */ | 280 | __u32 rotate; /* angle we rotate counter clockwise */ |
| 276 | __u32 reserved[5]; /* Reserved for future compatibility */ | 281 | __u32 colorspace; /* colorspace for FOURCC-based modes */ |
| 282 | __u32 reserved[4]; /* Reserved for future compatibility */ | ||
| 277 | }; | 283 | }; |
| 278 | 284 | ||
| 279 | struct fb_cmap { | 285 | struct fb_cmap { |
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 7aacf31418fe..386da09f229d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -319,6 +319,7 @@ struct inodes_stat_t { | |||
| 319 | #define BLKPBSZGET _IO(0x12,123) | 319 | #define BLKPBSZGET _IO(0x12,123) |
| 320 | #define BLKDISCARDZEROES _IO(0x12,124) | 320 | #define BLKDISCARDZEROES _IO(0x12,124) |
| 321 | #define BLKSECDISCARD _IO(0x12,125) | 321 | #define BLKSECDISCARD _IO(0x12,125) |
| 322 | #define BLKROTATIONAL _IO(0x12,126) | ||
| 322 | 323 | ||
| 323 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ | 324 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ |
| 324 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 325 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
| @@ -395,6 +396,7 @@ struct inodes_stat_t { | |||
| 395 | #include <linux/rculist_bl.h> | 396 | #include <linux/rculist_bl.h> |
| 396 | #include <linux/atomic.h> | 397 | #include <linux/atomic.h> |
| 397 | #include <linux/shrinker.h> | 398 | #include <linux/shrinker.h> |
| 399 | #include <linux/migrate_mode.h> | ||
| 398 | 400 | ||
| 399 | #include <asm/byteorder.h> | 401 | #include <asm/byteorder.h> |
| 400 | 402 | ||
| @@ -609,9 +611,12 @@ struct address_space_operations { | |||
| 609 | loff_t offset, unsigned long nr_segs); | 611 | loff_t offset, unsigned long nr_segs); |
| 610 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, | 612 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, |
| 611 | void **, unsigned long *); | 613 | void **, unsigned long *); |
| 612 | /* migrate the contents of a page to the specified target */ | 614 | /* |
| 615 | * migrate the contents of a page to the specified target. If sync | ||
| 616 | * is false, it must not block. | ||
| 617 | */ | ||
| 613 | int (*migratepage) (struct address_space *, | 618 | int (*migratepage) (struct address_space *, |
| 614 | struct page *, struct page *); | 619 | struct page *, struct page *, enum migrate_mode); |
| 615 | int (*launder_page) (struct page *); | 620 | int (*launder_page) (struct page *); |
| 616 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, | 621 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, |
| 617 | unsigned long); | 622 | unsigned long); |
| @@ -656,6 +661,7 @@ struct address_space { | |||
| 656 | * must be enforced here for CRIS, to let the least significant bit | 661 | * must be enforced here for CRIS, to let the least significant bit |
| 657 | * of struct page's "mapping" pointer be used for PAGE_MAPPING_ANON. | 662 | * of struct page's "mapping" pointer be used for PAGE_MAPPING_ANON. |
| 658 | */ | 663 | */ |
| 664 | struct request_queue; | ||
| 659 | 665 | ||
| 660 | struct block_device { | 666 | struct block_device { |
| 661 | dev_t bd_dev; /* not a kdev_t - it's a search key */ | 667 | dev_t bd_dev; /* not a kdev_t - it's a search key */ |
| @@ -678,6 +684,7 @@ struct block_device { | |||
| 678 | unsigned bd_part_count; | 684 | unsigned bd_part_count; |
| 679 | int bd_invalidated; | 685 | int bd_invalidated; |
| 680 | struct gendisk * bd_disk; | 686 | struct gendisk * bd_disk; |
| 687 | struct request_queue * bd_queue; | ||
| 681 | struct list_head bd_list; | 688 | struct list_head bd_list; |
| 682 | /* | 689 | /* |
| 683 | * Private data. You must have bd_claim'ed the block_device | 690 | * Private data. You must have bd_claim'ed the block_device |
| @@ -1001,6 +1008,7 @@ struct file { | |||
| 1001 | #ifdef CONFIG_EPOLL | 1008 | #ifdef CONFIG_EPOLL |
| 1002 | /* Used by fs/eventpoll.c to link all the hooks to this file */ | 1009 | /* Used by fs/eventpoll.c to link all the hooks to this file */ |
| 1003 | struct list_head f_ep_links; | 1010 | struct list_head f_ep_links; |
| 1011 | struct list_head f_tfile_llink; | ||
| 1004 | #endif /* #ifdef CONFIG_EPOLL */ | 1012 | #endif /* #ifdef CONFIG_EPOLL */ |
| 1005 | struct address_space *f_mapping; | 1013 | struct address_space *f_mapping; |
| 1006 | #ifdef CONFIG_DEBUG_WRITECOUNT | 1014 | #ifdef CONFIG_DEBUG_WRITECOUNT |
| @@ -2536,7 +2544,8 @@ extern int generic_check_addressable(unsigned, u64); | |||
| 2536 | 2544 | ||
| 2537 | #ifdef CONFIG_MIGRATION | 2545 | #ifdef CONFIG_MIGRATION |
| 2538 | extern int buffer_migrate_page(struct address_space *, | 2546 | extern int buffer_migrate_page(struct address_space *, |
| 2539 | struct page *, struct page *); | 2547 | struct page *, struct page *, |
| 2548 | enum migrate_mode); | ||
| 2540 | #else | 2549 | #else |
| 2541 | #define buffer_migrate_page NULL | 2550 | #define buffer_migrate_page NULL |
| 2542 | #endif | 2551 | #endif |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 26eafcef75be..028e26f0bf08 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
| @@ -133,6 +133,8 @@ struct ftrace_func_command { | |||
| 133 | int ftrace_arch_code_modify_prepare(void); | 133 | int ftrace_arch_code_modify_prepare(void); |
| 134 | int ftrace_arch_code_modify_post_process(void); | 134 | int ftrace_arch_code_modify_post_process(void); |
| 135 | 135 | ||
| 136 | void ftrace_bug(int err, unsigned long ip); | ||
| 137 | |||
| 136 | struct seq_file; | 138 | struct seq_file; |
| 137 | 139 | ||
| 138 | struct ftrace_probe_ops { | 140 | struct ftrace_probe_ops { |
| @@ -161,7 +163,6 @@ extern int ftrace_text_reserved(void *start, void *end); | |||
| 161 | 163 | ||
| 162 | enum { | 164 | enum { |
| 163 | FTRACE_FL_ENABLED = (1 << 30), | 165 | FTRACE_FL_ENABLED = (1 << 30), |
| 164 | FTRACE_FL_FREE = (1 << 31), | ||
| 165 | }; | 166 | }; |
| 166 | 167 | ||
| 167 | #define FTRACE_FL_MASK (0x3UL << 30) | 168 | #define FTRACE_FL_MASK (0x3UL << 30) |
| @@ -172,10 +173,7 @@ struct dyn_ftrace { | |||
| 172 | unsigned long ip; /* address of mcount call-site */ | 173 | unsigned long ip; /* address of mcount call-site */ |
| 173 | struct dyn_ftrace *freelist; | 174 | struct dyn_ftrace *freelist; |
| 174 | }; | 175 | }; |
| 175 | union { | 176 | unsigned long flags; |
| 176 | unsigned long flags; | ||
| 177 | struct dyn_ftrace *newlist; | ||
| 178 | }; | ||
| 179 | struct dyn_arch_ftrace arch; | 177 | struct dyn_arch_ftrace arch; |
| 180 | }; | 178 | }; |
| 181 | 179 | ||
| @@ -190,6 +188,56 @@ void ftrace_set_global_notrace(unsigned char *buf, int len, int reset); | |||
| 190 | int register_ftrace_command(struct ftrace_func_command *cmd); | 188 | int register_ftrace_command(struct ftrace_func_command *cmd); |
| 191 | int unregister_ftrace_command(struct ftrace_func_command *cmd); | 189 | int unregister_ftrace_command(struct ftrace_func_command *cmd); |
| 192 | 190 | ||
| 191 | enum { | ||
| 192 | FTRACE_UPDATE_CALLS = (1 << 0), | ||
| 193 | FTRACE_DISABLE_CALLS = (1 << 1), | ||
| 194 | FTRACE_UPDATE_TRACE_FUNC = (1 << 2), | ||
| 195 | FTRACE_START_FUNC_RET = (1 << 3), | ||
| 196 | FTRACE_STOP_FUNC_RET = (1 << 4), | ||
| 197 | }; | ||
| 198 | |||
| 199 | enum { | ||
| 200 | FTRACE_UPDATE_IGNORE, | ||
| 201 | FTRACE_UPDATE_MAKE_CALL, | ||
| 202 | FTRACE_UPDATE_MAKE_NOP, | ||
| 203 | }; | ||
| 204 | |||
| 205 | enum { | ||
| 206 | FTRACE_ITER_FILTER = (1 << 0), | ||
| 207 | FTRACE_ITER_NOTRACE = (1 << 1), | ||
| 208 | FTRACE_ITER_PRINTALL = (1 << 2), | ||
| 209 | FTRACE_ITER_DO_HASH = (1 << 3), | ||
| 210 | FTRACE_ITER_HASH = (1 << 4), | ||
| 211 | FTRACE_ITER_ENABLED = (1 << 5), | ||
| 212 | }; | ||
| 213 | |||
| 214 | void arch_ftrace_update_code(int command); | ||
| 215 | |||
| 216 | struct ftrace_rec_iter; | ||
| 217 | |||
| 218 | struct ftrace_rec_iter *ftrace_rec_iter_start(void); | ||
| 219 | struct ftrace_rec_iter *ftrace_rec_iter_next(struct ftrace_rec_iter *iter); | ||
| 220 | struct dyn_ftrace *ftrace_rec_iter_record(struct ftrace_rec_iter *iter); | ||
| 221 | |||
| 222 | int ftrace_update_record(struct dyn_ftrace *rec, int enable); | ||
| 223 | int ftrace_test_record(struct dyn_ftrace *rec, int enable); | ||
| 224 | void ftrace_run_stop_machine(int command); | ||
| 225 | int ftrace_location(unsigned long ip); | ||
| 226 | |||
| 227 | extern ftrace_func_t ftrace_trace_function; | ||
| 228 | |||
| 229 | int ftrace_regex_open(struct ftrace_ops *ops, int flag, | ||
| 230 | struct inode *inode, struct file *file); | ||
| 231 | ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf, | ||
| 232 | size_t cnt, loff_t *ppos); | ||
| 233 | ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, | ||
| 234 | size_t cnt, loff_t *ppos); | ||
| 235 | loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin); | ||
| 236 | int ftrace_regex_release(struct inode *inode, struct file *file); | ||
| 237 | |||
| 238 | void __init | ||
| 239 | ftrace_set_early_filter(struct ftrace_ops *ops, char *buf, int enable); | ||
| 240 | |||
| 193 | /* defined in arch */ | 241 | /* defined in arch */ |
| 194 | extern int ftrace_ip_converted(unsigned long ip); | 242 | extern int ftrace_ip_converted(unsigned long ip); |
| 195 | extern int ftrace_dyn_arch_init(void *data); | 243 | extern int ftrace_dyn_arch_init(void *data); |
| @@ -284,6 +332,25 @@ static inline int ftrace_text_reserved(void *start, void *end) | |||
| 284 | { | 332 | { |
| 285 | return 0; | 333 | return 0; |
| 286 | } | 334 | } |
| 335 | |||
| 336 | /* | ||
| 337 | * Again users of functions that have ftrace_ops may not | ||
| 338 | * have them defined when ftrace is not enabled, but these | ||
| 339 | * functions may still be called. Use a macro instead of inline. | ||
| 340 | */ | ||
| 341 | #define ftrace_regex_open(ops, flag, inod, file) ({ -ENODEV; }) | ||
| 342 | #define ftrace_set_early_filter(ops, buf, enable) do { } while (0) | ||
| 343 | |||
| 344 | static inline ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf, | ||
| 345 | size_t cnt, loff_t *ppos) { return -ENODEV; } | ||
| 346 | static inline ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, | ||
| 347 | size_t cnt, loff_t *ppos) { return -ENODEV; } | ||
| 348 | static inline loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin) | ||
| 349 | { | ||
| 350 | return -ENODEV; | ||
| 351 | } | ||
| 352 | static inline int | ||
| 353 | ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } | ||
| 287 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 354 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
| 288 | 355 | ||
| 289 | /* totally disable ftrace - can not re-enable after this */ | 356 | /* totally disable ftrace - can not re-enable after this */ |
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 464cff526860..8ba2c9460b28 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
| @@ -50,6 +50,10 @@ | |||
| 50 | * | 50 | * |
| 51 | * 7.17 | 51 | * 7.17 |
| 52 | * - add FUSE_FLOCK_LOCKS and FUSE_RELEASE_FLOCK_UNLOCK | 52 | * - add FUSE_FLOCK_LOCKS and FUSE_RELEASE_FLOCK_UNLOCK |
| 53 | * | ||
| 54 | * 7.18 | ||
| 55 | * - add FUSE_IOCTL_DIR flag | ||
| 56 | * - add FUSE_NOTIFY_DELETE | ||
| 53 | */ | 57 | */ |
| 54 | 58 | ||
| 55 | #ifndef _LINUX_FUSE_H | 59 | #ifndef _LINUX_FUSE_H |
| @@ -81,7 +85,7 @@ | |||
| 81 | #define FUSE_KERNEL_VERSION 7 | 85 | #define FUSE_KERNEL_VERSION 7 |
| 82 | 86 | ||
| 83 | /** Minor version number of this interface */ | 87 | /** Minor version number of this interface */ |
| 84 | #define FUSE_KERNEL_MINOR_VERSION 17 | 88 | #define FUSE_KERNEL_MINOR_VERSION 18 |
| 85 | 89 | ||
| 86 | /** The node ID of the root inode */ | 90 | /** The node ID of the root inode */ |
| 87 | #define FUSE_ROOT_ID 1 | 91 | #define FUSE_ROOT_ID 1 |
| @@ -214,6 +218,7 @@ struct fuse_file_lock { | |||
| 214 | * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed | 218 | * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed |
| 215 | * FUSE_IOCTL_RETRY: retry with new iovecs | 219 | * FUSE_IOCTL_RETRY: retry with new iovecs |
| 216 | * FUSE_IOCTL_32BIT: 32bit ioctl | 220 | * FUSE_IOCTL_32BIT: 32bit ioctl |
| 221 | * FUSE_IOCTL_DIR: is a directory | ||
| 217 | * | 222 | * |
| 218 | * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs | 223 | * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs |
| 219 | */ | 224 | */ |
| @@ -221,6 +226,7 @@ struct fuse_file_lock { | |||
| 221 | #define FUSE_IOCTL_UNRESTRICTED (1 << 1) | 226 | #define FUSE_IOCTL_UNRESTRICTED (1 << 1) |
| 222 | #define FUSE_IOCTL_RETRY (1 << 2) | 227 | #define FUSE_IOCTL_RETRY (1 << 2) |
| 223 | #define FUSE_IOCTL_32BIT (1 << 3) | 228 | #define FUSE_IOCTL_32BIT (1 << 3) |
| 229 | #define FUSE_IOCTL_DIR (1 << 4) | ||
| 224 | 230 | ||
| 225 | #define FUSE_IOCTL_MAX_IOV 256 | 231 | #define FUSE_IOCTL_MAX_IOV 256 |
| 226 | 232 | ||
| @@ -283,6 +289,7 @@ enum fuse_notify_code { | |||
| 283 | FUSE_NOTIFY_INVAL_ENTRY = 3, | 289 | FUSE_NOTIFY_INVAL_ENTRY = 3, |
| 284 | FUSE_NOTIFY_STORE = 4, | 290 | FUSE_NOTIFY_STORE = 4, |
| 285 | FUSE_NOTIFY_RETRIEVE = 5, | 291 | FUSE_NOTIFY_RETRIEVE = 5, |
| 292 | FUSE_NOTIFY_DELETE = 6, | ||
| 286 | FUSE_NOTIFY_CODE_MAX, | 293 | FUSE_NOTIFY_CODE_MAX, |
| 287 | }; | 294 | }; |
| 288 | 295 | ||
| @@ -606,6 +613,13 @@ struct fuse_notify_inval_entry_out { | |||
| 606 | __u32 padding; | 613 | __u32 padding; |
| 607 | }; | 614 | }; |
| 608 | 615 | ||
| 616 | struct fuse_notify_delete_out { | ||
| 617 | __u64 parent; | ||
| 618 | __u64 child; | ||
| 619 | __u32 namelen; | ||
| 620 | __u32 padding; | ||
| 621 | }; | ||
| 622 | |||
| 609 | struct fuse_notify_store_out { | 623 | struct fuse_notify_store_out { |
| 610 | __u64 nodeid; | 624 | __u64 nodeid; |
| 611 | __u64 offset; | 625 | __u64 offset; |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 3a76faf6a3ee..581e74b7df95 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -36,6 +36,7 @@ struct vm_area_struct; | |||
| 36 | #endif | 36 | #endif |
| 37 | #define ___GFP_NO_KSWAPD 0x400000u | 37 | #define ___GFP_NO_KSWAPD 0x400000u |
| 38 | #define ___GFP_OTHER_NODE 0x800000u | 38 | #define ___GFP_OTHER_NODE 0x800000u |
| 39 | #define ___GFP_WRITE 0x1000000u | ||
| 39 | 40 | ||
| 40 | /* | 41 | /* |
| 41 | * GFP bitmasks.. | 42 | * GFP bitmasks.. |
| @@ -85,6 +86,7 @@ struct vm_area_struct; | |||
| 85 | 86 | ||
| 86 | #define __GFP_NO_KSWAPD ((__force gfp_t)___GFP_NO_KSWAPD) | 87 | #define __GFP_NO_KSWAPD ((__force gfp_t)___GFP_NO_KSWAPD) |
| 87 | #define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */ | 88 | #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 */ | ||
| 88 | 90 | ||
| 89 | /* | 91 | /* |
| 90 | * This may seem redundant, but it's a way of annotating false positives vs. | 92 | * This may seem redundant, but it's a way of annotating false positives vs. |
| @@ -92,7 +94,7 @@ struct vm_area_struct; | |||
| 92 | */ | 94 | */ |
| 93 | #define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK) | 95 | #define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK) |
| 94 | 96 | ||
| 95 | #define __GFP_BITS_SHIFT 24 /* Room for N __GFP_FOO bits */ | 97 | #define __GFP_BITS_SHIFT 25 /* Room for N __GFP_FOO bits */ |
| 96 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) | 98 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) |
| 97 | 99 | ||
| 98 | /* This equals 0, but use constants in case they ever change */ | 100 | /* This equals 0, but use constants in case they ever change */ |
| @@ -313,7 +315,7 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, | |||
| 313 | static inline struct page *alloc_pages_exact_node(int nid, gfp_t gfp_mask, | 315 | static inline struct page *alloc_pages_exact_node(int nid, gfp_t gfp_mask, |
| 314 | unsigned int order) | 316 | unsigned int order) |
| 315 | { | 317 | { |
| 316 | VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES); | 318 | VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES || !node_online(nid)); |
| 317 | 319 | ||
| 318 | return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask)); | 320 | return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask)); |
| 319 | } | 321 | } |
| @@ -358,6 +360,7 @@ void *alloc_pages_exact_nid(int nid, size_t size, gfp_t gfp_mask); | |||
| 358 | extern void __free_pages(struct page *page, unsigned int order); | 360 | extern void __free_pages(struct page *page, unsigned int order); |
| 359 | extern void free_pages(unsigned long addr, unsigned int order); | 361 | extern void free_pages(unsigned long addr, unsigned int order); |
| 360 | extern void free_hot_cold_page(struct page *page, int cold); | 362 | extern void free_hot_cold_page(struct page *page, int cold); |
| 363 | extern void free_hot_cold_page_list(struct list_head *list, int cold); | ||
| 361 | 364 | ||
| 362 | #define __free_page(page) __free_pages((page), 0) | 365 | #define __free_page(page) __free_pages((page), 0) |
| 363 | #define free_page(addr) free_pages((addr), 0) | 366 | #define free_page(addr) free_pages((addr), 0) |
| @@ -367,9 +370,25 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp); | |||
| 367 | void drain_all_pages(void); | 370 | void drain_all_pages(void); |
| 368 | void drain_local_pages(void *dummy); | 371 | void drain_local_pages(void *dummy); |
| 369 | 372 | ||
| 373 | /* | ||
| 374 | * gfp_allowed_mask is set to GFP_BOOT_MASK during early boot to restrict what | ||
| 375 | * GFP flags are used before interrupts are enabled. Once interrupts are | ||
| 376 | * enabled, it is set to __GFP_BITS_MASK while the system is running. During | ||
| 377 | * hibernation, it is used by PM to avoid I/O during memory allocation while | ||
| 378 | * devices are suspended. | ||
| 379 | */ | ||
| 370 | extern gfp_t gfp_allowed_mask; | 380 | extern gfp_t gfp_allowed_mask; |
| 371 | 381 | ||
| 372 | extern void pm_restrict_gfp_mask(void); | 382 | extern void pm_restrict_gfp_mask(void); |
| 373 | extern void pm_restore_gfp_mask(void); | 383 | extern void pm_restore_gfp_mask(void); |
| 374 | 384 | ||
| 385 | #ifdef CONFIG_PM_SLEEP | ||
| 386 | extern bool pm_suspended_storage(void); | ||
| 387 | #else | ||
| 388 | static inline bool pm_suspended_storage(void) | ||
| 389 | { | ||
| 390 | return false; | ||
| 391 | } | ||
| 392 | #endif /* CONFIG_PM_SLEEP */ | ||
| 393 | |||
| 375 | #endif /* __LINUX_GFP_H */ | 394 | #endif /* __LINUX_GFP_H */ |
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h index 4f4462974c14..b148087f49a6 100644 --- a/include/linux/gfs2_ondisk.h +++ b/include/linux/gfs2_ondisk.h | |||
| @@ -22,6 +22,8 @@ | |||
| 22 | #define GFS2_LIVE_LOCK 1 | 22 | #define GFS2_LIVE_LOCK 1 |
| 23 | #define GFS2_TRANS_LOCK 2 | 23 | #define GFS2_TRANS_LOCK 2 |
| 24 | #define GFS2_RENAME_LOCK 3 | 24 | #define GFS2_RENAME_LOCK 3 |
| 25 | #define GFS2_CONTROL_LOCK 4 | ||
| 26 | #define GFS2_MOUNTED_LOCK 5 | ||
| 25 | 27 | ||
| 26 | /* Format numbers for various metadata types */ | 28 | /* Format numbers for various metadata types */ |
| 27 | 29 | ||
diff --git a/include/linux/gpio-pxa.h b/include/linux/gpio-pxa.h new file mode 100644 index 000000000000..05071ee34c3f --- /dev/null +++ b/include/linux/gpio-pxa.h | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #ifndef __GPIO_PXA_H | ||
| 2 | #define __GPIO_PXA_H | ||
| 3 | |||
| 4 | #define GPIO_bit(x) (1 << ((x) & 0x1f)) | ||
| 5 | |||
| 6 | #define gpio_to_bank(gpio) ((gpio) >> 5) | ||
| 7 | |||
| 8 | /* NOTE: some PXAs have fewer on-chip GPIOs (like PXA255, with 85). | ||
| 9 | * Those cases currently cause holes in the GPIO number space, the | ||
| 10 | * actual number of the last GPIO is recorded by 'pxa_last_gpio'. | ||
| 11 | */ | ||
| 12 | extern int pxa_last_gpio; | ||
| 13 | |||
| 14 | extern int pxa_irq_to_gpio(int irq); | ||
| 15 | |||
| 16 | #endif /* __GPIO_PXA_H */ | ||
diff --git a/include/linux/hid.h b/include/linux/hid.h index c235e4e8767c..3a95da60fd3e 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -72,6 +72,7 @@ | |||
| 72 | #include <linux/workqueue.h> | 72 | #include <linux/workqueue.h> |
| 73 | #include <linux/input.h> | 73 | #include <linux/input.h> |
| 74 | #include <linux/semaphore.h> | 74 | #include <linux/semaphore.h> |
| 75 | #include <linux/power_supply.h> | ||
| 75 | 76 | ||
| 76 | /* | 77 | /* |
| 77 | * We parse each description item into this structure. Short items data | 78 | * We parse each description item into this structure. Short items data |
| @@ -190,6 +191,7 @@ struct hid_item { | |||
| 190 | #define HID_UP_UNDEFINED 0x00000000 | 191 | #define HID_UP_UNDEFINED 0x00000000 |
| 191 | #define HID_UP_GENDESK 0x00010000 | 192 | #define HID_UP_GENDESK 0x00010000 |
| 192 | #define HID_UP_SIMULATION 0x00020000 | 193 | #define HID_UP_SIMULATION 0x00020000 |
| 194 | #define HID_UP_GENDEVCTRLS 0x00060000 | ||
| 193 | #define HID_UP_KEYBOARD 0x00070000 | 195 | #define HID_UP_KEYBOARD 0x00070000 |
| 194 | #define HID_UP_LED 0x00080000 | 196 | #define HID_UP_LED 0x00080000 |
| 195 | #define HID_UP_BUTTON 0x00090000 | 197 | #define HID_UP_BUTTON 0x00090000 |
| @@ -239,6 +241,8 @@ struct hid_item { | |||
| 239 | #define HID_GD_RIGHT 0x00010092 | 241 | #define HID_GD_RIGHT 0x00010092 |
| 240 | #define HID_GD_LEFT 0x00010093 | 242 | #define HID_GD_LEFT 0x00010093 |
| 241 | 243 | ||
| 244 | #define HID_DC_BATTERYSTRENGTH 0x00060020 | ||
| 245 | |||
| 242 | #define HID_DG_DIGITIZER 0x000d0001 | 246 | #define HID_DG_DIGITIZER 0x000d0001 |
| 243 | #define HID_DG_PEN 0x000d0002 | 247 | #define HID_DG_PEN 0x000d0002 |
| 244 | #define HID_DG_LIGHTPEN 0x000d0003 | 248 | #define HID_DG_LIGHTPEN 0x000d0003 |
| @@ -482,6 +486,19 @@ struct hid_device { /* device report descriptor */ | |||
| 482 | struct hid_driver *driver; | 486 | struct hid_driver *driver; |
| 483 | struct hid_ll_driver *ll_driver; | 487 | struct hid_ll_driver *ll_driver; |
| 484 | 488 | ||
| 489 | #ifdef CONFIG_HID_BATTERY_STRENGTH | ||
| 490 | /* | ||
| 491 | * Power supply information for HID devices which report | ||
| 492 | * battery strength. power_supply is registered iff | ||
| 493 | * battery.name is non-NULL. | ||
| 494 | */ | ||
| 495 | struct power_supply battery; | ||
| 496 | __s32 battery_min; | ||
| 497 | __s32 battery_max; | ||
| 498 | __s32 battery_report_type; | ||
| 499 | __s32 battery_report_id; | ||
| 500 | #endif | ||
| 501 | |||
| 485 | unsigned int status; /* see STAT flags above */ | 502 | unsigned int status; /* see STAT flags above */ |
| 486 | unsigned claimed; /* Claimed by hidinput, hiddev? */ | 503 | unsigned claimed; /* Claimed by hidinput, hiddev? */ |
| 487 | unsigned quirks; /* Various quirks the device can pull on us */ | 504 | unsigned quirks; /* Various quirks the device can pull on us */ |
| @@ -712,6 +729,8 @@ extern void hidinput_disconnect(struct hid_device *); | |||
| 712 | int hid_set_field(struct hid_field *, unsigned, __s32); | 729 | int hid_set_field(struct hid_field *, unsigned, __s32); |
| 713 | int hid_input_report(struct hid_device *, int type, u8 *, int, int); | 730 | int hid_input_report(struct hid_device *, int type, u8 *, int, int); |
| 714 | int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); | 731 | int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); |
| 732 | struct hid_field *hidinput_get_led_field(struct hid_device *hid); | ||
| 733 | unsigned int hidinput_count_leds(struct hid_device *hid); | ||
| 715 | void hid_output_report(struct hid_report *report, __u8 *data); | 734 | void hid_output_report(struct hid_report *report, __u8 *data); |
| 716 | struct hid_device *hid_allocate_device(void); | 735 | struct hid_device *hid_allocate_device(void); |
| 717 | struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); | 736 | struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); |
| @@ -719,6 +738,8 @@ int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); | |||
| 719 | int hid_check_keys_pressed(struct hid_device *hid); | 738 | int hid_check_keys_pressed(struct hid_device *hid); |
| 720 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); | 739 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); |
| 721 | void hid_disconnect(struct hid_device *hid); | 740 | void hid_disconnect(struct hid_device *hid); |
| 741 | const struct hid_device_id *hid_match_id(struct hid_device *hdev, | ||
| 742 | const struct hid_device_id *id); | ||
| 722 | 743 | ||
| 723 | /** | 744 | /** |
| 724 | * hid_map_usage - map usage input bits | 745 | * hid_map_usage - map usage input bits |
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index a9ace9c32507..1b921299abc4 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
| @@ -18,7 +18,7 @@ extern struct page *follow_trans_huge_pmd(struct mm_struct *mm, | |||
| 18 | unsigned int flags); | 18 | unsigned int flags); |
| 19 | extern int zap_huge_pmd(struct mmu_gather *tlb, | 19 | extern int zap_huge_pmd(struct mmu_gather *tlb, |
| 20 | struct vm_area_struct *vma, | 20 | struct vm_area_struct *vma, |
| 21 | pmd_t *pmd); | 21 | pmd_t *pmd, unsigned long addr); |
| 22 | extern int mincore_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, | 22 | extern int mincore_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, |
| 23 | unsigned long addr, unsigned long end, | 23 | unsigned long addr, unsigned long end, |
| 24 | unsigned char *vec); | 24 | unsigned char *vec); |
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 12ec328481de..62b908e0e591 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h | |||
| @@ -35,7 +35,7 @@ | |||
| 35 | #include <linux/mod_devicetable.h> | 35 | #include <linux/mod_devicetable.h> |
| 36 | 36 | ||
| 37 | 37 | ||
| 38 | #define MAX_PAGE_BUFFER_COUNT 16 | 38 | #define MAX_PAGE_BUFFER_COUNT 18 |
| 39 | #define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */ | 39 | #define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */ |
| 40 | 40 | ||
| 41 | #pragma pack(push, 1) | 41 | #pragma pack(push, 1) |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 114c0f6fc63d..78d3465251d6 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
| @@ -652,10 +652,12 @@ struct twl4030_power_data { | |||
| 652 | unsigned num; | 652 | unsigned num; |
| 653 | struct twl4030_resconfig *resource_config; | 653 | struct twl4030_resconfig *resource_config; |
| 654 | #define TWL4030_RESCONFIG_UNDEF ((u8)-1) | 654 | #define TWL4030_RESCONFIG_UNDEF ((u8)-1) |
| 655 | bool use_poweroff; /* Board is wired for TWL poweroff */ | ||
| 655 | }; | 656 | }; |
| 656 | 657 | ||
| 657 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); | 658 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); |
| 658 | extern int twl4030_remove_script(u8 flags); | 659 | extern int twl4030_remove_script(u8 flags); |
| 660 | extern void twl4030_power_off(void); | ||
| 659 | 661 | ||
| 660 | struct twl4030_codec_data { | 662 | struct twl4030_codec_data { |
| 661 | unsigned int digimic_delay; /* in ms */ | 663 | unsigned int digimic_delay; /* in ms */ |
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/inet_diag.h b/include/linux/inet_diag.h index 34e8d52c1925..f1362b5447fc 100644 --- a/include/linux/inet_diag.h +++ b/include/linux/inet_diag.h | |||
| @@ -22,7 +22,7 @@ struct inet_diag_sockid { | |||
| 22 | 22 | ||
| 23 | /* Request structure */ | 23 | /* Request structure */ |
| 24 | 24 | ||
| 25 | struct inet_diag_req_compat { | 25 | struct inet_diag_req { |
| 26 | __u8 idiag_family; /* Family of addresses. */ | 26 | __u8 idiag_family; /* Family of addresses. */ |
| 27 | __u8 idiag_src_len; | 27 | __u8 idiag_src_len; |
| 28 | __u8 idiag_dst_len; | 28 | __u8 idiag_dst_len; |
| @@ -34,7 +34,7 @@ struct inet_diag_req_compat { | |||
| 34 | __u32 idiag_dbs; /* Tables to dump (NI) */ | 34 | __u32 idiag_dbs; /* Tables to dump (NI) */ |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | struct inet_diag_req { | 37 | struct inet_diag_req_v2 { |
| 38 | __u8 sdiag_family; | 38 | __u8 sdiag_family; |
| 39 | __u8 sdiag_protocol; | 39 | __u8 sdiag_protocol; |
| 40 | __u8 idiag_ext; | 40 | __u8 idiag_ext; |
| @@ -143,12 +143,12 @@ struct netlink_callback; | |||
| 143 | struct inet_diag_handler { | 143 | struct inet_diag_handler { |
| 144 | void (*dump)(struct sk_buff *skb, | 144 | void (*dump)(struct sk_buff *skb, |
| 145 | struct netlink_callback *cb, | 145 | struct netlink_callback *cb, |
| 146 | struct inet_diag_req *r, | 146 | struct inet_diag_req_v2 *r, |
| 147 | struct nlattr *bc); | 147 | struct nlattr *bc); |
| 148 | 148 | ||
| 149 | int (*dump_one)(struct sk_buff *in_skb, | 149 | int (*dump_one)(struct sk_buff *in_skb, |
| 150 | const struct nlmsghdr *nlh, | 150 | const struct nlmsghdr *nlh, |
| 151 | struct inet_diag_req *req); | 151 | struct inet_diag_req_v2 *req); |
| 152 | 152 | ||
| 153 | void (*idiag_get_info)(struct sock *sk, | 153 | void (*idiag_get_info)(struct sock *sk, |
| 154 | struct inet_diag_msg *r, | 154 | struct inet_diag_msg *r, |
| @@ -158,15 +158,15 @@ struct inet_diag_handler { | |||
| 158 | 158 | ||
| 159 | struct inet_connection_sock; | 159 | struct inet_connection_sock; |
| 160 | int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, | 160 | int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, |
| 161 | struct sk_buff *skb, struct inet_diag_req *req, | 161 | struct sk_buff *skb, struct inet_diag_req_v2 *req, |
| 162 | u32 pid, u32 seq, u16 nlmsg_flags, | 162 | u32 pid, u32 seq, u16 nlmsg_flags, |
| 163 | const struct nlmsghdr *unlh); | 163 | const struct nlmsghdr *unlh); |
| 164 | void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb, | 164 | void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb, |
| 165 | struct netlink_callback *cb, struct inet_diag_req *r, | 165 | struct netlink_callback *cb, struct inet_diag_req_v2 *r, |
| 166 | struct nlattr *bc); | 166 | struct nlattr *bc); |
| 167 | int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo, | 167 | int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo, |
| 168 | struct sk_buff *in_skb, const struct nlmsghdr *nlh, | 168 | struct sk_buff *in_skb, const struct nlmsghdr *nlh, |
| 169 | struct inet_diag_req *req); | 169 | struct inet_diag_req_v2 *req); |
| 170 | 170 | ||
| 171 | int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk); | 171 | int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk); |
| 172 | 172 | ||
diff --git a/include/linux/init.h b/include/linux/init.h index 9146f39cdddf..6b951095a42f 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _LINUX_INIT_H | 2 | #define _LINUX_INIT_H |
| 3 | 3 | ||
| 4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
| 5 | #include <linux/types.h> | ||
| 5 | 6 | ||
| 6 | /* These macros are used to mark some functions or | 7 | /* These macros are used to mark some functions or |
| 7 | * initialized data (doesn't apply to uninitialized data) | 8 | * initialized data (doesn't apply to uninitialized data) |
| @@ -156,7 +157,7 @@ void prepare_namespace(void); | |||
| 156 | 157 | ||
| 157 | extern void (*late_time_init)(void); | 158 | extern void (*late_time_init)(void); |
| 158 | 159 | ||
| 159 | extern int initcall_debug; | 160 | extern bool initcall_debug; |
| 160 | 161 | ||
| 161 | #endif | 162 | #endif |
| 162 | 163 | ||
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 32574eef9394..9c66b1ada9d7 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
| @@ -23,11 +23,10 @@ extern struct files_struct init_files; | |||
| 23 | extern struct fs_struct init_fs; | 23 | extern struct fs_struct init_fs; |
| 24 | 24 | ||
| 25 | #ifdef CONFIG_CGROUPS | 25 | #ifdef CONFIG_CGROUPS |
| 26 | #define INIT_THREADGROUP_FORK_LOCK(sig) \ | 26 | #define INIT_GROUP_RWSEM(sig) \ |
| 27 | .threadgroup_fork_lock = \ | 27 | .group_rwsem = __RWSEM_INITIALIZER(sig.group_rwsem), |
| 28 | __RWSEM_INITIALIZER(sig.threadgroup_fork_lock), | ||
| 29 | #else | 28 | #else |
| 30 | #define INIT_THREADGROUP_FORK_LOCK(sig) | 29 | #define INIT_GROUP_RWSEM(sig) |
| 31 | #endif | 30 | #endif |
| 32 | 31 | ||
| 33 | #define INIT_SIGNALS(sig) { \ | 32 | #define INIT_SIGNALS(sig) { \ |
| @@ -46,7 +45,7 @@ extern struct fs_struct init_fs; | |||
| 46 | }, \ | 45 | }, \ |
| 47 | .cred_guard_mutex = \ | 46 | .cred_guard_mutex = \ |
| 48 | __MUTEX_INITIALIZER(sig.cred_guard_mutex), \ | 47 | __MUTEX_INITIALIZER(sig.cred_guard_mutex), \ |
| 49 | INIT_THREADGROUP_FORK_LOCK(sig) \ | 48 | INIT_GROUP_RWSEM(sig) \ |
| 50 | } | 49 | } |
| 51 | 50 | ||
| 52 | extern struct nsproxy init_nsproxy; | 51 | extern struct nsproxy init_nsproxy; |
diff --git a/include/linux/input/auo-pixcir-ts.h b/include/linux/input/auo-pixcir-ts.h new file mode 100644 index 000000000000..75d4be717714 --- /dev/null +++ b/include/linux/input/auo-pixcir-ts.h | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | /* | ||
| 2 | * Driver for AUO in-cell touchscreens | ||
| 3 | * | ||
| 4 | * Copyright (c) 2011 Heiko Stuebner <heiko@sntech.de> | ||
| 5 | * | ||
| 6 | * based on auo_touch.h from Dell Streak kernel | ||
| 7 | * | ||
| 8 | * Copyright (c) 2008 QUALCOMM Incorporated. | ||
| 9 | * Copyright (c) 2008 QUALCOMM USA, INC. | ||
| 10 | * | ||
| 11 | * | ||
| 12 | * This software is licensed under the terms of the GNU General Public | ||
| 13 | * License version 2, as published by the Free Software Foundation, and | ||
| 14 | * may be copied, distributed, and modified under those terms. | ||
| 15 | * | ||
| 16 | * This program is distributed in the hope that it will be useful, | ||
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 19 | * GNU General Public License for more details. | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef __AUO_PIXCIR_TS_H__ | ||
| 24 | #define __AUO_PIXCIR_TS_H__ | ||
| 25 | |||
| 26 | /* | ||
| 27 | * Interrupt modes: | ||
| 28 | * periodical: interrupt is asserted periodicaly | ||
| 29 | * compare coordinates: interrupt is asserted when coordinates change | ||
| 30 | * indicate touch: interrupt is asserted during touch | ||
| 31 | */ | ||
| 32 | #define AUO_PIXCIR_INT_PERIODICAL 0x00 | ||
| 33 | #define AUO_PIXCIR_INT_COMP_COORD 0x01 | ||
| 34 | #define AUO_PIXCIR_INT_TOUCH_IND 0x02 | ||
| 35 | |||
| 36 | /* | ||
| 37 | * @gpio_int interrupt gpio | ||
| 38 | * @int_setting one of AUO_PIXCIR_INT_* | ||
| 39 | * @init_hw hardwarespecific init | ||
| 40 | * @exit_hw hardwarespecific shutdown | ||
| 41 | * @x_max x-resolution | ||
| 42 | * @y_max y-resolution | ||
| 43 | */ | ||
| 44 | struct auo_pixcir_ts_platdata { | ||
| 45 | int gpio_int; | ||
| 46 | |||
| 47 | int int_setting; | ||
| 48 | |||
| 49 | void (*init_hw)(struct i2c_client *); | ||
| 50 | void (*exit_hw)(struct i2c_client *); | ||
| 51 | |||
| 52 | unsigned int x_max; | ||
| 53 | unsigned int y_max; | ||
| 54 | }; | ||
| 55 | |||
| 56 | #endif | ||
diff --git a/include/linux/input/gp2ap002a00f.h b/include/linux/input/gp2ap002a00f.h new file mode 100644 index 000000000000..aad2fd44a61a --- /dev/null +++ b/include/linux/input/gp2ap002a00f.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | #ifndef _GP2AP002A00F_H_ | ||
| 2 | #define _GP2AP002A00F_H_ | ||
| 3 | |||
| 4 | #include <linux/i2c.h> | ||
| 5 | |||
| 6 | #define GP2A_I2C_NAME "gp2ap002a00f" | ||
| 7 | |||
| 8 | /** | ||
| 9 | * struct gp2a_platform_data - Sharp gp2ap002a00f proximity platform data | ||
| 10 | * @vout_gpio: The gpio connected to the object detected pin (VOUT) | ||
| 11 | * @wakeup: Set to true if the proximity can wake the device from suspend | ||
| 12 | * @hw_setup: Callback for setting up hardware such as gpios and vregs | ||
| 13 | * @hw_shutdown: Callback for properly shutting down hardware | ||
| 14 | */ | ||
| 15 | struct gp2a_platform_data { | ||
| 16 | int vout_gpio; | ||
| 17 | bool wakeup; | ||
| 18 | int (*hw_setup)(struct i2c_client *client); | ||
| 19 | int (*hw_shutdown)(struct i2c_client *client); | ||
| 20 | }; | ||
| 21 | |||
| 22 | #endif | ||
diff --git a/include/linux/input/gpio_tilt.h b/include/linux/input/gpio_tilt.h new file mode 100644 index 000000000000..c1cc52d380e0 --- /dev/null +++ b/include/linux/input/gpio_tilt.h | |||
| @@ -0,0 +1,73 @@ | |||
| 1 | #ifndef _INPUT_GPIO_TILT_H | ||
| 2 | #define _INPUT_GPIO_TILT_H | ||
| 3 | |||
| 4 | /** | ||
| 5 | * struct gpio_tilt_axis - Axis used by the tilt switch | ||
| 6 | * @axis: Constant describing the axis, e.g. ABS_X | ||
| 7 | * @min: minimum value for abs_param | ||
| 8 | * @max: maximum value for abs_param | ||
| 9 | * @fuzz: fuzz value for abs_param | ||
| 10 | * @flat: flat value for abs_param | ||
| 11 | */ | ||
| 12 | struct gpio_tilt_axis { | ||
| 13 | int axis; | ||
| 14 | int min; | ||
| 15 | int max; | ||
| 16 | int fuzz; | ||
| 17 | int flat; | ||
| 18 | }; | ||
| 19 | |||
| 20 | /** | ||
| 21 | * struct gpio_tilt_state - state description | ||
| 22 | * @gpios: bitfield of gpio target-states for the value | ||
| 23 | * @axes: array containing the axes settings for the gpio state | ||
| 24 | * The array indizes must correspond to the axes defined | ||
| 25 | * in platform_data | ||
| 26 | * | ||
| 27 | * This structure describes a supported axis settings | ||
| 28 | * and the necessary gpio-state which represent it. | ||
| 29 | * | ||
| 30 | * The n-th bit in the bitfield describes the state of the n-th GPIO | ||
| 31 | * from the gpios-array defined in gpio_regulator_config below. | ||
| 32 | */ | ||
| 33 | struct gpio_tilt_state { | ||
| 34 | int gpios; | ||
| 35 | int *axes; | ||
| 36 | }; | ||
| 37 | |||
| 38 | /** | ||
| 39 | * struct gpio_tilt_platform_data | ||
| 40 | * @gpios: Array containing the gpios determining the tilt state | ||
| 41 | * @nr_gpios: Number of gpios | ||
| 42 | * @axes: Array of gpio_tilt_axis descriptions | ||
| 43 | * @nr_axes: Number of axes | ||
| 44 | * @states: Array of gpio_tilt_state entries describing | ||
| 45 | * the gpio state for specific tilts | ||
| 46 | * @nr_states: Number of states available | ||
| 47 | * @debounce_interval: debounce ticks interval in msecs | ||
| 48 | * @poll_interval: polling interval in msecs - for polling driver only | ||
| 49 | * @enable: callback to enable the tilt switch | ||
| 50 | * @disable: callback to disable the tilt switch | ||
| 51 | * | ||
| 52 | * This structure contains gpio-tilt-switch configuration | ||
| 53 | * information that must be passed by platform code to the | ||
| 54 | * gpio-tilt input driver. | ||
| 55 | */ | ||
| 56 | struct gpio_tilt_platform_data { | ||
| 57 | struct gpio *gpios; | ||
| 58 | int nr_gpios; | ||
| 59 | |||
| 60 | struct gpio_tilt_axis *axes; | ||
| 61 | int nr_axes; | ||
| 62 | |||
| 63 | struct gpio_tilt_state *states; | ||
| 64 | int nr_states; | ||
| 65 | |||
| 66 | int debounce_interval; | ||
| 67 | |||
| 68 | unsigned int poll_interval; | ||
| 69 | int (*enable)(struct device *dev); | ||
| 70 | void (*disable)(struct device *dev); | ||
| 71 | }; | ||
| 72 | |||
| 73 | #endif | ||
diff --git a/include/linux/input/pixcir_ts.h b/include/linux/input/pixcir_ts.h new file mode 100644 index 000000000000..7163d91c0373 --- /dev/null +++ b/include/linux/input/pixcir_ts.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef _PIXCIR_I2C_TS_H | ||
| 2 | #define _PIXCIR_I2C_TS_H | ||
| 3 | |||
| 4 | struct pixcir_ts_platform_data { | ||
| 5 | int (*attb_read_val)(void); | ||
| 6 | int x_max; | ||
| 7 | int y_max; | ||
| 8 | }; | ||
| 9 | |||
| 10 | #endif | ||
diff --git a/include/linux/input/samsung-keypad.h b/include/linux/input/samsung-keypad.h new file mode 100644 index 000000000000..f25619bfd8a8 --- /dev/null +++ b/include/linux/input/samsung-keypad.h | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | /* | ||
| 2 | * Samsung Keypad platform data definitions | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Samsung Electronics Co.Ltd | ||
| 5 | * Author: Joonyoung Shim <jy0922.shim@samsung.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 | ||
| 9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 10 | * option) any later version. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __SAMSUNG_KEYPAD_H | ||
| 14 | #define __SAMSUNG_KEYPAD_H | ||
| 15 | |||
| 16 | #include <linux/input/matrix_keypad.h> | ||
| 17 | |||
| 18 | #define SAMSUNG_MAX_ROWS 8 | ||
| 19 | #define SAMSUNG_MAX_COLS 8 | ||
| 20 | |||
| 21 | /** | ||
| 22 | * struct samsung_keypad_platdata - Platform device data for Samsung Keypad. | ||
| 23 | * @keymap_data: pointer to &matrix_keymap_data. | ||
| 24 | * @rows: number of keypad row supported. | ||
| 25 | * @cols: number of keypad col supported. | ||
| 26 | * @no_autorepeat: disable key autorepeat. | ||
| 27 | * @wakeup: controls whether the device should be set up as wakeup source. | ||
| 28 | * @cfg_gpio: configure the GPIO. | ||
| 29 | * | ||
| 30 | * Initialisation data specific to either the machine or the platform | ||
| 31 | * for the device driver to use or call-back when configuring gpio. | ||
| 32 | */ | ||
| 33 | struct samsung_keypad_platdata { | ||
| 34 | const struct matrix_keymap_data *keymap_data; | ||
| 35 | unsigned int rows; | ||
| 36 | unsigned int cols; | ||
| 37 | bool no_autorepeat; | ||
| 38 | bool wakeup; | ||
| 39 | |||
| 40 | void (*cfg_gpio)(unsigned int rows, unsigned int cols); | ||
| 41 | }; | ||
| 42 | |||
| 43 | #endif /* __SAMSUNG_KEYPAD_H */ | ||
diff --git a/include/linux/input/tca8418_keypad.h b/include/linux/input/tca8418_keypad.h new file mode 100644 index 000000000000..e71a85dc2cbd --- /dev/null +++ b/include/linux/input/tca8418_keypad.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | /* | ||
| 2 | * TCA8418 keypad platform support | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Fuel7, Inc. All rights reserved. | ||
| 5 | * | ||
| 6 | * Author: Kyle Manna <kyle.manna@fuel7.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public | ||
| 10 | * License v2 as published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public | ||
| 18 | * License along with this program; if not, write to the | ||
| 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
| 20 | * Boston, MA 021110-1307, USA. | ||
| 21 | * | ||
| 22 | * If you can't comply with GPLv2, alternative licensing terms may be | ||
| 23 | * arranged. Please contact Fuel7, Inc. (http://fuel7.com/) for proprietary | ||
| 24 | * alternative licensing inquiries. | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef _TCA8418_KEYPAD_H | ||
| 28 | #define _TCA8418_KEYPAD_H | ||
| 29 | |||
| 30 | #include <linux/types.h> | ||
| 31 | #include <linux/input/matrix_keypad.h> | ||
| 32 | |||
| 33 | #define TCA8418_I2C_ADDR 0x34 | ||
| 34 | #define TCA8418_NAME "tca8418_keypad" | ||
| 35 | |||
| 36 | struct tca8418_keypad_platform_data { | ||
| 37 | const struct matrix_keymap_data *keymap_data; | ||
| 38 | unsigned rows; | ||
| 39 | unsigned cols; | ||
| 40 | bool rep; | ||
| 41 | bool irq_is_gpio; | ||
| 42 | }; | ||
| 43 | |||
| 44 | #endif | ||
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h index 5037a0ad2312..7e1371c4bccf 100644 --- a/include/linux/iocontext.h +++ b/include/linux/iocontext.h | |||
| @@ -3,32 +3,92 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/radix-tree.h> | 4 | #include <linux/radix-tree.h> |
| 5 | #include <linux/rcupdate.h> | 5 | #include <linux/rcupdate.h> |
| 6 | #include <linux/workqueue.h> | ||
| 6 | 7 | ||
| 7 | struct cfq_queue; | 8 | enum { |
| 8 | struct cfq_ttime { | 9 | ICQ_IOPRIO_CHANGED, |
| 9 | unsigned long last_end_request; | 10 | ICQ_CGROUP_CHANGED, |
| 10 | |||
| 11 | unsigned long ttime_total; | ||
| 12 | unsigned long ttime_samples; | ||
| 13 | unsigned long ttime_mean; | ||
| 14 | }; | 11 | }; |
| 15 | 12 | ||
| 16 | struct cfq_io_context { | 13 | /* |
| 17 | void *key; | 14 | * An io_cq (icq) is association between an io_context (ioc) and a |
| 18 | 15 | * request_queue (q). This is used by elevators which need to track | |
| 19 | struct cfq_queue *cfqq[2]; | 16 | * information per ioc - q pair. |
| 20 | 17 | * | |
| 21 | struct io_context *ioc; | 18 | * Elevator can request use of icq by setting elevator_type->icq_size and |
| 22 | 19 | * ->icq_align. Both size and align must be larger than that of struct | |
| 23 | struct cfq_ttime ttime; | 20 | * io_cq and elevator can use the tail area for private information. The |
| 24 | 21 | * recommended way to do this is defining a struct which contains io_cq as | |
| 25 | struct list_head queue_list; | 22 | * the first member followed by private members and using its size and |
| 26 | struct hlist_node cic_list; | 23 | * align. For example, |
| 27 | 24 | * | |
| 28 | void (*dtor)(struct io_context *); /* destructor */ | 25 | * struct snail_io_cq { |
| 29 | void (*exit)(struct io_context *); /* called on task exit */ | 26 | * struct io_cq icq; |
| 27 | * int poke_snail; | ||
| 28 | * int feed_snail; | ||
| 29 | * }; | ||
| 30 | * | ||
| 31 | * struct elevator_type snail_elv_type { | ||
| 32 | * .ops = { ... }, | ||
| 33 | * .icq_size = sizeof(struct snail_io_cq), | ||
| 34 | * .icq_align = __alignof__(struct snail_io_cq), | ||
| 35 | * ... | ||
| 36 | * }; | ||
| 37 | * | ||
| 38 | * If icq_size is set, block core will manage icq's. All requests will | ||
| 39 | * have its ->elv.icq field set before elevator_ops->elevator_set_req_fn() | ||
| 40 | * is called and be holding a reference to the associated io_context. | ||
| 41 | * | ||
| 42 | * Whenever a new icq is created, elevator_ops->elevator_init_icq_fn() is | ||
| 43 | * called and, on destruction, ->elevator_exit_icq_fn(). Both functions | ||
| 44 | * are called with both the associated io_context and queue locks held. | ||
| 45 | * | ||
| 46 | * Elevator is allowed to lookup icq using ioc_lookup_icq() while holding | ||
| 47 | * queue lock but the returned icq is valid only until the queue lock is | ||
| 48 | * released. Elevators can not and should not try to create or destroy | ||
| 49 | * icq's. | ||
| 50 | * | ||
| 51 | * As icq's are linked from both ioc and q, the locking rules are a bit | ||
| 52 | * complex. | ||
| 53 | * | ||
| 54 | * - ioc lock nests inside q lock. | ||
| 55 | * | ||
| 56 | * - ioc->icq_list and icq->ioc_node are protected by ioc lock. | ||
| 57 | * q->icq_list and icq->q_node by q lock. | ||
| 58 | * | ||
| 59 | * - ioc->icq_tree and ioc->icq_hint are protected by ioc lock, while icq | ||
| 60 | * itself is protected by q lock. However, both the indexes and icq | ||
| 61 | * itself are also RCU managed and lookup can be performed holding only | ||
| 62 | * the q lock. | ||
| 63 | * | ||
| 64 | * - icq's are not reference counted. They are destroyed when either the | ||
| 65 | * ioc or q goes away. Each request with icq set holds an extra | ||
| 66 | * reference to ioc to ensure it stays until the request is completed. | ||
| 67 | * | ||
| 68 | * - Linking and unlinking icq's are performed while holding both ioc and q | ||
| 69 | * locks. Due to the lock ordering, q exit is simple but ioc exit | ||
| 70 | * requires reverse-order double lock dance. | ||
| 71 | */ | ||
| 72 | struct io_cq { | ||
| 73 | struct request_queue *q; | ||
| 74 | struct io_context *ioc; | ||
| 30 | 75 | ||
| 31 | struct rcu_head rcu_head; | 76 | /* |
| 77 | * q_node and ioc_node link io_cq through icq_list of q and ioc | ||
| 78 | * respectively. Both fields are unused once ioc_exit_icq() is | ||
| 79 | * called and shared with __rcu_icq_cache and __rcu_head which are | ||
| 80 | * used for RCU free of io_cq. | ||
| 81 | */ | ||
| 82 | union { | ||
| 83 | struct list_head q_node; | ||
| 84 | struct kmem_cache *__rcu_icq_cache; | ||
| 85 | }; | ||
| 86 | union { | ||
| 87 | struct hlist_node ioc_node; | ||
| 88 | struct rcu_head __rcu_head; | ||
| 89 | }; | ||
| 90 | |||
| 91 | unsigned long changed; | ||
| 32 | }; | 92 | }; |
| 33 | 93 | ||
| 34 | /* | 94 | /* |
| @@ -43,11 +103,6 @@ struct io_context { | |||
| 43 | spinlock_t lock; | 103 | spinlock_t lock; |
| 44 | 104 | ||
| 45 | unsigned short ioprio; | 105 | unsigned short ioprio; |
| 46 | unsigned short ioprio_changed; | ||
| 47 | |||
| 48 | #if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE) | ||
| 49 | unsigned short cgroup_changed; | ||
| 50 | #endif | ||
| 51 | 106 | ||
| 52 | /* | 107 | /* |
| 53 | * For request batching | 108 | * For request batching |
| @@ -55,9 +110,11 @@ struct io_context { | |||
| 55 | int nr_batch_requests; /* Number of requests left in the batch */ | 110 | int nr_batch_requests; /* Number of requests left in the batch */ |
| 56 | unsigned long last_waited; /* Time last woken after wait for request */ | 111 | unsigned long last_waited; /* Time last woken after wait for request */ |
| 57 | 112 | ||
| 58 | struct radix_tree_root radix_root; | 113 | struct radix_tree_root icq_tree; |
| 59 | struct hlist_head cic_list; | 114 | struct io_cq __rcu *icq_hint; |
| 60 | void __rcu *ioc_data; | 115 | struct hlist_head icq_list; |
| 116 | |||
| 117 | struct work_struct release_work; | ||
| 61 | }; | 118 | }; |
| 62 | 119 | ||
| 63 | static inline struct io_context *ioc_task_link(struct io_context *ioc) | 120 | static inline struct io_context *ioc_task_link(struct io_context *ioc) |
| @@ -76,20 +133,17 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc) | |||
| 76 | 133 | ||
| 77 | struct task_struct; | 134 | struct task_struct; |
| 78 | #ifdef CONFIG_BLOCK | 135 | #ifdef CONFIG_BLOCK |
| 79 | int put_io_context(struct io_context *ioc); | 136 | void put_io_context(struct io_context *ioc, struct request_queue *locked_q); |
| 80 | void exit_io_context(struct task_struct *task); | 137 | void exit_io_context(struct task_struct *task); |
| 81 | struct io_context *get_io_context(gfp_t gfp_flags, int node); | 138 | struct io_context *get_task_io_context(struct task_struct *task, |
| 82 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node); | 139 | gfp_t gfp_flags, int node); |
| 140 | void ioc_ioprio_changed(struct io_context *ioc, int ioprio); | ||
| 141 | void ioc_cgroup_changed(struct io_context *ioc); | ||
| 83 | #else | 142 | #else |
| 84 | static inline void exit_io_context(struct task_struct *task) | ||
| 85 | { | ||
| 86 | } | ||
| 87 | |||
| 88 | struct io_context; | 143 | struct io_context; |
| 89 | static inline int put_io_context(struct io_context *ioc) | 144 | static inline void put_io_context(struct io_context *ioc, |
| 90 | { | 145 | struct request_queue *locked_q) { } |
| 91 | return 1; | 146 | static inline void exit_io_context(struct task_struct *task) { } |
| 92 | } | ||
| 93 | #endif | 147 | #endif |
| 94 | 148 | ||
| 95 | #endif | 149 | #endif |
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 432acc4c054d..d937580417ba 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
| @@ -48,19 +48,34 @@ struct iommu_domain { | |||
| 48 | 48 | ||
| 49 | #ifdef CONFIG_IOMMU_API | 49 | #ifdef CONFIG_IOMMU_API |
| 50 | 50 | ||
| 51 | /** | ||
| 52 | * struct iommu_ops - iommu ops and capabilities | ||
| 53 | * @domain_init: init iommu domain | ||
| 54 | * @domain_destroy: destroy iommu domain | ||
| 55 | * @attach_dev: attach device to an iommu domain | ||
| 56 | * @detach_dev: detach device from an iommu domain | ||
| 57 | * @map: map a physically contiguous memory region to an iommu domain | ||
| 58 | * @unmap: unmap a physically contiguous memory region from an iommu domain | ||
| 59 | * @iova_to_phys: translate iova to physical address | ||
| 60 | * @domain_has_cap: domain capabilities query | ||
| 61 | * @commit: commit iommu domain | ||
| 62 | * @pgsize_bitmap: bitmap of supported page sizes | ||
| 63 | */ | ||
| 51 | struct iommu_ops { | 64 | struct iommu_ops { |
| 52 | int (*domain_init)(struct iommu_domain *domain); | 65 | int (*domain_init)(struct iommu_domain *domain); |
| 53 | void (*domain_destroy)(struct iommu_domain *domain); | 66 | void (*domain_destroy)(struct iommu_domain *domain); |
| 54 | int (*attach_dev)(struct iommu_domain *domain, struct device *dev); | 67 | int (*attach_dev)(struct iommu_domain *domain, struct device *dev); |
| 55 | void (*detach_dev)(struct iommu_domain *domain, struct device *dev); | 68 | void (*detach_dev)(struct iommu_domain *domain, struct device *dev); |
| 56 | int (*map)(struct iommu_domain *domain, unsigned long iova, | 69 | int (*map)(struct iommu_domain *domain, unsigned long iova, |
| 57 | phys_addr_t paddr, int gfp_order, int prot); | 70 | phys_addr_t paddr, size_t size, int prot); |
| 58 | int (*unmap)(struct iommu_domain *domain, unsigned long iova, | 71 | size_t (*unmap)(struct iommu_domain *domain, unsigned long iova, |
| 59 | int gfp_order); | 72 | size_t size); |
| 60 | phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, | 73 | phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, |
| 61 | unsigned long iova); | 74 | unsigned long iova); |
| 62 | int (*domain_has_cap)(struct iommu_domain *domain, | 75 | int (*domain_has_cap)(struct iommu_domain *domain, |
| 63 | unsigned long cap); | 76 | unsigned long cap); |
| 77 | int (*device_group)(struct device *dev, unsigned int *groupid); | ||
| 78 | unsigned long pgsize_bitmap; | ||
| 64 | }; | 79 | }; |
| 65 | 80 | ||
| 66 | extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops); | 81 | extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops); |
| @@ -72,15 +87,16 @@ extern int iommu_attach_device(struct iommu_domain *domain, | |||
| 72 | extern void iommu_detach_device(struct iommu_domain *domain, | 87 | extern void iommu_detach_device(struct iommu_domain *domain, |
| 73 | struct device *dev); | 88 | struct device *dev); |
| 74 | extern int iommu_map(struct iommu_domain *domain, unsigned long iova, | 89 | extern int iommu_map(struct iommu_domain *domain, unsigned long iova, |
| 75 | phys_addr_t paddr, int gfp_order, int prot); | 90 | phys_addr_t paddr, size_t size, int prot); |
| 76 | extern int iommu_unmap(struct iommu_domain *domain, unsigned long iova, | 91 | extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova, |
| 77 | int gfp_order); | 92 | size_t size); |
| 78 | extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | 93 | extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, |
| 79 | unsigned long iova); | 94 | unsigned long iova); |
| 80 | extern int iommu_domain_has_cap(struct iommu_domain *domain, | 95 | extern int iommu_domain_has_cap(struct iommu_domain *domain, |
| 81 | unsigned long cap); | 96 | unsigned long cap); |
| 82 | extern void iommu_set_fault_handler(struct iommu_domain *domain, | 97 | extern void iommu_set_fault_handler(struct iommu_domain *domain, |
| 83 | iommu_fault_handler_t handler); | 98 | iommu_fault_handler_t handler); |
| 99 | extern int iommu_device_group(struct device *dev, unsigned int *groupid); | ||
| 84 | 100 | ||
| 85 | /** | 101 | /** |
| 86 | * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework | 102 | * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework |
| @@ -179,6 +195,11 @@ static inline void iommu_set_fault_handler(struct iommu_domain *domain, | |||
| 179 | { | 195 | { |
| 180 | } | 196 | } |
| 181 | 197 | ||
| 198 | static inline int iommu_device_group(struct device *dev, unsigned int *groupid) | ||
| 199 | { | ||
| 200 | return -ENODEV; | ||
| 201 | } | ||
| 202 | |||
| 182 | #endif /* CONFIG_IOMMU_API */ | 203 | #endif /* CONFIG_IOMMU_API */ |
| 183 | 204 | ||
| 184 | #endif /* __LINUX_IOMMU_H */ | 205 | #endif /* __LINUX_IOMMU_H */ |
diff --git a/include/linux/isdn_divertif.h b/include/linux/isdn_divertif.h index 07821ca5955f..a5a50f523807 100644 --- a/include/linux/isdn_divertif.h +++ b/include/linux/isdn_divertif.h | |||
| @@ -10,6 +10,8 @@ | |||
| 10 | * | 10 | * |
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #ifndef _LINUX_ISDN_DIVERTIF_H | ||
| 14 | #define _LINUX_ISDN_DIVERTIF_H | ||
| 13 | 15 | ||
| 14 | /***********************************************************/ | 16 | /***********************************************************/ |
| 15 | /* magic value is also used to control version information */ | 17 | /* magic value is also used to control version information */ |
| @@ -45,3 +47,5 @@ typedef struct | |||
| 45 | /*********************/ | 47 | /*********************/ |
| 46 | extern int DIVERT_REG_NAME(isdn_divert_if *); | 48 | extern int DIVERT_REG_NAME(isdn_divert_if *); |
| 47 | #endif | 49 | #endif |
| 50 | |||
| 51 | #endif /* _LINUX_ISDN_DIVERTIF_H */ | ||
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index c7acdde3243d..d211732b9e99 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
| @@ -497,7 +497,6 @@ struct transaction_s | |||
| 497 | * @j_format_version: Version of the superblock format | 497 | * @j_format_version: Version of the superblock format |
| 498 | * @j_state_lock: Protect the various scalars in the journal | 498 | * @j_state_lock: Protect the various scalars in the journal |
| 499 | * @j_barrier_count: Number of processes waiting to create a barrier lock | 499 | * @j_barrier_count: Number of processes waiting to create a barrier lock |
| 500 | * @j_barrier: The barrier lock itself | ||
| 501 | * @j_running_transaction: The current running transaction.. | 500 | * @j_running_transaction: The current running transaction.. |
| 502 | * @j_committing_transaction: the transaction we are pushing to disk | 501 | * @j_committing_transaction: the transaction we are pushing to disk |
| 503 | * @j_checkpoint_transactions: a linked circular list of all transactions | 502 | * @j_checkpoint_transactions: a linked circular list of all transactions |
| @@ -580,9 +579,6 @@ struct journal_s | |||
| 580 | */ | 579 | */ |
| 581 | int j_barrier_count; | 580 | int j_barrier_count; |
| 582 | 581 | ||
| 583 | /* The barrier lock itself */ | ||
| 584 | struct mutex j_barrier; | ||
| 585 | |||
| 586 | /* | 582 | /* |
| 587 | * Transactions: The current running transaction... | 583 | * Transactions: The current running transaction... |
| 588 | * [j_state_lock] [caller holding open handle] | 584 | * [j_state_lock] [caller holding open handle] |
| @@ -913,6 +909,7 @@ extern int journal_set_revoke(journal_t *, unsigned int, tid_t); | |||
| 913 | extern int journal_test_revoke(journal_t *, unsigned int, tid_t); | 909 | extern int journal_test_revoke(journal_t *, unsigned int, tid_t); |
| 914 | extern void journal_clear_revoke(journal_t *); | 910 | extern void journal_clear_revoke(journal_t *); |
| 915 | extern void journal_switch_revoke_table(journal_t *journal); | 911 | extern void journal_switch_revoke_table(journal_t *journal); |
| 912 | extern void journal_clear_buffer_revoked_flags(journal_t *journal); | ||
| 916 | 913 | ||
| 917 | /* | 914 | /* |
| 918 | * The log thread user interface: | 915 | * The log thread user interface: |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 2092ea21e469..5557baefed60 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
| @@ -1151,6 +1151,7 @@ extern int jbd2_journal_set_revoke(journal_t *, unsigned long long, tid_t); | |||
| 1151 | extern int jbd2_journal_test_revoke(journal_t *, unsigned long long, tid_t); | 1151 | extern int jbd2_journal_test_revoke(journal_t *, unsigned long long, tid_t); |
| 1152 | extern void jbd2_journal_clear_revoke(journal_t *); | 1152 | extern void jbd2_journal_clear_revoke(journal_t *); |
| 1153 | extern void jbd2_journal_switch_revoke_table(journal_t *journal); | 1153 | extern void jbd2_journal_switch_revoke_table(journal_t *journal); |
| 1154 | extern void jbd2_clear_buffer_revoked_flags(journal_t *journal); | ||
| 1154 | 1155 | ||
| 1155 | /* | 1156 | /* |
| 1156 | * The log thread user interface: | 1157 | * The log thread user interface: |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e8b1597b5cf2..e8343422240a 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -185,16 +185,17 @@ static inline void might_fault(void) | |||
| 185 | 185 | ||
| 186 | extern struct atomic_notifier_head panic_notifier_list; | 186 | extern struct atomic_notifier_head panic_notifier_list; |
| 187 | extern long (*panic_blink)(int state); | 187 | extern long (*panic_blink)(int state); |
| 188 | NORET_TYPE void panic(const char * fmt, ...) | 188 | __printf(1, 2) |
| 189 | __attribute__ ((NORET_AND format (printf, 1, 2))) __cold; | 189 | void panic(const char *fmt, ...) |
| 190 | __noreturn __cold; | ||
| 190 | extern void oops_enter(void); | 191 | extern void oops_enter(void); |
| 191 | extern void oops_exit(void); | 192 | extern void oops_exit(void); |
| 192 | void print_oops_end_marker(void); | 193 | void print_oops_end_marker(void); |
| 193 | extern int oops_may_print(void); | 194 | extern int oops_may_print(void); |
| 194 | NORET_TYPE void do_exit(long error_code) | 195 | void do_exit(long error_code) |
| 195 | ATTRIB_NORET; | 196 | __noreturn; |
| 196 | NORET_TYPE void complete_and_exit(struct completion *, long) | 197 | void complete_and_exit(struct completion *, long) |
| 197 | ATTRIB_NORET; | 198 | __noreturn; |
| 198 | 199 | ||
| 199 | /* Internal, do not use. */ | 200 | /* Internal, do not use. */ |
| 200 | int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res); | 201 | int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res); |
| @@ -341,6 +342,7 @@ extern int panic_timeout; | |||
| 341 | extern int panic_on_oops; | 342 | extern int panic_on_oops; |
| 342 | extern int panic_on_unrecovered_nmi; | 343 | extern int panic_on_unrecovered_nmi; |
| 343 | extern int panic_on_io_nmi; | 344 | extern int panic_on_io_nmi; |
| 345 | extern int sysctl_panic_on_stackoverflow; | ||
| 344 | extern const char *print_tainted(void); | 346 | extern const char *print_tainted(void); |
| 345 | extern void add_taint(unsigned flag); | 347 | extern void add_taint(unsigned flag); |
| 346 | extern int test_taint(unsigned flag); | 348 | extern int test_taint(unsigned flag); |
| @@ -665,6 +667,7 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } | |||
| 665 | #define BUILD_BUG_ON_ZERO(e) (0) | 667 | #define BUILD_BUG_ON_ZERO(e) (0) |
| 666 | #define BUILD_BUG_ON_NULL(e) ((void*)0) | 668 | #define BUILD_BUG_ON_NULL(e) ((void*)0) |
| 667 | #define BUILD_BUG_ON(condition) | 669 | #define BUILD_BUG_ON(condition) |
| 670 | #define BUILD_BUG() (0) | ||
| 668 | #else /* __CHECKER__ */ | 671 | #else /* __CHECKER__ */ |
| 669 | 672 | ||
| 670 | /* Force a compilation error if a constant expression is not a power of 2 */ | 673 | /* Force a compilation error if a constant expression is not a power of 2 */ |
| @@ -703,6 +706,21 @@ extern int __build_bug_on_failed; | |||
| 703 | if (condition) __build_bug_on_failed = 1; \ | 706 | if (condition) __build_bug_on_failed = 1; \ |
| 704 | } while(0) | 707 | } while(0) |
| 705 | #endif | 708 | #endif |
| 709 | |||
| 710 | /** | ||
| 711 | * BUILD_BUG - break compile if used. | ||
| 712 | * | ||
| 713 | * If you have some code that you expect the compiler to eliminate at | ||
| 714 | * build time, you should use BUILD_BUG to detect if it is | ||
| 715 | * unexpectedly used. | ||
| 716 | */ | ||
| 717 | #define BUILD_BUG() \ | ||
| 718 | do { \ | ||
| 719 | extern void __build_bug_failed(void) \ | ||
| 720 | __linktime_error("BUILD_BUG failed"); \ | ||
| 721 | __build_bug_failed(); \ | ||
| 722 | } while (0) | ||
| 723 | |||
| 706 | #endif /* __CHECKER__ */ | 724 | #endif /* __CHECKER__ */ |
| 707 | 725 | ||
| 708 | /* Trap pasters of __FUNCTION__ at compile-time */ | 726 | /* Trap pasters of __FUNCTION__ at compile-time */ |
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/key-type.h b/include/linux/key-type.h index 9efd081bb31e..39e3c082c49d 100644 --- a/include/linux/key-type.h +++ b/include/linux/key-type.h | |||
| @@ -92,6 +92,7 @@ struct key_type { | |||
| 92 | 92 | ||
| 93 | /* internal fields */ | 93 | /* internal fields */ |
| 94 | struct list_head link; /* link in types list */ | 94 | struct list_head link; /* link in types list */ |
| 95 | struct lock_class_key lock_class; /* key->sem lock class */ | ||
| 95 | }; | 96 | }; |
| 96 | 97 | ||
| 97 | extern struct key_type key_type_keyring; | 98 | extern struct key_type key_type_keyring; |
diff --git a/include/linux/key.h b/include/linux/key.h index 183a6af7715d..5253471cd2ea 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
| @@ -271,7 +271,7 @@ extern int keyring_add_key(struct key *keyring, | |||
| 271 | 271 | ||
| 272 | extern struct key *key_lookup(key_serial_t id); | 272 | extern struct key *key_lookup(key_serial_t id); |
| 273 | 273 | ||
| 274 | static inline key_serial_t key_serial(struct key *key) | 274 | static inline key_serial_t key_serial(const struct key *key) |
| 275 | { | 275 | { |
| 276 | return key ? key->serial : 0; | 276 | return key ? key->serial : 0; |
| 277 | } | 277 | } |
| @@ -293,6 +293,9 @@ static inline bool key_is_instantiated(const struct key *key) | |||
| 293 | (rcu_dereference_protected((KEY)->payload.rcudata, \ | 293 | (rcu_dereference_protected((KEY)->payload.rcudata, \ |
| 294 | rwsem_is_locked(&((struct key *)(KEY))->sem))) | 294 | rwsem_is_locked(&((struct key *)(KEY))->sem))) |
| 295 | 295 | ||
| 296 | #define rcu_assign_keypointer(KEY, PAYLOAD) \ | ||
| 297 | (rcu_assign_pointer((KEY)->payload.rcudata, PAYLOAD)) | ||
| 298 | |||
| 296 | #ifdef CONFIG_SYSCTL | 299 | #ifdef CONFIG_SYSCTL |
| 297 | extern ctl_table key_sysctls[]; | 300 | extern ctl_table key_sysctls[]; |
| 298 | #endif | 301 | #endif |
diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h index 99d9a6766f7e..2a5e5548a1d2 100644 --- a/include/linux/kmemleak.h +++ b/include/linux/kmemleak.h | |||
| @@ -26,8 +26,10 @@ | |||
| 26 | extern void kmemleak_init(void) __ref; | 26 | extern void kmemleak_init(void) __ref; |
| 27 | extern void kmemleak_alloc(const void *ptr, size_t size, int min_count, | 27 | extern void kmemleak_alloc(const void *ptr, size_t size, int min_count, |
| 28 | gfp_t gfp) __ref; | 28 | gfp_t gfp) __ref; |
| 29 | extern void kmemleak_alloc_percpu(const void __percpu *ptr, size_t size) __ref; | ||
| 29 | extern void kmemleak_free(const void *ptr) __ref; | 30 | extern void kmemleak_free(const void *ptr) __ref; |
| 30 | extern void kmemleak_free_part(const void *ptr, size_t size) __ref; | 31 | extern void kmemleak_free_part(const void *ptr, size_t size) __ref; |
| 32 | extern void kmemleak_free_percpu(const void __percpu *ptr) __ref; | ||
| 31 | extern void kmemleak_padding(const void *ptr, unsigned long offset, | 33 | extern void kmemleak_padding(const void *ptr, unsigned long offset, |
| 32 | size_t size) __ref; | 34 | size_t size) __ref; |
| 33 | extern void kmemleak_not_leak(const void *ptr) __ref; | 35 | extern void kmemleak_not_leak(const void *ptr) __ref; |
| @@ -68,6 +70,9 @@ static inline void kmemleak_alloc_recursive(const void *ptr, size_t size, | |||
| 68 | gfp_t gfp) | 70 | gfp_t gfp) |
| 69 | { | 71 | { |
| 70 | } | 72 | } |
| 73 | static inline void kmemleak_alloc_percpu(const void __percpu *ptr, size_t size) | ||
| 74 | { | ||
| 75 | } | ||
| 71 | static inline void kmemleak_free(const void *ptr) | 76 | static inline void kmemleak_free(const void *ptr) |
| 72 | { | 77 | { |
| 73 | } | 78 | } |
| @@ -77,6 +82,9 @@ static inline void kmemleak_free_part(const void *ptr, size_t size) | |||
| 77 | static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags) | 82 | static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags) |
| 78 | { | 83 | { |
| 79 | } | 84 | } |
| 85 | static inline void kmemleak_free_percpu(const void __percpu *ptr) | ||
| 86 | { | ||
| 87 | } | ||
| 80 | static inline void kmemleak_not_leak(const void *ptr) | 88 | static inline void kmemleak_not_leak(const void *ptr) |
| 81 | { | 89 | { |
| 82 | } | 90 | } |
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h index ee0c952188de..fee66317e071 100644 --- a/include/linux/kmsg_dump.h +++ b/include/linux/kmsg_dump.h | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | enum kmsg_dump_reason { | 18 | enum kmsg_dump_reason { |
| 19 | KMSG_DUMP_OOPS, | 19 | KMSG_DUMP_OOPS, |
| 20 | KMSG_DUMP_PANIC, | 20 | KMSG_DUMP_PANIC, |
| 21 | KMSG_DUMP_KEXEC, | ||
| 22 | KMSG_DUMP_RESTART, | 21 | KMSG_DUMP_RESTART, |
| 23 | KMSG_DUMP_HALT, | 22 | KMSG_DUMP_HALT, |
| 24 | KMSG_DUMP_POWEROFF, | 23 | KMSG_DUMP_POWEROFF, |
diff --git a/include/linux/kref.h b/include/linux/kref.h index abc0120b09b7..9c07dcebded7 100644 --- a/include/linux/kref.h +++ b/include/linux/kref.h | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | #include <linux/bug.h> | 18 | #include <linux/bug.h> |
| 19 | #include <linux/atomic.h> | 19 | #include <linux/atomic.h> |
| 20 | #include <linux/kernel.h> | ||
| 20 | 21 | ||
| 21 | struct kref { | 22 | struct kref { |
| 22 | atomic_t refcount; | 23 | atomic_t refcount; |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index d52623199978..900c76337e8f 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/signal.h> | 14 | #include <linux/signal.h> |
| 15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
| 16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
| 17 | #include <linux/mmu_notifier.h> | ||
| 17 | #include <linux/preempt.h> | 18 | #include <linux/preempt.h> |
| 18 | #include <linux/msi.h> | 19 | #include <linux/msi.h> |
| 19 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
| @@ -50,6 +51,9 @@ | |||
| 50 | #define KVM_REQ_APF_HALT 12 | 51 | #define KVM_REQ_APF_HALT 12 |
| 51 | #define KVM_REQ_STEAL_UPDATE 13 | 52 | #define KVM_REQ_STEAL_UPDATE 13 |
| 52 | #define KVM_REQ_NMI 14 | 53 | #define KVM_REQ_NMI 14 |
| 54 | #define KVM_REQ_IMMEDIATE_EXIT 15 | ||
| 55 | #define KVM_REQ_PMU 16 | ||
| 56 | #define KVM_REQ_PMI 17 | ||
| 53 | 57 | ||
| 54 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 58 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
| 55 | 59 | ||
| @@ -179,6 +183,7 @@ struct kvm_memory_slot { | |||
| 179 | unsigned long *rmap; | 183 | unsigned long *rmap; |
| 180 | unsigned long *dirty_bitmap; | 184 | unsigned long *dirty_bitmap; |
| 181 | unsigned long *dirty_bitmap_head; | 185 | unsigned long *dirty_bitmap_head; |
| 186 | unsigned long nr_dirty_pages; | ||
| 182 | struct kvm_lpage_info *lpage_info[KVM_NR_PAGE_SIZES - 1]; | 187 | struct kvm_lpage_info *lpage_info[KVM_NR_PAGE_SIZES - 1]; |
| 183 | unsigned long userspace_addr; | 188 | unsigned long userspace_addr; |
| 184 | int user_alloc; | 189 | int user_alloc; |
| @@ -224,11 +229,20 @@ struct kvm_irq_routing_table {}; | |||
| 224 | 229 | ||
| 225 | #endif | 230 | #endif |
| 226 | 231 | ||
| 232 | #ifndef KVM_MEM_SLOTS_NUM | ||
| 233 | #define KVM_MEM_SLOTS_NUM (KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS) | ||
| 234 | #endif | ||
| 235 | |||
| 236 | /* | ||
| 237 | * Note: | ||
| 238 | * memslots are not sorted by id anymore, please use id_to_memslot() | ||
| 239 | * to get the memslot by its id. | ||
| 240 | */ | ||
| 227 | struct kvm_memslots { | 241 | struct kvm_memslots { |
| 228 | int nmemslots; | ||
| 229 | u64 generation; | 242 | u64 generation; |
| 230 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + | 243 | struct kvm_memory_slot memslots[KVM_MEM_SLOTS_NUM]; |
| 231 | KVM_PRIVATE_MEM_SLOTS]; | 244 | /* The mapping table from slot id to the index in memslots[]. */ |
| 245 | int id_to_index[KVM_MEM_SLOTS_NUM]; | ||
| 232 | }; | 246 | }; |
| 233 | 247 | ||
| 234 | struct kvm { | 248 | struct kvm { |
| @@ -239,7 +253,6 @@ struct kvm { | |||
| 239 | struct srcu_struct srcu; | 253 | struct srcu_struct srcu; |
| 240 | #ifdef CONFIG_KVM_APIC_ARCHITECTURE | 254 | #ifdef CONFIG_KVM_APIC_ARCHITECTURE |
| 241 | u32 bsp_vcpu_id; | 255 | u32 bsp_vcpu_id; |
| 242 | struct kvm_vcpu *bsp_vcpu; | ||
| 243 | #endif | 256 | #endif |
| 244 | struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; | 257 | struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; |
| 245 | atomic_t online_vcpus; | 258 | atomic_t online_vcpus; |
| @@ -302,6 +315,11 @@ static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i) | |||
| 302 | (vcpup = kvm_get_vcpu(kvm, idx)) != NULL; \ | 315 | (vcpup = kvm_get_vcpu(kvm, idx)) != NULL; \ |
| 303 | idx++) | 316 | idx++) |
| 304 | 317 | ||
| 318 | #define kvm_for_each_memslot(memslot, slots) \ | ||
| 319 | for (memslot = &slots->memslots[0]; \ | ||
| 320 | memslot < slots->memslots + KVM_MEM_SLOTS_NUM && memslot->npages;\ | ||
| 321 | memslot++) | ||
| 322 | |||
| 305 | int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id); | 323 | int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id); |
| 306 | void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); | 324 | void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); |
| 307 | 325 | ||
| @@ -314,6 +332,7 @@ void kvm_exit(void); | |||
| 314 | 332 | ||
| 315 | void kvm_get_kvm(struct kvm *kvm); | 333 | void kvm_get_kvm(struct kvm *kvm); |
| 316 | void kvm_put_kvm(struct kvm *kvm); | 334 | void kvm_put_kvm(struct kvm *kvm); |
| 335 | void update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new); | ||
| 317 | 336 | ||
| 318 | static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) | 337 | static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) |
| 319 | { | 338 | { |
| @@ -322,6 +341,18 @@ static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) | |||
| 322 | || lockdep_is_held(&kvm->slots_lock)); | 341 | || lockdep_is_held(&kvm->slots_lock)); |
| 323 | } | 342 | } |
| 324 | 343 | ||
| 344 | static inline struct kvm_memory_slot * | ||
| 345 | id_to_memslot(struct kvm_memslots *slots, int id) | ||
| 346 | { | ||
| 347 | int index = slots->id_to_index[id]; | ||
| 348 | struct kvm_memory_slot *slot; | ||
| 349 | |||
| 350 | slot = &slots->memslots[index]; | ||
| 351 | |||
| 352 | WARN_ON(slot->id != id); | ||
| 353 | return slot; | ||
| 354 | } | ||
| 355 | |||
| 325 | #define HPA_MSB ((sizeof(hpa_t) * 8) - 1) | 356 | #define HPA_MSB ((sizeof(hpa_t) * 8) - 1) |
| 326 | #define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB) | 357 | #define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB) |
| 327 | static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } | 358 | static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } |
diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h index 47a070b0520e..ff476ddaf310 100644 --- a/include/linux/kvm_para.h +++ b/include/linux/kvm_para.h | |||
| @@ -35,4 +35,3 @@ static inline int kvm_para_has_feature(unsigned int feature) | |||
| 35 | } | 35 | } |
| 36 | #endif /* __KERNEL__ */ | 36 | #endif /* __KERNEL__ */ |
| 37 | #endif /* __LINUX_KVM_PARA_H */ | 37 | #endif /* __LINUX_KVM_PARA_H */ |
| 38 | |||
diff --git a/include/linux/leds-tca6507.h b/include/linux/leds-tca6507.h new file mode 100644 index 000000000000..dcabf4fa2aef --- /dev/null +++ b/include/linux/leds-tca6507.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * TCA6507 LED chip driver. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Neil Brown <neil@brown.name> | ||
| 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 | ||
| 8 | * version 2 as published by the Free Software Foundation. | ||
| 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 | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 18 | * 02110-1301 USA | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __LINUX_TCA6507_H | ||
| 22 | #define __LINUX_TCA6507_H | ||
| 23 | #include <linux/leds.h> | ||
| 24 | |||
| 25 | struct tca6507_platform_data { | ||
| 26 | struct led_platform_data leds; | ||
| 27 | #ifdef CONFIG_GPIOLIB | ||
| 28 | int gpio_base; | ||
| 29 | void (*setup)(unsigned gpio_base, unsigned ngpio); | ||
| 30 | #endif | ||
| 31 | }; | ||
| 32 | |||
| 33 | #define TCA6507_MAKE_GPIO 1 | ||
| 34 | #endif /* __LINUX_TCA6507_H*/ | ||
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 3f46aedea42f..807f1e533226 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
| @@ -88,8 +88,4 @@ | |||
| 88 | 88 | ||
| 89 | #endif | 89 | #endif |
| 90 | 90 | ||
| 91 | #define NORET_TYPE /**/ | ||
| 92 | #define ATTRIB_NORET __attribute__((noreturn)) | ||
| 93 | #define NORET_AND noreturn, | ||
| 94 | |||
| 95 | #endif | 91 | #endif |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 90b0656a869e..88a114fce477 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
| @@ -195,7 +195,7 @@ extern struct svc_procedure nlmsvc_procedures4[]; | |||
| 195 | #endif | 195 | #endif |
| 196 | extern int nlmsvc_grace_period; | 196 | extern int nlmsvc_grace_period; |
| 197 | extern unsigned long nlmsvc_timeout; | 197 | extern unsigned long nlmsvc_timeout; |
| 198 | extern int nsm_use_hostnames; | 198 | extern bool nsm_use_hostnames; |
| 199 | extern u32 nsm_local_state; | 199 | extern u32 nsm_local_state; |
| 200 | 200 | ||
| 201 | /* | 201 | /* |
diff --git a/include/linux/lp8727.h b/include/linux/lp8727.h new file mode 100644 index 000000000000..d21fa2865bf4 --- /dev/null +++ b/include/linux/lp8727.h | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2011 National Semiconductor | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 as | ||
| 6 | * published by the Free Software Foundation. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _LP8727_H | ||
| 10 | #define _LP8727_H | ||
| 11 | |||
| 12 | enum lp8727_eoc_level { | ||
| 13 | EOC_5P, | ||
| 14 | EOC_10P, | ||
| 15 | EOC_16P, | ||
| 16 | EOC_20P, | ||
| 17 | EOC_25P, | ||
| 18 | EOC_33P, | ||
| 19 | EOC_50P, | ||
| 20 | }; | ||
| 21 | |||
| 22 | enum lp8727_ichg { | ||
| 23 | ICHG_90mA, | ||
| 24 | ICHG_100mA, | ||
| 25 | ICHG_400mA, | ||
| 26 | ICHG_450mA, | ||
| 27 | ICHG_500mA, | ||
| 28 | ICHG_600mA, | ||
| 29 | ICHG_700mA, | ||
| 30 | ICHG_800mA, | ||
| 31 | ICHG_900mA, | ||
| 32 | ICHG_1000mA, | ||
| 33 | }; | ||
| 34 | |||
| 35 | struct lp8727_chg_param { | ||
| 36 | /* end of charge level setting */ | ||
| 37 | enum lp8727_eoc_level eoc_level; | ||
| 38 | /* charging current */ | ||
| 39 | enum lp8727_ichg ichg; | ||
| 40 | }; | ||
| 41 | |||
| 42 | struct lp8727_platform_data { | ||
| 43 | u8 (*get_batt_present)(void); | ||
| 44 | u16 (*get_batt_level)(void); | ||
| 45 | u8 (*get_batt_capacity)(void); | ||
| 46 | u8 (*get_batt_temp)(void); | ||
| 47 | struct lp8727_chg_param ac; | ||
| 48 | struct lp8727_chg_param usb; | ||
| 49 | }; | ||
| 50 | |||
| 51 | #endif | ||
diff --git a/include/linux/mbus.h b/include/linux/mbus.h index c11ff2932549..efa1a6d7aca8 100644 --- a/include/linux/mbus.h +++ b/include/linux/mbus.h | |||
| @@ -32,5 +32,16 @@ struct mbus_dram_target_info | |||
| 32 | } cs[4]; | 32 | } cs[4]; |
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | 35 | /* | |
| 36 | * The Marvell mbus is to be found only on SOCs from the Orion family | ||
| 37 | * at the moment. Provide a dummy stub for other architectures. | ||
| 38 | */ | ||
| 39 | #ifdef CONFIG_PLAT_ORION | ||
| 40 | extern const struct mbus_dram_target_info *mv_mbus_dram_info(void); | ||
| 41 | #else | ||
| 42 | static inline const struct mbus_dram_target_info *mv_mbus_dram_info(void) | ||
| 43 | { | ||
| 44 | return NULL; | ||
| 45 | } | ||
| 46 | #endif | ||
| 36 | #endif | 47 | #endif |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 9b296ea41bb8..4d34356fe644 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
| @@ -32,13 +32,11 @@ enum mem_cgroup_page_stat_item { | |||
| 32 | MEMCG_NR_FILE_MAPPED, /* # of pages charged as file rss */ | 32 | MEMCG_NR_FILE_MAPPED, /* # of pages charged as file rss */ |
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | 35 | struct mem_cgroup_reclaim_cookie { |
| 36 | struct list_head *dst, | 36 | struct zone *zone; |
| 37 | unsigned long *scanned, int order, | 37 | int priority; |
| 38 | isolate_mode_t mode, | 38 | unsigned int generation; |
| 39 | struct zone *z, | 39 | }; |
| 40 | struct mem_cgroup *mem_cont, | ||
| 41 | int active, int file); | ||
| 42 | 40 | ||
| 43 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | 41 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
| 44 | /* | 42 | /* |
| @@ -56,20 +54,21 @@ extern int mem_cgroup_newpage_charge(struct page *page, struct mm_struct *mm, | |||
| 56 | gfp_t gfp_mask); | 54 | gfp_t gfp_mask); |
| 57 | /* for swap handling */ | 55 | /* for swap handling */ |
| 58 | extern int mem_cgroup_try_charge_swapin(struct mm_struct *mm, | 56 | extern int mem_cgroup_try_charge_swapin(struct mm_struct *mm, |
| 59 | struct page *page, gfp_t mask, struct mem_cgroup **ptr); | 57 | struct page *page, gfp_t mask, struct mem_cgroup **memcgp); |
| 60 | extern void mem_cgroup_commit_charge_swapin(struct page *page, | 58 | extern void mem_cgroup_commit_charge_swapin(struct page *page, |
| 61 | struct mem_cgroup *ptr); | 59 | struct mem_cgroup *memcg); |
| 62 | extern void mem_cgroup_cancel_charge_swapin(struct mem_cgroup *ptr); | 60 | extern void mem_cgroup_cancel_charge_swapin(struct mem_cgroup *memcg); |
| 63 | 61 | ||
| 64 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, | 62 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, |
| 65 | gfp_t gfp_mask); | 63 | gfp_t gfp_mask); |
| 66 | extern void mem_cgroup_add_lru_list(struct page *page, enum lru_list lru); | 64 | |
| 67 | extern void mem_cgroup_del_lru_list(struct page *page, enum lru_list lru); | 65 | struct lruvec *mem_cgroup_zone_lruvec(struct zone *, struct mem_cgroup *); |
| 68 | extern void mem_cgroup_rotate_reclaimable_page(struct page *page); | 66 | struct lruvec *mem_cgroup_lru_add_list(struct zone *, struct page *, |
| 69 | extern void mem_cgroup_rotate_lru_list(struct page *page, enum lru_list lru); | 67 | enum lru_list); |
| 70 | extern void mem_cgroup_del_lru(struct page *page); | 68 | void mem_cgroup_lru_del_list(struct page *, enum lru_list); |
| 71 | extern void mem_cgroup_move_lists(struct page *page, | 69 | void mem_cgroup_lru_del(struct page *); |
| 72 | enum lru_list from, enum lru_list to); | 70 | struct lruvec *mem_cgroup_lru_move_lists(struct zone *, struct page *, |
| 71 | enum lru_list, enum lru_list); | ||
| 73 | 72 | ||
| 74 | /* For coalescing uncharge for reducing memcg' overhead*/ | 73 | /* For coalescing uncharge for reducing memcg' overhead*/ |
| 75 | extern void mem_cgroup_uncharge_start(void); | 74 | extern void mem_cgroup_uncharge_start(void); |
| @@ -102,10 +101,15 @@ extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg); | |||
| 102 | 101 | ||
| 103 | extern int | 102 | extern int |
| 104 | mem_cgroup_prepare_migration(struct page *page, | 103 | mem_cgroup_prepare_migration(struct page *page, |
| 105 | struct page *newpage, struct mem_cgroup **ptr, gfp_t gfp_mask); | 104 | struct page *newpage, struct mem_cgroup **memcgp, gfp_t gfp_mask); |
| 106 | extern void mem_cgroup_end_migration(struct mem_cgroup *memcg, | 105 | extern void mem_cgroup_end_migration(struct mem_cgroup *memcg, |
| 107 | struct page *oldpage, struct page *newpage, bool migration_ok); | 106 | struct page *oldpage, struct page *newpage, bool migration_ok); |
| 108 | 107 | ||
| 108 | struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *, | ||
| 109 | struct mem_cgroup *, | ||
| 110 | struct mem_cgroup_reclaim_cookie *); | ||
| 111 | void mem_cgroup_iter_break(struct mem_cgroup *, struct mem_cgroup *); | ||
| 112 | |||
| 109 | /* | 113 | /* |
| 110 | * For memory reclaim. | 114 | * For memory reclaim. |
| 111 | */ | 115 | */ |
| @@ -122,7 +126,10 @@ struct zone_reclaim_stat* | |||
| 122 | mem_cgroup_get_reclaim_stat_from_page(struct page *page); | 126 | mem_cgroup_get_reclaim_stat_from_page(struct page *page); |
| 123 | extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, | 127 | extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, |
| 124 | struct task_struct *p); | 128 | struct task_struct *p); |
| 129 | extern void mem_cgroup_replace_page_cache(struct page *oldpage, | ||
| 130 | struct page *newpage); | ||
| 125 | 131 | ||
| 132 | extern void mem_cgroup_reset_owner(struct page *page); | ||
| 126 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | 133 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP |
| 127 | extern int do_swap_account; | 134 | extern int do_swap_account; |
| 128 | #endif | 135 | #endif |
| @@ -157,7 +164,7 @@ u64 mem_cgroup_get_limit(struct mem_cgroup *memcg); | |||
| 157 | 164 | ||
| 158 | void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); | 165 | void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); |
| 159 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 166 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
| 160 | void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail); | 167 | void mem_cgroup_split_huge_fixup(struct page *head); |
| 161 | #endif | 168 | #endif |
| 162 | 169 | ||
| 163 | #ifdef CONFIG_DEBUG_VM | 170 | #ifdef CONFIG_DEBUG_VM |
| @@ -180,17 +187,17 @@ static inline int mem_cgroup_cache_charge(struct page *page, | |||
| 180 | } | 187 | } |
| 181 | 188 | ||
| 182 | static inline int mem_cgroup_try_charge_swapin(struct mm_struct *mm, | 189 | static inline int mem_cgroup_try_charge_swapin(struct mm_struct *mm, |
| 183 | struct page *page, gfp_t gfp_mask, struct mem_cgroup **ptr) | 190 | struct page *page, gfp_t gfp_mask, struct mem_cgroup **memcgp) |
| 184 | { | 191 | { |
| 185 | return 0; | 192 | return 0; |
| 186 | } | 193 | } |
| 187 | 194 | ||
| 188 | static inline void mem_cgroup_commit_charge_swapin(struct page *page, | 195 | static inline void mem_cgroup_commit_charge_swapin(struct page *page, |
| 189 | struct mem_cgroup *ptr) | 196 | struct mem_cgroup *memcg) |
| 190 | { | 197 | { |
| 191 | } | 198 | } |
| 192 | 199 | ||
| 193 | static inline void mem_cgroup_cancel_charge_swapin(struct mem_cgroup *ptr) | 200 | static inline void mem_cgroup_cancel_charge_swapin(struct mem_cgroup *memcg) |
| 194 | { | 201 | { |
| 195 | } | 202 | } |
| 196 | 203 | ||
| @@ -210,33 +217,33 @@ static inline void mem_cgroup_uncharge_cache_page(struct page *page) | |||
| 210 | { | 217 | { |
| 211 | } | 218 | } |
| 212 | 219 | ||
| 213 | static inline void mem_cgroup_add_lru_list(struct page *page, int lru) | 220 | static inline struct lruvec *mem_cgroup_zone_lruvec(struct zone *zone, |
| 214 | { | 221 | struct mem_cgroup *memcg) |
| 215 | } | ||
| 216 | |||
| 217 | static inline void mem_cgroup_del_lru_list(struct page *page, int lru) | ||
| 218 | { | 222 | { |
| 219 | return ; | 223 | return &zone->lruvec; |
| 220 | } | 224 | } |
| 221 | 225 | ||
| 222 | static inline void mem_cgroup_rotate_reclaimable_page(struct page *page) | 226 | static inline struct lruvec *mem_cgroup_lru_add_list(struct zone *zone, |
| 227 | struct page *page, | ||
| 228 | enum lru_list lru) | ||
| 223 | { | 229 | { |
| 224 | return ; | 230 | return &zone->lruvec; |
| 225 | } | 231 | } |
| 226 | 232 | ||
| 227 | static inline void mem_cgroup_rotate_lru_list(struct page *page, int lru) | 233 | static inline void mem_cgroup_lru_del_list(struct page *page, enum lru_list lru) |
| 228 | { | 234 | { |
| 229 | return ; | ||
| 230 | } | 235 | } |
| 231 | 236 | ||
| 232 | static inline void mem_cgroup_del_lru(struct page *page) | 237 | static inline void mem_cgroup_lru_del(struct page *page) |
| 233 | { | 238 | { |
| 234 | return ; | ||
| 235 | } | 239 | } |
| 236 | 240 | ||
| 237 | static inline void | 241 | static inline struct lruvec *mem_cgroup_lru_move_lists(struct zone *zone, |
| 238 | mem_cgroup_move_lists(struct page *page, enum lru_list from, enum lru_list to) | 242 | struct page *page, |
| 243 | enum lru_list from, | ||
| 244 | enum lru_list to) | ||
| 239 | { | 245 | { |
| 246 | return &zone->lruvec; | ||
| 240 | } | 247 | } |
| 241 | 248 | ||
| 242 | static inline struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page) | 249 | static inline struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page) |
| @@ -269,7 +276,7 @@ static inline struct cgroup_subsys_state | |||
| 269 | 276 | ||
| 270 | static inline int | 277 | static inline int |
| 271 | mem_cgroup_prepare_migration(struct page *page, struct page *newpage, | 278 | mem_cgroup_prepare_migration(struct page *page, struct page *newpage, |
| 272 | struct mem_cgroup **ptr, gfp_t gfp_mask) | 279 | struct mem_cgroup **memcgp, gfp_t gfp_mask) |
| 273 | { | 280 | { |
| 274 | return 0; | 281 | return 0; |
| 275 | } | 282 | } |
| @@ -279,6 +286,19 @@ static inline void mem_cgroup_end_migration(struct mem_cgroup *memcg, | |||
| 279 | { | 286 | { |
| 280 | } | 287 | } |
| 281 | 288 | ||
| 289 | static inline struct mem_cgroup * | ||
| 290 | mem_cgroup_iter(struct mem_cgroup *root, | ||
| 291 | struct mem_cgroup *prev, | ||
| 292 | struct mem_cgroup_reclaim_cookie *reclaim) | ||
| 293 | { | ||
| 294 | return NULL; | ||
| 295 | } | ||
| 296 | |||
| 297 | static inline void mem_cgroup_iter_break(struct mem_cgroup *root, | ||
| 298 | struct mem_cgroup *prev) | ||
| 299 | { | ||
| 300 | } | ||
| 301 | |||
| 282 | static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *memcg) | 302 | static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *memcg) |
| 283 | { | 303 | { |
| 284 | return 0; | 304 | return 0; |
| @@ -360,8 +380,7 @@ u64 mem_cgroup_get_limit(struct mem_cgroup *memcg) | |||
| 360 | return 0; | 380 | return 0; |
| 361 | } | 381 | } |
| 362 | 382 | ||
| 363 | static inline void mem_cgroup_split_huge_fixup(struct page *head, | 383 | static inline void mem_cgroup_split_huge_fixup(struct page *head) |
| 364 | struct page *tail) | ||
| 365 | { | 384 | { |
| 366 | } | 385 | } |
| 367 | 386 | ||
| @@ -369,6 +388,14 @@ static inline | |||
| 369 | void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx) | 388 | void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx) |
| 370 | { | 389 | { |
| 371 | } | 390 | } |
| 391 | static inline void mem_cgroup_replace_page_cache(struct page *oldpage, | ||
| 392 | struct page *newpage) | ||
| 393 | { | ||
| 394 | } | ||
| 395 | |||
| 396 | static inline void mem_cgroup_reset_owner(struct page *page) | ||
| 397 | { | ||
| 398 | } | ||
| 372 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 399 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
| 373 | 400 | ||
| 374 | #if !defined(CONFIG_CGROUP_MEM_RES_CTLR) || !defined(CONFIG_DEBUG_VM) | 401 | #if !defined(CONFIG_CGROUP_MEM_RES_CTLR) || !defined(CONFIG_DEBUG_VM) |
| @@ -390,7 +417,6 @@ enum { | |||
| 390 | OVER_LIMIT, | 417 | OVER_LIMIT, |
| 391 | }; | 418 | }; |
| 392 | 419 | ||
| 393 | #ifdef CONFIG_INET | ||
| 394 | struct sock; | 420 | struct sock; |
| 395 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM | 421 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM |
| 396 | void sock_update_memcg(struct sock *sk); | 422 | void sock_update_memcg(struct sock *sk); |
| @@ -403,6 +429,5 @@ static inline void sock_release_memcg(struct sock *sk) | |||
| 403 | { | 429 | { |
| 404 | } | 430 | } |
| 405 | #endif /* CONFIG_CGROUP_MEM_RES_CTLR_KMEM */ | 431 | #endif /* CONFIG_CGROUP_MEM_RES_CTLR_KMEM */ |
| 406 | #endif /* CONFIG_INET */ | ||
| 407 | #endif /* _LINUX_MEMCONTROL_H */ | 432 | #endif /* _LINUX_MEMCONTROL_H */ |
| 408 | 433 | ||
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 7978eec1b7d9..7c727a90d70d 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
| @@ -164,11 +164,11 @@ static inline void mpol_get(struct mempolicy *pol) | |||
| 164 | atomic_inc(&pol->refcnt); | 164 | atomic_inc(&pol->refcnt); |
| 165 | } | 165 | } |
| 166 | 166 | ||
| 167 | extern int __mpol_equal(struct mempolicy *a, struct mempolicy *b); | 167 | extern bool __mpol_equal(struct mempolicy *a, struct mempolicy *b); |
| 168 | static inline int mpol_equal(struct mempolicy *a, struct mempolicy *b) | 168 | static inline bool mpol_equal(struct mempolicy *a, struct mempolicy *b) |
| 169 | { | 169 | { |
| 170 | if (a == b) | 170 | if (a == b) |
| 171 | return 1; | 171 | return true; |
| 172 | return __mpol_equal(a, b); | 172 | return __mpol_equal(a, b); |
| 173 | } | 173 | } |
| 174 | 174 | ||
| @@ -257,9 +257,9 @@ static inline int vma_migratable(struct vm_area_struct *vma) | |||
| 257 | 257 | ||
| 258 | struct mempolicy {}; | 258 | struct mempolicy {}; |
| 259 | 259 | ||
| 260 | static inline int mpol_equal(struct mempolicy *a, struct mempolicy *b) | 260 | static inline bool mpol_equal(struct mempolicy *a, struct mempolicy *b) |
| 261 | { | 261 | { |
| 262 | return 1; | 262 | return true; |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | static inline void mpol_put(struct mempolicy *p) | 265 | static inline void mpol_put(struct mempolicy *p) |
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h index 63b4fb8e3b6f..92be3476c9f5 100644 --- a/include/linux/mfd/88pm860x.h +++ b/include/linux/mfd/88pm860x.h | |||
| @@ -297,10 +297,11 @@ enum { | |||
| 297 | 297 | ||
| 298 | struct pm860x_chip { | 298 | struct pm860x_chip { |
| 299 | struct device *dev; | 299 | struct device *dev; |
| 300 | struct mutex io_lock; | ||
| 301 | struct mutex irq_lock; | 300 | struct mutex irq_lock; |
| 302 | struct i2c_client *client; | 301 | struct i2c_client *client; |
| 303 | struct i2c_client *companion; /* companion chip client */ | 302 | struct i2c_client *companion; /* companion chip client */ |
| 303 | struct regmap *regmap; | ||
| 304 | struct regmap *regmap_companion; | ||
| 304 | 305 | ||
| 305 | int buck3_double; /* DVC ramp slope double */ | 306 | int buck3_double; /* DVC ramp slope double */ |
| 306 | unsigned short companion_addr; | 307 | unsigned short companion_addr; |
diff --git a/include/linux/mfd/ab5500/ab5500.h b/include/linux/mfd/abx500/ab5500.h index a720051ae933..a720051ae933 100644 --- a/include/linux/mfd/ab5500/ab5500.h +++ b/include/linux/mfd/abx500/ab5500.h | |||
diff --git a/include/linux/mfd/ab8500/gpadc.h b/include/linux/mfd/abx500/ab8500-gpadc.h index 252966769d93..252966769d93 100644 --- a/include/linux/mfd/ab8500/gpadc.h +++ b/include/linux/mfd/abx500/ab8500-gpadc.h | |||
diff --git a/include/linux/mfd/ab8500/gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h index 488a8c920a29..488a8c920a29 100644 --- a/include/linux/mfd/ab8500/gpio.h +++ b/include/linux/mfd/abx500/ab8500-gpio.h | |||
diff --git a/include/linux/mfd/ab8500/sysctrl.h b/include/linux/mfd/abx500/ab8500-sysctrl.h index 10da0291f8f8..10da0291f8f8 100644 --- a/include/linux/mfd/ab8500/sysctrl.h +++ b/include/linux/mfd/abx500/ab8500-sysctrl.h | |||
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/abx500/ab8500.h index 838c6b487cc5..838c6b487cc5 100644 --- a/include/linux/mfd/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h | |||
diff --git a/include/linux/mfd/da9052/da9052.h b/include/linux/mfd/da9052/da9052.h new file mode 100644 index 000000000000..5702d1be13b4 --- /dev/null +++ b/include/linux/mfd/da9052/da9052.h | |||
| @@ -0,0 +1,131 @@ | |||
| 1 | /* | ||
| 2 | * da9052 declarations for DA9052 PMICs. | ||
| 3 | * | ||
| 4 | * Copyright(c) 2011 Dialog Semiconductor Ltd. | ||
| 5 | * | ||
| 6 | * Author: David Dajun Chen <dchen@diasemi.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 21 | * | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef __MFD_DA9052_DA9052_H | ||
| 25 | #define __MFD_DA9052_DA9052_H | ||
| 26 | |||
| 27 | #include <linux/interrupt.h> | ||
| 28 | #include <linux/regmap.h> | ||
| 29 | #include <linux/slab.h> | ||
| 30 | #include <linux/completion.h> | ||
| 31 | #include <linux/list.h> | ||
| 32 | #include <linux/mfd/core.h> | ||
| 33 | |||
| 34 | #include <linux/mfd/da9052/reg.h> | ||
| 35 | |||
| 36 | #define DA9052_IRQ_DCIN 0 | ||
| 37 | #define DA9052_IRQ_VBUS 1 | ||
| 38 | #define DA9052_IRQ_DCINREM 2 | ||
| 39 | #define DA9052_IRQ_VBUSREM 3 | ||
| 40 | #define DA9052_IRQ_VDDLOW 4 | ||
| 41 | #define DA9052_IRQ_ALARM 5 | ||
| 42 | #define DA9052_IRQ_SEQRDY 6 | ||
| 43 | #define DA9052_IRQ_COMP1V2 7 | ||
| 44 | #define DA9052_IRQ_NONKEY 8 | ||
| 45 | #define DA9052_IRQ_IDFLOAT 9 | ||
| 46 | #define DA9052_IRQ_IDGND 10 | ||
| 47 | #define DA9052_IRQ_CHGEND 11 | ||
| 48 | #define DA9052_IRQ_TBAT 12 | ||
| 49 | #define DA9052_IRQ_ADC_EOM 13 | ||
| 50 | #define DA9052_IRQ_PENDOWN 14 | ||
| 51 | #define DA9052_IRQ_TSIREADY 15 | ||
| 52 | #define DA9052_IRQ_GPI0 16 | ||
| 53 | #define DA9052_IRQ_GPI1 17 | ||
| 54 | #define DA9052_IRQ_GPI2 18 | ||
| 55 | #define DA9052_IRQ_GPI3 19 | ||
| 56 | #define DA9052_IRQ_GPI4 20 | ||
| 57 | #define DA9052_IRQ_GPI5 21 | ||
| 58 | #define DA9052_IRQ_GPI6 22 | ||
| 59 | #define DA9052_IRQ_GPI7 23 | ||
| 60 | #define DA9052_IRQ_GPI8 24 | ||
| 61 | #define DA9052_IRQ_GPI9 25 | ||
| 62 | #define DA9052_IRQ_GPI10 26 | ||
| 63 | #define DA9052_IRQ_GPI11 27 | ||
| 64 | #define DA9052_IRQ_GPI12 28 | ||
| 65 | #define DA9052_IRQ_GPI13 29 | ||
| 66 | #define DA9052_IRQ_GPI14 30 | ||
| 67 | #define DA9052_IRQ_GPI15 31 | ||
| 68 | |||
| 69 | enum da9052_chip_id { | ||
| 70 | DA9052, | ||
| 71 | DA9053_AA, | ||
| 72 | DA9053_BA, | ||
| 73 | DA9053_BB, | ||
| 74 | }; | ||
| 75 | |||
| 76 | struct da9052_pdata; | ||
| 77 | |||
| 78 | struct da9052 { | ||
| 79 | struct mutex io_lock; | ||
| 80 | |||
| 81 | struct device *dev; | ||
| 82 | struct regmap *regmap; | ||
| 83 | |||
| 84 | int irq_base; | ||
| 85 | u8 chip_id; | ||
| 86 | |||
| 87 | int chip_irq; | ||
| 88 | }; | ||
| 89 | |||
| 90 | /* Device I/O API */ | ||
| 91 | static inline int da9052_reg_read(struct da9052 *da9052, unsigned char reg) | ||
| 92 | { | ||
| 93 | int val, ret; | ||
| 94 | |||
| 95 | ret = regmap_read(da9052->regmap, reg, &val); | ||
| 96 | if (ret < 0) | ||
| 97 | return ret; | ||
| 98 | return val; | ||
| 99 | } | ||
| 100 | |||
| 101 | static inline int da9052_reg_write(struct da9052 *da9052, unsigned char reg, | ||
| 102 | unsigned char val) | ||
| 103 | { | ||
| 104 | return regmap_write(da9052->regmap, reg, val); | ||
| 105 | } | ||
| 106 | |||
| 107 | static inline int da9052_group_read(struct da9052 *da9052, unsigned char reg, | ||
| 108 | unsigned reg_cnt, unsigned char *val) | ||
| 109 | { | ||
| 110 | return regmap_bulk_read(da9052->regmap, reg, val, reg_cnt); | ||
| 111 | } | ||
| 112 | |||
| 113 | static inline int da9052_group_write(struct da9052 *da9052, unsigned char reg, | ||
| 114 | unsigned reg_cnt, unsigned char *val) | ||
| 115 | { | ||
| 116 | return regmap_raw_write(da9052->regmap, reg, val, reg_cnt); | ||
| 117 | } | ||
| 118 | |||
| 119 | static inline int da9052_reg_update(struct da9052 *da9052, unsigned char reg, | ||
| 120 | unsigned char bit_mask, | ||
| 121 | unsigned char reg_val) | ||
| 122 | { | ||
| 123 | return regmap_update_bits(da9052->regmap, reg, bit_mask, reg_val); | ||
| 124 | } | ||
| 125 | |||
| 126 | int da9052_device_init(struct da9052 *da9052, u8 chip_id); | ||
| 127 | void da9052_device_exit(struct da9052 *da9052); | ||
| 128 | |||
| 129 | extern struct regmap_config da9052_regmap_config; | ||
| 130 | |||
| 131 | #endif /* __MFD_DA9052_DA9052_H */ | ||
diff --git a/include/linux/mfd/da9052/pdata.h b/include/linux/mfd/da9052/pdata.h new file mode 100644 index 000000000000..62c5c3c2992e --- /dev/null +++ b/include/linux/mfd/da9052/pdata.h | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | /* | ||
| 2 | * Platform data declarations for DA9052 PMICs. | ||
| 3 | * | ||
| 4 | * Copyright(c) 2011 Dialog Semiconductor Ltd. | ||
| 5 | * | ||
| 6 | * Author: David Dajun Chen <dchen@diasemi.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 21 | * | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef __MFD_DA9052_PDATA_H__ | ||
| 25 | #define __MFD_DA9052_PDATA_H__ | ||
| 26 | |||
| 27 | #define DA9052_MAX_REGULATORS 14 | ||
| 28 | |||
| 29 | struct da9052; | ||
| 30 | |||
| 31 | struct da9052_pdata { | ||
| 32 | struct led_platform_data *pled; | ||
| 33 | int (*init) (struct da9052 *da9052); | ||
| 34 | int irq_base; | ||
| 35 | int gpio_base; | ||
| 36 | int use_for_apm; | ||
| 37 | struct regulator_init_data *regulators[DA9052_MAX_REGULATORS]; | ||
| 38 | }; | ||
| 39 | |||
| 40 | #endif | ||
diff --git a/include/linux/mfd/da9052/reg.h b/include/linux/mfd/da9052/reg.h new file mode 100644 index 000000000000..b97f7309d7f6 --- /dev/null +++ b/include/linux/mfd/da9052/reg.h | |||
| @@ -0,0 +1,749 @@ | |||
| 1 | /* | ||
| 2 | * Register declarations for DA9052 PMICs. | ||
| 3 | * | ||
| 4 | * Copyright(c) 2011 Dialog Semiconductor Ltd. | ||
| 5 | * | ||
| 6 | * Author: David Dajun Chen <dchen@diasemi.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 21 | * | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef __LINUX_MFD_DA9052_REG_H | ||
| 25 | #define __LINUX_MFD_DA9052_REG_H | ||
| 26 | |||
| 27 | /* PAGE REGISTERS */ | ||
| 28 | #define DA9052_PAGE0_CON_REG 0 | ||
| 29 | #define DA9052_PAGE1_CON_REG 128 | ||
| 30 | |||
| 31 | /* STATUS REGISTERS */ | ||
| 32 | #define DA9052_STATUS_A_REG 1 | ||
| 33 | #define DA9052_STATUS_B_REG 2 | ||
| 34 | #define DA9052_STATUS_C_REG 3 | ||
| 35 | #define DA9052_STATUS_D_REG 4 | ||
| 36 | |||
| 37 | /* EVENT REGISTERS */ | ||
| 38 | #define DA9052_EVENT_A_REG 5 | ||
| 39 | #define DA9052_EVENT_B_REG 6 | ||
| 40 | #define DA9052_EVENT_C_REG 7 | ||
| 41 | #define DA9052_EVENT_D_REG 8 | ||
| 42 | #define DA9052_FAULTLOG_REG 9 | ||
| 43 | |||
| 44 | /* IRQ REGISTERS */ | ||
| 45 | #define DA9052_IRQ_MASK_A_REG 10 | ||
| 46 | #define DA9052_IRQ_MASK_B_REG 11 | ||
| 47 | #define DA9052_IRQ_MASK_C_REG 12 | ||
| 48 | #define DA9052_IRQ_MASK_D_REG 13 | ||
| 49 | |||
| 50 | /* CONTROL REGISTERS */ | ||
| 51 | #define DA9052_CONTROL_A_REG 14 | ||
| 52 | #define DA9052_CONTROL_B_REG 15 | ||
| 53 | #define DA9052_CONTROL_C_REG 16 | ||
| 54 | #define DA9052_CONTROL_D_REG 17 | ||
| 55 | |||
| 56 | #define DA9052_PDDIS_REG 18 | ||
| 57 | #define DA9052_INTERFACE_REG 19 | ||
| 58 | #define DA9052_RESET_REG 20 | ||
| 59 | |||
| 60 | /* GPIO REGISTERS */ | ||
| 61 | #define DA9052_GPIO_0_1_REG 21 | ||
| 62 | #define DA9052_GPIO_2_3_REG 22 | ||
| 63 | #define DA9052_GPIO_4_5_REG 23 | ||
| 64 | #define DA9052_GPIO_6_7_REG 24 | ||
| 65 | #define DA9052_GPIO_14_15_REG 28 | ||
| 66 | |||
| 67 | /* POWER SEQUENCER CONTROL REGISTERS */ | ||
| 68 | #define DA9052_ID_0_1_REG 29 | ||
| 69 | #define DA9052_ID_2_3_REG 30 | ||
| 70 | #define DA9052_ID_4_5_REG 31 | ||
| 71 | #define DA9052_ID_6_7_REG 32 | ||
| 72 | #define DA9052_ID_8_9_REG 33 | ||
| 73 | #define DA9052_ID_10_11_REG 34 | ||
| 74 | #define DA9052_ID_12_13_REG 35 | ||
| 75 | #define DA9052_ID_14_15_REG 36 | ||
| 76 | #define DA9052_ID_16_17_REG 37 | ||
| 77 | #define DA9052_ID_18_19_REG 38 | ||
| 78 | #define DA9052_ID_20_21_REG 39 | ||
| 79 | #define DA9052_SEQ_STATUS_REG 40 | ||
| 80 | #define DA9052_SEQ_A_REG 41 | ||
| 81 | #define DA9052_SEQ_B_REG 42 | ||
| 82 | #define DA9052_SEQ_TIMER_REG 43 | ||
| 83 | |||
| 84 | /* LDO AND BUCK REGISTERS */ | ||
| 85 | #define DA9052_BUCKA_REG 44 | ||
| 86 | #define DA9052_BUCKB_REG 45 | ||
| 87 | #define DA9052_BUCKCORE_REG 46 | ||
| 88 | #define DA9052_BUCKPRO_REG 47 | ||
| 89 | #define DA9052_BUCKMEM_REG 48 | ||
| 90 | #define DA9052_BUCKPERI_REG 49 | ||
| 91 | #define DA9052_LDO1_REG 50 | ||
| 92 | #define DA9052_LDO2_REG 51 | ||
| 93 | #define DA9052_LDO3_REG 52 | ||
| 94 | #define DA9052_LDO4_REG 53 | ||
| 95 | #define DA9052_LDO5_REG 54 | ||
| 96 | #define DA9052_LDO6_REG 55 | ||
| 97 | #define DA9052_LDO7_REG 56 | ||
| 98 | #define DA9052_LDO8_REG 57 | ||
| 99 | #define DA9052_LDO9_REG 58 | ||
| 100 | #define DA9052_LDO10_REG 59 | ||
| 101 | #define DA9052_SUPPLY_REG 60 | ||
| 102 | #define DA9052_PULLDOWN_REG 61 | ||
| 103 | #define DA9052_CHGBUCK_REG 62 | ||
| 104 | #define DA9052_WAITCONT_REG 63 | ||
| 105 | #define DA9052_ISET_REG 64 | ||
| 106 | #define DA9052_BATCHG_REG 65 | ||
| 107 | |||
| 108 | /* BATTERY CONTROL REGISTRS */ | ||
| 109 | #define DA9052_CHG_CONT_REG 66 | ||
| 110 | #define DA9052_INPUT_CONT_REG 67 | ||
| 111 | #define DA9052_CHG_TIME_REG 68 | ||
| 112 | #define DA9052_BBAT_CONT_REG 69 | ||
| 113 | |||
| 114 | /* LED CONTROL REGISTERS */ | ||
| 115 | #define DA9052_BOOST_REG 70 | ||
| 116 | #define DA9052_LED_CONT_REG 71 | ||
| 117 | #define DA9052_LEDMIN123_REG 72 | ||
| 118 | #define DA9052_LED1_CONF_REG 73 | ||
| 119 | #define DA9052_LED2_CONF_REG 74 | ||
| 120 | #define DA9052_LED3_CONF_REG 75 | ||
| 121 | #define DA9052_LED1CONT_REG 76 | ||
| 122 | #define DA9052_LED2CONT_REG 77 | ||
| 123 | #define DA9052_LED3CONT_REG 78 | ||
| 124 | #define DA9052_LED_CONT_4_REG 79 | ||
| 125 | #define DA9052_LED_CONT_5_REG 80 | ||
| 126 | |||
| 127 | /* ADC CONTROL REGISTERS */ | ||
| 128 | #define DA9052_ADC_MAN_REG 81 | ||
| 129 | #define DA9052_ADC_CONT_REG 82 | ||
| 130 | #define DA9052_ADC_RES_L_REG 83 | ||
| 131 | #define DA9052_ADC_RES_H_REG 84 | ||
| 132 | #define DA9052_VDD_RES_REG 85 | ||
| 133 | #define DA9052_VDD_MON_REG 86 | ||
| 134 | |||
| 135 | #define DA9052_ICHG_AV_REG 87 | ||
| 136 | #define DA9052_ICHG_THD_REG 88 | ||
| 137 | #define DA9052_ICHG_END_REG 89 | ||
| 138 | #define DA9052_TBAT_RES_REG 90 | ||
| 139 | #define DA9052_TBAT_HIGHP_REG 91 | ||
| 140 | #define DA9052_TBAT_HIGHN_REG 92 | ||
| 141 | #define DA9052_TBAT_LOW_REG 93 | ||
| 142 | #define DA9052_T_OFFSET_REG 94 | ||
| 143 | |||
| 144 | #define DA9052_ADCIN4_RES_REG 95 | ||
| 145 | #define DA9052_AUTO4_HIGH_REG 96 | ||
| 146 | #define DA9052_AUTO4_LOW_REG 97 | ||
| 147 | #define DA9052_ADCIN5_RES_REG 98 | ||
| 148 | #define DA9052_AUTO5_HIGH_REG 99 | ||
| 149 | #define DA9052_AUTO5_LOW_REG 100 | ||
| 150 | #define DA9052_ADCIN6_RES_REG 101 | ||
| 151 | #define DA9052_AUTO6_HIGH_REG 102 | ||
| 152 | #define DA9052_AUTO6_LOW_REG 103 | ||
| 153 | |||
| 154 | #define DA9052_TJUNC_RES_REG 104 | ||
| 155 | |||
| 156 | /* TSI CONTROL REGISTERS */ | ||
| 157 | #define DA9052_TSI_CONT_A_REG 105 | ||
| 158 | #define DA9052_TSI_CONT_B_REG 106 | ||
| 159 | #define DA9052_TSI_X_MSB_REG 107 | ||
| 160 | #define DA9052_TSI_Y_MSB_REG 108 | ||
| 161 | #define DA9052_TSI_LSB_REG 109 | ||
| 162 | #define DA9052_TSI_Z_MSB_REG 110 | ||
| 163 | |||
| 164 | /* RTC COUNT REGISTERS */ | ||
| 165 | #define DA9052_COUNT_S_REG 111 | ||
| 166 | #define DA9052_COUNT_MI_REG 112 | ||
| 167 | #define DA9052_COUNT_H_REG 113 | ||
| 168 | #define DA9052_COUNT_D_REG 114 | ||
| 169 | #define DA9052_COUNT_MO_REG 115 | ||
| 170 | #define DA9052_COUNT_Y_REG 116 | ||
| 171 | |||
| 172 | /* RTC CONTROL REGISTERS */ | ||
| 173 | #define DA9052_ALARM_MI_REG 117 | ||
| 174 | #define DA9052_ALARM_H_REG 118 | ||
| 175 | #define DA9052_ALARM_D_REG 119 | ||
| 176 | #define DA9052_ALARM_MO_REG 120 | ||
| 177 | #define DA9052_ALARM_Y_REG 121 | ||
| 178 | #define DA9052_SECOND_A_REG 122 | ||
| 179 | #define DA9052_SECOND_B_REG 123 | ||
| 180 | #define DA9052_SECOND_C_REG 124 | ||
| 181 | #define DA9052_SECOND_D_REG 125 | ||
| 182 | |||
| 183 | /* PAGE CONFIGURATION BIT */ | ||
| 184 | #define DA9052_PAGE_CONF 0X80 | ||
| 185 | |||
| 186 | /* STATUS REGISTER A BITS */ | ||
| 187 | #define DA9052_STATUSA_VDATDET 0X80 | ||
| 188 | #define DA9052_STATUSA_VBUSSEL 0X40 | ||
| 189 | #define DA9052_STATUSA_DCINSEL 0X20 | ||
| 190 | #define DA9052_STATUSA_VBUSDET 0X10 | ||
| 191 | #define DA9052_STATUSA_DCINDET 0X08 | ||
| 192 | #define DA9052_STATUSA_IDGND 0X04 | ||
| 193 | #define DA9052_STATUSA_IDFLOAT 0X02 | ||
| 194 | #define DA9052_STATUSA_NONKEY 0X01 | ||
| 195 | |||
| 196 | /* STATUS REGISTER B BITS */ | ||
| 197 | #define DA9052_STATUSB_COMPDET 0X80 | ||
| 198 | #define DA9052_STATUSB_SEQUENCING 0X40 | ||
| 199 | #define DA9052_STATUSB_GPFB2 0X20 | ||
| 200 | #define DA9052_STATUSB_CHGTO 0X10 | ||
| 201 | #define DA9052_STATUSB_CHGEND 0X08 | ||
| 202 | #define DA9052_STATUSB_CHGLIM 0X04 | ||
| 203 | #define DA9052_STATUSB_CHGPRE 0X02 | ||
| 204 | #define DA9052_STATUSB_CHGATT 0X01 | ||
| 205 | |||
| 206 | /* STATUS REGISTER C BITS */ | ||
| 207 | #define DA9052_STATUSC_GPI7 0X80 | ||
| 208 | #define DA9052_STATUSC_GPI6 0X40 | ||
| 209 | #define DA9052_STATUSC_GPI5 0X20 | ||
| 210 | #define DA9052_STATUSC_GPI4 0X10 | ||
| 211 | #define DA9052_STATUSC_GPI3 0X08 | ||
| 212 | #define DA9052_STATUSC_GPI2 0X04 | ||
| 213 | #define DA9052_STATUSC_GPI1 0X02 | ||
| 214 | #define DA9052_STATUSC_GPI0 0X01 | ||
| 215 | |||
| 216 | /* STATUS REGISTER D BITS */ | ||
| 217 | #define DA9052_STATUSD_GPI15 0X80 | ||
| 218 | #define DA9052_STATUSD_GPI14 0X40 | ||
| 219 | #define DA9052_STATUSD_GPI13 0X20 | ||
| 220 | #define DA9052_STATUSD_GPI12 0X10 | ||
| 221 | #define DA9052_STATUSD_GPI11 0X08 | ||
| 222 | #define DA9052_STATUSD_GPI10 0X04 | ||
| 223 | #define DA9052_STATUSD_GPI9 0X02 | ||
| 224 | #define DA9052_STATUSD_GPI8 0X01 | ||
| 225 | |||
| 226 | /* EVENT REGISTER A BITS */ | ||
| 227 | #define DA9052_EVENTA_ECOMP1V2 0X80 | ||
| 228 | #define DA9052_EVENTA_ESEQRDY 0X40 | ||
| 229 | #define DA9052_EVENTA_EALRAM 0X20 | ||
| 230 | #define DA9052_EVENTA_EVDDLOW 0X10 | ||
| 231 | #define DA9052_EVENTA_EVBUSREM 0X08 | ||
| 232 | #define DA9052_EVENTA_EDCINREM 0X04 | ||
| 233 | #define DA9052_EVENTA_EVBUSDET 0X02 | ||
| 234 | #define DA9052_EVENTA_EDCINDET 0X01 | ||
| 235 | |||
| 236 | /* EVENT REGISTER B BITS */ | ||
| 237 | #define DA9052_EVENTB_ETSIREADY 0X80 | ||
| 238 | #define DA9052_EVENTB_EPENDOWN 0X40 | ||
| 239 | #define DA9052_EVENTB_EADCEOM 0X20 | ||
| 240 | #define DA9052_EVENTB_ETBAT 0X10 | ||
| 241 | #define DA9052_EVENTB_ECHGEND 0X08 | ||
| 242 | #define DA9052_EVENTB_EIDGND 0X04 | ||
| 243 | #define DA9052_EVENTB_EIDFLOAT 0X02 | ||
| 244 | #define DA9052_EVENTB_ENONKEY 0X01 | ||
| 245 | |||
| 246 | /* EVENT REGISTER C BITS */ | ||
| 247 | #define DA9052_EVENTC_EGPI7 0X80 | ||
| 248 | #define DA9052_EVENTC_EGPI6 0X40 | ||
| 249 | #define DA9052_EVENTC_EGPI5 0X20 | ||
| 250 | #define DA9052_EVENTC_EGPI4 0X10 | ||
| 251 | #define DA9052_EVENTC_EGPI3 0X08 | ||
| 252 | #define DA9052_EVENTC_EGPI2 0X04 | ||
| 253 | #define DA9052_EVENTC_EGPI1 0X02 | ||
| 254 | #define DA9052_EVENTC_EGPI0 0X01 | ||
| 255 | |||
| 256 | /* EVENT REGISTER D BITS */ | ||
| 257 | #define DA9052_EVENTD_EGPI15 0X80 | ||
| 258 | #define DA9052_EVENTD_EGPI14 0X40 | ||
| 259 | #define DA9052_EVENTD_EGPI13 0X20 | ||
| 260 | #define DA9052_EVENTD_EGPI12 0X10 | ||
| 261 | #define DA9052_EVENTD_EGPI11 0X08 | ||
| 262 | #define DA9052_EVENTD_EGPI10 0X04 | ||
| 263 | #define DA9052_EVENTD_EGPI9 0X02 | ||
| 264 | #define DA9052_EVENTD_EGPI8 0X01 | ||
| 265 | |||
| 266 | /* IRQ MASK REGISTERS BITS */ | ||
| 267 | #define DA9052_M_NONKEY 0X0100 | ||
| 268 | |||
| 269 | /* TSI EVENT REGISTERS BITS */ | ||
| 270 | #define DA9052_E_PEN_DOWN 0X4000 | ||
| 271 | #define DA9052_E_TSI_READY 0X8000 | ||
| 272 | |||
| 273 | /* FAULT LOG REGISTER BITS */ | ||
| 274 | #define DA9052_FAULTLOG_WAITSET 0X80 | ||
| 275 | #define DA9052_FAULTLOG_NSDSET 0X40 | ||
| 276 | #define DA9052_FAULTLOG_KEYSHUT 0X20 | ||
| 277 | #define DA9052_FAULTLOG_TEMPOVER 0X08 | ||
| 278 | #define DA9052_FAULTLOG_VDDSTART 0X04 | ||
| 279 | #define DA9052_FAULTLOG_VDDFAULT 0X02 | ||
| 280 | #define DA9052_FAULTLOG_TWDERROR 0X01 | ||
| 281 | |||
| 282 | /* CONTROL REGISTER A BITS */ | ||
| 283 | #define DA9052_CONTROLA_GPIV 0X80 | ||
| 284 | #define DA9052_CONTROLA_PMOTYPE 0X20 | ||
| 285 | #define DA9052_CONTROLA_PMOV 0X10 | ||
| 286 | #define DA9052_CONTROLA_PMIV 0X08 | ||
| 287 | #define DA9052_CONTROLA_PMIFV 0X08 | ||
| 288 | #define DA9052_CONTROLA_PWR1EN 0X04 | ||
| 289 | #define DA9052_CONTROLA_PWREN 0X02 | ||
| 290 | #define DA9052_CONTROLA_SYSEN 0X01 | ||
| 291 | |||
| 292 | /* CONTROL REGISTER B BITS */ | ||
| 293 | #define DA9052_CONTROLB_SHUTDOWN 0X80 | ||
| 294 | #define DA9052_CONTROLB_DEEPSLEEP 0X40 | ||
| 295 | #define DA9052_CONTROL_B_WRITEMODE 0X20 | ||
| 296 | #define DA9052_CONTROLB_BBATEN 0X10 | ||
| 297 | #define DA9052_CONTROLB_OTPREADEN 0X08 | ||
| 298 | #define DA9052_CONTROLB_AUTOBOOT 0X04 | ||
| 299 | #define DA9052_CONTROLB_ACTDIODE 0X02 | ||
| 300 | #define DA9052_CONTROLB_BUCKMERGE 0X01 | ||
| 301 | |||
| 302 | /* CONTROL REGISTER C BITS */ | ||
| 303 | #define DA9052_CONTROLC_BLINKDUR 0X80 | ||
| 304 | #define DA9052_CONTROLC_BLINKFRQ 0X60 | ||
| 305 | #define DA9052_CONTROLC_DEBOUNCING 0X1C | ||
| 306 | #define DA9052_CONTROLC_PMFB2PIN 0X02 | ||
| 307 | #define DA9052_CONTROLC_PMFB1PIN 0X01 | ||
| 308 | |||
| 309 | /* CONTROL REGISTER D BITS */ | ||
| 310 | #define DA9052_CONTROLD_WATCHDOG 0X80 | ||
| 311 | #define DA9052_CONTROLD_ACCDETEN 0X40 | ||
| 312 | #define DA9052_CONTROLD_GPI1415SD 0X20 | ||
| 313 | #define DA9052_CONTROLD_NONKEYSD 0X10 | ||
| 314 | #define DA9052_CONTROLD_KEEPACTEN 0X08 | ||
| 315 | #define DA9052_CONTROLD_TWDSCALE 0X07 | ||
| 316 | |||
| 317 | /* POWER DOWN DISABLE REGISTER BITS */ | ||
| 318 | #define DA9052_PDDIS_PMCONTPD 0X80 | ||
| 319 | #define DA9052_PDDIS_OUT32KPD 0X40 | ||
| 320 | #define DA9052_PDDIS_CHGBBATPD 0X20 | ||
| 321 | #define DA9052_PDDIS_CHGPD 0X10 | ||
| 322 | #define DA9052_PDDIS_HS2WIREPD 0X08 | ||
| 323 | #define DA9052_PDDIS_PMIFPD 0X04 | ||
| 324 | #define DA9052_PDDIS_GPADCPD 0X02 | ||
| 325 | #define DA9052_PDDIS_GPIOPD 0X01 | ||
| 326 | |||
| 327 | /* CONTROL REGISTER D BITS */ | ||
| 328 | #define DA9052_INTERFACE_IFBASEADDR 0XE0 | ||
| 329 | #define DA9052_INTERFACE_NCSPOL 0X10 | ||
| 330 | #define DA9052_INTERFACE_RWPOL 0X08 | ||
| 331 | #define DA9052_INTERFACE_CPHA 0X04 | ||
| 332 | #define DA9052_INTERFACE_CPOL 0X02 | ||
| 333 | #define DA9052_INTERFACE_IFTYPE 0X01 | ||
| 334 | |||
| 335 | /* CONTROL REGISTER D BITS */ | ||
| 336 | #define DA9052_RESET_RESETEVENT 0XC0 | ||
| 337 | #define DA9052_RESET_RESETTIMER 0X3F | ||
| 338 | |||
| 339 | /* GPIO REGISTERS */ | ||
| 340 | /* GPIO CONTROL REGISTER BITS */ | ||
| 341 | #define DA9052_GPIO_EVEN_PORT_PIN 0X03 | ||
| 342 | #define DA9052_GPIO_EVEN_PORT_TYPE 0X04 | ||
| 343 | #define DA9052_GPIO_EVEN_PORT_MODE 0X08 | ||
| 344 | |||
| 345 | #define DA9052_GPIO_ODD_PORT_PIN 0X30 | ||
| 346 | #define DA9052_GPIO_ODD_PORT_TYPE 0X40 | ||
| 347 | #define DA9052_GPIO_ODD_PORT_MODE 0X80 | ||
| 348 | |||
| 349 | /*POWER SEQUENCER REGISTER BITS */ | ||
| 350 | /* SEQ CONTROL REGISTER BITS FOR ID 0 AND 1 */ | ||
| 351 | #define DA9052_ID01_LDO1STEP 0XF0 | ||
| 352 | #define DA9052_ID01_SYSPRE 0X04 | ||
| 353 | #define DA9052_ID01_DEFSUPPLY 0X02 | ||
| 354 | #define DA9052_ID01_NRESMODE 0X01 | ||
| 355 | |||
| 356 | /* SEQ CONTROL REGISTER BITS FOR ID 2 AND 3 */ | ||
| 357 | #define DA9052_ID23_LDO3STEP 0XF0 | ||
| 358 | #define DA9052_ID23_LDO2STEP 0X0F | ||
| 359 | |||
| 360 | /* SEQ CONTROL REGISTER BITS FOR ID 4 AND 5 */ | ||
| 361 | #define DA9052_ID45_LDO5STEP 0XF0 | ||
| 362 | #define DA9052_ID45_LDO4STEP 0X0F | ||
| 363 | |||
| 364 | /* SEQ CONTROL REGISTER BITS FOR ID 6 AND 7 */ | ||
| 365 | #define DA9052_ID67_LDO7STEP 0XF0 | ||
| 366 | #define DA9052_ID67_LDO6STEP 0X0F | ||
| 367 | |||
| 368 | /* SEQ CONTROL REGISTER BITS FOR ID 8 AND 9 */ | ||
| 369 | #define DA9052_ID89_LDO9STEP 0XF0 | ||
| 370 | #define DA9052_ID89_LDO8STEP 0X0F | ||
| 371 | |||
| 372 | /* SEQ CONTROL REGISTER BITS FOR ID 10 AND 11 */ | ||
| 373 | #define DA9052_ID1011_PDDISSTEP 0XF0 | ||
| 374 | #define DA9052_ID1011_LDO10STEP 0X0F | ||
| 375 | |||
| 376 | /* SEQ CONTROL REGISTER BITS FOR ID 12 AND 13 */ | ||
| 377 | #define DA9052_ID1213_VMEMSWSTEP 0XF0 | ||
| 378 | #define DA9052_ID1213_VPERISWSTEP 0X0F | ||
| 379 | |||
| 380 | /* SEQ CONTROL REGISTER BITS FOR ID 14 AND 15 */ | ||
| 381 | #define DA9052_ID1415_BUCKPROSTEP 0XF0 | ||
| 382 | #define DA9052_ID1415_BUCKCORESTEP 0X0F | ||
| 383 | |||
| 384 | /* SEQ CONTROL REGISTER BITS FOR ID 16 AND 17 */ | ||
| 385 | #define DA9052_ID1617_BUCKPERISTEP 0XF0 | ||
| 386 | #define DA9052_ID1617_BUCKMEMSTEP 0X0F | ||
| 387 | |||
| 388 | /* SEQ CONTROL REGISTER BITS FOR ID 18 AND 19 */ | ||
| 389 | #define DA9052_ID1819_GPRISE2STEP 0XF0 | ||
| 390 | #define DA9052_ID1819_GPRISE1STEP 0X0F | ||
| 391 | |||
| 392 | /* SEQ CONTROL REGISTER BITS FOR ID 20 AND 21 */ | ||
| 393 | #define DA9052_ID2021_GPFALL2STEP 0XF0 | ||
| 394 | #define DA9052_ID2021_GPFALL1STEP 0X0F | ||
| 395 | |||
| 396 | /* POWER SEQ STATUS REGISTER BITS */ | ||
| 397 | #define DA9052_SEQSTATUS_SEQPOINTER 0XF0 | ||
| 398 | #define DA9052_SEQSTATUS_WAITSTEP 0X0F | ||
| 399 | |||
| 400 | /* POWER SEQ A REGISTER BITS */ | ||
| 401 | #define DA9052_SEQA_POWEREND 0XF0 | ||
| 402 | #define DA9052_SEQA_SYSTEMEND 0X0F | ||
| 403 | |||
| 404 | /* POWER SEQ B REGISTER BITS */ | ||
| 405 | #define DA9052_SEQB_PARTDOWN 0XF0 | ||
| 406 | #define DA9052_SEQB_MAXCOUNT 0X0F | ||
| 407 | |||
| 408 | /* POWER SEQ TIMER REGISTER BITS */ | ||
| 409 | #define DA9052_SEQTIMER_SEQDUMMY 0XF0 | ||
| 410 | #define DA9052_SEQTIMER_SEQTIME 0X0F | ||
| 411 | |||
| 412 | /*POWER SUPPLY CONTROL REGISTER BITS */ | ||
| 413 | /* BUCK REGISTER A BITS */ | ||
| 414 | #define DA9052_BUCKA_BPROILIM 0XC0 | ||
| 415 | #define DA9052_BUCKA_BPROMODE 0X30 | ||
| 416 | #define DA9052_BUCKA_BCOREILIM 0X0C | ||
| 417 | #define DA9052_BUCKA_BCOREMODE 0X03 | ||
| 418 | |||
| 419 | /* BUCK REGISTER B BITS */ | ||
| 420 | #define DA9052_BUCKB_BERIILIM 0XC0 | ||
| 421 | #define DA9052_BUCKB_BPERIMODE 0X30 | ||
| 422 | #define DA9052_BUCKB_BMEMILIM 0X0C | ||
| 423 | #define DA9052_BUCKB_BMEMMODE 0X03 | ||
| 424 | |||
| 425 | /* BUCKCORE REGISTER BITS */ | ||
| 426 | #define DA9052_BUCKCORE_BCORECONF 0X80 | ||
| 427 | #define DA9052_BUCKCORE_BCOREEN 0X40 | ||
| 428 | #define DA9052_BUCKCORE_VBCORE 0X3F | ||
| 429 | |||
| 430 | /* BUCKPRO REGISTER BITS */ | ||
| 431 | #define DA9052_BUCKPRO_BPROCONF 0X80 | ||
| 432 | #define DA9052_BUCKPRO_BPROEN 0X40 | ||
| 433 | #define DA9052_BUCKPRO_VBPRO 0X3F | ||
| 434 | |||
| 435 | /* BUCKMEM REGISTER BITS */ | ||
| 436 | #define DA9052_BUCKMEM_BMEMCONF 0X80 | ||
| 437 | #define DA9052_BUCKMEM_BMEMEN 0X40 | ||
| 438 | #define DA9052_BUCKMEM_VBMEM 0X3F | ||
| 439 | |||
| 440 | /* BUCKPERI REGISTER BITS */ | ||
| 441 | #define DA9052_BUCKPERI_BPERICONF 0X80 | ||
| 442 | #define DA9052_BUCKPERI_BPERIEN 0X40 | ||
| 443 | #define DA9052_BUCKPERI_BPERIHS 0X20 | ||
| 444 | #define DA9052_BUCKPERI_VBPERI 0X1F | ||
| 445 | |||
| 446 | /* LDO1 REGISTER BITS */ | ||
| 447 | #define DA9052_LDO1_LDO1CONF 0X80 | ||
| 448 | #define DA9052_LDO1_LDO1EN 0X40 | ||
| 449 | #define DA9052_LDO1_VLDO1 0X1F | ||
| 450 | |||
| 451 | /* LDO2 REGISTER BITS */ | ||
| 452 | #define DA9052_LDO2_LDO2CONF 0X80 | ||
| 453 | #define DA9052_LDO2_LDO2EN 0X40 | ||
| 454 | #define DA9052_LDO2_VLDO2 0X3F | ||
| 455 | |||
| 456 | /* LDO3 REGISTER BITS */ | ||
| 457 | #define DA9052_LDO3_LDO3CONF 0X80 | ||
| 458 | #define DA9052_LDO3_LDO3EN 0X40 | ||
| 459 | #define DA9052_LDO3_VLDO3 0X3F | ||
| 460 | |||
| 461 | /* LDO4 REGISTER BITS */ | ||
| 462 | #define DA9052_LDO4_LDO4CONF 0X80 | ||
| 463 | #define DA9052_LDO4_LDO4EN 0X40 | ||
| 464 | #define DA9052_LDO4_VLDO4 0X3F | ||
| 465 | |||
| 466 | /* LDO5 REGISTER BITS */ | ||
| 467 | #define DA9052_LDO5_LDO5CONF 0X80 | ||
| 468 | #define DA9052_LDO5_LDO5EN 0X40 | ||
| 469 | #define DA9052_LDO5_VLDO5 0X3F | ||
| 470 | |||
| 471 | /* LDO6 REGISTER BITS */ | ||
| 472 | #define DA9052_LDO6_LDO6CONF 0X80 | ||
| 473 | #define DA9052_LDO6_LDO6EN 0X40 | ||
| 474 | #define DA9052_LDO6_VLDO6 0X3F | ||
| 475 | |||
| 476 | /* LDO7 REGISTER BITS */ | ||
| 477 | #define DA9052_LDO7_LDO7CONF 0X80 | ||
| 478 | #define DA9052_LDO7_LDO7EN 0X40 | ||
| 479 | #define DA9052_LDO7_VLDO7 0X3F | ||
| 480 | |||
| 481 | /* LDO8 REGISTER BITS */ | ||
| 482 | #define DA9052_LDO8_LDO8CONF 0X80 | ||
| 483 | #define DA9052_LDO8_LDO8EN 0X40 | ||
| 484 | #define DA9052_LDO8_VLDO8 0X3F | ||
| 485 | |||
| 486 | /* LDO9 REGISTER BITS */ | ||
| 487 | #define DA9052_LDO9_LDO9CONF 0X80 | ||
| 488 | #define DA9052_LDO9_LDO9EN 0X40 | ||
| 489 | #define DA9052_LDO9_VLDO9 0X3F | ||
| 490 | |||
| 491 | /* LDO10 REGISTER BITS */ | ||
| 492 | #define DA9052_LDO10_LDO10CONF 0X80 | ||
| 493 | #define DA9052_LDO10_LDO10EN 0X40 | ||
| 494 | #define DA9052_LDO10_VLDO10 0X3F | ||
| 495 | |||
| 496 | /* SUPPLY REGISTER BITS */ | ||
| 497 | #define DA9052_SUPPLY_VLOCK 0X80 | ||
| 498 | #define DA9052_SUPPLY_VMEMSWEN 0X40 | ||
| 499 | #define DA9052_SUPPLY_VPERISWEN 0X20 | ||
| 500 | #define DA9052_SUPPLY_VLDO3GO 0X10 | ||
| 501 | #define DA9052_SUPPLY_VLDO2GO 0X08 | ||
| 502 | #define DA9052_SUPPLY_VBMEMGO 0X04 | ||
| 503 | #define DA9052_SUPPLY_VBPROGO 0X02 | ||
| 504 | #define DA9052_SUPPLY_VBCOREGO 0X01 | ||
| 505 | |||
| 506 | /* PULLDOWN REGISTER BITS */ | ||
| 507 | #define DA9052_PULLDOWN_LDO5PDDIS 0X20 | ||
| 508 | #define DA9052_PULLDOWN_LDO2PDDIS 0X10 | ||
| 509 | #define DA9052_PULLDOWN_LDO1PDDIS 0X08 | ||
| 510 | #define DA9052_PULLDOWN_MEMPDDIS 0X04 | ||
| 511 | #define DA9052_PULLDOWN_PROPDDIS 0X02 | ||
| 512 | #define DA9052_PULLDOWN_COREPDDIS 0X01 | ||
| 513 | |||
| 514 | /* BAT CHARGER REGISTER BITS */ | ||
| 515 | /* CHARGER BUCK REGISTER BITS */ | ||
| 516 | #define DA9052_CHGBUCK_CHGTEMP 0X80 | ||
| 517 | #define DA9052_CHGBUCK_CHGUSBILIM 0X40 | ||
| 518 | #define DA9052_CHGBUCK_CHGBUCKLP 0X20 | ||
| 519 | #define DA9052_CHGBUCK_CHGBUCKEN 0X10 | ||
| 520 | #define DA9052_CHGBUCK_ISETBUCK 0X0F | ||
| 521 | |||
| 522 | /* WAIT COUNTER REGISTER BITS */ | ||
| 523 | #define DA9052_WAITCONT_WAITDIR 0X80 | ||
| 524 | #define DA9052_WAITCONT_RTCCLOCK 0X40 | ||
| 525 | #define DA9052_WAITCONT_WAITMODE 0X20 | ||
| 526 | #define DA9052_WAITCONT_EN32KOUT 0X10 | ||
| 527 | #define DA9052_WAITCONT_DELAYTIME 0X0F | ||
| 528 | |||
| 529 | /* ISET CONTROL REGISTER BITS */ | ||
| 530 | #define DA9052_ISET_ISETDCIN 0XF0 | ||
| 531 | #define DA9052_ISET_ISETVBUS 0X0F | ||
| 532 | |||
| 533 | /* BATTERY CHARGER CONTROL REGISTER BITS */ | ||
| 534 | #define DA9052_BATCHG_ICHGPRE 0XC0 | ||
| 535 | #define DA9052_BATCHG_ICHGBAT 0X3F | ||
| 536 | |||
| 537 | /* CHARGER COUNTER REGISTER BITS */ | ||
| 538 | #define DA9052_CHG_CONT_VCHG_BAT 0XF8 | ||
| 539 | #define DA9052_CHG_CONT_TCTR 0X07 | ||
| 540 | |||
| 541 | /* INPUT CONTROL REGISTER BITS */ | ||
| 542 | #define DA9052_INPUT_CONT_TCTR_MODE 0X80 | ||
| 543 | #define DA9052_INPUT_CONT_VBUS_SUSP 0X10 | ||
| 544 | #define DA9052_INPUT_CONT_DCIN_SUSP 0X08 | ||
| 545 | |||
| 546 | /* CHARGING TIME REGISTER BITS */ | ||
| 547 | #define DA9052_CHGTIME_CHGTIME 0XFF | ||
| 548 | |||
| 549 | /* BACKUP BATTERY CONTROL REGISTER BITS */ | ||
| 550 | #define DA9052_BBATCONT_BCHARGERISET 0XF0 | ||
| 551 | #define DA9052_BBATCONT_BCHARGERVSET 0X0F | ||
| 552 | |||
| 553 | /* LED REGISTERS BITS */ | ||
| 554 | /* LED BOOST REGISTER BITS */ | ||
| 555 | #define DA9052_BOOST_EBFAULT 0X80 | ||
| 556 | #define DA9052_BOOST_MBFAULT 0X40 | ||
| 557 | #define DA9052_BOOST_BOOSTFRQ 0X20 | ||
| 558 | #define DA9052_BOOST_BOOSTILIM 0X10 | ||
| 559 | #define DA9052_BOOST_LED3INEN 0X08 | ||
| 560 | #define DA9052_BOOST_LED2INEN 0X04 | ||
| 561 | #define DA9052_BOOST_LED1INEN 0X02 | ||
| 562 | #define DA9052_BOOST_BOOSTEN 0X01 | ||
| 563 | |||
| 564 | /* LED CONTROL REGISTER BITS */ | ||
| 565 | #define DA9052_LEDCONT_SELLEDMODE 0X80 | ||
| 566 | #define DA9052_LEDCONT_LED3ICONT 0X40 | ||
| 567 | #define DA9052_LEDCONT_LED3RAMP 0X20 | ||
| 568 | #define DA9052_LEDCONT_LED3EN 0X10 | ||
| 569 | #define DA9052_LEDCONT_LED2RAMP 0X08 | ||
| 570 | #define DA9052_LEDCONT_LED2EN 0X04 | ||
| 571 | #define DA9052_LEDCONT_LED1RAMP 0X02 | ||
| 572 | #define DA9052_LEDCONT_LED1EN 0X01 | ||
| 573 | |||
| 574 | /* LEDMIN123 REGISTER BIT */ | ||
| 575 | #define DA9052_LEDMIN123_LEDMINCURRENT 0XFF | ||
| 576 | |||
| 577 | /* LED1CONF REGISTER BIT */ | ||
| 578 | #define DA9052_LED1CONF_LED1CURRENT 0XFF | ||
| 579 | |||
| 580 | /* LED2CONF REGISTER BIT */ | ||
| 581 | #define DA9052_LED2CONF_LED2CURRENT 0XFF | ||
| 582 | |||
| 583 | /* LED3CONF REGISTER BIT */ | ||
| 584 | #define DA9052_LED3CONF_LED3CURRENT 0XFF | ||
| 585 | |||
| 586 | /* LED COUNT REGISTER BIT */ | ||
| 587 | #define DA9052_LED_CONT_DIM 0X80 | ||
| 588 | |||
| 589 | /* ADC MAN REGISTERS BITS */ | ||
| 590 | #define DA9052_ADC_MAN_MAN_CONV 0X10 | ||
| 591 | #define DA9052_ADC_MAN_MUXSEL_VDDOUT 0X00 | ||
| 592 | #define DA9052_ADC_MAN_MUXSEL_ICH 0X01 | ||
| 593 | #define DA9052_ADC_MAN_MUXSEL_TBAT 0X02 | ||
| 594 | #define DA9052_ADC_MAN_MUXSEL_VBAT 0X03 | ||
| 595 | #define DA9052_ADC_MAN_MUXSEL_AD4 0X04 | ||
| 596 | #define DA9052_ADC_MAN_MUXSEL_AD5 0X05 | ||
| 597 | #define DA9052_ADC_MAN_MUXSEL_AD6 0X06 | ||
| 598 | #define DA9052_ADC_MAN_MUXSEL_VBBAT 0X09 | ||
| 599 | |||
| 600 | /* ADC CONTROL REGSISTERS BITS */ | ||
| 601 | #define DA9052_ADCCONT_COMP1V2EN 0X80 | ||
| 602 | #define DA9052_ADCCONT_ADCMODE 0X40 | ||
| 603 | #define DA9052_ADCCONT_TBATISRCEN 0X20 | ||
| 604 | #define DA9052_ADCCONT_AD4ISRCEN 0X10 | ||
| 605 | #define DA9052_ADCCONT_AUTOAD6EN 0X08 | ||
| 606 | #define DA9052_ADCCONT_AUTOAD5EN 0X04 | ||
| 607 | #define DA9052_ADCCONT_AUTOAD4EN 0X02 | ||
| 608 | #define DA9052_ADCCONT_AUTOVDDEN 0X01 | ||
| 609 | |||
| 610 | /* ADC 10 BIT MANUAL CONVERSION RESULT LOW REGISTER */ | ||
| 611 | #define DA9052_ADC_RES_LSB 0X03 | ||
| 612 | |||
| 613 | /* ADC 10 BIT MANUAL CONVERSION RESULT HIGH REGISTER */ | ||
| 614 | #define DA9052_ADCRESH_ADCRESMSB 0XFF | ||
| 615 | |||
| 616 | /* VDD RES REGSISTER BIT*/ | ||
| 617 | #define DA9052_VDDRES_VDDOUTRES 0XFF | ||
| 618 | |||
| 619 | /* VDD MON REGSISTER BIT */ | ||
| 620 | #define DA9052_VDDMON_VDDOUTMON 0XFF | ||
| 621 | |||
| 622 | /* ICHG_AV REGSISTER BIT */ | ||
| 623 | #define DA9052_ICHGAV_ICHGAV 0XFF | ||
| 624 | |||
| 625 | /* ICHG_THD REGSISTER BIT */ | ||
| 626 | #define DA9052_ICHGTHD_ICHGTHD 0XFF | ||
| 627 | |||
| 628 | /* ICHG_END REGSISTER BIT */ | ||
| 629 | #define DA9052_ICHGEND_ICHGEND 0XFF | ||
| 630 | |||
| 631 | /* TBAT_RES REGSISTER BIT */ | ||
| 632 | #define DA9052_TBATRES_TBATRES 0XFF | ||
| 633 | |||
| 634 | /* TBAT_HIGHP REGSISTER BIT */ | ||
| 635 | #define DA9052_TBATHIGHP_TBATHIGHP 0XFF | ||
| 636 | |||
| 637 | /* TBAT_HIGHN REGSISTER BIT */ | ||
| 638 | #define DA9052_TBATHIGHN_TBATHIGHN 0XFF | ||
| 639 | |||
| 640 | /* TBAT_LOW REGSISTER BIT */ | ||
| 641 | #define DA9052_TBATLOW_TBATLOW 0XFF | ||
| 642 | |||
| 643 | /* T_OFFSET REGSISTER BIT */ | ||
| 644 | #define DA9052_TOFFSET_TOFFSET 0XFF | ||
| 645 | |||
| 646 | /* ADCIN4_RES REGSISTER BIT */ | ||
| 647 | #define DA9052_ADCIN4RES_ADCIN4RES 0XFF | ||
| 648 | |||
| 649 | /* ADCIN4_HIGH REGSISTER BIT */ | ||
| 650 | #define DA9052_AUTO4HIGH_AUTO4HIGH 0XFF | ||
| 651 | |||
| 652 | /* ADCIN4_LOW REGSISTER BIT */ | ||
| 653 | #define DA9052_AUTO4LOW_AUTO4LOW 0XFF | ||
| 654 | |||
| 655 | /* ADCIN5_RES REGSISTER BIT */ | ||
| 656 | #define DA9052_ADCIN5RES_ADCIN5RES 0XFF | ||
| 657 | |||
| 658 | /* ADCIN5_HIGH REGSISTER BIT */ | ||
| 659 | #define DA9052_AUTO5HIGH_AUTOHIGH 0XFF | ||
| 660 | |||
| 661 | /* ADCIN5_LOW REGSISTER BIT */ | ||
| 662 | #define DA9052_AUTO5LOW_AUTO5LOW 0XFF | ||
| 663 | |||
| 664 | /* ADCIN6_RES REGSISTER BIT */ | ||
| 665 | #define DA9052_ADCIN6RES_ADCIN6RES 0XFF | ||
| 666 | |||
| 667 | /* ADCIN6_HIGH REGSISTER BIT */ | ||
| 668 | #define DA9052_AUTO6HIGH_AUTO6HIGH 0XFF | ||
| 669 | |||
| 670 | /* ADCIN6_LOW REGSISTER BIT */ | ||
| 671 | #define DA9052_AUTO6LOW_AUTO6LOW 0XFF | ||
| 672 | |||
| 673 | /* TJUNC_RES REGSISTER BIT*/ | ||
| 674 | #define DA9052_TJUNCRES_TJUNCRES 0XFF | ||
| 675 | |||
| 676 | /* TSI REGISTER */ | ||
| 677 | /* TSI CONTROL REGISTER A BITS */ | ||
| 678 | #define DA9052_TSICONTA_TSIDELAY 0XC0 | ||
| 679 | #define DA9052_TSICONTA_TSISKIP 0X38 | ||
| 680 | #define DA9052_TSICONTA_TSIMODE 0X04 | ||
| 681 | #define DA9052_TSICONTA_PENDETEN 0X02 | ||
| 682 | #define DA9052_TSICONTA_AUTOTSIEN 0X01 | ||
| 683 | |||
| 684 | /* TSI CONTROL REGISTER B BITS */ | ||
| 685 | #define DA9052_TSICONTB_ADCREF 0X80 | ||
| 686 | #define DA9052_TSICONTB_TSIMAN 0X40 | ||
| 687 | #define DA9052_TSICONTB_TSIMUX 0X30 | ||
| 688 | #define DA9052_TSICONTB_TSISEL3 0X08 | ||
| 689 | #define DA9052_TSICONTB_TSISEL2 0X04 | ||
| 690 | #define DA9052_TSICONTB_TSISEL1 0X02 | ||
| 691 | #define DA9052_TSICONTB_TSISEL0 0X01 | ||
| 692 | |||
| 693 | /* TSI X CO-ORDINATE MSB RESULT REGISTER BITS */ | ||
| 694 | #define DA9052_TSIXMSB_TSIXM 0XFF | ||
| 695 | |||
| 696 | /* TSI Y CO-ORDINATE MSB RESULT REGISTER BITS */ | ||
| 697 | #define DA9052_TSIYMSB_TSIYM 0XFF | ||
| 698 | |||
| 699 | /* TSI CO-ORDINATE LSB RESULT REGISTER BITS */ | ||
| 700 | #define DA9052_TSILSB_PENDOWN 0X40 | ||
| 701 | #define DA9052_TSILSB_TSIZL 0X30 | ||
| 702 | #define DA9052_TSILSB_TSIYL 0X0C | ||
| 703 | #define DA9052_TSILSB_TSIXL 0X03 | ||
| 704 | |||
| 705 | /* TSI Z MEASUREMENT MSB RESULT REGISTER BIT */ | ||
| 706 | #define DA9052_TSIZMSB_TSIZM 0XFF | ||
| 707 | |||
| 708 | /* RTC REGISTER */ | ||
| 709 | /* RTC TIMER SECONDS REGISTER BITS */ | ||
| 710 | #define DA9052_COUNTS_MONITOR 0X40 | ||
| 711 | #define DA9052_RTC_SEC 0X3F | ||
| 712 | |||
| 713 | /* RTC TIMER MINUTES REGISTER BIT */ | ||
| 714 | #define DA9052_RTC_MIN 0X3F | ||
| 715 | |||
| 716 | /* RTC TIMER HOUR REGISTER BIT */ | ||
| 717 | #define DA9052_RTC_HOUR 0X1F | ||
| 718 | |||
| 719 | /* RTC TIMER DAYS REGISTER BIT */ | ||
| 720 | #define DA9052_RTC_DAY 0X1F | ||
| 721 | |||
| 722 | /* RTC TIMER MONTHS REGISTER BIT */ | ||
| 723 | #define DA9052_RTC_MONTH 0X0F | ||
| 724 | |||
| 725 | /* RTC TIMER YEARS REGISTER BIT */ | ||
| 726 | #define DA9052_RTC_YEAR 0X3F | ||
| 727 | |||
| 728 | /* RTC ALARM MINUTES REGISTER BITS */ | ||
| 729 | #define DA9052_ALARMM_I_TICK_TYPE 0X80 | ||
| 730 | #define DA9052_ALARMMI_ALARMTYPE 0X40 | ||
| 731 | |||
| 732 | /* RTC ALARM YEARS REGISTER BITS */ | ||
| 733 | #define DA9052_ALARM_Y_TICK_ON 0X80 | ||
| 734 | #define DA9052_ALARM_Y_ALARM_ON 0X40 | ||
| 735 | |||
| 736 | /* RTC SECONDS REGISTER A BITS */ | ||
| 737 | #define DA9052_SECONDA_SECONDSA 0XFF | ||
| 738 | |||
| 739 | /* RTC SECONDS REGISTER B BITS */ | ||
| 740 | #define DA9052_SECONDB_SECONDSB 0XFF | ||
| 741 | |||
| 742 | /* RTC SECONDS REGISTER C BITS */ | ||
| 743 | #define DA9052_SECONDC_SECONDSC 0XFF | ||
| 744 | |||
| 745 | /* RTC SECONDS REGISTER D BITS */ | ||
| 746 | #define DA9052_SECONDD_SECONDSD 0XFF | ||
| 747 | |||
| 748 | #endif | ||
| 749 | /* __LINUX_MFD_DA9052_REG_H */ | ||
diff --git a/include/linux/mfd/max8925.h b/include/linux/mfd/max8925.h index 5259dfe8c585..15b2392a56fb 100644 --- a/include/linux/mfd/max8925.h +++ b/include/linux/mfd/max8925.h | |||
| @@ -167,9 +167,6 @@ enum { | |||
| 167 | MAX8925_IRQ_VCHG_DC_OVP, | 167 | MAX8925_IRQ_VCHG_DC_OVP, |
| 168 | MAX8925_IRQ_VCHG_DC_F, | 168 | MAX8925_IRQ_VCHG_DC_F, |
| 169 | MAX8925_IRQ_VCHG_DC_R, | 169 | MAX8925_IRQ_VCHG_DC_R, |
| 170 | MAX8925_IRQ_VCHG_USB_OVP, | ||
| 171 | MAX8925_IRQ_VCHG_USB_F, | ||
| 172 | MAX8925_IRQ_VCHG_USB_R, | ||
| 173 | MAX8925_IRQ_VCHG_THM_OK_R, | 170 | MAX8925_IRQ_VCHG_THM_OK_R, |
| 174 | MAX8925_IRQ_VCHG_THM_OK_F, | 171 | MAX8925_IRQ_VCHG_THM_OK_F, |
| 175 | MAX8925_IRQ_VCHG_SYSLOW_F, | 172 | MAX8925_IRQ_VCHG_SYSLOW_F, |
| @@ -206,6 +203,8 @@ struct max8925_chip { | |||
| 206 | int irq_base; | 203 | int irq_base; |
| 207 | int core_irq; | 204 | int core_irq; |
| 208 | int tsc_irq; | 205 | int tsc_irq; |
| 206 | |||
| 207 | unsigned int wakeup_flag; | ||
| 209 | }; | 208 | }; |
| 210 | 209 | ||
| 211 | struct max8925_backlight_pdata { | 210 | struct max8925_backlight_pdata { |
| @@ -223,6 +222,10 @@ struct max8925_power_pdata { | |||
| 223 | unsigned batt_detect:1; | 222 | unsigned batt_detect:1; |
| 224 | unsigned topoff_threshold:2; | 223 | unsigned topoff_threshold:2; |
| 225 | unsigned fast_charge:3; /* charge current */ | 224 | unsigned fast_charge:3; /* charge current */ |
| 225 | unsigned no_temp_support:1; /* set if no temperature detect */ | ||
| 226 | unsigned no_insert_detect:1; /* set if no ac insert detect */ | ||
| 227 | char **supplied_to; | ||
| 228 | int num_supplicants; | ||
| 226 | }; | 229 | }; |
| 227 | 230 | ||
| 228 | /* | 231 | /* |
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h index 0bbd13dbe336..fff590521e50 100644 --- a/include/linux/mfd/max8997.h +++ b/include/linux/mfd/max8997.h | |||
| @@ -77,6 +77,82 @@ struct max8997_regulator_data { | |||
| 77 | struct regulator_init_data *initdata; | 77 | struct regulator_init_data *initdata; |
| 78 | }; | 78 | }; |
| 79 | 79 | ||
| 80 | enum max8997_muic_usb_type { | ||
| 81 | MAX8997_USB_HOST, | ||
| 82 | MAX8997_USB_DEVICE, | ||
| 83 | }; | ||
| 84 | |||
| 85 | enum max8997_muic_charger_type { | ||
| 86 | MAX8997_CHARGER_TYPE_NONE = 0, | ||
| 87 | MAX8997_CHARGER_TYPE_USB, | ||
| 88 | MAX8997_CHARGER_TYPE_DOWNSTREAM_PORT, | ||
| 89 | MAX8997_CHARGER_TYPE_DEDICATED_CHG, | ||
| 90 | MAX8997_CHARGER_TYPE_500MA, | ||
| 91 | MAX8997_CHARGER_TYPE_1A, | ||
| 92 | MAX8997_CHARGER_TYPE_DEAD_BATTERY = 7, | ||
| 93 | }; | ||
| 94 | |||
| 95 | struct max8997_muic_reg_data { | ||
| 96 | u8 addr; | ||
| 97 | u8 data; | ||
| 98 | }; | ||
| 99 | |||
| 100 | /** | ||
| 101 | * struct max8997_muic_platform_data | ||
| 102 | * @usb_callback: callback function for USB | ||
| 103 | * inform callee of USB type (HOST or DEVICE) | ||
| 104 | * and attached state(true or false) | ||
| 105 | * @charger_callback: callback function for charger | ||
| 106 | * inform callee of charger_type | ||
| 107 | * and attached state(true or false) | ||
| 108 | * @deskdock_callback: callback function for desk dock | ||
| 109 | * inform callee of attached state(true or false) | ||
| 110 | * @cardock_callback: callback function for car dock | ||
| 111 | * inform callee of attached state(true or false) | ||
| 112 | * @mhl_callback: callback function for MHL (Mobile High-definition Link) | ||
| 113 | * inform callee of attached state(true or false) | ||
| 114 | * @uart_callback: callback function for JIG UART | ||
| 115 | * inform callee of attached state(true or false) | ||
| 116 | * @init_data: array of max8997_muic_reg_data | ||
| 117 | * used for initializing registers of MAX8997 MUIC device | ||
| 118 | * @num_init_data: array size of init_data | ||
| 119 | */ | ||
| 120 | struct max8997_muic_platform_data { | ||
| 121 | void (*usb_callback)(enum max8997_muic_usb_type usb_type, | ||
| 122 | bool attached); | ||
| 123 | void (*charger_callback)(bool attached, | ||
| 124 | enum max8997_muic_charger_type charger_type); | ||
| 125 | void (*deskdock_callback) (bool attached); | ||
| 126 | void (*cardock_callback) (bool attached); | ||
| 127 | void (*mhl_callback) (bool attached); | ||
| 128 | void (*uart_callback) (bool attached); | ||
| 129 | |||
| 130 | struct max8997_muic_reg_data *init_data; | ||
| 131 | int num_init_data; | ||
| 132 | }; | ||
| 133 | |||
| 134 | enum max8997_led_mode { | ||
| 135 | MAX8997_NONE, | ||
| 136 | MAX8997_FLASH_MODE, | ||
| 137 | MAX8997_MOVIE_MODE, | ||
| 138 | MAX8997_FLASH_PIN_CONTROL_MODE, | ||
| 139 | MAX8997_MOVIE_PIN_CONTROL_MODE, | ||
| 140 | }; | ||
| 141 | |||
| 142 | /** | ||
| 143 | * struct max8997_led_platform_data | ||
| 144 | * The number of LED devices for MAX8997 is two | ||
| 145 | * @mode: LED mode for each LED device | ||
| 146 | * @brightness: initial brightness for each LED device | ||
| 147 | * range: | ||
| 148 | * [0 - 31]: MAX8997_FLASH_MODE and MAX8997_FLASH_PIN_CONTROL_MODE | ||
| 149 | * [0 - 15]: MAX8997_MOVIE_MODE and MAX8997_MOVIE_PIN_CONTROL_MODE | ||
| 150 | */ | ||
| 151 | struct max8997_led_platform_data { | ||
| 152 | enum max8997_led_mode mode[2]; | ||
| 153 | u8 brightness[2]; | ||
| 154 | }; | ||
| 155 | |||
| 80 | struct max8997_platform_data { | 156 | struct max8997_platform_data { |
| 81 | /* IRQ */ | 157 | /* IRQ */ |
| 82 | int irq_base; | 158 | int irq_base; |
| @@ -113,10 +189,13 @@ struct max8997_platform_data { | |||
| 113 | /* charge Full Timeout */ | 189 | /* charge Full Timeout */ |
| 114 | int timeout; /* 0 (no timeout), 5, 6, 7 hours */ | 190 | int timeout; /* 0 (no timeout), 5, 6, 7 hours */ |
| 115 | 191 | ||
| 116 | /* MUIC: Not implemented */ | 192 | /* ---- MUIC ---- */ |
| 193 | struct max8997_muic_platform_data *muic_pdata; | ||
| 194 | |||
| 117 | /* HAPTIC: Not implemented */ | 195 | /* HAPTIC: Not implemented */ |
| 118 | /* RTC: Not implemented */ | 196 | /* RTC: Not implemented */ |
| 119 | /* Flash: Not implemented */ | 197 | /* ---- LED ---- */ |
| 198 | struct max8997_led_platform_data *led_pdata; | ||
| 120 | }; | 199 | }; |
| 121 | 200 | ||
| 122 | #endif /* __LINUX_MFD_MAX8998_H */ | 201 | #endif /* __LINUX_MFD_MAX8998_H */ |
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h index 3816c2fac0ad..b86ee45c8b03 100644 --- a/include/linux/mfd/mc13xxx.h +++ b/include/linux/mfd/mc13xxx.h | |||
| @@ -69,6 +69,7 @@ struct regulator_init_data; | |||
| 69 | struct mc13xxx_regulator_init_data { | 69 | struct mc13xxx_regulator_init_data { |
| 70 | int id; | 70 | int id; |
| 71 | struct regulator_init_data *init_data; | 71 | struct regulator_init_data *init_data; |
| 72 | struct device_node *node; | ||
| 72 | }; | 73 | }; |
| 73 | 74 | ||
| 74 | struct mc13xxx_regulator_platform_data { | 75 | struct mc13xxx_regulator_platform_data { |
| @@ -173,6 +174,9 @@ struct mc13xxx_platform_data { | |||
| 173 | #define MC13XXX_ADC_MODE_MULT_CHAN 3 | 174 | #define MC13XXX_ADC_MODE_MULT_CHAN 3 |
| 174 | 175 | ||
| 175 | #define MC13XXX_ADC0 43 | 176 | #define MC13XXX_ADC0 43 |
| 177 | #define MC13XXX_ADC0_LICELLCON (1 << 0) | ||
| 178 | #define MC13XXX_ADC0_CHRGICON (1 << 1) | ||
| 179 | #define MC13XXX_ADC0_BATICON (1 << 2) | ||
| 176 | #define MC13XXX_ADC0_ADREFEN (1 << 10) | 180 | #define MC13XXX_ADC0_ADREFEN (1 << 10) |
| 177 | #define MC13XXX_ADC0_TSMOD0 (1 << 12) | 181 | #define MC13XXX_ADC0_TSMOD0 (1 << 12) |
| 178 | #define MC13XXX_ADC0_TSMOD1 (1 << 13) | 182 | #define MC13XXX_ADC0_TSMOD1 (1 << 13) |
| @@ -184,4 +188,9 @@ struct mc13xxx_platform_data { | |||
| 184 | MC13XXX_ADC0_TSMOD1 | \ | 188 | MC13XXX_ADC0_TSMOD1 | \ |
| 185 | MC13XXX_ADC0_TSMOD2) | 189 | MC13XXX_ADC0_TSMOD2) |
| 186 | 190 | ||
| 191 | #define MC13XXX_ADC0_CONFIG_MASK (MC13XXX_ADC0_TSMOD_MASK | \ | ||
| 192 | MC13XXX_ADC0_LICELLCON | \ | ||
| 193 | MC13XXX_ADC0_CHRGICON | \ | ||
| 194 | MC13XXX_ADC0_BATICON) | ||
| 195 | |||
| 187 | #endif /* ifndef __LINUX_MFD_MC13XXX_H */ | 196 | #endif /* ifndef __LINUX_MFD_MC13XXX_H */ |
diff --git a/include/linux/mfd/mcp.h b/include/linux/mfd/mcp.h index ee496708e38b..f88c1cc0cb0f 100644 --- a/include/linux/mfd/mcp.h +++ b/include/linux/mfd/mcp.h | |||
| @@ -64,6 +64,9 @@ void mcp_driver_unregister(struct mcp_driver *); | |||
| 64 | #define mcp_get_drvdata(mcp) dev_get_drvdata(&(mcp)->attached_device) | 64 | #define mcp_get_drvdata(mcp) dev_get_drvdata(&(mcp)->attached_device) |
| 65 | #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) |
| 66 | 66 | ||
| 67 | #define mcp_priv(mcp) ((void *)((mcp)+1)) | 67 | static inline void *mcp_priv(struct mcp *mcp) |
| 68 | { | ||
| 69 | return mcp + 1; | ||
| 70 | } | ||
| 68 | 71 | ||
| 69 | #endif | 72 | #endif |
diff --git a/include/linux/mfd/s5m87xx/s5m-core.h b/include/linux/mfd/s5m87xx/s5m-core.h new file mode 100644 index 000000000000..a7480b57f92d --- /dev/null +++ b/include/linux/mfd/s5m87xx/s5m-core.h | |||
| @@ -0,0 +1,373 @@ | |||
| 1 | /* | ||
| 2 | * s5m-core.h | ||
| 3 | * | ||
| 4 | * Copyright (c) 2011 Samsung Electronics Co., Ltd | ||
| 5 | * http://www.samsung.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 | ||
| 9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 10 | * option) any later version. | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __LINUX_MFD_S5M_CORE_H | ||
| 15 | #define __LINUX_MFD_S5M_CORE_H | ||
| 16 | |||
| 17 | #define NUM_IRQ_REGS 4 | ||
| 18 | |||
| 19 | enum s5m_device_type { | ||
| 20 | S5M8751X, | ||
| 21 | S5M8763X, | ||
| 22 | S5M8767X, | ||
| 23 | }; | ||
| 24 | |||
| 25 | /* S5M8767 registers */ | ||
| 26 | enum s5m8767_reg { | ||
| 27 | S5M8767_REG_ID, | ||
| 28 | S5M8767_REG_INT1, | ||
| 29 | S5M8767_REG_INT2, | ||
| 30 | S5M8767_REG_INT3, | ||
| 31 | S5M8767_REG_INT1M, | ||
| 32 | S5M8767_REG_INT2M, | ||
| 33 | S5M8767_REG_INT3M, | ||
| 34 | S5M8767_REG_STATUS1, | ||
| 35 | S5M8767_REG_STATUS2, | ||
| 36 | S5M8767_REG_STATUS3, | ||
| 37 | S5M8767_REG_CTRL1, | ||
| 38 | S5M8767_REG_CTRL2, | ||
| 39 | S5M8767_REG_LOWBAT1, | ||
| 40 | S5M8767_REG_LOWBAT2, | ||
| 41 | S5M8767_REG_BUCHG, | ||
| 42 | S5M8767_REG_DVSRAMP, | ||
| 43 | S5M8767_REG_DVSTIMER2 = 0x10, | ||
| 44 | S5M8767_REG_DVSTIMER3, | ||
| 45 | S5M8767_REG_DVSTIMER4, | ||
| 46 | S5M8767_REG_LDO1, | ||
| 47 | S5M8767_REG_LDO2, | ||
| 48 | S5M8767_REG_LDO3, | ||
| 49 | S5M8767_REG_LDO4, | ||
| 50 | S5M8767_REG_LDO5, | ||
| 51 | S5M8767_REG_LDO6, | ||
| 52 | S5M8767_REG_LDO7, | ||
| 53 | S5M8767_REG_LDO8, | ||
| 54 | S5M8767_REG_LDO9, | ||
| 55 | S5M8767_REG_LDO10, | ||
| 56 | S5M8767_REG_LDO11, | ||
| 57 | S5M8767_REG_LDO12, | ||
| 58 | S5M8767_REG_LDO13, | ||
| 59 | S5M8767_REG_LDO14 = 0x20, | ||
| 60 | S5M8767_REG_LDO15, | ||
| 61 | S5M8767_REG_LDO16, | ||
| 62 | S5M8767_REG_LDO17, | ||
| 63 | S5M8767_REG_LDO18, | ||
| 64 | S5M8767_REG_LDO19, | ||
| 65 | S5M8767_REG_LDO20, | ||
| 66 | S5M8767_REG_LDO21, | ||
| 67 | S5M8767_REG_LDO22, | ||
| 68 | S5M8767_REG_LDO23, | ||
| 69 | S5M8767_REG_LDO24, | ||
| 70 | S5M8767_REG_LDO25, | ||
| 71 | S5M8767_REG_LDO26, | ||
| 72 | S5M8767_REG_LDO27, | ||
| 73 | S5M8767_REG_LDO28, | ||
| 74 | S5M8767_REG_UVLO = 0x31, | ||
| 75 | S5M8767_REG_BUCK1CTRL1, | ||
| 76 | S5M8767_REG_BUCK1CTRL2, | ||
| 77 | S5M8767_REG_BUCK2CTRL, | ||
| 78 | S5M8767_REG_BUCK2DVS1, | ||
| 79 | S5M8767_REG_BUCK2DVS2, | ||
| 80 | S5M8767_REG_BUCK2DVS3, | ||
| 81 | S5M8767_REG_BUCK2DVS4, | ||
| 82 | S5M8767_REG_BUCK2DVS5, | ||
| 83 | S5M8767_REG_BUCK2DVS6, | ||
| 84 | S5M8767_REG_BUCK2DVS7, | ||
| 85 | S5M8767_REG_BUCK2DVS8, | ||
| 86 | S5M8767_REG_BUCK3CTRL, | ||
| 87 | S5M8767_REG_BUCK3DVS1, | ||
| 88 | S5M8767_REG_BUCK3DVS2, | ||
| 89 | S5M8767_REG_BUCK3DVS3, | ||
| 90 | S5M8767_REG_BUCK3DVS4, | ||
| 91 | S5M8767_REG_BUCK3DVS5, | ||
| 92 | S5M8767_REG_BUCK3DVS6, | ||
| 93 | S5M8767_REG_BUCK3DVS7, | ||
| 94 | S5M8767_REG_BUCK3DVS8, | ||
| 95 | S5M8767_REG_BUCK4CTRL, | ||
| 96 | S5M8767_REG_BUCK4DVS1, | ||
| 97 | S5M8767_REG_BUCK4DVS2, | ||
| 98 | S5M8767_REG_BUCK4DVS3, | ||
| 99 | S5M8767_REG_BUCK4DVS4, | ||
| 100 | S5M8767_REG_BUCK4DVS5, | ||
| 101 | S5M8767_REG_BUCK4DVS6, | ||
| 102 | S5M8767_REG_BUCK4DVS7, | ||
| 103 | S5M8767_REG_BUCK4DVS8, | ||
| 104 | S5M8767_REG_BUCK5CTRL1, | ||
| 105 | S5M8767_REG_BUCK5CTRL2, | ||
| 106 | S5M8767_REG_BUCK5CTRL3, | ||
| 107 | S5M8767_REG_BUCK5CTRL4, | ||
| 108 | S5M8767_REG_BUCK5CTRL5, | ||
| 109 | S5M8767_REG_BUCK6CTRL1, | ||
| 110 | S5M8767_REG_BUCK6CTRL2, | ||
| 111 | S5M8767_REG_BUCK7CTRL1, | ||
| 112 | S5M8767_REG_BUCK7CTRL2, | ||
| 113 | S5M8767_REG_BUCK8CTRL1, | ||
| 114 | S5M8767_REG_BUCK8CTRL2, | ||
| 115 | S5M8767_REG_BUCK9CTRL1, | ||
| 116 | S5M8767_REG_BUCK9CTRL2, | ||
| 117 | S5M8767_REG_LDO1CTRL, | ||
| 118 | S5M8767_REG_LDO2_1CTRL, | ||
| 119 | S5M8767_REG_LDO2_2CTRL, | ||
| 120 | S5M8767_REG_LDO2_3CTRL, | ||
| 121 | S5M8767_REG_LDO2_4CTRL, | ||
| 122 | S5M8767_REG_LDO3CTRL, | ||
| 123 | S5M8767_REG_LDO4CTRL, | ||
| 124 | S5M8767_REG_LDO5CTRL, | ||
| 125 | S5M8767_REG_LDO6CTRL, | ||
| 126 | S5M8767_REG_LDO7CTRL, | ||
| 127 | S5M8767_REG_LDO8CTRL, | ||
| 128 | S5M8767_REG_LDO9CTRL, | ||
| 129 | S5M8767_REG_LDO10CTRL, | ||
| 130 | S5M8767_REG_LDO11CTRL, | ||
| 131 | S5M8767_REG_LDO12CTRL, | ||
| 132 | S5M8767_REG_LDO13CTRL, | ||
| 133 | S5M8767_REG_LDO14CTRL, | ||
| 134 | S5M8767_REG_LDO15CTRL, | ||
| 135 | S5M8767_REG_LDO16CTRL, | ||
| 136 | S5M8767_REG_LDO17CTRL, | ||
| 137 | S5M8767_REG_LDO18CTRL, | ||
| 138 | S5M8767_REG_LDO19CTRL, | ||
| 139 | S5M8767_REG_LDO20CTRL, | ||
| 140 | S5M8767_REG_LDO21CTRL, | ||
| 141 | S5M8767_REG_LDO22CTRL, | ||
| 142 | S5M8767_REG_LDO23CTRL, | ||
| 143 | S5M8767_REG_LDO24CTRL, | ||
| 144 | S5M8767_REG_LDO25CTRL, | ||
| 145 | S5M8767_REG_LDO26CTRL, | ||
| 146 | S5M8767_REG_LDO27CTRL, | ||
| 147 | S5M8767_REG_LDO28CTRL, | ||
| 148 | }; | ||
| 149 | |||
| 150 | /* S5M8763 registers */ | ||
| 151 | enum s5m8763_reg { | ||
| 152 | S5M8763_REG_IRQ1, | ||
| 153 | S5M8763_REG_IRQ2, | ||
| 154 | S5M8763_REG_IRQ3, | ||
| 155 | S5M8763_REG_IRQ4, | ||
| 156 | S5M8763_REG_IRQM1, | ||
| 157 | S5M8763_REG_IRQM2, | ||
| 158 | S5M8763_REG_IRQM3, | ||
| 159 | S5M8763_REG_IRQM4, | ||
| 160 | S5M8763_REG_STATUS1, | ||
| 161 | S5M8763_REG_STATUS2, | ||
| 162 | S5M8763_REG_STATUSM1, | ||
| 163 | S5M8763_REG_STATUSM2, | ||
| 164 | S5M8763_REG_CHGR1, | ||
| 165 | S5M8763_REG_CHGR2, | ||
| 166 | S5M8763_REG_LDO_ACTIVE_DISCHARGE1, | ||
| 167 | S5M8763_REG_LDO_ACTIVE_DISCHARGE2, | ||
| 168 | S5M8763_REG_BUCK_ACTIVE_DISCHARGE3, | ||
| 169 | S5M8763_REG_ONOFF1, | ||
| 170 | S5M8763_REG_ONOFF2, | ||
| 171 | S5M8763_REG_ONOFF3, | ||
| 172 | S5M8763_REG_ONOFF4, | ||
| 173 | S5M8763_REG_BUCK1_VOLTAGE1, | ||
| 174 | S5M8763_REG_BUCK1_VOLTAGE2, | ||
| 175 | S5M8763_REG_BUCK1_VOLTAGE3, | ||
| 176 | S5M8763_REG_BUCK1_VOLTAGE4, | ||
| 177 | S5M8763_REG_BUCK2_VOLTAGE1, | ||
| 178 | S5M8763_REG_BUCK2_VOLTAGE2, | ||
| 179 | S5M8763_REG_BUCK3, | ||
| 180 | S5M8763_REG_BUCK4, | ||
| 181 | S5M8763_REG_LDO1_LDO2, | ||
| 182 | S5M8763_REG_LDO3, | ||
| 183 | S5M8763_REG_LDO4, | ||
| 184 | S5M8763_REG_LDO5, | ||
| 185 | S5M8763_REG_LDO6, | ||
| 186 | S5M8763_REG_LDO7, | ||
| 187 | S5M8763_REG_LDO7_LDO8, | ||
| 188 | S5M8763_REG_LDO9_LDO10, | ||
| 189 | S5M8763_REG_LDO11, | ||
| 190 | S5M8763_REG_LDO12, | ||
| 191 | S5M8763_REG_LDO13, | ||
| 192 | S5M8763_REG_LDO14, | ||
| 193 | S5M8763_REG_LDO15, | ||
| 194 | S5M8763_REG_LDO16, | ||
| 195 | S5M8763_REG_BKCHR, | ||
| 196 | S5M8763_REG_LBCNFG1, | ||
| 197 | S5M8763_REG_LBCNFG2, | ||
| 198 | }; | ||
| 199 | |||
| 200 | enum s5m8767_irq { | ||
| 201 | S5M8767_IRQ_PWRR, | ||
| 202 | S5M8767_IRQ_PWRF, | ||
| 203 | S5M8767_IRQ_PWR1S, | ||
| 204 | S5M8767_IRQ_JIGR, | ||
| 205 | S5M8767_IRQ_JIGF, | ||
| 206 | S5M8767_IRQ_LOWBAT2, | ||
| 207 | S5M8767_IRQ_LOWBAT1, | ||
| 208 | |||
| 209 | S5M8767_IRQ_MRB, | ||
| 210 | S5M8767_IRQ_DVSOK2, | ||
| 211 | S5M8767_IRQ_DVSOK3, | ||
| 212 | S5M8767_IRQ_DVSOK4, | ||
| 213 | |||
| 214 | S5M8767_IRQ_RTC60S, | ||
| 215 | S5M8767_IRQ_RTCA1, | ||
| 216 | S5M8767_IRQ_RTCA2, | ||
| 217 | S5M8767_IRQ_SMPL, | ||
| 218 | S5M8767_IRQ_RTC1S, | ||
| 219 | S5M8767_IRQ_WTSR, | ||
| 220 | |||
| 221 | S5M8767_IRQ_NR, | ||
| 222 | }; | ||
| 223 | |||
| 224 | #define S5M8767_IRQ_PWRR_MASK (1 << 0) | ||
| 225 | #define S5M8767_IRQ_PWRF_MASK (1 << 1) | ||
| 226 | #define S5M8767_IRQ_PWR1S_MASK (1 << 3) | ||
| 227 | #define S5M8767_IRQ_JIGR_MASK (1 << 4) | ||
| 228 | #define S5M8767_IRQ_JIGF_MASK (1 << 5) | ||
| 229 | #define S5M8767_IRQ_LOWBAT2_MASK (1 << 6) | ||
| 230 | #define S5M8767_IRQ_LOWBAT1_MASK (1 << 7) | ||
| 231 | |||
| 232 | #define S5M8767_IRQ_MRB_MASK (1 << 2) | ||
| 233 | #define S5M8767_IRQ_DVSOK2_MASK (1 << 3) | ||
| 234 | #define S5M8767_IRQ_DVSOK3_MASK (1 << 4) | ||
| 235 | #define S5M8767_IRQ_DVSOK4_MASK (1 << 5) | ||
| 236 | |||
| 237 | #define S5M8767_IRQ_RTC60S_MASK (1 << 0) | ||
| 238 | #define S5M8767_IRQ_RTCA1_MASK (1 << 1) | ||
| 239 | #define S5M8767_IRQ_RTCA2_MASK (1 << 2) | ||
| 240 | #define S5M8767_IRQ_SMPL_MASK (1 << 3) | ||
| 241 | #define S5M8767_IRQ_RTC1S_MASK (1 << 4) | ||
| 242 | #define S5M8767_IRQ_WTSR_MASK (1 << 5) | ||
| 243 | |||
| 244 | enum s5m8763_irq { | ||
| 245 | S5M8763_IRQ_DCINF, | ||
| 246 | S5M8763_IRQ_DCINR, | ||
| 247 | S5M8763_IRQ_JIGF, | ||
| 248 | S5M8763_IRQ_JIGR, | ||
| 249 | S5M8763_IRQ_PWRONF, | ||
| 250 | S5M8763_IRQ_PWRONR, | ||
| 251 | |||
| 252 | S5M8763_IRQ_WTSREVNT, | ||
| 253 | S5M8763_IRQ_SMPLEVNT, | ||
| 254 | S5M8763_IRQ_ALARM1, | ||
| 255 | S5M8763_IRQ_ALARM0, | ||
| 256 | |||
| 257 | S5M8763_IRQ_ONKEY1S, | ||
| 258 | S5M8763_IRQ_TOPOFFR, | ||
| 259 | S5M8763_IRQ_DCINOVPR, | ||
| 260 | S5M8763_IRQ_CHGRSTF, | ||
| 261 | S5M8763_IRQ_DONER, | ||
| 262 | S5M8763_IRQ_CHGFAULT, | ||
| 263 | |||
| 264 | S5M8763_IRQ_LOBAT1, | ||
| 265 | S5M8763_IRQ_LOBAT2, | ||
| 266 | |||
| 267 | S5M8763_IRQ_NR, | ||
| 268 | }; | ||
| 269 | |||
| 270 | #define S5M8763_IRQ_DCINF_MASK (1 << 2) | ||
| 271 | #define S5M8763_IRQ_DCINR_MASK (1 << 3) | ||
| 272 | #define S5M8763_IRQ_JIGF_MASK (1 << 4) | ||
| 273 | #define S5M8763_IRQ_JIGR_MASK (1 << 5) | ||
| 274 | #define S5M8763_IRQ_PWRONF_MASK (1 << 6) | ||
| 275 | #define S5M8763_IRQ_PWRONR_MASK (1 << 7) | ||
| 276 | |||
| 277 | #define S5M8763_IRQ_WTSREVNT_MASK (1 << 0) | ||
| 278 | #define S5M8763_IRQ_SMPLEVNT_MASK (1 << 1) | ||
| 279 | #define S5M8763_IRQ_ALARM1_MASK (1 << 2) | ||
| 280 | #define S5M8763_IRQ_ALARM0_MASK (1 << 3) | ||
| 281 | |||
| 282 | #define S5M8763_IRQ_ONKEY1S_MASK (1 << 0) | ||
| 283 | #define S5M8763_IRQ_TOPOFFR_MASK (1 << 2) | ||
| 284 | #define S5M8763_IRQ_DCINOVPR_MASK (1 << 3) | ||
| 285 | #define S5M8763_IRQ_CHGRSTF_MASK (1 << 4) | ||
| 286 | #define S5M8763_IRQ_DONER_MASK (1 << 5) | ||
| 287 | #define S5M8763_IRQ_CHGFAULT_MASK (1 << 7) | ||
| 288 | |||
| 289 | #define S5M8763_IRQ_LOBAT1_MASK (1 << 0) | ||
| 290 | #define S5M8763_IRQ_LOBAT2_MASK (1 << 1) | ||
| 291 | |||
| 292 | #define S5M8763_ENRAMP (1 << 4) | ||
| 293 | |||
| 294 | /** | ||
| 295 | * struct s5m87xx_dev - s5m87xx master device for sub-drivers | ||
| 296 | * @dev: master device of the chip (can be used to access platform data) | ||
| 297 | * @i2c: i2c client private data for regulator | ||
| 298 | * @rtc: i2c client private data for rtc | ||
| 299 | * @iolock: mutex for serializing io access | ||
| 300 | * @irqlock: mutex for buslock | ||
| 301 | * @irq_base: base IRQ number for s5m87xx, required for IRQs | ||
| 302 | * @irq: generic IRQ number for s5m87xx | ||
| 303 | * @ono: power onoff IRQ number for s5m87xx | ||
| 304 | * @irq_masks_cur: currently active value | ||
| 305 | * @irq_masks_cache: cached hardware value | ||
| 306 | * @type: indicate which s5m87xx "variant" is used | ||
| 307 | */ | ||
| 308 | struct s5m87xx_dev { | ||
| 309 | struct device *dev; | ||
| 310 | struct regmap *regmap; | ||
| 311 | struct i2c_client *i2c; | ||
| 312 | struct i2c_client *rtc; | ||
| 313 | struct mutex iolock; | ||
| 314 | struct mutex irqlock; | ||
| 315 | |||
| 316 | int device_type; | ||
| 317 | int irq_base; | ||
| 318 | int irq; | ||
| 319 | int ono; | ||
| 320 | u8 irq_masks_cur[NUM_IRQ_REGS]; | ||
| 321 | u8 irq_masks_cache[NUM_IRQ_REGS]; | ||
| 322 | int type; | ||
| 323 | bool wakeup; | ||
| 324 | }; | ||
| 325 | |||
| 326 | int s5m_irq_init(struct s5m87xx_dev *s5m87xx); | ||
| 327 | void s5m_irq_exit(struct s5m87xx_dev *s5m87xx); | ||
| 328 | int s5m_irq_resume(struct s5m87xx_dev *s5m87xx); | ||
| 329 | |||
| 330 | extern int s5m_reg_read(struct s5m87xx_dev *s5m87xx, u8 reg, void *dest); | ||
| 331 | extern int s5m_bulk_read(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf); | ||
| 332 | extern int s5m_reg_write(struct s5m87xx_dev *s5m87xx, u8 reg, u8 value); | ||
| 333 | extern int s5m_bulk_write(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf); | ||
| 334 | extern int s5m_reg_update(struct s5m87xx_dev *s5m87xx, u8 reg, u8 val, u8 mask); | ||
| 335 | |||
| 336 | struct s5m_platform_data { | ||
| 337 | struct s5m_regulator_data *regulators; | ||
| 338 | int device_type; | ||
| 339 | int num_regulators; | ||
| 340 | |||
| 341 | int irq_base; | ||
| 342 | int (*cfg_pmic_irq)(void); | ||
| 343 | |||
| 344 | int ono; | ||
| 345 | bool wakeup; | ||
| 346 | bool buck_voltage_lock; | ||
| 347 | |||
| 348 | int buck_gpios[3]; | ||
| 349 | int buck2_voltage[8]; | ||
| 350 | bool buck2_gpiodvs; | ||
| 351 | int buck3_voltage[8]; | ||
| 352 | bool buck3_gpiodvs; | ||
| 353 | int buck4_voltage[8]; | ||
| 354 | bool buck4_gpiodvs; | ||
| 355 | |||
| 356 | int buck_set1; | ||
| 357 | int buck_set2; | ||
| 358 | int buck_set3; | ||
| 359 | int buck2_enable; | ||
| 360 | int buck3_enable; | ||
| 361 | int buck4_enable; | ||
| 362 | int buck_default_idx; | ||
| 363 | int buck2_default_idx; | ||
| 364 | int buck3_default_idx; | ||
| 365 | int buck4_default_idx; | ||
| 366 | |||
| 367 | int buck_ramp_delay; | ||
| 368 | bool buck2_ramp_enable; | ||
| 369 | bool buck3_ramp_enable; | ||
| 370 | bool buck4_ramp_enable; | ||
| 371 | }; | ||
| 372 | |||
| 373 | #endif /* __LINUX_MFD_S5M_CORE_H */ | ||
diff --git a/include/linux/mfd/s5m87xx/s5m-pmic.h b/include/linux/mfd/s5m87xx/s5m-pmic.h new file mode 100644 index 000000000000..a72a5d27e62e --- /dev/null +++ b/include/linux/mfd/s5m87xx/s5m-pmic.h | |||
| @@ -0,0 +1,100 @@ | |||
| 1 | /* s5m87xx.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. | ||
| 4 | * http://www.samsung.com | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __LINUX_MFD_S5M_PMIC_H | ||
| 12 | #define __LINUX_MFD_S5M_PMIC_H | ||
| 13 | |||
| 14 | #include <linux/regulator/machine.h> | ||
| 15 | |||
| 16 | /* S5M8767 regulator ids */ | ||
| 17 | enum s5m8767_regulators { | ||
| 18 | S5M8767_LDO1, | ||
| 19 | S5M8767_LDO2, | ||
| 20 | S5M8767_LDO3, | ||
| 21 | S5M8767_LDO4, | ||
| 22 | S5M8767_LDO5, | ||
| 23 | S5M8767_LDO6, | ||
| 24 | S5M8767_LDO7, | ||
| 25 | S5M8767_LDO8, | ||
| 26 | S5M8767_LDO9, | ||
| 27 | S5M8767_LDO10, | ||
| 28 | S5M8767_LDO11, | ||
| 29 | S5M8767_LDO12, | ||
| 30 | S5M8767_LDO13, | ||
| 31 | S5M8767_LDO14, | ||
| 32 | S5M8767_LDO15, | ||
| 33 | S5M8767_LDO16, | ||
| 34 | S5M8767_LDO17, | ||
| 35 | S5M8767_LDO18, | ||
| 36 | S5M8767_LDO19, | ||
| 37 | S5M8767_LDO20, | ||
| 38 | S5M8767_LDO21, | ||
| 39 | S5M8767_LDO22, | ||
| 40 | S5M8767_LDO23, | ||
| 41 | S5M8767_LDO24, | ||
| 42 | S5M8767_LDO25, | ||
| 43 | S5M8767_LDO26, | ||
| 44 | S5M8767_LDO27, | ||
| 45 | S5M8767_LDO28, | ||
| 46 | S5M8767_BUCK1, | ||
| 47 | S5M8767_BUCK2, | ||
| 48 | S5M8767_BUCK3, | ||
| 49 | S5M8767_BUCK4, | ||
| 50 | S5M8767_BUCK5, | ||
| 51 | S5M8767_BUCK6, | ||
| 52 | S5M8767_BUCK7, | ||
| 53 | S5M8767_BUCK8, | ||
| 54 | S5M8767_BUCK9, | ||
| 55 | S5M8767_AP_EN32KHZ, | ||
| 56 | S5M8767_CP_EN32KHZ, | ||
| 57 | |||
| 58 | S5M8767_REG_MAX, | ||
| 59 | }; | ||
| 60 | |||
| 61 | /* S5M8763 regulator ids */ | ||
| 62 | enum s5m8763_regulators { | ||
| 63 | S5M8763_LDO1, | ||
| 64 | S5M8763_LDO2, | ||
| 65 | S5M8763_LDO3, | ||
| 66 | S5M8763_LDO4, | ||
| 67 | S5M8763_LDO5, | ||
| 68 | S5M8763_LDO6, | ||
| 69 | S5M8763_LDO7, | ||
| 70 | S5M8763_LDO8, | ||
| 71 | S5M8763_LDO9, | ||
| 72 | S5M8763_LDO10, | ||
| 73 | S5M8763_LDO11, | ||
| 74 | S5M8763_LDO12, | ||
| 75 | S5M8763_LDO13, | ||
| 76 | S5M8763_LDO14, | ||
| 77 | S5M8763_LDO15, | ||
| 78 | S5M8763_LDO16, | ||
| 79 | S5M8763_BUCK1, | ||
| 80 | S5M8763_BUCK2, | ||
| 81 | S5M8763_BUCK3, | ||
| 82 | S5M8763_BUCK4, | ||
| 83 | S5M8763_AP_EN32KHZ, | ||
| 84 | S5M8763_CP_EN32KHZ, | ||
| 85 | S5M8763_ENCHGVI, | ||
| 86 | S5M8763_ESAFEUSB1, | ||
| 87 | S5M8763_ESAFEUSB2, | ||
| 88 | }; | ||
| 89 | |||
| 90 | /** | ||
| 91 | * s5m87xx_regulator_data - regulator data | ||
| 92 | * @id: regulator id | ||
| 93 | * @initdata: regulator init data (contraints, supplies, ...) | ||
| 94 | */ | ||
| 95 | struct s5m_regulator_data { | ||
| 96 | int id; | ||
| 97 | struct regulator_init_data *initdata; | ||
| 98 | }; | ||
| 99 | |||
| 100 | #endif /* __LINUX_MFD_S5M_PMIC_H */ | ||
diff --git a/include/linux/mfd/s5m87xx/s5m-rtc.h b/include/linux/mfd/s5m87xx/s5m-rtc.h new file mode 100644 index 000000000000..6ce8da264cec --- /dev/null +++ b/include/linux/mfd/s5m87xx/s5m-rtc.h | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | /* | ||
| 2 | * s5m-rtc.h | ||
| 3 | * | ||
| 4 | * Copyright (c) 2011 Samsung Electronics Co., Ltd | ||
| 5 | * http://www.samsung.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 | ||
| 9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 10 | * option) any later version. | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __LINUX_MFD_S5M_RTC_H | ||
| 15 | #define __LINUX_MFD_S5M_RTC_H | ||
| 16 | |||
| 17 | enum s5m87xx_rtc_reg { | ||
| 18 | S5M87XX_RTC_SEC, | ||
| 19 | S5M87XX_RTC_MIN, | ||
| 20 | S5M87XX_RTC_HOUR, | ||
| 21 | S5M87XX_RTC_WEEKDAY, | ||
| 22 | S5M87XX_RTC_DATE, | ||
| 23 | S5M87XX_RTC_MONTH, | ||
| 24 | S5M87XX_RTC_YEAR1, | ||
| 25 | S5M87XX_RTC_YEAR2, | ||
| 26 | S5M87XX_ALARM0_SEC, | ||
| 27 | S5M87XX_ALARM0_MIN, | ||
| 28 | S5M87XX_ALARM0_HOUR, | ||
| 29 | S5M87XX_ALARM0_WEEKDAY, | ||
| 30 | S5M87XX_ALARM0_DATE, | ||
| 31 | S5M87XX_ALARM0_MONTH, | ||
| 32 | S5M87XX_ALARM0_YEAR1, | ||
| 33 | S5M87XX_ALARM0_YEAR2, | ||
| 34 | S5M87XX_ALARM1_SEC, | ||
| 35 | S5M87XX_ALARM1_MIN, | ||
| 36 | S5M87XX_ALARM1_HOUR, | ||
| 37 | S5M87XX_ALARM1_WEEKDAY, | ||
| 38 | S5M87XX_ALARM1_DATE, | ||
| 39 | S5M87XX_ALARM1_MONTH, | ||
| 40 | S5M87XX_ALARM1_YEAR1, | ||
| 41 | S5M87XX_ALARM1_YEAR2, | ||
| 42 | S5M87XX_ALARM0_CONF, | ||
| 43 | S5M87XX_ALARM1_CONF, | ||
| 44 | S5M87XX_RTC_STATUS, | ||
| 45 | S5M87XX_WTSR_SMPL_CNTL, | ||
| 46 | S5M87XX_RTC_UDR_CON, | ||
| 47 | }; | ||
| 48 | |||
| 49 | #define RTC_I2C_ADDR (0x0C >> 1) | ||
| 50 | |||
| 51 | #define HOUR_12 (1 << 7) | ||
| 52 | #define HOUR_AMPM (1 << 6) | ||
| 53 | #define HOUR_PM (1 << 5) | ||
| 54 | #define ALARM0_STATUS (1 << 1) | ||
| 55 | #define ALARM1_STATUS (1 << 2) | ||
| 56 | #define UPDATE_AD (1 << 0) | ||
| 57 | |||
| 58 | /* RTC Control Register */ | ||
| 59 | #define BCD_EN_SHIFT 0 | ||
| 60 | #define BCD_EN_MASK (1 << BCD_EN_SHIFT) | ||
| 61 | #define MODEL24_SHIFT 1 | ||
| 62 | #define MODEL24_MASK (1 << MODEL24_SHIFT) | ||
| 63 | /* RTC Update Register1 */ | ||
| 64 | #define RTC_UDR_SHIFT 0 | ||
| 65 | #define RTC_UDR_MASK (1 << RTC_UDR_SHIFT) | ||
| 66 | /* RTC Hour register */ | ||
| 67 | #define HOUR_PM_SHIFT 6 | ||
| 68 | #define HOUR_PM_MASK (1 << HOUR_PM_SHIFT) | ||
| 69 | /* RTC Alarm Enable */ | ||
| 70 | #define ALARM_ENABLE_SHIFT 7 | ||
| 71 | #define ALARM_ENABLE_MASK (1 << ALARM_ENABLE_SHIFT) | ||
| 72 | |||
| 73 | enum { | ||
| 74 | RTC_SEC = 0, | ||
| 75 | RTC_MIN, | ||
| 76 | RTC_HOUR, | ||
| 77 | RTC_WEEKDAY, | ||
| 78 | RTC_DATE, | ||
| 79 | RTC_MONTH, | ||
| 80 | RTC_YEAR1, | ||
| 81 | RTC_YEAR2, | ||
| 82 | }; | ||
| 83 | |||
| 84 | #endif /* __LINUX_MFD_S5M_RTC_H */ | ||
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h index be1af7c42e57..ca1d7a347600 100644 --- a/include/linux/mfd/stmpe.h +++ b/include/linux/mfd/stmpe.h | |||
| @@ -20,6 +20,8 @@ enum stmpe_block { | |||
| 20 | }; | 20 | }; |
| 21 | 21 | ||
| 22 | enum stmpe_partnum { | 22 | enum stmpe_partnum { |
| 23 | STMPE610, | ||
| 24 | STMPE801, | ||
| 23 | STMPE811, | 25 | STMPE811, |
| 24 | STMPE1601, | 26 | STMPE1601, |
| 25 | STMPE2401, | 27 | STMPE2401, |
| @@ -50,17 +52,20 @@ enum { | |||
| 50 | 52 | ||
| 51 | 53 | ||
| 52 | struct stmpe_variant_info; | 54 | struct stmpe_variant_info; |
| 55 | struct stmpe_client_info; | ||
| 53 | 56 | ||
| 54 | /** | 57 | /** |
| 55 | * struct stmpe - STMPE MFD structure | 58 | * struct stmpe - STMPE MFD structure |
| 56 | * @lock: lock protecting I/O operations | 59 | * @lock: lock protecting I/O operations |
| 57 | * @irq_lock: IRQ bus lock | 60 | * @irq_lock: IRQ bus lock |
| 58 | * @dev: device, mostly for dev_dbg() | 61 | * @dev: device, mostly for dev_dbg() |
| 59 | * @i2c: i2c client | 62 | * @client: client - i2c or spi |
| 63 | * @ci: client specific information | ||
| 60 | * @partnum: part number | 64 | * @partnum: part number |
| 61 | * @variant: the detected STMPE model number | 65 | * @variant: the detected STMPE model number |
| 62 | * @regs: list of addresses of registers which are at different addresses on | 66 | * @regs: list of addresses of registers which are at different addresses on |
| 63 | * different variants. Indexed by one of STMPE_IDX_*. | 67 | * different variants. Indexed by one of STMPE_IDX_*. |
| 68 | * @irq: irq number for stmpe | ||
| 64 | * @irq_base: starting IRQ number for internal IRQs | 69 | * @irq_base: starting IRQ number for internal IRQs |
| 65 | * @num_gpios: number of gpios, differs for variants | 70 | * @num_gpios: number of gpios, differs for variants |
| 66 | * @ier: cache of IER registers for bus_lock | 71 | * @ier: cache of IER registers for bus_lock |
| @@ -71,11 +76,13 @@ struct stmpe { | |||
| 71 | struct mutex lock; | 76 | struct mutex lock; |
| 72 | struct mutex irq_lock; | 77 | struct mutex irq_lock; |
| 73 | struct device *dev; | 78 | struct device *dev; |
| 74 | struct i2c_client *i2c; | 79 | void *client; |
| 80 | struct stmpe_client_info *ci; | ||
| 75 | enum stmpe_partnum partnum; | 81 | enum stmpe_partnum partnum; |
| 76 | struct stmpe_variant_info *variant; | 82 | struct stmpe_variant_info *variant; |
| 77 | const u8 *regs; | 83 | const u8 *regs; |
| 78 | 84 | ||
| 85 | int irq; | ||
| 79 | int irq_base; | 86 | int irq_base; |
| 80 | int num_gpios; | 87 | int num_gpios; |
| 81 | u8 ier[2]; | 88 | u8 ier[2]; |
| @@ -183,6 +190,9 @@ struct stmpe_ts_platform_data { | |||
| 183 | * @autosleep_timeout: inactivity timeout in milliseconds for autosleep | 190 | * @autosleep_timeout: inactivity timeout in milliseconds for autosleep |
| 184 | * @irq_base: base IRQ number. %STMPE_NR_IRQS irqs will be used, or | 191 | * @irq_base: base IRQ number. %STMPE_NR_IRQS irqs will be used, or |
| 185 | * %STMPE_NR_INTERNAL_IRQS if the GPIO driver is not used. | 192 | * %STMPE_NR_INTERNAL_IRQS if the GPIO driver is not used. |
| 193 | * @irq_over_gpio: true if gpio is used to get irq | ||
| 194 | * @irq_gpio: gpio number over which irq will be requested (significant only if | ||
| 195 | * irq_over_gpio is true) | ||
| 186 | * @gpio: GPIO-specific platform data | 196 | * @gpio: GPIO-specific platform data |
| 187 | * @keypad: keypad-specific platform data | 197 | * @keypad: keypad-specific platform data |
| 188 | * @ts: touchscreen-specific platform data | 198 | * @ts: touchscreen-specific platform data |
| @@ -194,6 +204,8 @@ struct stmpe_platform_data { | |||
| 194 | unsigned int irq_trigger; | 204 | unsigned int irq_trigger; |
| 195 | bool irq_invert_polarity; | 205 | bool irq_invert_polarity; |
| 196 | bool autosleep; | 206 | bool autosleep; |
| 207 | bool irq_over_gpio; | ||
| 208 | int irq_gpio; | ||
| 197 | int autosleep_timeout; | 209 | int autosleep_timeout; |
| 198 | 210 | ||
| 199 | struct stmpe_gpio_platform_data *gpio; | 211 | struct stmpe_gpio_platform_data *gpio; |
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h index 8bf2cb9502dd..d0cb12eba402 100644 --- a/include/linux/mfd/tps65910.h +++ b/include/linux/mfd/tps65910.h | |||
| @@ -740,6 +740,34 @@ | |||
| 740 | #define TPS65910_GPIO_STS BIT(1) | 740 | #define TPS65910_GPIO_STS BIT(1) |
| 741 | #define TPS65910_GPIO_SET BIT(0) | 741 | #define TPS65910_GPIO_SET BIT(0) |
| 742 | 742 | ||
| 743 | /* Regulator Index Definitions */ | ||
| 744 | #define TPS65910_REG_VRTC 0 | ||
| 745 | #define TPS65910_REG_VIO 1 | ||
| 746 | #define TPS65910_REG_VDD1 2 | ||
| 747 | #define TPS65910_REG_VDD2 3 | ||
| 748 | #define TPS65910_REG_VDD3 4 | ||
| 749 | #define TPS65910_REG_VDIG1 5 | ||
| 750 | #define TPS65910_REG_VDIG2 6 | ||
| 751 | #define TPS65910_REG_VPLL 7 | ||
| 752 | #define TPS65910_REG_VDAC 8 | ||
| 753 | #define TPS65910_REG_VAUX1 9 | ||
| 754 | #define TPS65910_REG_VAUX2 10 | ||
| 755 | #define TPS65910_REG_VAUX33 11 | ||
| 756 | #define TPS65910_REG_VMMC 12 | ||
| 757 | |||
| 758 | #define TPS65911_REG_VDDCTRL 4 | ||
| 759 | #define TPS65911_REG_LDO1 5 | ||
| 760 | #define TPS65911_REG_LDO2 6 | ||
| 761 | #define TPS65911_REG_LDO3 7 | ||
| 762 | #define TPS65911_REG_LDO4 8 | ||
| 763 | #define TPS65911_REG_LDO5 9 | ||
| 764 | #define TPS65911_REG_LDO6 10 | ||
| 765 | #define TPS65911_REG_LDO7 11 | ||
| 766 | #define TPS65911_REG_LDO8 12 | ||
| 767 | |||
| 768 | /* Max number of TPS65910/11 regulators */ | ||
| 769 | #define TPS65910_NUM_REGS 13 | ||
| 770 | |||
| 743 | /** | 771 | /** |
| 744 | * struct tps65910_board | 772 | * struct tps65910_board |
| 745 | * Board platform data may be used to initialize regulators. | 773 | * Board platform data may be used to initialize regulators. |
| @@ -751,7 +779,7 @@ struct tps65910_board { | |||
| 751 | int irq_base; | 779 | int irq_base; |
| 752 | int vmbch_threshold; | 780 | int vmbch_threshold; |
| 753 | int vmbch2_threshold; | 781 | int vmbch2_threshold; |
| 754 | struct regulator_init_data *tps65910_pmic_init_data; | 782 | struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS]; |
| 755 | }; | 783 | }; |
| 756 | 784 | ||
| 757 | /** | 785 | /** |
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h index f44bdb7273bd..9eff2a351ec5 100644 --- a/include/linux/mfd/wm8994/core.h +++ b/include/linux/mfd/wm8994/core.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #ifndef __MFD_WM8994_CORE_H__ | 15 | #ifndef __MFD_WM8994_CORE_H__ |
| 16 | #define __MFD_WM8994_CORE_H__ | 16 | #define __MFD_WM8994_CORE_H__ |
| 17 | 17 | ||
| 18 | #include <linux/mutex.h> | ||
| 18 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
| 19 | 20 | ||
| 20 | enum wm8994_type { | 21 | enum wm8994_type { |
| @@ -55,6 +56,7 @@ struct wm8994 { | |||
| 55 | struct mutex irq_lock; | 56 | struct mutex irq_lock; |
| 56 | 57 | ||
| 57 | enum wm8994_type type; | 58 | enum wm8994_type type; |
| 59 | int revision; | ||
| 58 | 60 | ||
| 59 | struct device *dev; | 61 | struct device *dev; |
| 60 | struct regmap *regmap; | 62 | struct regmap *regmap; |
| @@ -65,13 +67,10 @@ struct wm8994 { | |||
| 65 | int irq_base; | 67 | int irq_base; |
| 66 | 68 | ||
| 67 | int irq; | 69 | int irq; |
| 68 | u16 irq_masks_cur[WM8994_NUM_IRQ_REGS]; | 70 | struct regmap_irq_chip_data *irq_data; |
| 69 | u16 irq_masks_cache[WM8994_NUM_IRQ_REGS]; | ||
| 70 | 71 | ||
| 71 | /* Used over suspend/resume */ | 72 | /* Used over suspend/resume */ |
| 72 | bool suspended; | 73 | bool suspended; |
| 73 | u16 ldo_regs[WM8994_NUM_LDO_REGS]; | ||
| 74 | u16 gpio_regs[WM8994_NUM_GPIO_REGS]; | ||
| 75 | 74 | ||
| 76 | struct regulator_dev *dbvdd; | 75 | struct regulator_dev *dbvdd; |
| 77 | int num_supplies; | 76 | int num_supplies; |
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h index ea32f306dca6..3fb1f407d5e6 100644 --- a/include/linux/mfd/wm8994/pdata.h +++ b/include/linux/mfd/wm8994/pdata.h | |||
| @@ -23,7 +23,7 @@ struct wm8994_ldo_pdata { | |||
| 23 | int enable; | 23 | int enable; |
| 24 | 24 | ||
| 25 | const char *supply; | 25 | const char *supply; |
| 26 | struct regulator_init_data *init_data; | 26 | const struct regulator_init_data *init_data; |
| 27 | }; | 27 | }; |
| 28 | 28 | ||
| 29 | #define WM8994_CONFIGURE_GPIO 0x10000 | 29 | #define WM8994_CONFIGURE_GPIO 0x10000 |
| @@ -113,6 +113,23 @@ struct wm8958_enh_eq_cfg { | |||
| 113 | u16 regs[WM8958_ENH_EQ_REGS]; | 113 | u16 regs[WM8958_ENH_EQ_REGS]; |
| 114 | }; | 114 | }; |
| 115 | 115 | ||
| 116 | /** | ||
| 117 | * Microphone detection rates, used to tune response rates and power | ||
| 118 | * consumption for WM8958/WM1811 microphone detection. | ||
| 119 | * | ||
| 120 | * @sysclk: System clock rate to use this configuration for. | ||
| 121 | * @idle: True if this configuration should use when no accessory is detected, | ||
| 122 | * false otherwise. | ||
| 123 | * @start: Value for MICD_BIAS_START_TIME register field (not shifted). | ||
| 124 | * @rate: Value for MICD_RATE register field (not shifted). | ||
| 125 | */ | ||
| 126 | struct wm8958_micd_rate { | ||
| 127 | int sysclk; | ||
| 128 | bool idle; | ||
| 129 | int start; | ||
| 130 | int rate; | ||
| 131 | }; | ||
| 132 | |||
| 116 | struct wm8994_pdata { | 133 | struct wm8994_pdata { |
| 117 | int gpio_base; | 134 | int gpio_base; |
| 118 | 135 | ||
| @@ -144,6 +161,9 @@ struct wm8994_pdata { | |||
| 144 | int num_enh_eq_cfgs; | 161 | int num_enh_eq_cfgs; |
| 145 | struct wm8958_enh_eq_cfg *enh_eq_cfgs; | 162 | struct wm8958_enh_eq_cfg *enh_eq_cfgs; |
| 146 | 163 | ||
| 164 | int num_micd_rates; | ||
| 165 | struct wm8958_micd_rate *micd_rates; | ||
| 166 | |||
| 147 | /* LINEOUT can be differential or single ended */ | 167 | /* LINEOUT can be differential or single ended */ |
| 148 | unsigned int lineout1_diff:1; | 168 | unsigned int lineout1_diff:1; |
| 149 | unsigned int lineout2_diff:1; | 169 | unsigned int lineout2_diff:1; |
| @@ -168,12 +188,21 @@ struct wm8994_pdata { | |||
| 168 | /* WM8958 microphone bias configuration */ | 188 | /* WM8958 microphone bias configuration */ |
| 169 | int micbias[2]; | 189 | int micbias[2]; |
| 170 | 190 | ||
| 191 | /* WM8958 microphone detection ranges */ | ||
| 192 | u16 micd_lvl_sel; | ||
| 193 | |||
| 171 | /* Disable the internal pull downs on the LDOs if they are | 194 | /* Disable the internal pull downs on the LDOs if they are |
| 172 | * always driven (eg, connected to an always on supply or | 195 | * always driven (eg, connected to an always on supply or |
| 173 | * GPIO that always drives an output. If they float power | 196 | * GPIO that always drives an output. If they float power |
| 174 | * consumption will rise. | 197 | * consumption will rise. |
| 175 | */ | 198 | */ |
| 176 | bool ldo_ena_always_driven; | 199 | bool ldo_ena_always_driven; |
| 200 | |||
| 201 | /* | ||
| 202 | * SPKMODE must be pulled internally by the device on this | ||
| 203 | * system. | ||
| 204 | */ | ||
| 205 | bool spkmode_pu; | ||
| 177 | }; | 206 | }; |
| 178 | 207 | ||
| 179 | #endif | 208 | #endif |
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h index 83a9caec0e43..86e6a032a078 100644 --- a/include/linux/mfd/wm8994/registers.h +++ b/include/linux/mfd/wm8994/registers.h | |||
| @@ -95,11 +95,15 @@ | |||
| 95 | #define WM8994_FLL1_CONTROL_3 0x222 | 95 | #define WM8994_FLL1_CONTROL_3 0x222 |
| 96 | #define WM8994_FLL1_CONTROL_4 0x223 | 96 | #define WM8994_FLL1_CONTROL_4 0x223 |
| 97 | #define WM8994_FLL1_CONTROL_5 0x224 | 97 | #define WM8994_FLL1_CONTROL_5 0x224 |
| 98 | #define WM8958_FLL1_EFS_1 0x226 | ||
| 99 | #define WM8958_FLL1_EFS_2 0x227 | ||
| 98 | #define WM8994_FLL2_CONTROL_1 0x240 | 100 | #define WM8994_FLL2_CONTROL_1 0x240 |
| 99 | #define WM8994_FLL2_CONTROL_2 0x241 | 101 | #define WM8994_FLL2_CONTROL_2 0x241 |
| 100 | #define WM8994_FLL2_CONTROL_3 0x242 | 102 | #define WM8994_FLL2_CONTROL_3 0x242 |
| 101 | #define WM8994_FLL2_CONTROL_4 0x243 | 103 | #define WM8994_FLL2_CONTROL_4 0x243 |
| 102 | #define WM8994_FLL2_CONTROL_5 0x244 | 104 | #define WM8994_FLL2_CONTROL_5 0x244 |
| 105 | #define WM8958_FLL2_EFS_1 0x246 | ||
| 106 | #define WM8958_FLL2_EFS_2 0x247 | ||
| 103 | #define WM8994_AIF1_CONTROL_1 0x300 | 107 | #define WM8994_AIF1_CONTROL_1 0x300 |
| 104 | #define WM8994_AIF1_CONTROL_2 0x301 | 108 | #define WM8994_AIF1_CONTROL_2 0x301 |
| 105 | #define WM8994_AIF1_MASTER_SLAVE 0x302 | 109 | #define WM8994_AIF1_MASTER_SLAVE 0x302 |
| @@ -116,6 +120,7 @@ | |||
| 116 | #define WM8994_AIF2DAC_LRCLK 0x315 | 120 | #define WM8994_AIF2DAC_LRCLK 0x315 |
| 117 | #define WM8994_AIF2DAC_DATA 0x316 | 121 | #define WM8994_AIF2DAC_DATA 0x316 |
| 118 | #define WM8994_AIF2ADC_DATA 0x317 | 122 | #define WM8994_AIF2ADC_DATA 0x317 |
| 123 | #define WM1811_AIF2TX_CONTROL 0x318 | ||
| 119 | #define WM8958_AIF3_CONTROL_1 0x320 | 124 | #define WM8958_AIF3_CONTROL_1 0x320 |
| 120 | #define WM8958_AIF3_CONTROL_2 0x321 | 125 | #define WM8958_AIF3_CONTROL_2 0x321 |
| 121 | #define WM8958_AIF3DAC_DATA 0x322 | 126 | #define WM8958_AIF3DAC_DATA 0x322 |
| @@ -166,6 +171,7 @@ | |||
| 166 | #define WM8994_AIF1_DAC1_EQ_BAND_5_A 0x491 | 171 | #define WM8994_AIF1_DAC1_EQ_BAND_5_A 0x491 |
| 167 | #define WM8994_AIF1_DAC1_EQ_BAND_5_B 0x492 | 172 | #define WM8994_AIF1_DAC1_EQ_BAND_5_B 0x492 |
| 168 | #define WM8994_AIF1_DAC1_EQ_BAND_5_PG 0x493 | 173 | #define WM8994_AIF1_DAC1_EQ_BAND_5_PG 0x493 |
| 174 | #define WM8994_AIF1_DAC1_EQ_BAND_1_C 0x494 | ||
| 169 | #define WM8994_AIF1_DAC2_EQ_GAINS_1 0x4A0 | 175 | #define WM8994_AIF1_DAC2_EQ_GAINS_1 0x4A0 |
| 170 | #define WM8994_AIF1_DAC2_EQ_GAINS_2 0x4A1 | 176 | #define WM8994_AIF1_DAC2_EQ_GAINS_2 0x4A1 |
| 171 | #define WM8994_AIF1_DAC2_EQ_BAND_1_A 0x4A2 | 177 | #define WM8994_AIF1_DAC2_EQ_BAND_1_A 0x4A2 |
| @@ -186,6 +192,7 @@ | |||
| 186 | #define WM8994_AIF1_DAC2_EQ_BAND_5_A 0x4B1 | 192 | #define WM8994_AIF1_DAC2_EQ_BAND_5_A 0x4B1 |
| 187 | #define WM8994_AIF1_DAC2_EQ_BAND_5_B 0x4B2 | 193 | #define WM8994_AIF1_DAC2_EQ_BAND_5_B 0x4B2 |
| 188 | #define WM8994_AIF1_DAC2_EQ_BAND_5_PG 0x4B3 | 194 | #define WM8994_AIF1_DAC2_EQ_BAND_5_PG 0x4B3 |
| 195 | #define WM8994_AIF1_DAC2_EQ_BAND_1_C 0x4B4 | ||
| 189 | #define WM8994_AIF2_ADC_LEFT_VOLUME 0x500 | 196 | #define WM8994_AIF2_ADC_LEFT_VOLUME 0x500 |
| 190 | #define WM8994_AIF2_ADC_RIGHT_VOLUME 0x501 | 197 | #define WM8994_AIF2_ADC_RIGHT_VOLUME 0x501 |
| 191 | #define WM8994_AIF2_DAC_LEFT_VOLUME 0x502 | 198 | #define WM8994_AIF2_DAC_LEFT_VOLUME 0x502 |
| @@ -219,6 +226,7 @@ | |||
| 219 | #define WM8994_AIF2_EQ_BAND_5_A 0x591 | 226 | #define WM8994_AIF2_EQ_BAND_5_A 0x591 |
| 220 | #define WM8994_AIF2_EQ_BAND_5_B 0x592 | 227 | #define WM8994_AIF2_EQ_BAND_5_B 0x592 |
| 221 | #define WM8994_AIF2_EQ_BAND_5_PG 0x593 | 228 | #define WM8994_AIF2_EQ_BAND_5_PG 0x593 |
| 229 | #define WM8994_AIF2_EQ_BAND_1_C 0x594 | ||
| 222 | #define WM8994_DAC1_MIXER_VOLUMES 0x600 | 230 | #define WM8994_DAC1_MIXER_VOLUMES 0x600 |
| 223 | #define WM8994_DAC1_LEFT_MIXER_ROUTING 0x601 | 231 | #define WM8994_DAC1_LEFT_MIXER_ROUTING 0x601 |
| 224 | #define WM8994_DAC1_RIGHT_MIXER_ROUTING 0x602 | 232 | #define WM8994_DAC1_RIGHT_MIXER_ROUTING 0x602 |
| @@ -242,6 +250,7 @@ | |||
| 242 | #define WM8994_GPIO_4 0x703 | 250 | #define WM8994_GPIO_4 0x703 |
| 243 | #define WM8994_GPIO_5 0x704 | 251 | #define WM8994_GPIO_5 0x704 |
| 244 | #define WM8994_GPIO_6 0x705 | 252 | #define WM8994_GPIO_6 0x705 |
| 253 | #define WM1811_JACKDET_CTRL 0x705 | ||
| 245 | #define WM8994_GPIO_7 0x706 | 254 | #define WM8994_GPIO_7 0x706 |
| 246 | #define WM8994_GPIO_8 0x707 | 255 | #define WM8994_GPIO_8 0x707 |
| 247 | #define WM8994_GPIO_9 0x708 | 256 | #define WM8994_GPIO_9 0x708 |
| @@ -264,7 +273,43 @@ | |||
| 264 | #define WM8958_DSP2_RELEASETIME 0xA03 | 273 | #define WM8958_DSP2_RELEASETIME 0xA03 |
| 265 | #define WM8958_DSP2_VERMAJMIN 0xA04 | 274 | #define WM8958_DSP2_VERMAJMIN 0xA04 |
| 266 | #define WM8958_DSP2_VERBUILD 0xA05 | 275 | #define WM8958_DSP2_VERBUILD 0xA05 |
| 276 | #define WM8958_DSP2_TESTREG 0xA06 | ||
| 277 | #define WM8958_DSP2_XORREG 0xA07 | ||
| 278 | #define WM8958_DSP2_SHIFTMAXX 0xA08 | ||
| 279 | #define WM8958_DSP2_SHIFTMAXY 0xA09 | ||
| 280 | #define WM8958_DSP2_SHIFTMAXZ 0xA0A | ||
| 281 | #define WM8958_DSP2_SHIFTMAXEXTLO 0xA0B | ||
| 282 | #define WM8958_DSP2_AESSELECT 0xA0C | ||
| 267 | #define WM8958_DSP2_EXECCONTROL 0xA0D | 283 | #define WM8958_DSP2_EXECCONTROL 0xA0D |
| 284 | #define WM8958_DSP2_SAMPLEBREAK 0xA0E | ||
| 285 | #define WM8958_DSP2_COUNTBREAK 0xA0F | ||
| 286 | #define WM8958_DSP2_INTSTATUS 0xA10 | ||
| 287 | #define WM8958_DSP2_EVENTSTATUS 0xA11 | ||
| 288 | #define WM8958_DSP2_INTMASK 0xA12 | ||
| 289 | #define WM8958_DSP2_CONFIGDWIDTH 0xA13 | ||
| 290 | #define WM8958_DSP2_CONFIGINSTR 0xA14 | ||
| 291 | #define WM8958_DSP2_CONFIGDMEM 0xA15 | ||
| 292 | #define WM8958_DSP2_CONFIGDELAYS 0xA16 | ||
| 293 | #define WM8958_DSP2_CONFIGNUMIO 0xA17 | ||
| 294 | #define WM8958_DSP2_CONFIGEXTDEPTH 0xA18 | ||
| 295 | #define WM8958_DSP2_CONFIGMULTIPLIER 0xA19 | ||
| 296 | #define WM8958_DSP2_CONFIGCTRLDWIDTH 0xA1A | ||
| 297 | #define WM8958_DSP2_CONFIGPIPELINE 0xA1B | ||
| 298 | #define WM8958_DSP2_SHIFTMAXEXTHI 0xA1C | ||
| 299 | #define WM8958_DSP2_SWVERSIONREG 0xA1D | ||
| 300 | #define WM8958_DSP2_CONFIGXMEM 0xA1E | ||
| 301 | #define WM8958_DSP2_CONFIGYMEM 0xA1F | ||
| 302 | #define WM8958_DSP2_CONFIGZMEM 0xA20 | ||
| 303 | #define WM8958_FW_BUILD_1 0x2000 | ||
| 304 | #define WM8958_FW_BUILD_0 0x2001 | ||
| 305 | #define WM8958_FW_ID_1 0x2002 | ||
| 306 | #define WM8958_FW_ID_0 0x2003 | ||
| 307 | #define WM8958_FW_MAJOR_1 0x2004 | ||
| 308 | #define WM8958_FW_MAJOR_0 0x2005 | ||
| 309 | #define WM8958_FW_MINOR_1 0x2006 | ||
| 310 | #define WM8958_FW_MINOR_0 0x2007 | ||
| 311 | #define WM8958_FW_PATCH_1 0x2008 | ||
| 312 | #define WM8958_FW_PATCH_0 0x2009 | ||
| 268 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_1 0x2200 | 313 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_1 0x2200 |
| 269 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_2 0x2201 | 314 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_2 0x2201 |
| 270 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C2_1 0x2202 | 315 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C2_1 0x2202 |
| @@ -333,6 +378,14 @@ | |||
| 333 | #define WM8958_MBC_B2_PG2_2 0x242D | 378 | #define WM8958_MBC_B2_PG2_2 0x242D |
| 334 | #define WM8958_MBC_B1_PG2_1 0x242E | 379 | #define WM8958_MBC_B1_PG2_1 0x242E |
| 335 | #define WM8958_MBC_B1_PG2_2 0x242F | 380 | #define WM8958_MBC_B1_PG2_2 0x242F |
| 381 | #define WM8958_MBC_CROSSOVER_1 0x2600 | ||
| 382 | #define WM8958_MBC_CROSSOVER_2 0x2601 | ||
| 383 | #define WM8958_MBC_HPF_1 0x2602 | ||
| 384 | #define WM8958_MBC_HPF_2 0x2603 | ||
| 385 | #define WM8958_MBC_LPF_1 0x2606 | ||
| 386 | #define WM8958_MBC_LPF_2 0x2607 | ||
| 387 | #define WM8958_MBC_RMS_LIMIT_1 0x260A | ||
| 388 | #define WM8958_MBC_RMS_LIMIT_2 0x260B | ||
| 336 | #define WM8994_WRITE_SEQUENCER_0 0x3000 | 389 | #define WM8994_WRITE_SEQUENCER_0 0x3000 |
| 337 | #define WM8994_WRITE_SEQUENCER_1 0x3001 | 390 | #define WM8994_WRITE_SEQUENCER_1 0x3001 |
| 338 | #define WM8994_WRITE_SEQUENCER_2 0x3002 | 391 | #define WM8994_WRITE_SEQUENCER_2 0x3002 |
| @@ -1852,6 +1905,9 @@ | |||
| 1852 | /* | 1905 | /* |
| 1853 | * R57 (0x39) - AntiPOP (2) | 1906 | * R57 (0x39) - AntiPOP (2) |
| 1854 | */ | 1907 | */ |
| 1908 | #define WM1811_JACKDET_MODE_MASK 0x0180 /* JACKDET_MODE - [8:7] */ | ||
| 1909 | #define WM1811_JACKDET_MODE_SHIFT 7 /* JACKDET_MODE - [8:7] */ | ||
| 1910 | #define WM1811_JACKDET_MODE_WIDTH 2 /* JACKDET_MODE - [8:7] */ | ||
| 1855 | #define WM8994_MICB2_DISCH 0x0100 /* MICB2_DISCH */ | 1911 | #define WM8994_MICB2_DISCH 0x0100 /* MICB2_DISCH */ |
| 1856 | #define WM8994_MICB2_DISCH_MASK 0x0100 /* MICB2_DISCH */ | 1912 | #define WM8994_MICB2_DISCH_MASK 0x0100 /* MICB2_DISCH */ |
| 1857 | #define WM8994_MICB2_DISCH_SHIFT 8 /* MICB2_DISCH */ | 1913 | #define WM8994_MICB2_DISCH_SHIFT 8 /* MICB2_DISCH */ |
| @@ -2389,6 +2445,10 @@ | |||
| 2389 | /* | 2445 | /* |
| 2390 | * R548 (0x224) - FLL1 Control (5) | 2446 | * R548 (0x224) - FLL1 Control (5) |
| 2391 | */ | 2447 | */ |
| 2448 | #define WM8958_FLL1_BYP 0x8000 /* FLL1_BYP */ | ||
| 2449 | #define WM8958_FLL1_BYP_MASK 0x8000 /* FLL1_BYP */ | ||
| 2450 | #define WM8958_FLL1_BYP_SHIFT 15 /* FLL1_BYP */ | ||
| 2451 | #define WM8958_FLL1_BYP_WIDTH 1 /* FLL1_BYP */ | ||
| 2392 | #define WM8994_FLL1_FRC_NCO_VAL_MASK 0x1F80 /* FLL1_FRC_NCO_VAL - [12:7] */ | 2452 | #define WM8994_FLL1_FRC_NCO_VAL_MASK 0x1F80 /* FLL1_FRC_NCO_VAL - [12:7] */ |
| 2393 | #define WM8994_FLL1_FRC_NCO_VAL_SHIFT 7 /* FLL1_FRC_NCO_VAL - [12:7] */ | 2453 | #define WM8994_FLL1_FRC_NCO_VAL_SHIFT 7 /* FLL1_FRC_NCO_VAL - [12:7] */ |
| 2394 | #define WM8994_FLL1_FRC_NCO_VAL_WIDTH 6 /* FLL1_FRC_NCO_VAL - [12:7] */ | 2454 | #define WM8994_FLL1_FRC_NCO_VAL_WIDTH 6 /* FLL1_FRC_NCO_VAL - [12:7] */ |
| @@ -2404,6 +2464,24 @@ | |||
| 2404 | #define WM8994_FLL1_REFCLK_SRC_WIDTH 2 /* FLL1_REFCLK_SRC - [1:0] */ | 2464 | #define WM8994_FLL1_REFCLK_SRC_WIDTH 2 /* FLL1_REFCLK_SRC - [1:0] */ |
| 2405 | 2465 | ||
| 2406 | /* | 2466 | /* |
| 2467 | * R550 (0x226) - FLL1 EFS 1 | ||
| 2468 | */ | ||
| 2469 | #define WM8958_FLL1_LAMBDA_MASK 0xFFFF /* FLL1_LAMBDA - [15:0] */ | ||
| 2470 | #define WM8958_FLL1_LAMBDA_SHIFT 0 /* FLL1_LAMBDA - [15:0] */ | ||
| 2471 | #define WM8958_FLL1_LAMBDA_WIDTH 16 /* FLL1_LAMBDA - [15:0] */ | ||
| 2472 | |||
| 2473 | /* | ||
| 2474 | * R551 (0x227) - FLL1 EFS 2 | ||
| 2475 | */ | ||
| 2476 | #define WM8958_FLL1_LFSR_SEL_MASK 0x0006 /* FLL1_LFSR_SEL - [2:1] */ | ||
| 2477 | #define WM8958_FLL1_LFSR_SEL_SHIFT 1 /* FLL1_LFSR_SEL - [2:1] */ | ||
| 2478 | #define WM8958_FLL1_LFSR_SEL_WIDTH 2 /* FLL1_LFSR_SEL - [2:1] */ | ||
| 2479 | #define WM8958_FLL1_EFS_ENA 0x0001 /* FLL1_EFS_ENA */ | ||
| 2480 | #define WM8958_FLL1_EFS_ENA_MASK 0x0001 /* FLL1_EFS_ENA */ | ||
| 2481 | #define WM8958_FLL1_EFS_ENA_SHIFT 0 /* FLL1_EFS_ENA */ | ||
| 2482 | #define WM8958_FLL1_EFS_ENA_WIDTH 1 /* FLL1_EFS_ENA */ | ||
| 2483 | |||
| 2484 | /* | ||
| 2407 | * R576 (0x240) - FLL2 Control (1) | 2485 | * R576 (0x240) - FLL2 Control (1) |
| 2408 | */ | 2486 | */ |
| 2409 | #define WM8994_FLL2_FRAC 0x0004 /* FLL2_FRAC */ | 2487 | #define WM8994_FLL2_FRAC 0x0004 /* FLL2_FRAC */ |
| @@ -2452,6 +2530,10 @@ | |||
| 2452 | /* | 2530 | /* |
| 2453 | * R580 (0x244) - FLL2 Control (5) | 2531 | * R580 (0x244) - FLL2 Control (5) |
| 2454 | */ | 2532 | */ |
| 2533 | #define WM8958_FLL2_BYP 0x8000 /* FLL2_BYP */ | ||
| 2534 | #define WM8958_FLL2_BYP_MASK 0x8000 /* FLL2_BYP */ | ||
| 2535 | #define WM8958_FLL2_BYP_SHIFT 15 /* FLL2_BYP */ | ||
| 2536 | #define WM8958_FLL2_BYP_WIDTH 1 /* FLL2_BYP */ | ||
| 2455 | #define WM8994_FLL2_FRC_NCO_VAL_MASK 0x1F80 /* FLL2_FRC_NCO_VAL - [12:7] */ | 2537 | #define WM8994_FLL2_FRC_NCO_VAL_MASK 0x1F80 /* FLL2_FRC_NCO_VAL - [12:7] */ |
| 2456 | #define WM8994_FLL2_FRC_NCO_VAL_SHIFT 7 /* FLL2_FRC_NCO_VAL - [12:7] */ | 2538 | #define WM8994_FLL2_FRC_NCO_VAL_SHIFT 7 /* FLL2_FRC_NCO_VAL - [12:7] */ |
| 2457 | #define WM8994_FLL2_FRC_NCO_VAL_WIDTH 6 /* FLL2_FRC_NCO_VAL - [12:7] */ | 2539 | #define WM8994_FLL2_FRC_NCO_VAL_WIDTH 6 /* FLL2_FRC_NCO_VAL - [12:7] */ |
| @@ -2467,6 +2549,24 @@ | |||
| 2467 | #define WM8994_FLL2_REFCLK_SRC_WIDTH 2 /* FLL2_REFCLK_SRC - [1:0] */ | 2549 | #define WM8994_FLL2_REFCLK_SRC_WIDTH 2 /* FLL2_REFCLK_SRC - [1:0] */ |
| 2468 | 2550 | ||
| 2469 | /* | 2551 | /* |
| 2552 | * R582 (0x246) - FLL2 EFS 1 | ||
| 2553 | */ | ||
| 2554 | #define WM8958_FLL2_LAMBDA_MASK 0xFFFF /* FLL2_LAMBDA - [15:0] */ | ||
| 2555 | #define WM8958_FLL2_LAMBDA_SHIFT 0 /* FLL2_LAMBDA - [15:0] */ | ||
| 2556 | #define WM8958_FLL2_LAMBDA_WIDTH 16 /* FLL2_LAMBDA - [15:0] */ | ||
| 2557 | |||
| 2558 | /* | ||
| 2559 | * R583 (0x247) - FLL2 EFS 2 | ||
| 2560 | */ | ||
| 2561 | #define WM8958_FLL2_LFSR_SEL_MASK 0x0006 /* FLL2_LFSR_SEL - [2:1] */ | ||
| 2562 | #define WM8958_FLL2_LFSR_SEL_SHIFT 1 /* FLL2_LFSR_SEL - [2:1] */ | ||
| 2563 | #define WM8958_FLL2_LFSR_SEL_WIDTH 2 /* FLL2_LFSR_SEL - [2:1] */ | ||
| 2564 | #define WM8958_FLL2_EFS_ENA 0x0001 /* FLL2_EFS_ENA */ | ||
| 2565 | #define WM8958_FLL2_EFS_ENA_MASK 0x0001 /* FLL2_EFS_ENA */ | ||
| 2566 | #define WM8958_FLL2_EFS_ENA_SHIFT 0 /* FLL2_EFS_ENA */ | ||
| 2567 | #define WM8958_FLL2_EFS_ENA_WIDTH 1 /* FLL2_EFS_ENA */ | ||
| 2568 | |||
| 2569 | /* | ||
| 2470 | * R768 (0x300) - AIF1 Control (1) | 2570 | * R768 (0x300) - AIF1 Control (1) |
| 2471 | */ | 2571 | */ |
| 2472 | #define WM8994_AIF1ADCL_SRC 0x8000 /* AIF1ADCL_SRC */ | 2572 | #define WM8994_AIF1ADCL_SRC 0x8000 /* AIF1ADCL_SRC */ |
| @@ -4187,6 +4287,18 @@ | |||
| 4187 | #define WM8994_STL_SEL_WIDTH 1 /* STL_SEL */ | 4287 | #define WM8994_STL_SEL_WIDTH 1 /* STL_SEL */ |
| 4188 | 4288 | ||
| 4189 | /* | 4289 | /* |
| 4290 | * R1797 (0x705) - JACKDET Ctrl | ||
| 4291 | */ | ||
| 4292 | #define WM1811_JACKDET_DB 0x0100 /* JACKDET_DB */ | ||
| 4293 | #define WM1811_JACKDET_DB_MASK 0x0100 /* JACKDET_DB */ | ||
| 4294 | #define WM1811_JACKDET_DB_SHIFT 8 /* JACKDET_DB */ | ||
| 4295 | #define WM1811_JACKDET_DB_WIDTH 1 /* JACKDET_DB */ | ||
| 4296 | #define WM1811_JACKDET_LVL 0x0040 /* JACKDET_LVL */ | ||
| 4297 | #define WM1811_JACKDET_LVL_MASK 0x0040 /* JACKDET_LVL */ | ||
| 4298 | #define WM1811_JACKDET_LVL_SHIFT 6 /* JACKDET_LVL */ | ||
| 4299 | #define WM1811_JACKDET_LVL_WIDTH 1 /* JACKDET_LVL */ | ||
| 4300 | |||
| 4301 | /* | ||
| 4190 | * R1824 (0x720) - Pull Control (1) | 4302 | * R1824 (0x720) - Pull Control (1) |
| 4191 | */ | 4303 | */ |
| 4192 | #define WM8994_DMICDAT2_PU 0x0800 /* DMICDAT2_PU */ | 4304 | #define WM8994_DMICDAT2_PU 0x0800 /* DMICDAT2_PU */ |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index e39aeecfe9a2..05ed2828a553 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
| @@ -3,6 +3,7 @@ | |||
| 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 | ||
| @@ -11,13 +12,13 @@ typedef struct page *new_page_t(struct page *, unsigned long private, int **); | |||
| 11 | 12 | ||
| 12 | extern void putback_lru_pages(struct list_head *l); | 13 | extern void putback_lru_pages(struct list_head *l); |
| 13 | extern int migrate_page(struct address_space *, | 14 | extern int migrate_page(struct address_space *, |
| 14 | struct page *, struct page *); | 15 | struct page *, struct page *, enum migrate_mode); |
| 15 | extern int migrate_pages(struct list_head *l, new_page_t x, | 16 | extern int migrate_pages(struct list_head *l, new_page_t x, |
| 16 | unsigned long private, bool offlining, | 17 | unsigned long private, bool offlining, |
| 17 | bool sync); | 18 | enum migrate_mode mode); |
| 18 | extern int migrate_huge_pages(struct list_head *l, new_page_t x, | 19 | extern int migrate_huge_pages(struct list_head *l, new_page_t x, |
| 19 | unsigned long private, bool offlining, | 20 | unsigned long private, bool offlining, |
| 20 | bool sync); | 21 | enum migrate_mode mode); |
| 21 | 22 | ||
| 22 | extern int fail_migrate_page(struct address_space *, | 23 | extern int fail_migrate_page(struct address_space *, |
| 23 | struct page *, struct page *); | 24 | struct page *, struct page *); |
| @@ -36,10 +37,10 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
| 36 | static inline void putback_lru_pages(struct list_head *l) {} | 37 | static inline void putback_lru_pages(struct list_head *l) {} |
| 37 | static inline int migrate_pages(struct list_head *l, new_page_t x, | 38 | static inline int migrate_pages(struct list_head *l, new_page_t x, |
| 38 | unsigned long private, bool offlining, | 39 | unsigned long private, bool offlining, |
| 39 | bool sync) { return -ENOSYS; } | 40 | enum migrate_mode mode) { return -ENOSYS; } |
| 40 | static inline int migrate_huge_pages(struct list_head *l, new_page_t x, | 41 | static inline int migrate_huge_pages(struct list_head *l, new_page_t x, |
| 41 | unsigned long private, bool offlining, | 42 | unsigned long private, bool offlining, |
| 42 | bool sync) { return -ENOSYS; } | 43 | enum migrate_mode mode) { return -ENOSYS; } |
| 43 | 44 | ||
| 44 | static inline int migrate_prep(void) { return -ENOSYS; } | 45 | static inline int migrate_prep(void) { return -ENOSYS; } |
| 45 | static inline int migrate_prep_local(void) { return -ENOSYS; } | 46 | static inline int migrate_prep_local(void) { return -ENOSYS; } |
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/miscdevice.h b/include/linux/miscdevice.h index 32085249e9cb..0549d2115507 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
| @@ -42,6 +42,7 @@ | |||
| 42 | #define AUTOFS_MINOR 235 | 42 | #define AUTOFS_MINOR 235 |
| 43 | #define MAPPER_CTRL_MINOR 236 | 43 | #define MAPPER_CTRL_MINOR 236 |
| 44 | #define LOOP_CTRL_MINOR 237 | 44 | #define LOOP_CTRL_MINOR 237 |
| 45 | #define VHOST_NET_MINOR 238 | ||
| 45 | #define MISC_DYNAMIC_MINOR 255 | 46 | #define MISC_DYNAMIC_MINOR 255 |
| 46 | 47 | ||
| 47 | struct device; | 48 | struct device; |
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/mm.h b/include/linux/mm.h index 5d9b4c9813bd..17b27cd269c4 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -1482,6 +1482,18 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma) | |||
| 1482 | return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; | 1482 | return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; |
| 1483 | } | 1483 | } |
| 1484 | 1484 | ||
| 1485 | /* Look up the first VMA which exactly match the interval vm_start ... vm_end */ | ||
| 1486 | static inline struct vm_area_struct *find_exact_vma(struct mm_struct *mm, | ||
| 1487 | unsigned long vm_start, unsigned long vm_end) | ||
| 1488 | { | ||
| 1489 | struct vm_area_struct *vma = find_vma(mm, vm_start); | ||
| 1490 | |||
| 1491 | if (vma && (vma->vm_start != vm_start || vma->vm_end != vm_end)) | ||
| 1492 | vma = NULL; | ||
| 1493 | |||
| 1494 | return vma; | ||
| 1495 | } | ||
| 1496 | |||
| 1485 | #ifdef CONFIG_MMU | 1497 | #ifdef CONFIG_MMU |
| 1486 | pgprot_t vm_get_page_prot(unsigned long vm_flags); | 1498 | pgprot_t vm_get_page_prot(unsigned long vm_flags); |
| 1487 | #else | 1499 | #else |
| @@ -1528,23 +1540,13 @@ static inline void vm_stat_account(struct mm_struct *mm, | |||
| 1528 | #endif /* CONFIG_PROC_FS */ | 1540 | #endif /* CONFIG_PROC_FS */ |
| 1529 | 1541 | ||
| 1530 | #ifdef CONFIG_DEBUG_PAGEALLOC | 1542 | #ifdef CONFIG_DEBUG_PAGEALLOC |
| 1531 | extern int debug_pagealloc_enabled; | ||
| 1532 | |||
| 1533 | extern void kernel_map_pages(struct page *page, int numpages, int enable); | 1543 | extern void kernel_map_pages(struct page *page, int numpages, int enable); |
| 1534 | |||
| 1535 | static inline void enable_debug_pagealloc(void) | ||
| 1536 | { | ||
| 1537 | debug_pagealloc_enabled = 1; | ||
| 1538 | } | ||
| 1539 | #ifdef CONFIG_HIBERNATION | 1544 | #ifdef CONFIG_HIBERNATION |
| 1540 | extern bool kernel_page_present(struct page *page); | 1545 | extern bool kernel_page_present(struct page *page); |
| 1541 | #endif /* CONFIG_HIBERNATION */ | 1546 | #endif /* CONFIG_HIBERNATION */ |
| 1542 | #else | 1547 | #else |
| 1543 | static inline void | 1548 | static inline void |
| 1544 | kernel_map_pages(struct page *page, int numpages, int enable) {} | 1549 | kernel_map_pages(struct page *page, int numpages, int enable) {} |
| 1545 | static inline void enable_debug_pagealloc(void) | ||
| 1546 | { | ||
| 1547 | } | ||
| 1548 | #ifdef CONFIG_HIBERNATION | 1550 | #ifdef CONFIG_HIBERNATION |
| 1549 | static inline bool kernel_page_present(struct page *page) { return true; } | 1551 | static inline bool kernel_page_present(struct page *page) { return true; } |
| 1550 | #endif /* CONFIG_HIBERNATION */ | 1552 | #endif /* CONFIG_HIBERNATION */ |
| @@ -1618,5 +1620,22 @@ extern void copy_user_huge_page(struct page *dst, struct page *src, | |||
| 1618 | unsigned int pages_per_huge_page); | 1620 | unsigned int pages_per_huge_page); |
| 1619 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */ | 1621 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */ |
| 1620 | 1622 | ||
| 1623 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
| 1624 | extern unsigned int _debug_guardpage_minorder; | ||
| 1625 | |||
| 1626 | static inline unsigned int debug_guardpage_minorder(void) | ||
| 1627 | { | ||
| 1628 | return _debug_guardpage_minorder; | ||
| 1629 | } | ||
| 1630 | |||
| 1631 | static inline bool page_is_guard(struct page *page) | ||
| 1632 | { | ||
| 1633 | return test_bit(PAGE_DEBUG_FLAG_GUARD, &page->debug_flags); | ||
| 1634 | } | ||
| 1635 | #else | ||
| 1636 | static inline unsigned int debug_guardpage_minorder(void) { return 0; } | ||
| 1637 | static inline bool page_is_guard(struct page *page) { return false; } | ||
| 1638 | #endif /* CONFIG_DEBUG_PAGEALLOC */ | ||
| 1639 | |||
| 1621 | #endif /* __KERNEL__ */ | 1640 | #endif /* __KERNEL__ */ |
| 1622 | #endif /* _LINUX_MM_H */ | 1641 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 8f7d24712dc1..227fd3e9a9c9 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
| @@ -22,26 +22,21 @@ static inline int page_is_file_cache(struct page *page) | |||
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | static inline void | 24 | static inline void |
| 25 | __add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l, | 25 | add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list lru) |
| 26 | struct list_head *head) | ||
| 27 | { | 26 | { |
| 28 | list_add(&page->lru, head); | 27 | struct lruvec *lruvec; |
| 29 | __mod_zone_page_state(zone, NR_LRU_BASE + l, hpage_nr_pages(page)); | ||
| 30 | mem_cgroup_add_lru_list(page, l); | ||
| 31 | } | ||
| 32 | 28 | ||
| 33 | static inline void | 29 | lruvec = mem_cgroup_lru_add_list(zone, page, lru); |
| 34 | add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l) | 30 | list_add(&page->lru, &lruvec->lists[lru]); |
| 35 | { | 31 | __mod_zone_page_state(zone, NR_LRU_BASE + lru, hpage_nr_pages(page)); |
| 36 | __add_page_to_lru_list(zone, page, l, &zone->lru[l].list); | ||
| 37 | } | 32 | } |
| 38 | 33 | ||
| 39 | static inline void | 34 | static inline void |
| 40 | del_page_from_lru_list(struct zone *zone, struct page *page, enum lru_list l) | 35 | del_page_from_lru_list(struct zone *zone, struct page *page, enum lru_list lru) |
| 41 | { | 36 | { |
| 37 | mem_cgroup_lru_del_list(page, lru); | ||
| 42 | list_del(&page->lru); | 38 | list_del(&page->lru); |
| 43 | __mod_zone_page_state(zone, NR_LRU_BASE + l, -hpage_nr_pages(page)); | 39 | __mod_zone_page_state(zone, NR_LRU_BASE + lru, -hpage_nr_pages(page)); |
| 44 | mem_cgroup_del_lru_list(page, l); | ||
| 45 | } | 40 | } |
| 46 | 41 | ||
| 47 | /** | 42 | /** |
| @@ -59,24 +54,28 @@ static inline enum lru_list page_lru_base_type(struct page *page) | |||
| 59 | return LRU_INACTIVE_ANON; | 54 | return LRU_INACTIVE_ANON; |
| 60 | } | 55 | } |
| 61 | 56 | ||
| 62 | static inline void | 57 | /** |
| 63 | del_page_from_lru(struct zone *zone, struct page *page) | 58 | * page_off_lru - which LRU list was page on? clearing its lru flags. |
| 59 | * @page: the page to test | ||
| 60 | * | ||
| 61 | * Returns the LRU list a page was on, as an index into the array of LRU | ||
| 62 | * lists; and clears its Unevictable or Active flags, ready for freeing. | ||
| 63 | */ | ||
| 64 | static inline enum lru_list page_off_lru(struct page *page) | ||
| 64 | { | 65 | { |
| 65 | enum lru_list l; | 66 | enum lru_list lru; |
| 66 | 67 | ||
| 67 | list_del(&page->lru); | ||
| 68 | if (PageUnevictable(page)) { | 68 | if (PageUnevictable(page)) { |
| 69 | __ClearPageUnevictable(page); | 69 | __ClearPageUnevictable(page); |
| 70 | l = LRU_UNEVICTABLE; | 70 | lru = LRU_UNEVICTABLE; |
| 71 | } else { | 71 | } else { |
| 72 | l = page_lru_base_type(page); | 72 | lru = page_lru_base_type(page); |
| 73 | if (PageActive(page)) { | 73 | if (PageActive(page)) { |
| 74 | __ClearPageActive(page); | 74 | __ClearPageActive(page); |
| 75 | l += LRU_ACTIVE; | 75 | lru += LRU_ACTIVE; |
| 76 | } | 76 | } |
| 77 | } | 77 | } |
| 78 | __mod_zone_page_state(zone, NR_LRU_BASE + l, -hpage_nr_pages(page)); | 78 | return lru; |
| 79 | mem_cgroup_del_lru_list(page, l); | ||
| 80 | } | 79 | } |
| 81 | 80 | ||
| 82 | /** | 81 | /** |
| @@ -97,7 +96,6 @@ static inline enum lru_list page_lru(struct page *page) | |||
| 97 | if (PageActive(page)) | 96 | if (PageActive(page)) |
| 98 | lru += LRU_ACTIVE; | 97 | lru += LRU_ACTIVE; |
| 99 | } | 98 | } |
| 100 | |||
| 101 | return lru; | 99 | return lru; |
| 102 | } | 100 | } |
| 103 | 101 | ||
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 5b42f1b34eb7..3cc3062b3767 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -151,12 +151,11 @@ struct page { | |||
| 151 | #endif | 151 | #endif |
| 152 | } | 152 | } |
| 153 | /* | 153 | /* |
| 154 | * If another subsystem starts using the double word pairing for atomic | 154 | * The struct page can be forced to be double word aligned so that atomic ops |
| 155 | * operations on struct page then it must change the #if to ensure | 155 | * on double words work. The SLUB allocator can make use of such a feature. |
| 156 | * proper alignment of the page struct. | ||
| 157 | */ | 156 | */ |
| 158 | #if defined(CONFIG_SLUB) && defined(CONFIG_CMPXCHG_LOCAL) | 157 | #ifdef CONFIG_HAVE_ALIGNED_STRUCT_PAGE |
| 159 | __attribute__((__aligned__(2*sizeof(unsigned long)))) | 158 | __aligned(2 * sizeof(unsigned long)) |
| 160 | #endif | 159 | #endif |
| 161 | ; | 160 | ; |
| 162 | 161 | ||
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index c8ef9bc54d50..9f22ba572de0 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -71,6 +71,8 @@ struct mmc_ext_csd { | |||
| 71 | bool hpi_en; /* HPI enablebit */ | 71 | bool hpi_en; /* HPI enablebit */ |
| 72 | bool hpi; /* HPI support bit */ | 72 | bool hpi; /* HPI support bit */ |
| 73 | unsigned int hpi_cmd; /* cmd used as HPI */ | 73 | unsigned int hpi_cmd; /* cmd used as HPI */ |
| 74 | unsigned int boot_ro_lock; /* ro lock support */ | ||
| 75 | bool boot_ro_lockable; | ||
| 74 | u8 raw_partition_support; /* 160 */ | 76 | u8 raw_partition_support; /* 160 */ |
| 75 | u8 raw_erased_mem_count; /* 181 */ | 77 | u8 raw_erased_mem_count; /* 181 */ |
| 76 | u8 raw_ext_csd_structure; /* 194 */ | 78 | u8 raw_ext_csd_structure; /* 194 */ |
| @@ -110,6 +112,7 @@ struct sd_ssr { | |||
| 110 | struct sd_switch_caps { | 112 | struct sd_switch_caps { |
| 111 | unsigned int hs_max_dtr; | 113 | unsigned int hs_max_dtr; |
| 112 | unsigned int uhs_max_dtr; | 114 | unsigned int uhs_max_dtr; |
| 115 | #define HIGH_SPEED_MAX_DTR 50000000 | ||
| 113 | #define UHS_SDR104_MAX_DTR 208000000 | 116 | #define UHS_SDR104_MAX_DTR 208000000 |
| 114 | #define UHS_SDR50_MAX_DTR 100000000 | 117 | #define UHS_SDR50_MAX_DTR 100000000 |
| 115 | #define UHS_DDR50_MAX_DTR 50000000 | 118 | #define UHS_DDR50_MAX_DTR 50000000 |
| @@ -117,11 +120,13 @@ struct sd_switch_caps { | |||
| 117 | #define UHS_SDR12_MAX_DTR 25000000 | 120 | #define UHS_SDR12_MAX_DTR 25000000 |
| 118 | unsigned int sd3_bus_mode; | 121 | unsigned int sd3_bus_mode; |
| 119 | #define UHS_SDR12_BUS_SPEED 0 | 122 | #define UHS_SDR12_BUS_SPEED 0 |
| 123 | #define HIGH_SPEED_BUS_SPEED 1 | ||
| 120 | #define UHS_SDR25_BUS_SPEED 1 | 124 | #define UHS_SDR25_BUS_SPEED 1 |
| 121 | #define UHS_SDR50_BUS_SPEED 2 | 125 | #define UHS_SDR50_BUS_SPEED 2 |
| 122 | #define UHS_SDR104_BUS_SPEED 3 | 126 | #define UHS_SDR104_BUS_SPEED 3 |
| 123 | #define UHS_DDR50_BUS_SPEED 4 | 127 | #define UHS_DDR50_BUS_SPEED 4 |
| 124 | 128 | ||
| 129 | #define SD_MODE_HIGH_SPEED (1 << HIGH_SPEED_BUS_SPEED) | ||
| 125 | #define SD_MODE_UHS_SDR12 (1 << UHS_SDR12_BUS_SPEED) | 130 | #define SD_MODE_UHS_SDR12 (1 << UHS_SDR12_BUS_SPEED) |
| 126 | #define SD_MODE_UHS_SDR25 (1 << UHS_SDR25_BUS_SPEED) | 131 | #define SD_MODE_UHS_SDR25 (1 << UHS_SDR25_BUS_SPEED) |
| 127 | #define SD_MODE_UHS_SDR50 (1 << UHS_SDR50_BUS_SPEED) | 132 | #define SD_MODE_UHS_SDR50 (1 << UHS_SDR50_BUS_SPEED) |
| @@ -184,6 +189,10 @@ struct mmc_part { | |||
| 184 | unsigned int part_cfg; /* partition type */ | 189 | unsigned int part_cfg; /* partition type */ |
| 185 | char name[MAX_MMC_PART_NAME_LEN]; | 190 | char name[MAX_MMC_PART_NAME_LEN]; |
| 186 | bool force_ro; /* to make boot parts RO by default */ | 191 | bool force_ro; /* to make boot parts RO by default */ |
| 192 | unsigned int area_type; | ||
| 193 | #define MMC_BLK_DATA_AREA_MAIN (1<<0) | ||
| 194 | #define MMC_BLK_DATA_AREA_BOOT (1<<1) | ||
| 195 | #define MMC_BLK_DATA_AREA_GP (1<<2) | ||
| 187 | }; | 196 | }; |
| 188 | 197 | ||
| 189 | /* | 198 | /* |
| @@ -206,6 +215,8 @@ struct mmc_card { | |||
| 206 | #define MMC_STATE_HIGHSPEED_DDR (1<<4) /* card is in high speed mode */ | 215 | #define MMC_STATE_HIGHSPEED_DDR (1<<4) /* card is in high speed mode */ |
| 207 | #define MMC_STATE_ULTRAHIGHSPEED (1<<5) /* card is in ultra high speed mode */ | 216 | #define MMC_STATE_ULTRAHIGHSPEED (1<<5) /* card is in ultra high speed mode */ |
| 208 | #define MMC_CARD_SDXC (1<<6) /* card is SDXC */ | 217 | #define MMC_CARD_SDXC (1<<6) /* card is SDXC */ |
| 218 | #define MMC_CARD_REMOVED (1<<7) /* card has been removed */ | ||
| 219 | #define MMC_STATE_HIGHSPEED_200 (1<<8) /* card is in HS200 mode */ | ||
| 209 | unsigned int quirks; /* card quirks */ | 220 | unsigned int quirks; /* card quirks */ |
| 210 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ | 221 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ |
| 211 | #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ | 222 | #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ |
| @@ -261,12 +272,14 @@ struct mmc_card { | |||
| 261 | * This function fill contents in mmc_part. | 272 | * This function fill contents in mmc_part. |
| 262 | */ | 273 | */ |
| 263 | static inline void mmc_part_add(struct mmc_card *card, unsigned int size, | 274 | static inline void mmc_part_add(struct mmc_card *card, unsigned int size, |
| 264 | unsigned int part_cfg, char *name, int idx, bool ro) | 275 | unsigned int part_cfg, char *name, int idx, bool ro, |
| 276 | int area_type) | ||
| 265 | { | 277 | { |
| 266 | card->part[card->nr_parts].size = size; | 278 | card->part[card->nr_parts].size = size; |
| 267 | card->part[card->nr_parts].part_cfg = part_cfg; | 279 | card->part[card->nr_parts].part_cfg = part_cfg; |
| 268 | sprintf(card->part[card->nr_parts].name, name, idx); | 280 | sprintf(card->part[card->nr_parts].name, name, idx); |
| 269 | card->part[card->nr_parts].force_ro = ro; | 281 | card->part[card->nr_parts].force_ro = ro; |
| 282 | card->part[card->nr_parts].area_type = area_type; | ||
| 270 | card->nr_parts++; | 283 | card->nr_parts++; |
| 271 | } | 284 | } |
| 272 | 285 | ||
| @@ -362,18 +375,24 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data) | |||
| 362 | #define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT) | 375 | #define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT) |
| 363 | #define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) | 376 | #define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) |
| 364 | #define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) | 377 | #define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) |
| 378 | #define mmc_card_hs200(c) ((c)->state & MMC_STATE_HIGHSPEED_200) | ||
| 365 | #define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) | 379 | #define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) |
| 366 | #define mmc_card_ddr_mode(c) ((c)->state & MMC_STATE_HIGHSPEED_DDR) | 380 | #define mmc_card_ddr_mode(c) ((c)->state & MMC_STATE_HIGHSPEED_DDR) |
| 367 | #define mmc_sd_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED) | 381 | #define mmc_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED) |
| 382 | #define mmc_sd_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED) | ||
| 368 | #define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC) | 383 | #define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC) |
| 384 | #define mmc_card_removed(c) ((c) && ((c)->state & MMC_CARD_REMOVED)) | ||
| 369 | 385 | ||
| 370 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) | 386 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) |
| 371 | #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) | 387 | #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) |
| 372 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) | 388 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) |
| 389 | #define mmc_card_set_hs200(c) ((c)->state |= MMC_STATE_HIGHSPEED_200) | ||
| 373 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) | 390 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) |
| 374 | #define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR) | 391 | #define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR) |
| 392 | #define mmc_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED) | ||
| 375 | #define mmc_sd_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED) | 393 | #define mmc_sd_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED) |
| 376 | #define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC) | 394 | #define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC) |
| 395 | #define mmc_card_set_removed(c) ((c)->state |= MMC_CARD_REMOVED) | ||
| 377 | 396 | ||
| 378 | /* | 397 | /* |
| 379 | * Quirk add/remove for MMC products. | 398 | * Quirk add/remove for MMC products. |
diff --git a/include/linux/mmc/cd-gpio.h b/include/linux/mmc/cd-gpio.h new file mode 100644 index 000000000000..a8e469783318 --- /dev/null +++ b/include/linux/mmc/cd-gpio.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * Generic GPIO card-detect helper header | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011, Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
| 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 | #ifndef MMC_CD_GPIO_H | ||
| 12 | #define MMC_CD_GPIO_H | ||
| 13 | |||
| 14 | struct mmc_host; | ||
| 15 | int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio, | ||
| 16 | unsigned int irq, unsigned long flags); | ||
| 17 | void mmc_cd_gpio_free(struct mmc_host *host); | ||
| 18 | |||
| 19 | #endif | ||
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 174a844a5dda..87a976cc5654 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
| @@ -180,6 +180,8 @@ extern int mmc_try_claim_host(struct mmc_host *host); | |||
| 180 | 180 | ||
| 181 | extern int mmc_flush_cache(struct mmc_card *); | 181 | extern int mmc_flush_cache(struct mmc_card *); |
| 182 | 182 | ||
| 183 | extern int mmc_detect_card_removed(struct mmc_host *host); | ||
| 184 | |||
| 183 | /** | 185 | /** |
| 184 | * mmc_claim_host - exclusively claim a host | 186 | * mmc_claim_host - exclusively claim a host |
| 185 | * @host: mmc host to claim | 187 | * @host: mmc host to claim |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 6dc9b80568a0..e8779c6d1759 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
| @@ -214,6 +214,7 @@ struct dw_mci_board { | |||
| 214 | unsigned int bus_hz; /* Bus speed */ | 214 | unsigned int bus_hz; /* Bus speed */ |
| 215 | 215 | ||
| 216 | unsigned int caps; /* Capabilities */ | 216 | unsigned int caps; /* Capabilities */ |
| 217 | unsigned int caps2; /* More capabilities */ | ||
| 217 | /* | 218 | /* |
| 218 | * Override fifo depth. If 0, autodetect it from the FIFOTH register, | 219 | * Override fifo depth. If 0, autodetect it from the FIFOTH register, |
| 219 | * but note that this may not be reliable after a bootloader has used | 220 | * 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 a3ac9c48e5de..0beba1e5e1ed 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
| @@ -56,10 +56,13 @@ struct mmc_ios { | |||
| 56 | #define MMC_TIMING_UHS_SDR50 3 | 56 | #define MMC_TIMING_UHS_SDR50 3 |
| 57 | #define MMC_TIMING_UHS_SDR104 4 | 57 | #define MMC_TIMING_UHS_SDR104 4 |
| 58 | #define MMC_TIMING_UHS_DDR50 5 | 58 | #define MMC_TIMING_UHS_DDR50 5 |
| 59 | #define MMC_TIMING_MMC_HS200 6 | ||
| 59 | 60 | ||
| 60 | #define MMC_SDR_MODE 0 | 61 | #define MMC_SDR_MODE 0 |
| 61 | #define MMC_1_2V_DDR_MODE 1 | 62 | #define MMC_1_2V_DDR_MODE 1 |
| 62 | #define MMC_1_8V_DDR_MODE 2 | 63 | #define MMC_1_8V_DDR_MODE 2 |
| 64 | #define MMC_1_2V_SDR_MODE 3 | ||
| 65 | #define MMC_1_8V_SDR_MODE 4 | ||
| 63 | 66 | ||
| 64 | unsigned char signal_voltage; /* signalling voltage (1.8V or 3.3V) */ | 67 | unsigned char signal_voltage; /* signalling voltage (1.8V or 3.3V) */ |
| 65 | 68 | ||
| @@ -148,7 +151,9 @@ struct mmc_host_ops { | |||
| 148 | void (*init_card)(struct mmc_host *host, struct mmc_card *card); | 151 | void (*init_card)(struct mmc_host *host, struct mmc_card *card); |
| 149 | 152 | ||
| 150 | int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); | 153 | int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); |
| 151 | int (*execute_tuning)(struct mmc_host *host); | 154 | |
| 155 | /* The tuning command opcode value is different for SD and eMMC cards */ | ||
| 156 | int (*execute_tuning)(struct mmc_host *host, u32 opcode); | ||
| 152 | void (*enable_preset_value)(struct mmc_host *host, bool enable); | 157 | void (*enable_preset_value)(struct mmc_host *host, bool enable); |
| 153 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); | 158 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); |
| 154 | void (*hw_reset)(struct mmc_host *host); | 159 | void (*hw_reset)(struct mmc_host *host); |
| @@ -167,6 +172,11 @@ struct mmc_async_req { | |||
| 167 | int (*err_check) (struct mmc_card *, struct mmc_async_req *); | 172 | int (*err_check) (struct mmc_card *, struct mmc_async_req *); |
| 168 | }; | 173 | }; |
| 169 | 174 | ||
| 175 | struct mmc_hotplug { | ||
| 176 | unsigned int irq; | ||
| 177 | void *handler_priv; | ||
| 178 | }; | ||
| 179 | |||
| 170 | struct mmc_host { | 180 | struct mmc_host { |
| 171 | struct device *parent; | 181 | struct device *parent; |
| 172 | struct device class_dev; | 182 | struct device class_dev; |
| @@ -242,6 +252,11 @@ struct mmc_host { | |||
| 242 | #define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ | 252 | #define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ |
| 243 | #define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */ | 253 | #define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */ |
| 244 | #define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ | 254 | #define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ |
| 255 | #define MMC_CAP2_NO_SLEEP_CMD (1 << 4) /* Don't allow sleep command */ | ||
| 256 | #define MMC_CAP2_HS200_1_8V_SDR (1 << 5) /* can support */ | ||
| 257 | #define MMC_CAP2_HS200_1_2V_SDR (1 << 6) /* can support */ | ||
| 258 | #define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \ | ||
| 259 | MMC_CAP2_HS200_1_2V_SDR) | ||
| 245 | 260 | ||
| 246 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 261 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
| 247 | unsigned int power_notify_type; | 262 | unsigned int power_notify_type; |
| @@ -253,10 +268,12 @@ struct mmc_host { | |||
| 253 | int clk_requests; /* internal reference counter */ | 268 | int clk_requests; /* internal reference counter */ |
| 254 | unsigned int clk_delay; /* number of MCI clk hold cycles */ | 269 | unsigned int clk_delay; /* number of MCI clk hold cycles */ |
| 255 | bool clk_gated; /* clock gated */ | 270 | bool clk_gated; /* clock gated */ |
| 256 | struct work_struct clk_gate_work; /* delayed clock gate */ | 271 | struct delayed_work clk_gate_work; /* delayed clock gate */ |
| 257 | unsigned int clk_old; /* old clock value cache */ | 272 | unsigned int clk_old; /* old clock value cache */ |
| 258 | spinlock_t clk_lock; /* lock for clk fields */ | 273 | spinlock_t clk_lock; /* lock for clk fields */ |
| 259 | struct mutex clk_gate_mutex; /* mutex for clock gating */ | 274 | struct mutex clk_gate_mutex; /* mutex for clock gating */ |
| 275 | struct device_attribute clkgate_delay_attr; | ||
| 276 | unsigned long clkgate_delay; | ||
| 260 | #endif | 277 | #endif |
| 261 | 278 | ||
| 262 | /* host specific block data */ | 279 | /* host specific block data */ |
| @@ -297,6 +314,8 @@ struct mmc_host { | |||
| 297 | int claim_cnt; /* "claim" nesting count */ | 314 | int claim_cnt; /* "claim" nesting count */ |
| 298 | 315 | ||
| 299 | struct delayed_work detect; | 316 | struct delayed_work detect; |
| 317 | int detect_change; /* card detect flag */ | ||
| 318 | struct mmc_hotplug hotplug; | ||
| 300 | 319 | ||
| 301 | const struct mmc_bus_ops *bus_ops; /* current bus driver */ | 320 | const struct mmc_bus_ops *bus_ops; /* current bus driver */ |
| 302 | unsigned int bus_refs; /* reference counter */ | 321 | unsigned int bus_refs; /* reference counter */ |
| @@ -323,6 +342,8 @@ struct mmc_host { | |||
| 323 | struct fault_attr fail_mmc_request; | 342 | struct fault_attr fail_mmc_request; |
| 324 | #endif | 343 | #endif |
| 325 | 344 | ||
| 345 | unsigned int actual_clock; /* Actual HC clock rate */ | ||
| 346 | |||
| 326 | unsigned long private[0] ____cacheline_aligned; | 347 | unsigned long private[0] ____cacheline_aligned; |
| 327 | }; | 348 | }; |
| 328 | 349 | ||
| @@ -396,7 +417,7 @@ static inline void mmc_set_disable_delay(struct mmc_host *host, | |||
| 396 | } | 417 | } |
| 397 | 418 | ||
| 398 | /* Module parameter */ | 419 | /* Module parameter */ |
| 399 | extern int mmc_assume_removable; | 420 | extern bool mmc_assume_removable; |
| 400 | 421 | ||
| 401 | static inline int mmc_card_is_removable(struct mmc_host *host) | 422 | static inline int mmc_card_is_removable(struct mmc_host *host) |
| 402 | { | 423 | { |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 0e7135697d11..fb9f6e116e1c 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
| @@ -51,6 +51,7 @@ | |||
| 51 | #define MMC_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */ | 51 | #define MMC_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */ |
| 52 | #define MMC_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */ | 52 | #define MMC_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */ |
| 53 | #define MMC_SEND_TUNING_BLOCK 19 /* adtc R1 */ | 53 | #define MMC_SEND_TUNING_BLOCK 19 /* adtc R1 */ |
| 54 | #define MMC_SEND_TUNING_BLOCK_HS200 21 /* adtc R1 */ | ||
| 54 | 55 | ||
| 55 | /* class 3 */ | 56 | /* class 3 */ |
| 56 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ | 57 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ |
| @@ -280,6 +281,7 @@ struct _mmc_csd { | |||
| 280 | #define EXT_CSD_RST_N_FUNCTION 162 /* R/W */ | 281 | #define EXT_CSD_RST_N_FUNCTION 162 /* R/W */ |
| 281 | #define EXT_CSD_SANITIZE_START 165 /* W */ | 282 | #define EXT_CSD_SANITIZE_START 165 /* W */ |
| 282 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ | 283 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ |
| 284 | #define EXT_CSD_BOOT_WP 173 /* R/W */ | ||
| 283 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ | 285 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ |
| 284 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ | 286 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ |
| 285 | #define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ | 287 | #define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ |
| @@ -321,6 +323,11 @@ struct _mmc_csd { | |||
| 321 | 323 | ||
| 322 | #define EXT_CSD_WR_REL_PARAM_EN (1<<2) | 324 | #define EXT_CSD_WR_REL_PARAM_EN (1<<2) |
| 323 | 325 | ||
| 326 | #define EXT_CSD_BOOT_WP_B_PWR_WP_DIS (0x40) | ||
| 327 | #define EXT_CSD_BOOT_WP_B_PERM_WP_DIS (0x10) | ||
| 328 | #define EXT_CSD_BOOT_WP_B_PERM_WP_EN (0x04) | ||
| 329 | #define EXT_CSD_BOOT_WP_B_PWR_WP_EN (0x01) | ||
| 330 | |||
| 324 | #define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) | 331 | #define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) |
| 325 | #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) | 332 | #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) |
| 326 | #define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) | 333 | #define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) |
| @@ -333,13 +340,76 @@ struct _mmc_csd { | |||
| 333 | 340 | ||
| 334 | #define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ | 341 | #define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ |
| 335 | #define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ | 342 | #define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ |
| 336 | #define EXT_CSD_CARD_TYPE_MASK 0xF /* Mask out reserved bits */ | 343 | #define EXT_CSD_CARD_TYPE_MASK 0x3F /* Mask out reserved bits */ |
| 337 | #define EXT_CSD_CARD_TYPE_DDR_1_8V (1<<2) /* Card can run at 52MHz */ | 344 | #define EXT_CSD_CARD_TYPE_DDR_1_8V (1<<2) /* Card can run at 52MHz */ |
| 338 | /* DDR mode @1.8V or 3V I/O */ | 345 | /* DDR mode @1.8V or 3V I/O */ |
| 339 | #define EXT_CSD_CARD_TYPE_DDR_1_2V (1<<3) /* Card can run at 52MHz */ | 346 | #define EXT_CSD_CARD_TYPE_DDR_1_2V (1<<3) /* Card can run at 52MHz */ |
| 340 | /* DDR mode @1.2V I/O */ | 347 | /* DDR mode @1.2V I/O */ |
| 341 | #define EXT_CSD_CARD_TYPE_DDR_52 (EXT_CSD_CARD_TYPE_DDR_1_8V \ | 348 | #define EXT_CSD_CARD_TYPE_DDR_52 (EXT_CSD_CARD_TYPE_DDR_1_8V \ |
| 342 | | EXT_CSD_CARD_TYPE_DDR_1_2V) | 349 | | EXT_CSD_CARD_TYPE_DDR_1_2V) |
| 350 | #define EXT_CSD_CARD_TYPE_SDR_1_8V (1<<4) /* Card can run at 200MHz */ | ||
| 351 | #define EXT_CSD_CARD_TYPE_SDR_1_2V (1<<5) /* Card can run at 200MHz */ | ||
| 352 | /* SDR mode @1.2V I/O */ | ||
| 353 | |||
| 354 | #define EXT_CSD_CARD_TYPE_SDR_200 (EXT_CSD_CARD_TYPE_SDR_1_8V | \ | ||
| 355 | EXT_CSD_CARD_TYPE_SDR_1_2V) | ||
| 356 | |||
| 357 | #define EXT_CSD_CARD_TYPE_SDR_ALL (EXT_CSD_CARD_TYPE_SDR_200 | \ | ||
| 358 | EXT_CSD_CARD_TYPE_52 | \ | ||
| 359 | EXT_CSD_CARD_TYPE_26) | ||
| 360 | |||
| 361 | #define EXT_CSD_CARD_TYPE_SDR_1_2V_ALL (EXT_CSD_CARD_TYPE_SDR_1_2V | \ | ||
| 362 | EXT_CSD_CARD_TYPE_52 | \ | ||
| 363 | EXT_CSD_CARD_TYPE_26) | ||
| 364 | |||
| 365 | #define EXT_CSD_CARD_TYPE_SDR_1_8V_ALL (EXT_CSD_CARD_TYPE_SDR_1_8V | \ | ||
| 366 | EXT_CSD_CARD_TYPE_52 | \ | ||
| 367 | EXT_CSD_CARD_TYPE_26) | ||
| 368 | |||
| 369 | #define EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_1_8V (EXT_CSD_CARD_TYPE_SDR_1_2V | \ | ||
| 370 | EXT_CSD_CARD_TYPE_DDR_1_8V | \ | ||
| 371 | EXT_CSD_CARD_TYPE_52 | \ | ||
| 372 | EXT_CSD_CARD_TYPE_26) | ||
| 373 | |||
| 374 | #define EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_1_8V (EXT_CSD_CARD_TYPE_SDR_1_8V | \ | ||
| 375 | EXT_CSD_CARD_TYPE_DDR_1_8V | \ | ||
| 376 | EXT_CSD_CARD_TYPE_52 | \ | ||
| 377 | EXT_CSD_CARD_TYPE_26) | ||
| 378 | |||
| 379 | #define EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_1_2V (EXT_CSD_CARD_TYPE_SDR_1_2V | \ | ||
| 380 | EXT_CSD_CARD_TYPE_DDR_1_2V | \ | ||
| 381 | EXT_CSD_CARD_TYPE_52 | \ | ||
| 382 | EXT_CSD_CARD_TYPE_26) | ||
| 383 | |||
| 384 | #define EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_1_2V (EXT_CSD_CARD_TYPE_SDR_1_8V | \ | ||
| 385 | EXT_CSD_CARD_TYPE_DDR_1_2V | \ | ||
| 386 | EXT_CSD_CARD_TYPE_52 | \ | ||
| 387 | EXT_CSD_CARD_TYPE_26) | ||
| 388 | |||
| 389 | #define EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_52 (EXT_CSD_CARD_TYPE_SDR_1_2V | \ | ||
| 390 | EXT_CSD_CARD_TYPE_DDR_52 | \ | ||
| 391 | EXT_CSD_CARD_TYPE_52 | \ | ||
| 392 | EXT_CSD_CARD_TYPE_26) | ||
| 393 | |||
| 394 | #define EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_52 (EXT_CSD_CARD_TYPE_SDR_1_8V | \ | ||
| 395 | EXT_CSD_CARD_TYPE_DDR_52 | \ | ||
| 396 | EXT_CSD_CARD_TYPE_52 | \ | ||
| 397 | EXT_CSD_CARD_TYPE_26) | ||
| 398 | |||
| 399 | #define EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_8V (EXT_CSD_CARD_TYPE_SDR_200 | \ | ||
| 400 | EXT_CSD_CARD_TYPE_DDR_1_8V | \ | ||
| 401 | EXT_CSD_CARD_TYPE_52 | \ | ||
| 402 | EXT_CSD_CARD_TYPE_26) | ||
| 403 | |||
| 404 | #define EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_2V (EXT_CSD_CARD_TYPE_SDR_200 | \ | ||
| 405 | EXT_CSD_CARD_TYPE_DDR_1_2V | \ | ||
| 406 | EXT_CSD_CARD_TYPE_52 | \ | ||
| 407 | EXT_CSD_CARD_TYPE_26) | ||
| 408 | |||
| 409 | #define EXT_CSD_CARD_TYPE_SDR_ALL_DDR_52 (EXT_CSD_CARD_TYPE_SDR_200 | \ | ||
| 410 | EXT_CSD_CARD_TYPE_DDR_52 | \ | ||
| 411 | EXT_CSD_CARD_TYPE_52 | \ | ||
| 412 | EXT_CSD_CARD_TYPE_26) | ||
| 343 | 413 | ||
| 344 | #define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ | 414 | #define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ |
| 345 | #define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ | 415 | #define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ |
diff --git a/include/linux/mmc/sdhci-pci-data.h b/include/linux/mmc/sdhci-pci-data.h new file mode 100644 index 000000000000..8959604a13d3 --- /dev/null +++ b/include/linux/mmc/sdhci-pci-data.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #ifndef LINUX_MMC_SDHCI_PCI_DATA_H | ||
| 2 | #define LINUX_MMC_SDHCI_PCI_DATA_H | ||
| 3 | |||
| 4 | struct pci_dev; | ||
| 5 | |||
| 6 | struct sdhci_pci_data { | ||
| 7 | struct pci_dev *pdev; | ||
| 8 | int slotno; | ||
| 9 | int rst_n_gpio; /* Set to -EINVAL if unused */ | ||
| 10 | int cd_gpio; /* Set to -EINVAL if unused */ | ||
| 11 | int (*setup)(struct sdhci_pci_data *data); | ||
| 12 | void (*cleanup)(struct sdhci_pci_data *data); | ||
| 13 | }; | ||
| 14 | |||
| 15 | extern struct sdhci_pci_data *(*sdhci_pci_get_data)(struct pci_dev *pdev, | ||
| 16 | int slotno); | ||
| 17 | |||
| 18 | #endif | ||
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index e4b69353678d..c750f85177d9 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
| @@ -90,8 +90,6 @@ struct sdhci_host { | |||
| 90 | 90 | ||
| 91 | unsigned int quirks2; /* More deviations from spec. */ | 91 | unsigned int quirks2; /* More deviations from spec. */ |
| 92 | 92 | ||
| 93 | #define SDHCI_QUIRK2_OWN_CARD_DETECTION (1<<0) | ||
| 94 | |||
| 95 | int irq; /* Device IRQ */ | 93 | int irq; /* Device IRQ */ |
| 96 | void __iomem *ioaddr; /* Mapped address */ | 94 | void __iomem *ioaddr; /* Mapped address */ |
| 97 | 95 | ||
| @@ -121,6 +119,7 @@ struct sdhci_host { | |||
| 121 | #define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ | 119 | #define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ |
| 122 | #define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */ | 120 | #define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */ |
| 123 | #define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ | 121 | #define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ |
| 122 | #define SDHCI_HS200_NEEDS_TUNING (1<<10) /* HS200 needs tuning */ | ||
| 124 | 123 | ||
| 125 | unsigned int version; /* SDHCI spec. version */ | 124 | unsigned int version; /* SDHCI spec. version */ |
| 126 | 125 | ||
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h index e0b1123497b9..c9fe66c58f8f 100644 --- a/include/linux/mmc/sdio.h +++ b/include/linux/mmc/sdio.h | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | * [8:0] Byte/block count | 38 | * [8:0] Byte/block count |
| 39 | */ | 39 | */ |
| 40 | 40 | ||
| 41 | #define R4_18V_PRESENT (1<<24) | ||
| 41 | #define R4_MEMORY_PRESENT (1 << 27) | 42 | #define R4_MEMORY_PRESENT (1 << 27) |
| 42 | 43 | ||
| 43 | /* | 44 | /* |
| @@ -85,6 +86,7 @@ | |||
| 85 | #define SDIO_SD_REV_1_01 0 /* SD Physical Spec Version 1.01 */ | 86 | #define SDIO_SD_REV_1_01 0 /* SD Physical Spec Version 1.01 */ |
| 86 | #define SDIO_SD_REV_1_10 1 /* SD Physical Spec Version 1.10 */ | 87 | #define SDIO_SD_REV_1_10 1 /* SD Physical Spec Version 1.10 */ |
| 87 | #define SDIO_SD_REV_2_00 2 /* SD Physical Spec Version 2.00 */ | 88 | #define SDIO_SD_REV_2_00 2 /* SD Physical Spec Version 2.00 */ |
| 89 | #define SDIO_SD_REV_3_00 3 /* SD Physical Spev Version 3.00 */ | ||
| 88 | 90 | ||
| 89 | #define SDIO_CCCR_IOEx 0x02 | 91 | #define SDIO_CCCR_IOEx 0x02 |
| 90 | #define SDIO_CCCR_IORx 0x03 | 92 | #define SDIO_CCCR_IORx 0x03 |
| @@ -134,8 +136,31 @@ | |||
| 134 | #define SDIO_CCCR_SPEED 0x13 | 136 | #define SDIO_CCCR_SPEED 0x13 |
| 135 | 137 | ||
| 136 | #define SDIO_SPEED_SHS 0x01 /* Supports High-Speed mode */ | 138 | #define SDIO_SPEED_SHS 0x01 /* Supports High-Speed mode */ |
| 137 | #define SDIO_SPEED_EHS 0x02 /* Enable High-Speed mode */ | 139 | #define SDIO_SPEED_BSS_SHIFT 1 |
| 138 | 140 | #define SDIO_SPEED_BSS_MASK (7<<SDIO_SPEED_BSS_SHIFT) | |
| 141 | #define SDIO_SPEED_SDR12 (0<<SDIO_SPEED_BSS_SHIFT) | ||
| 142 | #define SDIO_SPEED_SDR25 (1<<SDIO_SPEED_BSS_SHIFT) | ||
| 143 | #define SDIO_SPEED_SDR50 (2<<SDIO_SPEED_BSS_SHIFT) | ||
| 144 | #define SDIO_SPEED_SDR104 (3<<SDIO_SPEED_BSS_SHIFT) | ||
| 145 | #define SDIO_SPEED_DDR50 (4<<SDIO_SPEED_BSS_SHIFT) | ||
| 146 | #define SDIO_SPEED_EHS SDIO_SPEED_SDR25 /* Enable High-Speed */ | ||
| 147 | |||
| 148 | #define SDIO_CCCR_UHS 0x14 | ||
| 149 | #define SDIO_UHS_SDR50 0x01 | ||
| 150 | #define SDIO_UHS_SDR104 0x02 | ||
| 151 | #define SDIO_UHS_DDR50 0x04 | ||
| 152 | |||
| 153 | #define SDIO_CCCR_DRIVE_STRENGTH 0x15 | ||
| 154 | #define SDIO_SDTx_MASK 0x07 | ||
| 155 | #define SDIO_DRIVE_SDTA (1<<0) | ||
| 156 | #define SDIO_DRIVE_SDTC (1<<1) | ||
| 157 | #define SDIO_DRIVE_SDTD (1<<2) | ||
| 158 | #define SDIO_DRIVE_DTSx_MASK 0x03 | ||
| 159 | #define SDIO_DRIVE_DTSx_SHIFT 4 | ||
| 160 | #define SDIO_DTSx_SET_TYPE_B (0 << SDIO_DRIVE_DTSx_SHIFT) | ||
| 161 | #define SDIO_DTSx_SET_TYPE_A (1 << SDIO_DRIVE_DTSx_SHIFT) | ||
| 162 | #define SDIO_DTSx_SET_TYPE_C (2 << SDIO_DRIVE_DTSx_SHIFT) | ||
| 163 | #define SDIO_DTSx_SET_TYPE_D (3 << SDIO_DRIVE_DTSx_SHIFT) | ||
| 139 | /* | 164 | /* |
| 140 | * Function Basic Registers (FBR) | 165 | * Function Basic Registers (FBR) |
| 141 | */ | 166 | */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 3ac040f19369..650ba2fb3301 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -140,25 +140,29 @@ enum lru_list { | |||
| 140 | NR_LRU_LISTS | 140 | NR_LRU_LISTS |
| 141 | }; | 141 | }; |
| 142 | 142 | ||
| 143 | #define for_each_lru(l) for (l = 0; l < NR_LRU_LISTS; l++) | 143 | #define for_each_lru(lru) for (lru = 0; lru < NR_LRU_LISTS; lru++) |
| 144 | 144 | ||
| 145 | #define for_each_evictable_lru(l) for (l = 0; l <= LRU_ACTIVE_FILE; l++) | 145 | #define for_each_evictable_lru(lru) for (lru = 0; lru <= LRU_ACTIVE_FILE; lru++) |
| 146 | 146 | ||
| 147 | static inline int is_file_lru(enum lru_list l) | 147 | static inline int is_file_lru(enum lru_list lru) |
| 148 | { | 148 | { |
| 149 | return (l == LRU_INACTIVE_FILE || l == LRU_ACTIVE_FILE); | 149 | return (lru == LRU_INACTIVE_FILE || lru == LRU_ACTIVE_FILE); |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | static inline int is_active_lru(enum lru_list l) | 152 | static inline int is_active_lru(enum lru_list lru) |
| 153 | { | 153 | { |
| 154 | return (l == LRU_ACTIVE_ANON || l == LRU_ACTIVE_FILE); | 154 | return (lru == LRU_ACTIVE_ANON || lru == LRU_ACTIVE_FILE); |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | static inline int is_unevictable_lru(enum lru_list l) | 157 | static inline int is_unevictable_lru(enum lru_list lru) |
| 158 | { | 158 | { |
| 159 | return (l == LRU_UNEVICTABLE); | 159 | return (lru == LRU_UNEVICTABLE); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | struct lruvec { | ||
| 163 | struct list_head lists[NR_LRU_LISTS]; | ||
| 164 | }; | ||
| 165 | |||
| 162 | /* Mask used at gathering information at once (see memcontrol.c) */ | 166 | /* Mask used at gathering information at once (see memcontrol.c) */ |
| 163 | #define LRU_ALL_FILE (BIT(LRU_INACTIVE_FILE) | BIT(LRU_ACTIVE_FILE)) | 167 | #define LRU_ALL_FILE (BIT(LRU_INACTIVE_FILE) | BIT(LRU_ACTIVE_FILE)) |
| 164 | #define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON)) | 168 | #define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON)) |
| @@ -173,6 +177,8 @@ static inline int is_unevictable_lru(enum lru_list l) | |||
| 173 | #define ISOLATE_CLEAN ((__force isolate_mode_t)0x4) | 177 | #define ISOLATE_CLEAN ((__force isolate_mode_t)0x4) |
| 174 | /* Isolate unmapped file */ | 178 | /* Isolate unmapped file */ |
| 175 | #define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x8) | 179 | #define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x8) |
| 180 | /* Isolate for asynchronous migration */ | ||
| 181 | #define ISOLATE_ASYNC_MIGRATE ((__force isolate_mode_t)0x10) | ||
| 176 | 182 | ||
| 177 | /* LRU Isolation modes. */ | 183 | /* LRU Isolation modes. */ |
| 178 | typedef unsigned __bitwise__ isolate_mode_t; | 184 | typedef unsigned __bitwise__ isolate_mode_t; |
| @@ -317,6 +323,12 @@ struct zone { | |||
| 317 | */ | 323 | */ |
| 318 | unsigned long lowmem_reserve[MAX_NR_ZONES]; | 324 | unsigned long lowmem_reserve[MAX_NR_ZONES]; |
| 319 | 325 | ||
| 326 | /* | ||
| 327 | * This is a per-zone reserve of pages that should not be | ||
| 328 | * considered dirtyable memory. | ||
| 329 | */ | ||
| 330 | unsigned long dirty_balance_reserve; | ||
| 331 | |||
| 320 | #ifdef CONFIG_NUMA | 332 | #ifdef CONFIG_NUMA |
| 321 | int node; | 333 | int node; |
| 322 | /* | 334 | /* |
| @@ -358,10 +370,8 @@ struct zone { | |||
| 358 | ZONE_PADDING(_pad1_) | 370 | ZONE_PADDING(_pad1_) |
| 359 | 371 | ||
| 360 | /* Fields commonly accessed by the page reclaim scanner */ | 372 | /* Fields commonly accessed by the page reclaim scanner */ |
| 361 | spinlock_t lru_lock; | 373 | spinlock_t lru_lock; |
| 362 | struct zone_lru { | 374 | struct lruvec lruvec; |
| 363 | struct list_head list; | ||
| 364 | } lru[NR_LRU_LISTS]; | ||
| 365 | 375 | ||
| 366 | struct zone_reclaim_stat reclaim_stat; | 376 | struct zone_reclaim_stat reclaim_stat; |
| 367 | 377 | ||
diff --git a/include/linux/module.h b/include/linux/module.h index 3cb7839a60b9..4598bf03e98b 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -205,6 +205,20 @@ enum module_state | |||
| 205 | MODULE_STATE_GOING, | 205 | MODULE_STATE_GOING, |
| 206 | }; | 206 | }; |
| 207 | 207 | ||
| 208 | /** | ||
| 209 | * struct module_ref - per cpu module reference counts | ||
| 210 | * @incs: number of module get on this cpu | ||
| 211 | * @decs: number of module put on this cpu | ||
| 212 | * | ||
| 213 | * We force an alignment on 8 or 16 bytes, so that alloc_percpu() | ||
| 214 | * put @incs/@decs in same cache line, with no extra memory cost, | ||
| 215 | * since alloc_percpu() is fine grained. | ||
| 216 | */ | ||
| 217 | struct module_ref { | ||
| 218 | unsigned long incs; | ||
| 219 | unsigned long decs; | ||
| 220 | } __attribute((aligned(2 * sizeof(unsigned long)))); | ||
| 221 | |||
| 208 | struct module | 222 | struct module |
| 209 | { | 223 | { |
| 210 | enum module_state state; | 224 | enum module_state state; |
| @@ -347,10 +361,7 @@ struct module | |||
| 347 | /* Destruction function. */ | 361 | /* Destruction function. */ |
| 348 | void (*exit)(void); | 362 | void (*exit)(void); |
| 349 | 363 | ||
| 350 | struct module_ref { | 364 | struct module_ref __percpu *refptr; |
| 351 | unsigned int incs; | ||
| 352 | unsigned int decs; | ||
| 353 | } __percpu *refptr; | ||
| 354 | #endif | 365 | #endif |
| 355 | 366 | ||
| 356 | #ifdef CONFIG_CONSTRUCTORS | 367 | #ifdef CONFIG_CONSTRUCTORS |
| @@ -434,7 +445,7 @@ extern void __module_put_and_exit(struct module *mod, long code) | |||
| 434 | #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code); | 445 | #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code); |
| 435 | 446 | ||
| 436 | #ifdef CONFIG_MODULE_UNLOAD | 447 | #ifdef CONFIG_MODULE_UNLOAD |
| 437 | unsigned int module_refcount(struct module *mod); | 448 | unsigned long module_refcount(struct module *mod); |
| 438 | void __symbol_put(const char *symbol); | 449 | void __symbol_put(const char *symbol); |
| 439 | #define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x) | 450 | #define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x) |
| 440 | void symbol_put_addr(void *addr); | 451 | void symbol_put_addr(void *addr); |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 7939f636c8ba..c47f4d60db0b 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
| @@ -350,23 +350,23 @@ extern int param_set_charp(const char *val, const struct kernel_param *kp); | |||
| 350 | extern int param_get_charp(char *buffer, const struct kernel_param *kp); | 350 | extern int param_get_charp(char *buffer, const struct kernel_param *kp); |
| 351 | #define param_check_charp(name, p) __param_check(name, p, char *) | 351 | #define param_check_charp(name, p) __param_check(name, p, char *) |
| 352 | 352 | ||
| 353 | /* For historical reasons "bool" parameters can be (unsigned) "int". */ | 353 | /* We used to allow int as well as bool. We're taking that away! */ |
| 354 | extern struct kernel_param_ops param_ops_bool; | 354 | extern struct kernel_param_ops param_ops_bool; |
| 355 | extern int param_set_bool(const char *val, const struct kernel_param *kp); | 355 | extern int param_set_bool(const char *val, const struct kernel_param *kp); |
| 356 | extern int param_get_bool(char *buffer, const struct kernel_param *kp); | 356 | extern int param_get_bool(char *buffer, const struct kernel_param *kp); |
| 357 | #define param_check_bool(name, p) \ | 357 | #define param_check_bool(name, p) __param_check(name, p, bool) |
| 358 | static inline void __check_##name(void) \ | ||
| 359 | { \ | ||
| 360 | BUILD_BUG_ON(!__same_type((p), bool *) && \ | ||
| 361 | !__same_type((p), unsigned int *) && \ | ||
| 362 | !__same_type((p), int *)); \ | ||
| 363 | } | ||
| 364 | 358 | ||
| 365 | extern struct kernel_param_ops param_ops_invbool; | 359 | extern struct kernel_param_ops param_ops_invbool; |
| 366 | extern int param_set_invbool(const char *val, const struct kernel_param *kp); | 360 | extern int param_set_invbool(const char *val, const struct kernel_param *kp); |
| 367 | extern int param_get_invbool(char *buffer, const struct kernel_param *kp); | 361 | extern int param_get_invbool(char *buffer, const struct kernel_param *kp); |
| 368 | #define param_check_invbool(name, p) __param_check(name, p, bool) | 362 | #define param_check_invbool(name, p) __param_check(name, p, bool) |
| 369 | 363 | ||
| 364 | /* An int, which can only be set like a bool (though it shows as an int). */ | ||
| 365 | extern struct kernel_param_ops param_ops_bint; | ||
| 366 | extern int param_set_bint(const char *val, const struct kernel_param *kp); | ||
| 367 | #define param_get_bint param_get_int | ||
| 368 | #define param_check_bint param_check_int | ||
| 369 | |||
| 370 | /** | 370 | /** |
| 371 | * module_param_array - a parameter which is an array of some type | 371 | * module_param_array - a parameter which is an array of some type |
| 372 | * @name: the name of the array variable | 372 | * @name: the name of the array variable |
| @@ -395,6 +395,7 @@ extern int param_get_invbool(char *buffer, const struct kernel_param *kp); | |||
| 395 | * module_param_named() for why this might be necessary. | 395 | * module_param_named() for why this might be necessary. |
| 396 | */ | 396 | */ |
| 397 | #define module_param_array_named(name, array, type, nump, perm) \ | 397 | #define module_param_array_named(name, array, type, nump, perm) \ |
| 398 | param_check_##type(name, &(array)[0]); \ | ||
| 398 | static const struct kparam_array __param_arr_##name \ | 399 | static const struct kparam_array __param_arr_##name \ |
| 399 | = { .max = ARRAY_SIZE(array), .num = nump, \ | 400 | = { .max = ARRAY_SIZE(array), .num = nump, \ |
| 400 | .ops = ¶m_ops_##type, \ | 401 | .ops = ¶m_ops_##type, \ |
diff --git a/include/linux/mpi.h b/include/linux/mpi.h new file mode 100644 index 000000000000..d02cca6cc8ce --- /dev/null +++ b/include/linux/mpi.h | |||
| @@ -0,0 +1,144 @@ | |||
| 1 | /* mpi.h - Multi Precision Integers | ||
| 2 | * Copyright (C) 1994, 1996, 1998, 1999, | ||
| 3 | * 2000, 2001 Free Software Foundation, Inc. | ||
| 4 | * | ||
| 5 | * This file is part of GNUPG. | ||
| 6 | * | ||
| 7 | * GNUPG is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * GNUPG is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA | ||
| 20 | * | ||
| 21 | * Note: This code is heavily based on the GNU MP Library. | ||
| 22 | * Actually it's the same code with only minor changes in the | ||
| 23 | * way the data is stored; this is to support the abstraction | ||
| 24 | * of an optional secure memory allocation which may be used | ||
| 25 | * to avoid revealing of sensitive data due to paging etc. | ||
| 26 | * The GNU MP Library itself is published under the LGPL; | ||
| 27 | * however I decided to publish this code under the plain GPL. | ||
| 28 | */ | ||
| 29 | |||
| 30 | #ifndef G10_MPI_H | ||
| 31 | #define G10_MPI_H | ||
| 32 | |||
| 33 | #include <linux/types.h> | ||
| 34 | |||
| 35 | /* DSI defines */ | ||
| 36 | |||
| 37 | #define SHA1_DIGEST_LENGTH 20 | ||
| 38 | |||
| 39 | /*end of DSI defines */ | ||
| 40 | |||
| 41 | #define BYTES_PER_MPI_LIMB (BITS_PER_LONG / 8) | ||
| 42 | #define BITS_PER_MPI_LIMB BITS_PER_LONG | ||
| 43 | |||
| 44 | typedef unsigned long int mpi_limb_t; | ||
| 45 | typedef signed long int mpi_limb_signed_t; | ||
| 46 | |||
| 47 | struct gcry_mpi { | ||
| 48 | int alloced; /* array size (# of allocated limbs) */ | ||
| 49 | int nlimbs; /* number of valid limbs */ | ||
| 50 | int nbits; /* the real number of valid bits (info only) */ | ||
| 51 | int sign; /* indicates a negative number */ | ||
| 52 | unsigned flags; /* bit 0: array must be allocated in secure memory space */ | ||
| 53 | /* bit 1: not used */ | ||
| 54 | /* bit 2: the limb is a pointer to some m_alloced data */ | ||
| 55 | mpi_limb_t *d; /* array with the limbs */ | ||
| 56 | }; | ||
| 57 | |||
| 58 | typedef struct gcry_mpi *MPI; | ||
| 59 | |||
| 60 | #define mpi_get_nlimbs(a) ((a)->nlimbs) | ||
| 61 | #define mpi_is_neg(a) ((a)->sign) | ||
| 62 | |||
| 63 | /*-- mpiutil.c --*/ | ||
| 64 | MPI mpi_alloc(unsigned nlimbs); | ||
| 65 | MPI mpi_alloc_secure(unsigned nlimbs); | ||
| 66 | MPI mpi_alloc_like(MPI a); | ||
| 67 | void mpi_free(MPI a); | ||
| 68 | int mpi_resize(MPI a, unsigned nlimbs); | ||
| 69 | int mpi_copy(MPI *copy, const MPI a); | ||
| 70 | void mpi_clear(MPI a); | ||
| 71 | int mpi_set(MPI w, MPI u); | ||
| 72 | int mpi_set_ui(MPI w, ulong u); | ||
| 73 | MPI mpi_alloc_set_ui(unsigned long u); | ||
| 74 | void mpi_m_check(MPI a); | ||
| 75 | void mpi_swap(MPI a, MPI b); | ||
| 76 | |||
| 77 | /*-- mpicoder.c --*/ | ||
| 78 | MPI do_encode_md(const void *sha_buffer, unsigned nbits); | ||
| 79 | MPI mpi_read_from_buffer(const void *buffer, unsigned *ret_nread); | ||
| 80 | int mpi_fromstr(MPI val, const char *str); | ||
| 81 | u32 mpi_get_keyid(MPI a, u32 *keyid); | ||
| 82 | void *mpi_get_buffer(MPI a, unsigned *nbytes, int *sign); | ||
| 83 | void *mpi_get_secure_buffer(MPI a, unsigned *nbytes, int *sign); | ||
| 84 | int mpi_set_buffer(MPI a, const void *buffer, unsigned nbytes, int sign); | ||
| 85 | |||
| 86 | #define log_mpidump g10_log_mpidump | ||
| 87 | |||
| 88 | /*-- mpi-add.c --*/ | ||
| 89 | int mpi_add_ui(MPI w, MPI u, ulong v); | ||
| 90 | int mpi_add(MPI w, MPI u, MPI v); | ||
| 91 | int mpi_addm(MPI w, MPI u, MPI v, MPI m); | ||
| 92 | int mpi_sub_ui(MPI w, MPI u, ulong v); | ||
| 93 | int mpi_sub(MPI w, MPI u, MPI v); | ||
| 94 | int mpi_subm(MPI w, MPI u, MPI v, MPI m); | ||
| 95 | |||
| 96 | /*-- mpi-mul.c --*/ | ||
| 97 | int mpi_mul_ui(MPI w, MPI u, ulong v); | ||
| 98 | int mpi_mul_2exp(MPI w, MPI u, ulong cnt); | ||
| 99 | int mpi_mul(MPI w, MPI u, MPI v); | ||
| 100 | int mpi_mulm(MPI w, MPI u, MPI v, MPI m); | ||
| 101 | |||
| 102 | /*-- mpi-div.c --*/ | ||
| 103 | ulong mpi_fdiv_r_ui(MPI rem, MPI dividend, ulong divisor); | ||
| 104 | int mpi_fdiv_r(MPI rem, MPI dividend, MPI divisor); | ||
| 105 | int mpi_fdiv_q(MPI quot, MPI dividend, MPI divisor); | ||
| 106 | int mpi_fdiv_qr(MPI quot, MPI rem, MPI dividend, MPI divisor); | ||
| 107 | int mpi_tdiv_r(MPI rem, MPI num, MPI den); | ||
| 108 | int mpi_tdiv_qr(MPI quot, MPI rem, MPI num, MPI den); | ||
| 109 | int mpi_tdiv_q_2exp(MPI w, MPI u, unsigned count); | ||
| 110 | int mpi_divisible_ui(const MPI dividend, ulong divisor); | ||
| 111 | |||
| 112 | /*-- mpi-gcd.c --*/ | ||
| 113 | int mpi_gcd(MPI g, const MPI a, const MPI b); | ||
| 114 | |||
| 115 | /*-- mpi-pow.c --*/ | ||
| 116 | int mpi_pow(MPI w, MPI u, MPI v); | ||
| 117 | int mpi_powm(MPI res, MPI base, MPI exp, MPI mod); | ||
| 118 | |||
| 119 | /*-- mpi-mpow.c --*/ | ||
| 120 | int mpi_mulpowm(MPI res, MPI *basearray, MPI *exparray, MPI mod); | ||
| 121 | |||
| 122 | /*-- mpi-cmp.c --*/ | ||
| 123 | int mpi_cmp_ui(MPI u, ulong v); | ||
| 124 | int mpi_cmp(MPI u, MPI v); | ||
| 125 | |||
| 126 | /*-- mpi-scan.c --*/ | ||
| 127 | int mpi_getbyte(MPI a, unsigned idx); | ||
| 128 | void mpi_putbyte(MPI a, unsigned idx, int value); | ||
| 129 | unsigned mpi_trailing_zeros(MPI a); | ||
| 130 | |||
| 131 | /*-- mpi-bit.c --*/ | ||
| 132 | void mpi_normalize(MPI a); | ||
| 133 | unsigned mpi_get_nbits(MPI a); | ||
| 134 | int mpi_test_bit(MPI a, unsigned n); | ||
| 135 | int mpi_set_bit(MPI a, unsigned n); | ||
| 136 | int mpi_set_highbit(MPI a, unsigned n); | ||
| 137 | void mpi_clear_highbit(MPI a, unsigned n); | ||
| 138 | void mpi_clear_bit(MPI a, unsigned n); | ||
| 139 | int mpi_rshift(MPI x, MPI a, unsigned n); | ||
| 140 | |||
| 141 | /*-- mpi-inv.c --*/ | ||
| 142 | int mpi_invm(MPI x, MPI u, MPI v); | ||
| 143 | |||
| 144 | #endif /*G10_MPI_H */ | ||
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index a3759cb0ac10..6d8c7251eb8d 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
| @@ -43,9 +43,11 @@ typedef unsigned short mifi_t; | |||
| 43 | typedef __u32 if_mask; | 43 | typedef __u32 if_mask; |
| 44 | #define NIFBITS (sizeof(if_mask) * 8) /* bits per mask */ | 44 | #define NIFBITS (sizeof(if_mask) * 8) /* bits per mask */ |
| 45 | 45 | ||
| 46 | #if !defined(__KERNEL__) && !defined(DIV_ROUND_UP) | 46 | #if !defined(__KERNEL__) |
| 47 | #if !defined(DIV_ROUND_UP) | ||
| 47 | #define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y)) | 48 | #define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y)) |
| 48 | #endif | 49 | #endif |
| 50 | #endif | ||
| 49 | 51 | ||
| 50 | typedef struct if_set { | 52 | typedef struct if_set { |
| 51 | if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)]; | 53 | if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)]; |
diff --git a/include/linux/msi.h b/include/linux/msi.h index 05acced439a3..ce93a341337d 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef LINUX_MSI_H | 1 | #ifndef LINUX_MSI_H |
| 2 | #define LINUX_MSI_H | 2 | #define LINUX_MSI_H |
| 3 | 3 | ||
| 4 | #include <linux/kobject.h> | ||
| 4 | #include <linux/list.h> | 5 | #include <linux/list.h> |
| 5 | 6 | ||
| 6 | struct msi_msg { | 7 | struct msi_msg { |
| @@ -44,6 +45,8 @@ struct msi_desc { | |||
| 44 | 45 | ||
| 45 | /* Last set MSI message */ | 46 | /* Last set MSI message */ |
| 46 | struct msi_msg msg; | 47 | struct msi_msg msg; |
| 48 | |||
| 49 | struct kobject kobj; | ||
| 47 | }; | 50 | }; |
| 48 | 51 | ||
| 49 | /* | 52 | /* |
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index d24925492972..d5d2ec6494bb 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
| @@ -354,10 +354,10 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf | |||
| 354 | onecmd = cmd; | 354 | onecmd = cmd; |
| 355 | break; | 355 | break; |
| 356 | case 2: | 356 | case 2: |
| 357 | onecmd = cpu_to_cfi16(cmd); | 357 | onecmd = cpu_to_cfi16(map, cmd); |
| 358 | break; | 358 | break; |
| 359 | case 4: | 359 | case 4: |
| 360 | onecmd = cpu_to_cfi32(cmd); | 360 | onecmd = cpu_to_cfi32(map, cmd); |
| 361 | break; | 361 | break; |
| 362 | } | 362 | } |
| 363 | 363 | ||
| @@ -437,10 +437,10 @@ static inline unsigned long cfi_merge_status(map_word val, struct map_info *map, | |||
| 437 | case 1: | 437 | case 1: |
| 438 | break; | 438 | break; |
| 439 | case 2: | 439 | case 2: |
| 440 | res = cfi16_to_cpu(res); | 440 | res = cfi16_to_cpu(map, res); |
| 441 | break; | 441 | break; |
| 442 | case 4: | 442 | case 4: |
| 443 | res = cfi32_to_cpu(res); | 443 | res = cfi32_to_cpu(map, res); |
| 444 | break; | 444 | break; |
| 445 | default: BUG(); | 445 | default: BUG(); |
| 446 | } | 446 | } |
| @@ -480,12 +480,12 @@ static inline uint8_t cfi_read_query(struct map_info *map, uint32_t addr) | |||
| 480 | if (map_bankwidth_is_1(map)) { | 480 | if (map_bankwidth_is_1(map)) { |
| 481 | return val.x[0]; | 481 | return val.x[0]; |
| 482 | } else if (map_bankwidth_is_2(map)) { | 482 | } else if (map_bankwidth_is_2(map)) { |
| 483 | return cfi16_to_cpu(val.x[0]); | 483 | return cfi16_to_cpu(map, val.x[0]); |
| 484 | } else { | 484 | } else { |
| 485 | /* No point in a 64-bit byteswap since that would just be | 485 | /* No point in a 64-bit byteswap since that would just be |
| 486 | swapping the responses from different chips, and we are | 486 | swapping the responses from different chips, and we are |
| 487 | only interested in one chip (a representative sample) */ | 487 | only interested in one chip (a representative sample) */ |
| 488 | return cfi32_to_cpu(val.x[0]); | 488 | return cfi32_to_cpu(map, val.x[0]); |
| 489 | } | 489 | } |
| 490 | } | 490 | } |
| 491 | 491 | ||
| @@ -496,12 +496,12 @@ static inline uint16_t cfi_read_query16(struct map_info *map, uint32_t addr) | |||
| 496 | if (map_bankwidth_is_1(map)) { | 496 | if (map_bankwidth_is_1(map)) { |
| 497 | return val.x[0] & 0xff; | 497 | return val.x[0] & 0xff; |
| 498 | } else if (map_bankwidth_is_2(map)) { | 498 | } else if (map_bankwidth_is_2(map)) { |
| 499 | return cfi16_to_cpu(val.x[0]); | 499 | return cfi16_to_cpu(map, val.x[0]); |
| 500 | } else { | 500 | } else { |
| 501 | /* No point in a 64-bit byteswap since that would just be | 501 | /* No point in a 64-bit byteswap since that would just be |
| 502 | swapping the responses from different chips, and we are | 502 | swapping the responses from different chips, and we are |
| 503 | only interested in one chip (a representative sample) */ | 503 | only interested in one chip (a representative sample) */ |
| 504 | return cfi32_to_cpu(val.x[0]); | 504 | return cfi32_to_cpu(map, val.x[0]); |
| 505 | } | 505 | } |
| 506 | } | 506 | } |
| 507 | 507 | ||
diff --git a/include/linux/mtd/cfi_endian.h b/include/linux/mtd/cfi_endian.h index 51cc3f5917a8..b97a625071f8 100644 --- a/include/linux/mtd/cfi_endian.h +++ b/include/linux/mtd/cfi_endian.h | |||
| @@ -19,53 +19,35 @@ | |||
| 19 | 19 | ||
| 20 | #include <asm/byteorder.h> | 20 | #include <asm/byteorder.h> |
| 21 | 21 | ||
| 22 | #ifndef CONFIG_MTD_CFI_ADV_OPTIONS | 22 | #define CFI_HOST_ENDIAN 1 |
| 23 | 23 | #define CFI_LITTLE_ENDIAN 2 | |
| 24 | #define CFI_HOST_ENDIAN | 24 | #define CFI_BIG_ENDIAN 3 |
| 25 | 25 | ||
| 26 | #else | 26 | #if !defined(CONFIG_MTD_CFI_ADV_OPTIONS) || defined(CONFIG_MTD_CFI_NOSWAP) |
| 27 | 27 | #define CFI_DEFAULT_ENDIAN CFI_HOST_ENDIAN | |
| 28 | #ifdef CONFIG_MTD_CFI_NOSWAP | 28 | #elif defined(CONFIG_MTD_CFI_LE_BYTE_SWAP) |
| 29 | #define CFI_HOST_ENDIAN | 29 | #define CFI_DEFAULT_ENDIAN CFI_LITTLE_ENDIAN |
| 30 | #endif | 30 | #elif defined(CONFIG_MTD_CFI_BE_BYTE_SWAP) |
| 31 | 31 | #define CFI_DEFAULT_ENDIAN CFI_BIG_ENDIAN | |
| 32 | #ifdef CONFIG_MTD_CFI_LE_BYTE_SWAP | ||
| 33 | #define CFI_LITTLE_ENDIAN | ||
| 34 | #endif | ||
| 35 | |||
| 36 | #ifdef CONFIG_MTD_CFI_BE_BYTE_SWAP | ||
| 37 | #define CFI_BIG_ENDIAN | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #endif | ||
| 41 | |||
| 42 | #if defined(CFI_LITTLE_ENDIAN) | ||
| 43 | #define cpu_to_cfi8(x) (x) | ||
| 44 | #define cfi8_to_cpu(x) (x) | ||
| 45 | #define cpu_to_cfi16(x) cpu_to_le16(x) | ||
| 46 | #define cpu_to_cfi32(x) cpu_to_le32(x) | ||
| 47 | #define cpu_to_cfi64(x) cpu_to_le64(x) | ||
| 48 | #define cfi16_to_cpu(x) le16_to_cpu(x) | ||
| 49 | #define cfi32_to_cpu(x) le32_to_cpu(x) | ||
| 50 | #define cfi64_to_cpu(x) le64_to_cpu(x) | ||
| 51 | #elif defined (CFI_BIG_ENDIAN) | ||
| 52 | #define cpu_to_cfi8(x) (x) | ||
| 53 | #define cfi8_to_cpu(x) (x) | ||
| 54 | #define cpu_to_cfi16(x) cpu_to_be16(x) | ||
| 55 | #define cpu_to_cfi32(x) cpu_to_be32(x) | ||
| 56 | #define cpu_to_cfi64(x) cpu_to_be64(x) | ||
| 57 | #define cfi16_to_cpu(x) be16_to_cpu(x) | ||
| 58 | #define cfi32_to_cpu(x) be32_to_cpu(x) | ||
| 59 | #define cfi64_to_cpu(x) be64_to_cpu(x) | ||
| 60 | #elif defined (CFI_HOST_ENDIAN) | ||
| 61 | #define cpu_to_cfi8(x) (x) | ||
| 62 | #define cfi8_to_cpu(x) (x) | ||
| 63 | #define cpu_to_cfi16(x) (x) | ||
| 64 | #define cpu_to_cfi32(x) (x) | ||
| 65 | #define cpu_to_cfi64(x) (x) | ||
| 66 | #define cfi16_to_cpu(x) (x) | ||
| 67 | #define cfi32_to_cpu(x) (x) | ||
| 68 | #define cfi64_to_cpu(x) (x) | ||
| 69 | #else | 32 | #else |
| 70 | #error No CFI endianness defined | 33 | #error No CFI endianness defined |
| 71 | #endif | 34 | #endif |
| 35 | |||
| 36 | #define cfi_default(s) ((s)?:CFI_DEFAULT_ENDIAN) | ||
| 37 | #define cfi_be(s) (cfi_default(s) == CFI_BIG_ENDIAN) | ||
| 38 | #define cfi_le(s) (cfi_default(s) == CFI_LITTLE_ENDIAN) | ||
| 39 | #define cfi_host(s) (cfi_default(s) == CFI_HOST_ENDIAN) | ||
| 40 | |||
| 41 | #define cpu_to_cfi8(map, x) (x) | ||
| 42 | #define cfi8_to_cpu(map, x) (x) | ||
| 43 | #define cpu_to_cfi16(map, x) _cpu_to_cfi(16, (map)->swap, (x)) | ||
| 44 | #define cpu_to_cfi32(map, x) _cpu_to_cfi(32, (map)->swap, (x)) | ||
| 45 | #define cpu_to_cfi64(map, x) _cpu_to_cfi(64, (map)->swap, (x)) | ||
| 46 | #define cfi16_to_cpu(map, x) _cfi_to_cpu(16, (map)->swap, (x)) | ||
| 47 | #define cfi32_to_cpu(map, x) _cfi_to_cpu(32, (map)->swap, (x)) | ||
| 48 | #define cfi64_to_cpu(map, x) _cfi_to_cpu(64, (map)->swap, (x)) | ||
| 49 | |||
| 50 | #define _cpu_to_cfi(w, s, x) (cfi_host(s)?(x):_swap_to_cfi(w, s, x)) | ||
| 51 | #define _cfi_to_cpu(w, s, x) (cfi_host(s)?(x):_swap_to_cpu(w, s, x)) | ||
| 52 | #define _swap_to_cfi(w, s, x) (cfi_be(s)?cpu_to_be##w(x):cpu_to_le##w(x)) | ||
| 53 | #define _swap_to_cpu(w, s, x) (cfi_be(s)?be##w##_to_cpu(x):le##w##_to_cpu(x)) | ||
diff --git a/include/linux/mtd/gpmi-nand.h b/include/linux/mtd/gpmi-nand.h new file mode 100644 index 000000000000..69b6dbf46b5e --- /dev/null +++ b/include/linux/mtd/gpmi-nand.h | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 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 as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along | ||
| 15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __MACH_MXS_GPMI_NAND_H__ | ||
| 20 | #define __MACH_MXS_GPMI_NAND_H__ | ||
| 21 | |||
| 22 | /* The size of the resources is fixed. */ | ||
| 23 | #define GPMI_NAND_RES_SIZE 6 | ||
| 24 | |||
| 25 | /* Resource names for the GPMI NAND driver. */ | ||
| 26 | #define GPMI_NAND_GPMI_REGS_ADDR_RES_NAME "GPMI NAND GPMI Registers" | ||
| 27 | #define GPMI_NAND_GPMI_INTERRUPT_RES_NAME "GPMI NAND GPMI Interrupt" | ||
| 28 | #define GPMI_NAND_BCH_REGS_ADDR_RES_NAME "GPMI NAND BCH Registers" | ||
| 29 | #define GPMI_NAND_BCH_INTERRUPT_RES_NAME "GPMI NAND BCH Interrupt" | ||
| 30 | #define GPMI_NAND_DMA_CHANNELS_RES_NAME "GPMI NAND DMA Channels" | ||
| 31 | #define GPMI_NAND_DMA_INTERRUPT_RES_NAME "GPMI NAND DMA Interrupt" | ||
| 32 | |||
| 33 | /** | ||
| 34 | * struct gpmi_nand_platform_data - GPMI NAND driver platform data. | ||
| 35 | * | ||
| 36 | * This structure communicates platform-specific information to the GPMI NAND | ||
| 37 | * driver that can't be expressed as resources. | ||
| 38 | * | ||
| 39 | * @platform_init: A pointer to a function the driver will call to | ||
| 40 | * initialize the platform (e.g., set up the pin mux). | ||
| 41 | * @min_prop_delay_in_ns: Minimum propagation delay of GPMI signals to and | ||
| 42 | * from the NAND Flash device, in nanoseconds. | ||
| 43 | * @max_prop_delay_in_ns: Maximum propagation delay of GPMI signals to and | ||
| 44 | * from the NAND Flash device, in nanoseconds. | ||
| 45 | * @max_chip_count: The maximum number of chips for which the driver | ||
| 46 | * should configure the hardware. This value most | ||
| 47 | * likely reflects the number of pins that are | ||
| 48 | * connected to a NAND Flash device. If this is | ||
| 49 | * greater than the SoC hardware can support, the | ||
| 50 | * driver will print a message and fail to initialize. | ||
| 51 | * @partitions: An optional pointer to an array of partition | ||
| 52 | * descriptions. | ||
| 53 | * @partition_count: The number of elements in the partitions array. | ||
| 54 | */ | ||
| 55 | struct gpmi_nand_platform_data { | ||
| 56 | /* SoC hardware information. */ | ||
| 57 | int (*platform_init)(void); | ||
| 58 | |||
| 59 | /* NAND Flash information. */ | ||
| 60 | unsigned int min_prop_delay_in_ns; | ||
| 61 | unsigned int max_prop_delay_in_ns; | ||
| 62 | unsigned int max_chip_count; | ||
| 63 | |||
| 64 | /* Medium information. */ | ||
| 65 | struct mtd_partition *partitions; | ||
| 66 | unsigned partition_count; | ||
| 67 | }; | ||
| 68 | #endif | ||
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index a9e6ba46865e..94e924e2ecd5 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | #include <linux/list.h> | 26 | #include <linux/list.h> |
| 27 | #include <linux/string.h> | 27 | #include <linux/string.h> |
| 28 | #include <linux/bug.h> | 28 | #include <linux/bug.h> |
| 29 | 29 | #include <linux/kernel.h> | |
| 30 | 30 | ||
| 31 | #include <asm/unaligned.h> | 31 | #include <asm/unaligned.h> |
| 32 | #include <asm/system.h> | 32 | #include <asm/system.h> |
| @@ -214,6 +214,7 @@ struct map_info { | |||
| 214 | void __iomem *virt; | 214 | void __iomem *virt; |
| 215 | void *cached; | 215 | void *cached; |
| 216 | 216 | ||
| 217 | int swap; /* this mapping's byte-swapping requirement */ | ||
| 217 | int bankwidth; /* in octets. This isn't necessarily the width | 218 | int bankwidth; /* in octets. This isn't necessarily the width |
| 218 | of actual bus cycles -- it's the repeat interval | 219 | of actual bus cycles -- it's the repeat interval |
| 219 | in bytes, before you are talking to the first chip again. | 220 | in bytes, before you are talking to the first chip again. |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 9f5b312af783..887ebe318c75 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -171,87 +171,60 @@ struct mtd_info { | |||
| 171 | struct mtd_erase_region_info *eraseregions; | 171 | struct mtd_erase_region_info *eraseregions; |
| 172 | 172 | ||
| 173 | /* | 173 | /* |
| 174 | * Erase is an asynchronous operation. Device drivers are supposed | 174 | * Do not call via these pointers, use corresponding mtd_*() |
| 175 | * to call instr->callback() whenever the operation completes, even | 175 | * wrappers instead. |
| 176 | * if it completes with a failure. | ||
| 177 | * Callers are supposed to pass a callback function and wait for it | ||
| 178 | * to be called before writing to the block. | ||
| 179 | */ | 176 | */ |
| 180 | int (*erase) (struct mtd_info *mtd, struct erase_info *instr); | 177 | int (*erase) (struct mtd_info *mtd, struct erase_info *instr); |
| 181 | |||
| 182 | /* This stuff for eXecute-In-Place */ | ||
| 183 | /* phys is optional and may be set to NULL */ | ||
| 184 | int (*point) (struct mtd_info *mtd, loff_t from, size_t len, | 178 | int (*point) (struct mtd_info *mtd, loff_t from, size_t len, |
| 185 | size_t *retlen, void **virt, resource_size_t *phys); | 179 | size_t *retlen, void **virt, resource_size_t *phys); |
| 186 | |||
| 187 | /* We probably shouldn't allow XIP if the unpoint isn't a NULL */ | ||
| 188 | void (*unpoint) (struct mtd_info *mtd, loff_t from, size_t len); | 180 | void (*unpoint) (struct mtd_info *mtd, loff_t from, size_t len); |
| 189 | |||
| 190 | /* Allow NOMMU mmap() to directly map the device (if not NULL) | ||
| 191 | * - return the address to which the offset maps | ||
| 192 | * - return -ENOSYS to indicate refusal to do the mapping | ||
| 193 | */ | ||
| 194 | unsigned long (*get_unmapped_area) (struct mtd_info *mtd, | 181 | unsigned long (*get_unmapped_area) (struct mtd_info *mtd, |
| 195 | unsigned long len, | 182 | unsigned long len, |
| 196 | unsigned long offset, | 183 | unsigned long offset, |
| 197 | unsigned long flags); | 184 | unsigned long flags); |
| 198 | 185 | int (*read) (struct mtd_info *mtd, loff_t from, size_t len, | |
| 199 | /* Backing device capabilities for this device | 186 | size_t *retlen, u_char *buf); |
| 200 | * - provides mmap capabilities | 187 | int (*write) (struct mtd_info *mtd, loff_t to, size_t len, |
| 201 | */ | 188 | size_t *retlen, const u_char *buf); |
| 202 | struct backing_dev_info *backing_dev_info; | 189 | int (*panic_write) (struct mtd_info *mtd, loff_t to, size_t len, |
| 203 | 190 | size_t *retlen, const u_char *buf); | |
| 204 | |||
| 205 | int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | ||
| 206 | int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); | ||
| 207 | |||
| 208 | /* In blackbox flight recorder like scenarios we want to make successful | ||
| 209 | writes in interrupt context. panic_write() is only intended to be | ||
| 210 | called when its known the kernel is about to panic and we need the | ||
| 211 | write to succeed. Since the kernel is not going to be running for much | ||
| 212 | longer, this function can break locks and delay to ensure the write | ||
| 213 | succeeds (but not sleep). */ | ||
| 214 | |||
| 215 | int (*panic_write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); | ||
| 216 | |||
| 217 | int (*read_oob) (struct mtd_info *mtd, loff_t from, | 191 | int (*read_oob) (struct mtd_info *mtd, loff_t from, |
| 218 | struct mtd_oob_ops *ops); | 192 | struct mtd_oob_ops *ops); |
| 219 | int (*write_oob) (struct mtd_info *mtd, loff_t to, | 193 | int (*write_oob) (struct mtd_info *mtd, loff_t to, |
| 220 | struct mtd_oob_ops *ops); | 194 | struct mtd_oob_ops *ops); |
| 221 | 195 | int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, | |
| 222 | /* | 196 | size_t len); |
| 223 | * Methods to access the protection register area, present in some | 197 | int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, |
| 224 | * flash devices. The user data is one time programmable but the | 198 | size_t len, size_t *retlen, u_char *buf); |
| 225 | * factory data is read only. | 199 | int (*get_user_prot_info) (struct mtd_info *mtd, struct otp_info *buf, |
| 226 | */ | 200 | size_t len); |
| 227 | int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len); | 201 | int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from, |
| 228 | int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | 202 | size_t len, size_t *retlen, u_char *buf); |
| 229 | int (*get_user_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len); | 203 | int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t to, size_t len, |
| 230 | int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | 204 | size_t *retlen, u_char *buf); |
| 231 | int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | 205 | int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, |
| 232 | int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len); | 206 | size_t len); |
| 233 | 207 | int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, | |
| 234 | /* kvec-based read/write methods. | 208 | unsigned long count, loff_t to, size_t *retlen); |
| 235 | NB: The 'count' parameter is the number of _vectors_, each of | ||
| 236 | which contains an (ofs, len) tuple. | ||
| 237 | */ | ||
| 238 | int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); | ||
| 239 | |||
| 240 | /* Sync */ | ||
| 241 | void (*sync) (struct mtd_info *mtd); | 209 | void (*sync) (struct mtd_info *mtd); |
| 242 | |||
| 243 | /* Chip-supported device locking */ | ||
| 244 | int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); | 210 | int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
| 245 | int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); | 211 | int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
| 246 | int (*is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len); | 212 | int (*is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
| 247 | 213 | int (*block_isbad) (struct mtd_info *mtd, loff_t ofs); | |
| 248 | /* Power Management functions */ | 214 | int (*block_markbad) (struct mtd_info *mtd, loff_t ofs); |
| 249 | int (*suspend) (struct mtd_info *mtd); | 215 | int (*suspend) (struct mtd_info *mtd); |
| 250 | void (*resume) (struct mtd_info *mtd); | 216 | void (*resume) (struct mtd_info *mtd); |
| 217 | /* | ||
| 218 | * If the driver is something smart, like UBI, it may need to maintain | ||
| 219 | * its own reference counting. The below functions are only for driver. | ||
| 220 | */ | ||
| 221 | int (*get_device) (struct mtd_info *mtd); | ||
| 222 | void (*put_device) (struct mtd_info *mtd); | ||
| 251 | 223 | ||
| 252 | /* Bad block management functions */ | 224 | /* Backing device capabilities for this device |
| 253 | int (*block_isbad) (struct mtd_info *mtd, loff_t ofs); | 225 | * - provides mmap capabilities |
| 254 | int (*block_markbad) (struct mtd_info *mtd, loff_t ofs); | 226 | */ |
| 227 | struct backing_dev_info *backing_dev_info; | ||
| 255 | 228 | ||
| 256 | struct notifier_block reboot_notifier; /* default mode before reboot */ | 229 | struct notifier_block reboot_notifier; /* default mode before reboot */ |
| 257 | 230 | ||
| @@ -265,18 +238,218 @@ struct mtd_info { | |||
| 265 | struct module *owner; | 238 | struct module *owner; |
| 266 | struct device dev; | 239 | struct device dev; |
| 267 | int usecount; | 240 | int usecount; |
| 268 | |||
| 269 | /* If the driver is something smart, like UBI, it may need to maintain | ||
| 270 | * its own reference counting. The below functions are only for driver. | ||
| 271 | * The driver may register its callbacks. These callbacks are not | ||
| 272 | * supposed to be called by MTD users */ | ||
| 273 | int (*get_device) (struct mtd_info *mtd); | ||
| 274 | void (*put_device) (struct mtd_info *mtd); | ||
| 275 | }; | 241 | }; |
| 276 | 242 | ||
| 277 | static inline struct mtd_info *dev_to_mtd(struct device *dev) | 243 | /* |
| 244 | * Erase is an asynchronous operation. Device drivers are supposed | ||
| 245 | * to call instr->callback() whenever the operation completes, even | ||
| 246 | * if it completes with a failure. | ||
| 247 | * Callers are supposed to pass a callback function and wait for it | ||
| 248 | * to be called before writing to the block. | ||
| 249 | */ | ||
| 250 | static inline int mtd_erase(struct mtd_info *mtd, struct erase_info *instr) | ||
| 251 | { | ||
| 252 | return mtd->erase(mtd, instr); | ||
| 253 | } | ||
| 254 | |||
| 255 | /* | ||
| 256 | * This stuff for eXecute-In-Place. phys is optional and may be set to NULL. | ||
| 257 | */ | ||
| 258 | static inline int mtd_point(struct mtd_info *mtd, loff_t from, size_t len, | ||
| 259 | size_t *retlen, void **virt, resource_size_t *phys) | ||
| 260 | { | ||
| 261 | *retlen = 0; | ||
| 262 | if (!mtd->point) | ||
| 263 | return -EOPNOTSUPP; | ||
| 264 | return mtd->point(mtd, from, len, retlen, virt, phys); | ||
| 265 | } | ||
| 266 | |||
| 267 | /* We probably shouldn't allow XIP if the unpoint isn't a NULL */ | ||
| 268 | static inline void mtd_unpoint(struct mtd_info *mtd, loff_t from, size_t len) | ||
| 278 | { | 269 | { |
| 279 | return dev ? dev_get_drvdata(dev) : NULL; | 270 | return mtd->unpoint(mtd, from, len); |
| 271 | } | ||
| 272 | |||
| 273 | /* | ||
| 274 | * Allow NOMMU mmap() to directly map the device (if not NULL) | ||
| 275 | * - return the address to which the offset maps | ||
| 276 | * - return -ENOSYS to indicate refusal to do the mapping | ||
| 277 | */ | ||
| 278 | static inline unsigned long mtd_get_unmapped_area(struct mtd_info *mtd, | ||
| 279 | unsigned long len, | ||
| 280 | unsigned long offset, | ||
| 281 | unsigned long flags) | ||
| 282 | { | ||
| 283 | if (!mtd->get_unmapped_area) | ||
| 284 | return -EOPNOTSUPP; | ||
| 285 | return mtd->get_unmapped_area(mtd, len, offset, flags); | ||
| 286 | } | ||
| 287 | |||
| 288 | static inline int mtd_read(struct mtd_info *mtd, loff_t from, size_t len, | ||
| 289 | size_t *retlen, u_char *buf) | ||
| 290 | { | ||
| 291 | return mtd->read(mtd, from, len, retlen, buf); | ||
| 292 | } | ||
| 293 | |||
| 294 | static inline int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, | ||
| 295 | size_t *retlen, const u_char *buf) | ||
| 296 | { | ||
| 297 | *retlen = 0; | ||
| 298 | if (!mtd->write) | ||
| 299 | return -EROFS; | ||
| 300 | return mtd->write(mtd, to, len, retlen, buf); | ||
| 301 | } | ||
| 302 | |||
| 303 | /* | ||
| 304 | * In blackbox flight recorder like scenarios we want to make successful writes | ||
| 305 | * in interrupt context. panic_write() is only intended to be called when its | ||
| 306 | * known the kernel is about to panic and we need the write to succeed. Since | ||
| 307 | * the kernel is not going to be running for much longer, this function can | ||
| 308 | * break locks and delay to ensure the write succeeds (but not sleep). | ||
| 309 | */ | ||
| 310 | static inline int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, | ||
| 311 | size_t *retlen, const u_char *buf) | ||
| 312 | { | ||
| 313 | *retlen = 0; | ||
| 314 | if (!mtd->panic_write) | ||
| 315 | return -EOPNOTSUPP; | ||
| 316 | return mtd->panic_write(mtd, to, len, retlen, buf); | ||
| 317 | } | ||
| 318 | |||
| 319 | static inline int mtd_read_oob(struct mtd_info *mtd, loff_t from, | ||
| 320 | struct mtd_oob_ops *ops) | ||
| 321 | { | ||
| 322 | ops->retlen = ops->oobretlen = 0; | ||
| 323 | if (!mtd->read_oob) | ||
| 324 | return -EOPNOTSUPP; | ||
| 325 | return mtd->read_oob(mtd, from, ops); | ||
| 326 | } | ||
| 327 | |||
| 328 | static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to, | ||
| 329 | struct mtd_oob_ops *ops) | ||
| 330 | { | ||
| 331 | ops->retlen = ops->oobretlen = 0; | ||
| 332 | if (!mtd->write_oob) | ||
| 333 | return -EOPNOTSUPP; | ||
| 334 | return mtd->write_oob(mtd, to, ops); | ||
| 335 | } | ||
| 336 | |||
| 337 | /* | ||
| 338 | * Method to access the protection register area, present in some flash | ||
| 339 | * devices. The user data is one time programmable but the factory data is read | ||
| 340 | * only. | ||
| 341 | */ | ||
| 342 | static inline int mtd_get_fact_prot_info(struct mtd_info *mtd, | ||
| 343 | struct otp_info *buf, size_t len) | ||
| 344 | { | ||
| 345 | if (!mtd->get_fact_prot_info) | ||
| 346 | return -EOPNOTSUPP; | ||
| 347 | return mtd->get_fact_prot_info(mtd, buf, len); | ||
| 348 | } | ||
| 349 | |||
| 350 | static inline int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from, | ||
| 351 | size_t len, size_t *retlen, | ||
| 352 | u_char *buf) | ||
| 353 | { | ||
| 354 | *retlen = 0; | ||
| 355 | if (!mtd->read_fact_prot_reg) | ||
| 356 | return -EOPNOTSUPP; | ||
| 357 | return mtd->read_fact_prot_reg(mtd, from, len, retlen, buf); | ||
| 358 | } | ||
| 359 | |||
| 360 | static inline int mtd_get_user_prot_info(struct mtd_info *mtd, | ||
| 361 | struct otp_info *buf, | ||
| 362 | size_t len) | ||
| 363 | { | ||
| 364 | if (!mtd->get_user_prot_info) | ||
| 365 | return -EOPNOTSUPP; | ||
| 366 | return mtd->get_user_prot_info(mtd, buf, len); | ||
| 367 | } | ||
| 368 | |||
| 369 | static inline int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from, | ||
| 370 | size_t len, size_t *retlen, | ||
| 371 | u_char *buf) | ||
| 372 | { | ||
| 373 | *retlen = 0; | ||
| 374 | if (!mtd->read_user_prot_reg) | ||
| 375 | return -EOPNOTSUPP; | ||
| 376 | return mtd->read_user_prot_reg(mtd, from, len, retlen, buf); | ||
| 377 | } | ||
| 378 | |||
| 379 | static inline int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to, | ||
| 380 | size_t len, size_t *retlen, | ||
| 381 | u_char *buf) | ||
| 382 | { | ||
| 383 | *retlen = 0; | ||
| 384 | if (!mtd->write_user_prot_reg) | ||
| 385 | return -EOPNOTSUPP; | ||
| 386 | return mtd->write_user_prot_reg(mtd, to, len, retlen, buf); | ||
| 387 | } | ||
| 388 | |||
| 389 | static inline int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, | ||
| 390 | size_t len) | ||
| 391 | { | ||
| 392 | if (!mtd->lock_user_prot_reg) | ||
| 393 | return -EOPNOTSUPP; | ||
| 394 | return mtd->lock_user_prot_reg(mtd, from, len); | ||
| 395 | } | ||
| 396 | |||
| 397 | int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, | ||
| 398 | unsigned long count, loff_t to, size_t *retlen); | ||
| 399 | |||
| 400 | static inline void mtd_sync(struct mtd_info *mtd) | ||
| 401 | { | ||
| 402 | if (mtd->sync) | ||
| 403 | mtd->sync(mtd); | ||
| 404 | } | ||
| 405 | |||
| 406 | /* Chip-supported device locking */ | ||
| 407 | static inline int mtd_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) | ||
| 408 | { | ||
| 409 | if (!mtd->lock) | ||
| 410 | return -EOPNOTSUPP; | ||
| 411 | return mtd->lock(mtd, ofs, len); | ||
| 412 | } | ||
| 413 | |||
| 414 | static inline int mtd_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) | ||
| 415 | { | ||
| 416 | if (!mtd->unlock) | ||
| 417 | return -EOPNOTSUPP; | ||
| 418 | return mtd->unlock(mtd, ofs, len); | ||
| 419 | } | ||
| 420 | |||
| 421 | static inline int mtd_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len) | ||
| 422 | { | ||
| 423 | if (!mtd->is_locked) | ||
| 424 | return -EOPNOTSUPP; | ||
| 425 | return mtd->is_locked(mtd, ofs, len); | ||
| 426 | } | ||
| 427 | |||
| 428 | static inline int mtd_suspend(struct mtd_info *mtd) | ||
| 429 | { | ||
| 430 | if (!mtd->suspend) | ||
| 431 | return -EOPNOTSUPP; | ||
| 432 | return mtd->suspend(mtd); | ||
| 433 | } | ||
| 434 | |||
| 435 | static inline void mtd_resume(struct mtd_info *mtd) | ||
| 436 | { | ||
| 437 | if (mtd->resume) | ||
| 438 | mtd->resume(mtd); | ||
| 439 | } | ||
| 440 | |||
| 441 | static inline int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs) | ||
| 442 | { | ||
| 443 | if (!mtd->block_isbad) | ||
| 444 | return 0; | ||
| 445 | return mtd->block_isbad(mtd, ofs); | ||
| 446 | } | ||
| 447 | |||
| 448 | static inline int mtd_block_markbad(struct mtd_info *mtd, loff_t ofs) | ||
| 449 | { | ||
| 450 | if (!mtd->block_markbad) | ||
| 451 | return -EOPNOTSUPP; | ||
| 452 | return mtd->block_markbad(mtd, ofs); | ||
| 280 | } | 453 | } |
| 281 | 454 | ||
| 282 | static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd) | 455 | static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd) |
| @@ -309,6 +482,16 @@ static inline uint32_t mtd_mod_by_ws(uint64_t sz, struct mtd_info *mtd) | |||
| 309 | return do_div(sz, mtd->writesize); | 482 | return do_div(sz, mtd->writesize); |
| 310 | } | 483 | } |
| 311 | 484 | ||
| 485 | static inline int mtd_has_oob(const struct mtd_info *mtd) | ||
| 486 | { | ||
| 487 | return mtd->read_oob && mtd->write_oob; | ||
| 488 | } | ||
| 489 | |||
| 490 | static inline int mtd_can_have_bb(const struct mtd_info *mtd) | ||
| 491 | { | ||
| 492 | return !!mtd->block_isbad; | ||
| 493 | } | ||
| 494 | |||
| 312 | /* Kernel-side ioctl definitions */ | 495 | /* Kernel-side ioctl definitions */ |
| 313 | 496 | ||
| 314 | struct mtd_partition; | 497 | struct mtd_partition; |
| @@ -338,13 +521,6 @@ struct mtd_notifier { | |||
| 338 | 521 | ||
| 339 | extern void register_mtd_user (struct mtd_notifier *new); | 522 | extern void register_mtd_user (struct mtd_notifier *new); |
| 340 | extern int unregister_mtd_user (struct mtd_notifier *old); | 523 | extern int unregister_mtd_user (struct mtd_notifier *old); |
| 341 | |||
| 342 | int default_mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, | ||
| 343 | unsigned long count, loff_t to, size_t *retlen); | ||
| 344 | |||
| 345 | int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs, | ||
| 346 | unsigned long count, loff_t from, size_t *retlen); | ||
| 347 | |||
| 348 | void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size); | 524 | void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size); |
| 349 | 525 | ||
| 350 | void mtd_erase_callback(struct erase_info *instr); | 526 | void mtd_erase_callback(struct erase_info *instr); |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 904131bab501..63b5a8b6dfbd 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
| @@ -555,6 +555,7 @@ struct nand_chip { | |||
| 555 | #define NAND_MFR_HYNIX 0xad | 555 | #define NAND_MFR_HYNIX 0xad |
| 556 | #define NAND_MFR_MICRON 0x2c | 556 | #define NAND_MFR_MICRON 0x2c |
| 557 | #define NAND_MFR_AMD 0x01 | 557 | #define NAND_MFR_AMD 0x01 |
| 558 | #define NAND_MFR_MACRONIX 0xc2 | ||
| 558 | 559 | ||
| 559 | /** | 560 | /** |
| 560 | * struct nand_flash_dev - NAND Flash Device ID Structure | 561 | * struct nand_flash_dev - NAND Flash Device ID Structure |
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h index 04e018160e2b..d2887e76b7f6 100644 --- a/include/linux/mtd/physmap.h +++ b/include/linux/mtd/physmap.h | |||
| @@ -30,6 +30,7 @@ struct physmap_flash_data { | |||
| 30 | unsigned int pfow_base; | 30 | unsigned int pfow_base; |
| 31 | char *probe_type; | 31 | char *probe_type; |
| 32 | struct mtd_partition *parts; | 32 | struct mtd_partition *parts; |
| 33 | const char **part_probe_types; | ||
| 33 | }; | 34 | }; |
| 34 | 35 | ||
| 35 | #endif /* __LINUX_MTD_PHYSMAP__ */ | 36 | #endif /* __LINUX_MTD_PHYSMAP__ */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index a1d109590da4..0eac07c95255 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -2155,7 +2155,7 @@ extern void netdev_run_todo(void); | |||
| 2155 | */ | 2155 | */ |
| 2156 | static inline void dev_put(struct net_device *dev) | 2156 | static inline void dev_put(struct net_device *dev) |
| 2157 | { | 2157 | { |
| 2158 | irqsafe_cpu_dec(*dev->pcpu_refcnt); | 2158 | this_cpu_dec(*dev->pcpu_refcnt); |
| 2159 | } | 2159 | } |
| 2160 | 2160 | ||
| 2161 | /** | 2161 | /** |
| @@ -2166,7 +2166,7 @@ static inline void dev_put(struct net_device *dev) | |||
| 2166 | */ | 2166 | */ |
| 2167 | static inline void dev_hold(struct net_device *dev) | 2167 | static inline void dev_hold(struct net_device *dev) |
| 2168 | { | 2168 | { |
| 2169 | irqsafe_cpu_inc(*dev->pcpu_refcnt); | 2169 | this_cpu_inc(*dev->pcpu_refcnt); |
| 2170 | } | 2170 | } |
| 2171 | 2171 | ||
| 2172 | /* Carrier loss detection, dial on demand. The functions netif_carrier_on | 2172 | /* Carrier loss detection, dial on demand. The functions netif_carrier_on |
| @@ -2450,6 +2450,11 @@ static inline void netif_addr_lock(struct net_device *dev) | |||
| 2450 | spin_lock(&dev->addr_list_lock); | 2450 | spin_lock(&dev->addr_list_lock); |
| 2451 | } | 2451 | } |
| 2452 | 2452 | ||
| 2453 | static inline void netif_addr_lock_nested(struct net_device *dev) | ||
| 2454 | { | ||
| 2455 | spin_lock_nested(&dev->addr_list_lock, SINGLE_DEPTH_NESTING); | ||
| 2456 | } | ||
| 2457 | |||
| 2453 | static inline void netif_addr_lock_bh(struct net_device *dev) | 2458 | static inline void netif_addr_lock_bh(struct net_device *dev) |
| 2454 | { | 2459 | { |
| 2455 | spin_lock_bh(&dev->addr_list_lock); | 2460 | spin_lock_bh(&dev->addr_list_lock); |
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h index 9e3a2838291b..0d3dd66322ec 100644 --- a/include/linux/netfilter/nf_conntrack_common.h +++ b/include/linux/netfilter/nf_conntrack_common.h | |||
| @@ -83,10 +83,6 @@ enum ip_conntrack_status { | |||
| 83 | /* Conntrack is a fake untracked entry */ | 83 | /* Conntrack is a fake untracked entry */ |
| 84 | IPS_UNTRACKED_BIT = 12, | 84 | IPS_UNTRACKED_BIT = 12, |
| 85 | IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT), | 85 | IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT), |
| 86 | |||
| 87 | /* Conntrack has a userspace helper. */ | ||
| 88 | IPS_USERSPACE_HELPER_BIT = 13, | ||
| 89 | IPS_USERSPACE_HELPER = (1 << IPS_USERSPACE_HELPER_BIT), | ||
| 90 | }; | 86 | }; |
| 91 | 87 | ||
| 92 | /* Connection tracking event types */ | 88 | /* Connection tracking event types */ |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 32cddf78b13e..8d674a786744 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
| @@ -471,7 +471,7 @@ DECLARE_PER_CPU(seqcount_t, xt_recseq); | |||
| 471 | * | 471 | * |
| 472 | * Begin packet processing : all readers must wait the end | 472 | * Begin packet processing : all readers must wait the end |
| 473 | * 1) Must be called with preemption disabled | 473 | * 1) Must be called with preemption disabled |
| 474 | * 2) softirqs must be disabled too (or we should use irqsafe_cpu_add()) | 474 | * 2) softirqs must be disabled too (or we should use this_cpu_add()) |
| 475 | * Returns : | 475 | * Returns : |
| 476 | * 1 if no recursion on this cpu | 476 | * 1 if no recursion on this cpu |
| 477 | * 0 if recursion detected | 477 | * 0 if recursion detected |
| @@ -503,7 +503,7 @@ static inline unsigned int xt_write_recseq_begin(void) | |||
| 503 | * | 503 | * |
| 504 | * End packet processing : all readers can proceed | 504 | * End packet processing : all readers can proceed |
| 505 | * 1) Must be called with preemption disabled | 505 | * 1) Must be called with preemption disabled |
| 506 | * 2) softirqs must be disabled too (or we should use irqsafe_cpu_add()) | 506 | * 2) softirqs must be disabled too (or we should use this_cpu_add()) |
| 507 | */ | 507 | */ |
| 508 | static inline void xt_write_recseq_end(unsigned int addend) | 508 | static inline void xt_write_recseq_end(unsigned int addend) |
| 509 | { | 509 | { |
diff --git a/include/linux/netfilter/xt_CT.h b/include/linux/netfilter/xt_CT.h index 6390f0992f36..b56e76811c04 100644 --- a/include/linux/netfilter/xt_CT.h +++ b/include/linux/netfilter/xt_CT.h | |||
| @@ -3,8 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | #define XT_CT_NOTRACK 0x1 | 6 | #define XT_CT_NOTRACK 0x1 |
| 7 | #define XT_CT_USERSPACE_HELPER 0x2 | ||
| 8 | 7 | ||
| 9 | struct xt_ct_target_info { | 8 | struct xt_ct_target_info { |
| 10 | __u16 flags; | 9 | __u16 flags; |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index b5479df8378d..ba4d7656ecfd 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
| @@ -153,6 +153,7 @@ struct nfs_server { | |||
| 153 | struct rb_root openowner_id; | 153 | struct rb_root openowner_id; |
| 154 | struct rb_root lockowner_id; | 154 | struct rb_root lockowner_id; |
| 155 | #endif | 155 | #endif |
| 156 | struct list_head state_owners_lru; | ||
| 156 | struct list_head layouts; | 157 | struct list_head layouts; |
| 157 | struct list_head delegations; | 158 | struct list_head delegations; |
| 158 | void (*destroy)(struct nfs_server *); | 159 | void (*destroy)(struct nfs_server *); |
diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h index ae7d6a380dae..308c18877018 100644 --- a/include/linux/nfs_idmap.h +++ b/include/linux/nfs_idmap.h | |||
| @@ -66,6 +66,8 @@ struct idmap_msg { | |||
| 66 | /* Forward declaration to make this header independent of others */ | 66 | /* Forward declaration to make this header independent of others */ |
| 67 | struct nfs_client; | 67 | struct nfs_client; |
| 68 | struct nfs_server; | 68 | struct nfs_server; |
| 69 | struct nfs_fattr; | ||
| 70 | struct nfs4_string; | ||
| 69 | 71 | ||
| 70 | #ifdef CONFIG_NFS_USE_NEW_IDMAPPER | 72 | #ifdef CONFIG_NFS_USE_NEW_IDMAPPER |
| 71 | 73 | ||
| @@ -97,6 +99,12 @@ void nfs_idmap_delete(struct nfs_client *); | |||
| 97 | 99 | ||
| 98 | #endif /* CONFIG_NFS_USE_NEW_IDMAPPER */ | 100 | #endif /* CONFIG_NFS_USE_NEW_IDMAPPER */ |
| 99 | 101 | ||
| 102 | void nfs_fattr_init_names(struct nfs_fattr *fattr, | ||
| 103 | struct nfs4_string *owner_name, | ||
| 104 | struct nfs4_string *group_name); | ||
| 105 | void nfs_fattr_free_names(struct nfs_fattr *); | ||
| 106 | void nfs_fattr_map_and_free_names(struct nfs_server *, struct nfs_fattr *); | ||
| 107 | |||
| 100 | int nfs_map_name_to_uid(const struct nfs_server *, const char *, size_t, __u32 *); | 108 | int nfs_map_name_to_uid(const struct nfs_server *, const char *, size_t, __u32 *); |
| 101 | int nfs_map_group_to_gid(const struct nfs_server *, const char *, size_t, __u32 *); | 109 | int nfs_map_group_to_gid(const struct nfs_server *, const char *, size_t, __u32 *); |
| 102 | int nfs_map_uid_to_name(const struct nfs_server *, __u32, char *, size_t); | 110 | int nfs_map_uid_to_name(const struct nfs_server *, __u32, char *, size_t); |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 2a7c533be5dd..a764cef06b73 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -18,6 +18,11 @@ | |||
| 18 | /* Forward declaration for NFS v3 */ | 18 | /* Forward declaration for NFS v3 */ |
| 19 | struct nfs4_secinfo_flavors; | 19 | struct nfs4_secinfo_flavors; |
| 20 | 20 | ||
| 21 | struct nfs4_string { | ||
| 22 | unsigned int len; | ||
| 23 | char *data; | ||
| 24 | }; | ||
| 25 | |||
| 21 | struct nfs_fsid { | 26 | struct nfs_fsid { |
| 22 | uint64_t major; | 27 | uint64_t major; |
| 23 | uint64_t minor; | 28 | uint64_t minor; |
| @@ -61,6 +66,8 @@ struct nfs_fattr { | |||
| 61 | struct timespec pre_ctime; /* pre_op_attr.ctime */ | 66 | struct timespec pre_ctime; /* pre_op_attr.ctime */ |
| 62 | unsigned long time_start; | 67 | unsigned long time_start; |
| 63 | unsigned long gencount; | 68 | unsigned long gencount; |
| 69 | struct nfs4_string *owner_name; | ||
| 70 | struct nfs4_string *group_name; | ||
| 64 | }; | 71 | }; |
| 65 | 72 | ||
| 66 | #define NFS_ATTR_FATTR_TYPE (1U << 0) | 73 | #define NFS_ATTR_FATTR_TYPE (1U << 0) |
| @@ -85,6 +92,8 @@ struct nfs_fattr { | |||
| 85 | #define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */ | 92 | #define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */ |
| 86 | #define NFS_ATTR_FATTR_MOUNTPOINT (1U << 20) /* Treat as mountpoint */ | 93 | #define NFS_ATTR_FATTR_MOUNTPOINT (1U << 20) /* Treat as mountpoint */ |
| 87 | #define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 21) | 94 | #define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 21) |
| 95 | #define NFS_ATTR_FATTR_OWNER_NAME (1U << 22) | ||
| 96 | #define NFS_ATTR_FATTR_GROUP_NAME (1U << 23) | ||
| 88 | 97 | ||
| 89 | #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \ | 98 | #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \ |
| 90 | | NFS_ATTR_FATTR_MODE \ | 99 | | NFS_ATTR_FATTR_MODE \ |
| @@ -324,6 +333,7 @@ struct nfs_openargs { | |||
| 324 | const struct qstr * name; | 333 | const struct qstr * name; |
| 325 | const struct nfs_server *server; /* Needed for ID mapping */ | 334 | const struct nfs_server *server; /* Needed for ID mapping */ |
| 326 | const u32 * bitmask; | 335 | const u32 * bitmask; |
| 336 | const u32 * dir_bitmask; | ||
| 327 | __u32 claim; | 337 | __u32 claim; |
| 328 | struct nfs4_sequence_args seq_args; | 338 | struct nfs4_sequence_args seq_args; |
| 329 | }; | 339 | }; |
| @@ -342,6 +352,8 @@ struct nfs_openres { | |||
| 342 | __u32 do_recall; | 352 | __u32 do_recall; |
| 343 | __u64 maxsize; | 353 | __u64 maxsize; |
| 344 | __u32 attrset[NFS4_BITMAP_SIZE]; | 354 | __u32 attrset[NFS4_BITMAP_SIZE]; |
| 355 | struct nfs4_string *owner; | ||
| 356 | struct nfs4_string *group_owner; | ||
| 345 | struct nfs4_sequence_res seq_res; | 357 | struct nfs4_sequence_res seq_res; |
| 346 | }; | 358 | }; |
| 347 | 359 | ||
| @@ -602,11 +614,16 @@ struct nfs_getaclargs { | |||
| 602 | size_t acl_len; | 614 | size_t acl_len; |
| 603 | unsigned int acl_pgbase; | 615 | unsigned int acl_pgbase; |
| 604 | struct page ** acl_pages; | 616 | struct page ** acl_pages; |
| 617 | struct page * acl_scratch; | ||
| 605 | struct nfs4_sequence_args seq_args; | 618 | struct nfs4_sequence_args seq_args; |
| 606 | }; | 619 | }; |
| 607 | 620 | ||
| 621 | /* getxattr ACL interface flags */ | ||
| 622 | #define NFS4_ACL_LEN_REQUEST 0x0001 /* zero length getxattr buffer */ | ||
| 608 | struct nfs_getaclres { | 623 | struct nfs_getaclres { |
| 609 | size_t acl_len; | 624 | size_t acl_len; |
| 625 | size_t acl_data_offset; | ||
| 626 | int acl_flags; | ||
| 610 | struct nfs4_sequence_res seq_res; | 627 | struct nfs4_sequence_res seq_res; |
| 611 | }; | 628 | }; |
| 612 | 629 | ||
| @@ -773,11 +790,6 @@ struct nfs3_getaclres { | |||
| 773 | struct posix_acl * acl_default; | 790 | struct posix_acl * acl_default; |
| 774 | }; | 791 | }; |
| 775 | 792 | ||
| 776 | struct nfs4_string { | ||
| 777 | unsigned int len; | ||
| 778 | char *data; | ||
| 779 | }; | ||
| 780 | |||
| 781 | #ifdef CONFIG_NFS_V4 | 793 | #ifdef CONFIG_NFS_V4 |
| 782 | 794 | ||
| 783 | typedef u64 clientid4; | 795 | typedef u64 clientid4; |
diff --git a/include/linux/nls.h b/include/linux/nls.h index d47beef08dfd..5dc635f8d79e 100644 --- a/include/linux/nls.h +++ b/include/linux/nls.h | |||
| @@ -43,7 +43,7 @@ enum utf16_endian { | |||
| 43 | UTF16_BIG_ENDIAN | 43 | UTF16_BIG_ENDIAN |
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| 46 | /* nls.c */ | 46 | /* nls_base.c */ |
| 47 | extern int register_nls(struct nls_table *); | 47 | extern int register_nls(struct nls_table *); |
| 48 | extern int unregister_nls(struct nls_table *); | 48 | extern int unregister_nls(struct nls_table *); |
| 49 | extern struct nls_table *load_nls(char *); | 49 | extern struct nls_table *load_nls(char *); |
| @@ -52,7 +52,8 @@ extern struct nls_table *load_nls_default(void); | |||
| 52 | 52 | ||
| 53 | extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu); | 53 | extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu); |
| 54 | extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen); | 54 | extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen); |
| 55 | extern int utf8s_to_utf16s(const u8 *s, int len, wchar_t *pwcs); | 55 | extern int utf8s_to_utf16s(const u8 *s, int len, |
| 56 | enum utf16_endian endian, wchar_t *pwcs, int maxlen); | ||
| 56 | extern int utf16s_to_utf8s(const wchar_t *pwcs, int len, | 57 | extern int utf16s_to_utf8s(const wchar_t *pwcs, int len, |
| 57 | enum utf16_endian endian, u8 *s, int maxlen); | 58 | enum utf16_endian endian, u8 *s, int maxlen); |
| 58 | 59 | ||
diff --git a/include/linux/nvme.h b/include/linux/nvme.h new file mode 100644 index 000000000000..9490a00529f4 --- /dev/null +++ b/include/linux/nvme.h | |||
| @@ -0,0 +1,434 @@ | |||
| 1 | /* | ||
| 2 | * Definitions for the NVM Express interface | ||
| 3 | * Copyright (c) 2011, 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 | #ifndef _LINUX_NVME_H | ||
| 20 | #define _LINUX_NVME_H | ||
| 21 | |||
| 22 | #include <linux/types.h> | ||
| 23 | |||
| 24 | struct nvme_bar { | ||
| 25 | __u64 cap; /* Controller Capabilities */ | ||
| 26 | __u32 vs; /* Version */ | ||
| 27 | __u32 intms; /* Interrupt Mask Set */ | ||
| 28 | __u32 intmc; /* Interrupt Mask Clear */ | ||
| 29 | __u32 cc; /* Controller Configuration */ | ||
| 30 | __u32 rsvd1; /* Reserved */ | ||
| 31 | __u32 csts; /* Controller Status */ | ||
| 32 | __u32 rsvd2; /* Reserved */ | ||
| 33 | __u32 aqa; /* Admin Queue Attributes */ | ||
| 34 | __u64 asq; /* Admin SQ Base Address */ | ||
| 35 | __u64 acq; /* Admin CQ Base Address */ | ||
| 36 | }; | ||
| 37 | |||
| 38 | #define NVME_CAP_TIMEOUT(cap) (((cap) >> 24) & 0xff) | ||
| 39 | #define NVME_CAP_STRIDE(cap) (((cap) >> 32) & 0xf) | ||
| 40 | |||
| 41 | enum { | ||
| 42 | NVME_CC_ENABLE = 1 << 0, | ||
| 43 | NVME_CC_CSS_NVM = 0 << 4, | ||
| 44 | NVME_CC_MPS_SHIFT = 7, | ||
| 45 | NVME_CC_ARB_RR = 0 << 11, | ||
| 46 | NVME_CC_ARB_WRRU = 1 << 11, | ||
| 47 | NVME_CC_ARB_VS = 7 << 11, | ||
| 48 | NVME_CC_SHN_NONE = 0 << 14, | ||
| 49 | NVME_CC_SHN_NORMAL = 1 << 14, | ||
| 50 | NVME_CC_SHN_ABRUPT = 2 << 14, | ||
| 51 | NVME_CC_IOSQES = 6 << 16, | ||
| 52 | NVME_CC_IOCQES = 4 << 20, | ||
| 53 | NVME_CSTS_RDY = 1 << 0, | ||
| 54 | NVME_CSTS_CFS = 1 << 1, | ||
| 55 | NVME_CSTS_SHST_NORMAL = 0 << 2, | ||
| 56 | NVME_CSTS_SHST_OCCUR = 1 << 2, | ||
| 57 | NVME_CSTS_SHST_CMPLT = 2 << 2, | ||
| 58 | }; | ||
| 59 | |||
| 60 | struct nvme_id_power_state { | ||
| 61 | __le16 max_power; /* centiwatts */ | ||
| 62 | __u16 rsvd2; | ||
| 63 | __le32 entry_lat; /* microseconds */ | ||
| 64 | __le32 exit_lat; /* microseconds */ | ||
| 65 | __u8 read_tput; | ||
| 66 | __u8 read_lat; | ||
| 67 | __u8 write_tput; | ||
| 68 | __u8 write_lat; | ||
| 69 | __u8 rsvd16[16]; | ||
| 70 | }; | ||
| 71 | |||
| 72 | #define NVME_VS(major, minor) (major << 16 | minor) | ||
| 73 | |||
| 74 | struct nvme_id_ctrl { | ||
| 75 | __le16 vid; | ||
| 76 | __le16 ssvid; | ||
| 77 | char sn[20]; | ||
| 78 | char mn[40]; | ||
| 79 | char fr[8]; | ||
| 80 | __u8 rab; | ||
| 81 | __u8 ieee[3]; | ||
| 82 | __u8 mic; | ||
| 83 | __u8 mdts; | ||
| 84 | __u8 rsvd78[178]; | ||
| 85 | __le16 oacs; | ||
| 86 | __u8 acl; | ||
| 87 | __u8 aerl; | ||
| 88 | __u8 frmw; | ||
| 89 | __u8 lpa; | ||
| 90 | __u8 elpe; | ||
| 91 | __u8 npss; | ||
| 92 | __u8 rsvd264[248]; | ||
| 93 | __u8 sqes; | ||
| 94 | __u8 cqes; | ||
| 95 | __u8 rsvd514[2]; | ||
| 96 | __le32 nn; | ||
| 97 | __le16 oncs; | ||
| 98 | __le16 fuses; | ||
| 99 | __u8 fna; | ||
| 100 | __u8 vwc; | ||
| 101 | __le16 awun; | ||
| 102 | __le16 awupf; | ||
| 103 | __u8 rsvd530[1518]; | ||
| 104 | struct nvme_id_power_state psd[32]; | ||
| 105 | __u8 vs[1024]; | ||
| 106 | }; | ||
| 107 | |||
| 108 | struct nvme_lbaf { | ||
| 109 | __le16 ms; | ||
| 110 | __u8 ds; | ||
| 111 | __u8 rp; | ||
| 112 | }; | ||
| 113 | |||
| 114 | struct nvme_id_ns { | ||
| 115 | __le64 nsze; | ||
| 116 | __le64 ncap; | ||
| 117 | __le64 nuse; | ||
| 118 | __u8 nsfeat; | ||
| 119 | __u8 nlbaf; | ||
| 120 | __u8 flbas; | ||
| 121 | __u8 mc; | ||
| 122 | __u8 dpc; | ||
| 123 | __u8 dps; | ||
| 124 | __u8 rsvd30[98]; | ||
| 125 | struct nvme_lbaf lbaf[16]; | ||
| 126 | __u8 rsvd192[192]; | ||
| 127 | __u8 vs[3712]; | ||
| 128 | }; | ||
| 129 | |||
| 130 | enum { | ||
| 131 | NVME_NS_FEAT_THIN = 1 << 0, | ||
| 132 | NVME_LBAF_RP_BEST = 0, | ||
| 133 | NVME_LBAF_RP_BETTER = 1, | ||
| 134 | NVME_LBAF_RP_GOOD = 2, | ||
| 135 | NVME_LBAF_RP_DEGRADED = 3, | ||
| 136 | }; | ||
| 137 | |||
| 138 | struct nvme_lba_range_type { | ||
| 139 | __u8 type; | ||
| 140 | __u8 attributes; | ||
| 141 | __u8 rsvd2[14]; | ||
| 142 | __u64 slba; | ||
| 143 | __u64 nlb; | ||
| 144 | __u8 guid[16]; | ||
| 145 | __u8 rsvd48[16]; | ||
| 146 | }; | ||
| 147 | |||
| 148 | enum { | ||
| 149 | NVME_LBART_TYPE_FS = 0x01, | ||
| 150 | NVME_LBART_TYPE_RAID = 0x02, | ||
| 151 | NVME_LBART_TYPE_CACHE = 0x03, | ||
| 152 | NVME_LBART_TYPE_SWAP = 0x04, | ||
| 153 | |||
| 154 | NVME_LBART_ATTRIB_TEMP = 1 << 0, | ||
| 155 | NVME_LBART_ATTRIB_HIDE = 1 << 1, | ||
| 156 | }; | ||
| 157 | |||
| 158 | /* I/O commands */ | ||
| 159 | |||
| 160 | enum nvme_opcode { | ||
| 161 | nvme_cmd_flush = 0x00, | ||
| 162 | nvme_cmd_write = 0x01, | ||
| 163 | nvme_cmd_read = 0x02, | ||
| 164 | nvme_cmd_write_uncor = 0x04, | ||
| 165 | nvme_cmd_compare = 0x05, | ||
| 166 | nvme_cmd_dsm = 0x09, | ||
| 167 | }; | ||
| 168 | |||
| 169 | struct nvme_common_command { | ||
| 170 | __u8 opcode; | ||
| 171 | __u8 flags; | ||
| 172 | __u16 command_id; | ||
| 173 | __le32 nsid; | ||
| 174 | __u32 cdw2[2]; | ||
| 175 | __le64 metadata; | ||
| 176 | __le64 prp1; | ||
| 177 | __le64 prp2; | ||
| 178 | __u32 cdw10[6]; | ||
| 179 | }; | ||
| 180 | |||
| 181 | struct nvme_rw_command { | ||
| 182 | __u8 opcode; | ||
| 183 | __u8 flags; | ||
| 184 | __u16 command_id; | ||
| 185 | __le32 nsid; | ||
| 186 | __u64 rsvd2; | ||
| 187 | __le64 metadata; | ||
| 188 | __le64 prp1; | ||
| 189 | __le64 prp2; | ||
| 190 | __le64 slba; | ||
| 191 | __le16 length; | ||
| 192 | __le16 control; | ||
| 193 | __le32 dsmgmt; | ||
| 194 | __le32 reftag; | ||
| 195 | __le16 apptag; | ||
| 196 | __le16 appmask; | ||
| 197 | }; | ||
| 198 | |||
| 199 | enum { | ||
| 200 | NVME_RW_LR = 1 << 15, | ||
| 201 | NVME_RW_FUA = 1 << 14, | ||
| 202 | NVME_RW_DSM_FREQ_UNSPEC = 0, | ||
| 203 | NVME_RW_DSM_FREQ_TYPICAL = 1, | ||
| 204 | NVME_RW_DSM_FREQ_RARE = 2, | ||
| 205 | NVME_RW_DSM_FREQ_READS = 3, | ||
| 206 | NVME_RW_DSM_FREQ_WRITES = 4, | ||
| 207 | NVME_RW_DSM_FREQ_RW = 5, | ||
| 208 | NVME_RW_DSM_FREQ_ONCE = 6, | ||
| 209 | NVME_RW_DSM_FREQ_PREFETCH = 7, | ||
| 210 | NVME_RW_DSM_FREQ_TEMP = 8, | ||
| 211 | NVME_RW_DSM_LATENCY_NONE = 0 << 4, | ||
| 212 | NVME_RW_DSM_LATENCY_IDLE = 1 << 4, | ||
| 213 | NVME_RW_DSM_LATENCY_NORM = 2 << 4, | ||
| 214 | NVME_RW_DSM_LATENCY_LOW = 3 << 4, | ||
| 215 | NVME_RW_DSM_SEQ_REQ = 1 << 6, | ||
| 216 | NVME_RW_DSM_COMPRESSED = 1 << 7, | ||
| 217 | }; | ||
| 218 | |||
| 219 | /* Admin commands */ | ||
| 220 | |||
| 221 | enum nvme_admin_opcode { | ||
| 222 | nvme_admin_delete_sq = 0x00, | ||
| 223 | nvme_admin_create_sq = 0x01, | ||
| 224 | nvme_admin_get_log_page = 0x02, | ||
| 225 | nvme_admin_delete_cq = 0x04, | ||
| 226 | nvme_admin_create_cq = 0x05, | ||
| 227 | nvme_admin_identify = 0x06, | ||
| 228 | nvme_admin_abort_cmd = 0x08, | ||
| 229 | nvme_admin_set_features = 0x09, | ||
| 230 | nvme_admin_get_features = 0x0a, | ||
| 231 | nvme_admin_async_event = 0x0c, | ||
| 232 | nvme_admin_activate_fw = 0x10, | ||
| 233 | nvme_admin_download_fw = 0x11, | ||
| 234 | nvme_admin_format_nvm = 0x80, | ||
| 235 | nvme_admin_security_send = 0x81, | ||
| 236 | nvme_admin_security_recv = 0x82, | ||
| 237 | }; | ||
| 238 | |||
| 239 | enum { | ||
| 240 | NVME_QUEUE_PHYS_CONTIG = (1 << 0), | ||
| 241 | NVME_CQ_IRQ_ENABLED = (1 << 1), | ||
| 242 | NVME_SQ_PRIO_URGENT = (0 << 1), | ||
| 243 | NVME_SQ_PRIO_HIGH = (1 << 1), | ||
| 244 | NVME_SQ_PRIO_MEDIUM = (2 << 1), | ||
| 245 | NVME_SQ_PRIO_LOW = (3 << 1), | ||
| 246 | NVME_FEAT_ARBITRATION = 0x01, | ||
| 247 | NVME_FEAT_POWER_MGMT = 0x02, | ||
| 248 | NVME_FEAT_LBA_RANGE = 0x03, | ||
| 249 | NVME_FEAT_TEMP_THRESH = 0x04, | ||
| 250 | NVME_FEAT_ERR_RECOVERY = 0x05, | ||
| 251 | NVME_FEAT_VOLATILE_WC = 0x06, | ||
| 252 | NVME_FEAT_NUM_QUEUES = 0x07, | ||
| 253 | NVME_FEAT_IRQ_COALESCE = 0x08, | ||
| 254 | NVME_FEAT_IRQ_CONFIG = 0x09, | ||
| 255 | NVME_FEAT_WRITE_ATOMIC = 0x0a, | ||
| 256 | NVME_FEAT_ASYNC_EVENT = 0x0b, | ||
| 257 | NVME_FEAT_SW_PROGRESS = 0x0c, | ||
| 258 | }; | ||
| 259 | |||
| 260 | struct nvme_identify { | ||
| 261 | __u8 opcode; | ||
| 262 | __u8 flags; | ||
| 263 | __u16 command_id; | ||
| 264 | __le32 nsid; | ||
| 265 | __u64 rsvd2[2]; | ||
| 266 | __le64 prp1; | ||
| 267 | __le64 prp2; | ||
| 268 | __le32 cns; | ||
| 269 | __u32 rsvd11[5]; | ||
| 270 | }; | ||
| 271 | |||
| 272 | struct nvme_features { | ||
| 273 | __u8 opcode; | ||
| 274 | __u8 flags; | ||
| 275 | __u16 command_id; | ||
| 276 | __le32 nsid; | ||
| 277 | __u64 rsvd2[2]; | ||
| 278 | __le64 prp1; | ||
| 279 | __le64 prp2; | ||
| 280 | __le32 fid; | ||
| 281 | __le32 dword11; | ||
| 282 | __u32 rsvd12[4]; | ||
| 283 | }; | ||
| 284 | |||
| 285 | struct nvme_create_cq { | ||
| 286 | __u8 opcode; | ||
| 287 | __u8 flags; | ||
| 288 | __u16 command_id; | ||
| 289 | __u32 rsvd1[5]; | ||
| 290 | __le64 prp1; | ||
| 291 | __u64 rsvd8; | ||
| 292 | __le16 cqid; | ||
| 293 | __le16 qsize; | ||
| 294 | __le16 cq_flags; | ||
| 295 | __le16 irq_vector; | ||
| 296 | __u32 rsvd12[4]; | ||
| 297 | }; | ||
| 298 | |||
| 299 | struct nvme_create_sq { | ||
| 300 | __u8 opcode; | ||
| 301 | __u8 flags; | ||
| 302 | __u16 command_id; | ||
| 303 | __u32 rsvd1[5]; | ||
| 304 | __le64 prp1; | ||
| 305 | __u64 rsvd8; | ||
| 306 | __le16 sqid; | ||
| 307 | __le16 qsize; | ||
| 308 | __le16 sq_flags; | ||
| 309 | __le16 cqid; | ||
| 310 | __u32 rsvd12[4]; | ||
| 311 | }; | ||
| 312 | |||
| 313 | struct nvme_delete_queue { | ||
| 314 | __u8 opcode; | ||
| 315 | __u8 flags; | ||
| 316 | __u16 command_id; | ||
| 317 | __u32 rsvd1[9]; | ||
| 318 | __le16 qid; | ||
| 319 | __u16 rsvd10; | ||
| 320 | __u32 rsvd11[5]; | ||
| 321 | }; | ||
| 322 | |||
| 323 | struct nvme_download_firmware { | ||
| 324 | __u8 opcode; | ||
| 325 | __u8 flags; | ||
| 326 | __u16 command_id; | ||
| 327 | __u32 rsvd1[5]; | ||
| 328 | __le64 prp1; | ||
| 329 | __le64 prp2; | ||
| 330 | __le32 numd; | ||
| 331 | __le32 offset; | ||
| 332 | __u32 rsvd12[4]; | ||
| 333 | }; | ||
| 334 | |||
| 335 | struct nvme_command { | ||
| 336 | union { | ||
| 337 | struct nvme_common_command common; | ||
| 338 | struct nvme_rw_command rw; | ||
| 339 | struct nvme_identify identify; | ||
| 340 | struct nvme_features features; | ||
| 341 | struct nvme_create_cq create_cq; | ||
| 342 | struct nvme_create_sq create_sq; | ||
| 343 | struct nvme_delete_queue delete_queue; | ||
| 344 | struct nvme_download_firmware dlfw; | ||
| 345 | }; | ||
| 346 | }; | ||
| 347 | |||
| 348 | enum { | ||
| 349 | NVME_SC_SUCCESS = 0x0, | ||
| 350 | NVME_SC_INVALID_OPCODE = 0x1, | ||
| 351 | NVME_SC_INVALID_FIELD = 0x2, | ||
| 352 | NVME_SC_CMDID_CONFLICT = 0x3, | ||
| 353 | NVME_SC_DATA_XFER_ERROR = 0x4, | ||
| 354 | NVME_SC_POWER_LOSS = 0x5, | ||
| 355 | NVME_SC_INTERNAL = 0x6, | ||
| 356 | NVME_SC_ABORT_REQ = 0x7, | ||
| 357 | NVME_SC_ABORT_QUEUE = 0x8, | ||
| 358 | NVME_SC_FUSED_FAIL = 0x9, | ||
| 359 | NVME_SC_FUSED_MISSING = 0xa, | ||
| 360 | NVME_SC_INVALID_NS = 0xb, | ||
| 361 | NVME_SC_LBA_RANGE = 0x80, | ||
| 362 | NVME_SC_CAP_EXCEEDED = 0x81, | ||
| 363 | NVME_SC_NS_NOT_READY = 0x82, | ||
| 364 | NVME_SC_CQ_INVALID = 0x100, | ||
| 365 | NVME_SC_QID_INVALID = 0x101, | ||
| 366 | NVME_SC_QUEUE_SIZE = 0x102, | ||
| 367 | NVME_SC_ABORT_LIMIT = 0x103, | ||
| 368 | NVME_SC_ABORT_MISSING = 0x104, | ||
| 369 | NVME_SC_ASYNC_LIMIT = 0x105, | ||
| 370 | NVME_SC_FIRMWARE_SLOT = 0x106, | ||
| 371 | NVME_SC_FIRMWARE_IMAGE = 0x107, | ||
| 372 | NVME_SC_INVALID_VECTOR = 0x108, | ||
| 373 | NVME_SC_INVALID_LOG_PAGE = 0x109, | ||
| 374 | NVME_SC_INVALID_FORMAT = 0x10a, | ||
| 375 | NVME_SC_BAD_ATTRIBUTES = 0x180, | ||
| 376 | NVME_SC_WRITE_FAULT = 0x280, | ||
| 377 | NVME_SC_READ_ERROR = 0x281, | ||
| 378 | NVME_SC_GUARD_CHECK = 0x282, | ||
| 379 | NVME_SC_APPTAG_CHECK = 0x283, | ||
| 380 | NVME_SC_REFTAG_CHECK = 0x284, | ||
| 381 | NVME_SC_COMPARE_FAILED = 0x285, | ||
| 382 | NVME_SC_ACCESS_DENIED = 0x286, | ||
| 383 | }; | ||
| 384 | |||
| 385 | struct nvme_completion { | ||
| 386 | __le32 result; /* Used by admin commands to return data */ | ||
| 387 | __u32 rsvd; | ||
| 388 | __le16 sq_head; /* how much of this queue may be reclaimed */ | ||
| 389 | __le16 sq_id; /* submission queue that generated this entry */ | ||
| 390 | __u16 command_id; /* of the command which completed */ | ||
| 391 | __le16 status; /* did the command fail, and if so, why? */ | ||
| 392 | }; | ||
| 393 | |||
| 394 | struct nvme_user_io { | ||
| 395 | __u8 opcode; | ||
| 396 | __u8 flags; | ||
| 397 | __u16 control; | ||
| 398 | __u16 nblocks; | ||
| 399 | __u16 rsvd; | ||
| 400 | __u64 metadata; | ||
| 401 | __u64 addr; | ||
| 402 | __u64 slba; | ||
| 403 | __u32 dsmgmt; | ||
| 404 | __u32 reftag; | ||
| 405 | __u16 apptag; | ||
| 406 | __u16 appmask; | ||
| 407 | }; | ||
| 408 | |||
| 409 | struct nvme_admin_cmd { | ||
| 410 | __u8 opcode; | ||
| 411 | __u8 flags; | ||
| 412 | __u16 rsvd1; | ||
| 413 | __u32 nsid; | ||
| 414 | __u32 cdw2; | ||
| 415 | __u32 cdw3; | ||
| 416 | __u64 metadata; | ||
| 417 | __u64 addr; | ||
| 418 | __u32 metadata_len; | ||
| 419 | __u32 data_len; | ||
| 420 | __u32 cdw10; | ||
| 421 | __u32 cdw11; | ||
| 422 | __u32 cdw12; | ||
| 423 | __u32 cdw13; | ||
| 424 | __u32 cdw14; | ||
| 425 | __u32 cdw15; | ||
| 426 | __u32 timeout_ms; | ||
| 427 | __u32 result; | ||
| 428 | }; | ||
| 429 | |||
| 430 | #define NVME_IOCTL_ID _IO('N', 0x40) | ||
| 431 | #define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd) | ||
| 432 | #define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io) | ||
| 433 | |||
| 434 | #endif /* _LINUX_NVME_H */ | ||
diff --git a/include/linux/oom.h b/include/linux/oom.h index 6f9d04a85336..552fba9c7d5a 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
| @@ -43,7 +43,7 @@ enum oom_constraint { | |||
| 43 | extern void compare_swap_oom_score_adj(int old_val, int new_val); | 43 | extern void compare_swap_oom_score_adj(int old_val, int new_val); |
| 44 | extern int test_set_oom_score_adj(int new_val); | 44 | extern int test_set_oom_score_adj(int new_val); |
| 45 | 45 | ||
| 46 | extern unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, | 46 | extern unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *memcg, |
| 47 | const nodemask_t *nodemask, unsigned long totalpages); | 47 | const nodemask_t *nodemask, unsigned long totalpages); |
| 48 | extern int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); | 48 | extern int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); |
| 49 | extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); | 49 | extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); |
diff --git a/include/linux/page-debug-flags.h b/include/linux/page-debug-flags.h index b0638fd91e92..22691f614043 100644 --- a/include/linux/page-debug-flags.h +++ b/include/linux/page-debug-flags.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | enum page_debug_flags { | 14 | enum page_debug_flags { |
| 15 | PAGE_DEBUG_FLAG_POISON, /* Page is poisoned */ | 15 | PAGE_DEBUG_FLAG_POISON, /* Page is poisoned */ |
| 16 | PAGE_DEBUG_FLAG_GUARD, | ||
| 16 | }; | 17 | }; |
| 17 | 18 | ||
| 18 | /* | 19 | /* |
| @@ -21,7 +22,8 @@ enum page_debug_flags { | |||
| 21 | */ | 22 | */ |
| 22 | 23 | ||
| 23 | #ifdef CONFIG_WANT_PAGE_DEBUG_FLAGS | 24 | #ifdef CONFIG_WANT_PAGE_DEBUG_FLAGS |
| 24 | #if !defined(CONFIG_PAGE_POISONING) \ | 25 | #if !defined(CONFIG_PAGE_POISONING) && \ |
| 26 | !defined(CONFIG_PAGE_GUARD) \ | ||
| 25 | /* && !defined(CONFIG_PAGE_DEBUG_SOMETHING_ELSE) && ... */ | 27 | /* && !defined(CONFIG_PAGE_DEBUG_SOMETHING_ELSE) && ... */ |
| 26 | #error WANT_PAGE_DEBUG_FLAGS is turned on with no debug features! | 28 | #error WANT_PAGE_DEBUG_FLAGS is turned on with no debug features! |
| 27 | #endif | 29 | #endif |
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index 961ecc7d30bc..a2d11771c84b 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
| @@ -10,8 +10,6 @@ enum { | |||
| 10 | /* flags for mem_cgroup and file and I/O status */ | 10 | /* flags for mem_cgroup and file and I/O status */ |
| 11 | PCG_MOVE_LOCK, /* For race between move_account v.s. following bits */ | 11 | PCG_MOVE_LOCK, /* For race between move_account v.s. following bits */ |
| 12 | PCG_FILE_MAPPED, /* page is accounted as "mapped" */ | 12 | PCG_FILE_MAPPED, /* page is accounted as "mapped" */ |
| 13 | /* No lock in page_cgroup */ | ||
| 14 | PCG_ACCT_LRU, /* page has been accounted for (under lru_lock) */ | ||
| 15 | __NR_PCG_FLAGS, | 13 | __NR_PCG_FLAGS, |
| 16 | }; | 14 | }; |
| 17 | 15 | ||
| @@ -31,7 +29,6 @@ enum { | |||
| 31 | struct page_cgroup { | 29 | struct page_cgroup { |
| 32 | unsigned long flags; | 30 | unsigned long flags; |
| 33 | struct mem_cgroup *mem_cgroup; | 31 | struct mem_cgroup *mem_cgroup; |
| 34 | struct list_head lru; /* per cgroup LRU list */ | ||
| 35 | }; | 32 | }; |
| 36 | 33 | ||
| 37 | void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat); | 34 | void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat); |
| @@ -76,12 +73,6 @@ TESTPCGFLAG(Used, USED) | |||
| 76 | CLEARPCGFLAG(Used, USED) | 73 | CLEARPCGFLAG(Used, USED) |
| 77 | SETPCGFLAG(Used, USED) | 74 | SETPCGFLAG(Used, USED) |
| 78 | 75 | ||
| 79 | SETPCGFLAG(AcctLRU, ACCT_LRU) | ||
| 80 | CLEARPCGFLAG(AcctLRU, ACCT_LRU) | ||
| 81 | TESTPCGFLAG(AcctLRU, ACCT_LRU) | ||
| 82 | TESTCLEARPCGFLAG(AcctLRU, ACCT_LRU) | ||
| 83 | |||
| 84 | |||
| 85 | SETPCGFLAG(FileMapped, FILE_MAPPED) | 76 | SETPCGFLAG(FileMapped, FILE_MAPPED) |
| 86 | CLEARPCGFLAG(FileMapped, FILE_MAPPED) | 77 | CLEARPCGFLAG(FileMapped, FILE_MAPPED) |
| 87 | TESTPCGFLAG(FileMapped, FILE_MAPPED) | 78 | TESTPCGFLAG(FileMapped, FILE_MAPPED) |
| @@ -122,39 +113,6 @@ static inline void move_unlock_page_cgroup(struct page_cgroup *pc, | |||
| 122 | local_irq_restore(*flags); | 113 | local_irq_restore(*flags); |
| 123 | } | 114 | } |
| 124 | 115 | ||
| 125 | #ifdef CONFIG_SPARSEMEM | ||
| 126 | #define PCG_ARRAYID_WIDTH SECTIONS_SHIFT | ||
| 127 | #else | ||
| 128 | #define PCG_ARRAYID_WIDTH NODES_SHIFT | ||
| 129 | #endif | ||
| 130 | |||
| 131 | #if (PCG_ARRAYID_WIDTH > BITS_PER_LONG - NR_PCG_FLAGS) | ||
| 132 | #error Not enough space left in pc->flags to store page_cgroup array IDs | ||
| 133 | #endif | ||
| 134 | |||
| 135 | /* pc->flags: ARRAY-ID | FLAGS */ | ||
| 136 | |||
| 137 | #define PCG_ARRAYID_MASK ((1UL << PCG_ARRAYID_WIDTH) - 1) | ||
| 138 | |||
| 139 | #define PCG_ARRAYID_OFFSET (BITS_PER_LONG - PCG_ARRAYID_WIDTH) | ||
| 140 | /* | ||
| 141 | * Zero the shift count for non-existent fields, to prevent compiler | ||
| 142 | * warnings and ensure references are optimized away. | ||
| 143 | */ | ||
| 144 | #define PCG_ARRAYID_SHIFT (PCG_ARRAYID_OFFSET * (PCG_ARRAYID_WIDTH != 0)) | ||
| 145 | |||
| 146 | static inline void set_page_cgroup_array_id(struct page_cgroup *pc, | ||
| 147 | unsigned long id) | ||
| 148 | { | ||
| 149 | pc->flags &= ~(PCG_ARRAYID_MASK << PCG_ARRAYID_SHIFT); | ||
| 150 | pc->flags |= (id & PCG_ARRAYID_MASK) << PCG_ARRAYID_SHIFT; | ||
| 151 | } | ||
| 152 | |||
| 153 | static inline unsigned long page_cgroup_array_id(struct page_cgroup *pc) | ||
| 154 | { | ||
| 155 | return (pc->flags >> PCG_ARRAYID_SHIFT) & PCG_ARRAYID_MASK; | ||
| 156 | } | ||
| 157 | |||
| 158 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 116 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
| 159 | struct page_cgroup; | 117 | struct page_cgroup; |
| 160 | 118 | ||
| @@ -183,7 +141,7 @@ static inline void __init page_cgroup_init_flatmem(void) | |||
| 183 | extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent, | 141 | extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent, |
| 184 | unsigned short old, unsigned short new); | 142 | unsigned short old, unsigned short new); |
| 185 | extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); | 143 | extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); |
| 186 | extern unsigned short lookup_swap_cgroup(swp_entry_t ent); | 144 | extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent); |
| 187 | extern int swap_cgroup_swapon(int type, unsigned long max_pages); | 145 | extern int swap_cgroup_swapon(int type, unsigned long max_pages); |
| 188 | extern void swap_cgroup_swapoff(int type); | 146 | extern void swap_cgroup_swapoff(int type); |
| 189 | #else | 147 | #else |
| @@ -195,7 +153,7 @@ unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id) | |||
| 195 | } | 153 | } |
| 196 | 154 | ||
| 197 | static inline | 155 | static inline |
| 198 | unsigned short lookup_swap_cgroup(swp_entry_t ent) | 156 | unsigned short lookup_swap_cgroup_id(swp_entry_t ent) |
| 199 | { | 157 | { |
| 200 | return 0; | 158 | return 0; |
| 201 | } | 159 | } |
diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h index bab82f4c571c..2aa12b8499c0 100644 --- a/include/linux/pagevec.h +++ b/include/linux/pagevec.h | |||
| @@ -21,9 +21,7 @@ struct pagevec { | |||
| 21 | }; | 21 | }; |
| 22 | 22 | ||
| 23 | void __pagevec_release(struct pagevec *pvec); | 23 | void __pagevec_release(struct pagevec *pvec); |
| 24 | void __pagevec_free(struct pagevec *pvec); | 24 | void __pagevec_lru_add(struct pagevec *pvec, enum lru_list lru); |
| 25 | void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru); | ||
| 26 | void pagevec_strip(struct pagevec *pvec); | ||
| 27 | unsigned pagevec_lookup(struct pagevec *pvec, struct address_space *mapping, | 25 | unsigned pagevec_lookup(struct pagevec *pvec, struct address_space *mapping, |
| 28 | pgoff_t start, unsigned nr_pages); | 26 | pgoff_t start, unsigned nr_pages); |
| 29 | unsigned pagevec_lookup_tag(struct pagevec *pvec, | 27 | unsigned pagevec_lookup_tag(struct pagevec *pvec, |
| @@ -60,37 +58,30 @@ static inline unsigned pagevec_add(struct pagevec *pvec, struct page *page) | |||
| 60 | return pagevec_space(pvec); | 58 | return pagevec_space(pvec); |
| 61 | } | 59 | } |
| 62 | 60 | ||
| 63 | |||
| 64 | static inline void pagevec_release(struct pagevec *pvec) | 61 | static inline void pagevec_release(struct pagevec *pvec) |
| 65 | { | 62 | { |
| 66 | if (pagevec_count(pvec)) | 63 | if (pagevec_count(pvec)) |
| 67 | __pagevec_release(pvec); | 64 | __pagevec_release(pvec); |
| 68 | } | 65 | } |
| 69 | 66 | ||
| 70 | static inline void pagevec_free(struct pagevec *pvec) | ||
| 71 | { | ||
| 72 | if (pagevec_count(pvec)) | ||
| 73 | __pagevec_free(pvec); | ||
| 74 | } | ||
| 75 | |||
| 76 | static inline void __pagevec_lru_add_anon(struct pagevec *pvec) | 67 | static inline void __pagevec_lru_add_anon(struct pagevec *pvec) |
| 77 | { | 68 | { |
| 78 | ____pagevec_lru_add(pvec, LRU_INACTIVE_ANON); | 69 | __pagevec_lru_add(pvec, LRU_INACTIVE_ANON); |
| 79 | } | 70 | } |
| 80 | 71 | ||
| 81 | static inline void __pagevec_lru_add_active_anon(struct pagevec *pvec) | 72 | static inline void __pagevec_lru_add_active_anon(struct pagevec *pvec) |
| 82 | { | 73 | { |
| 83 | ____pagevec_lru_add(pvec, LRU_ACTIVE_ANON); | 74 | __pagevec_lru_add(pvec, LRU_ACTIVE_ANON); |
| 84 | } | 75 | } |
| 85 | 76 | ||
| 86 | static inline void __pagevec_lru_add_file(struct pagevec *pvec) | 77 | static inline void __pagevec_lru_add_file(struct pagevec *pvec) |
| 87 | { | 78 | { |
| 88 | ____pagevec_lru_add(pvec, LRU_INACTIVE_FILE); | 79 | __pagevec_lru_add(pvec, LRU_INACTIVE_FILE); |
| 89 | } | 80 | } |
| 90 | 81 | ||
| 91 | static inline void __pagevec_lru_add_active_file(struct pagevec *pvec) | 82 | static inline void __pagevec_lru_add_active_file(struct pagevec *pvec) |
| 92 | { | 83 | { |
| 93 | ____pagevec_lru_add(pvec, LRU_ACTIVE_FILE); | 84 | __pagevec_lru_add(pvec, LRU_ACTIVE_FILE); |
| 94 | } | 85 | } |
| 95 | 86 | ||
| 96 | static inline void pagevec_lru_add_file(struct pagevec *pvec) | 87 | static inline void pagevec_lru_add_file(struct pagevec *pvec) |
diff --git a/include/linux/patchkey.h b/include/linux/patchkey.h index d974a6e92372..aefda0ec6e62 100644 --- a/include/linux/patchkey.h +++ b/include/linux/patchkey.h | |||
| @@ -32,7 +32,8 @@ | |||
| 32 | # else | 32 | # else |
| 33 | # error "could not determine byte order" | 33 | # error "could not determine byte order" |
| 34 | # endif | 34 | # endif |
| 35 | #elif defined(__BYTE_ORDER) | 35 | #else |
| 36 | #if defined(__BYTE_ORDER) | ||
| 36 | # if __BYTE_ORDER == __BIG_ENDIAN | 37 | # if __BYTE_ORDER == __BIG_ENDIAN |
| 37 | # define _PATCHKEY(id) (0xfd00|id) | 38 | # define _PATCHKEY(id) (0xfd00|id) |
| 38 | # elif __BYTE_ORDER == __LITTLE_ENDIAN | 39 | # elif __BYTE_ORDER == __LITTLE_ENDIAN |
| @@ -41,5 +42,6 @@ | |||
| 41 | # error "could not determine byte order" | 42 | # error "could not determine byte order" |
| 42 | # endif | 43 | # endif |
| 43 | #endif | 44 | #endif |
| 45 | #endif | ||
| 44 | 46 | ||
| 45 | #endif /* _LINUX_PATCHKEY_H */ | 47 | #endif /* _LINUX_PATCHKEY_H */ |
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h index 7cea7b6c1413..c8320144fe79 100644 --- a/include/linux/pci-aspm.h +++ b/include/linux/pci-aspm.h | |||
| @@ -29,7 +29,7 @@ extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); | |||
| 29 | extern void pcie_aspm_powersave_config_link(struct pci_dev *pdev); | 29 | extern void pcie_aspm_powersave_config_link(struct pci_dev *pdev); |
| 30 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); | 30 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); |
| 31 | extern void pci_disable_link_state_locked(struct pci_dev *pdev, int state); | 31 | extern void pci_disable_link_state_locked(struct pci_dev *pdev, int state); |
| 32 | extern void pcie_clear_aspm(void); | 32 | extern void pcie_clear_aspm(struct pci_bus *bus); |
| 33 | extern void pcie_no_aspm(void); | 33 | extern void pcie_no_aspm(void); |
| 34 | #else | 34 | #else |
| 35 | static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) | 35 | static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) |
| @@ -47,7 +47,7 @@ static inline void pcie_aspm_powersave_config_link(struct pci_dev *pdev) | |||
| 47 | static inline void pci_disable_link_state(struct pci_dev *pdev, int state) | 47 | static inline void pci_disable_link_state(struct pci_dev *pdev, int state) |
| 48 | { | 48 | { |
| 49 | } | 49 | } |
| 50 | static inline void pcie_clear_aspm(void) | 50 | static inline void pcie_clear_aspm(struct pci_bus *bus) |
| 51 | { | 51 | { |
| 52 | } | 52 | } |
| 53 | static inline void pcie_no_aspm(void) | 53 | static inline void pcie_no_aspm(void) |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 7cda65b5f798..a16b1df3deff 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -111,7 +111,7 @@ enum { | |||
| 111 | PCI_NUM_RESOURCES, | 111 | PCI_NUM_RESOURCES, |
| 112 | 112 | ||
| 113 | /* preserve this for compatibility */ | 113 | /* preserve this for compatibility */ |
| 114 | DEVICE_COUNT_RESOURCE | 114 | DEVICE_COUNT_RESOURCE = PCI_NUM_RESOURCES, |
| 115 | }; | 115 | }; |
| 116 | 116 | ||
| 117 | typedef int __bitwise pci_power_t; | 117 | typedef int __bitwise pci_power_t; |
| @@ -308,7 +308,7 @@ struct pci_dev { | |||
| 308 | unsigned int is_added:1; | 308 | unsigned int is_added:1; |
| 309 | unsigned int is_busmaster:1; /* device is busmaster */ | 309 | unsigned int is_busmaster:1; /* device is busmaster */ |
| 310 | unsigned int no_msi:1; /* device may not use msi */ | 310 | unsigned int no_msi:1; /* device may not use msi */ |
| 311 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ | 311 | unsigned int block_cfg_access:1; /* config space access is blocked */ |
| 312 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ | 312 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ |
| 313 | unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */ | 313 | unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */ |
| 314 | unsigned int msi_enabled:1; | 314 | unsigned int msi_enabled:1; |
| @@ -336,6 +336,7 @@ struct pci_dev { | |||
| 336 | struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */ | 336 | struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */ |
| 337 | #ifdef CONFIG_PCI_MSI | 337 | #ifdef CONFIG_PCI_MSI |
| 338 | struct list_head msi_list; | 338 | struct list_head msi_list; |
| 339 | struct kset *msi_kset; | ||
| 339 | #endif | 340 | #endif |
| 340 | struct pci_vpd *vpd; | 341 | struct pci_vpd *vpd; |
| 341 | #ifdef CONFIG_PCI_ATS | 342 | #ifdef CONFIG_PCI_ATS |
| @@ -660,17 +661,13 @@ extern struct pci_bus *pci_find_bus(int domain, int busnr); | |||
| 660 | void pci_bus_add_devices(const struct pci_bus *bus); | 661 | void pci_bus_add_devices(const struct pci_bus *bus); |
| 661 | struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, | 662 | struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, |
| 662 | struct pci_ops *ops, void *sysdata); | 663 | struct pci_ops *ops, void *sysdata); |
| 663 | static inline struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops, | 664 | struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata); |
| 664 | void *sysdata) | 665 | struct pci_bus *pci_create_root_bus(struct device *parent, int bus, |
| 665 | { | 666 | struct pci_ops *ops, void *sysdata, |
| 666 | struct pci_bus *root_bus; | 667 | struct list_head *resources); |
| 667 | root_bus = pci_scan_bus_parented(NULL, bus, ops, sysdata); | 668 | struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus, |
| 668 | if (root_bus) | 669 | struct pci_ops *ops, void *sysdata, |
| 669 | pci_bus_add_devices(root_bus); | 670 | struct list_head *resources); |
| 670 | return root_bus; | ||
| 671 | } | ||
| 672 | struct pci_bus *pci_create_bus(struct device *parent, int bus, | ||
| 673 | struct pci_ops *ops, void *sysdata); | ||
| 674 | struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, | 671 | struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, |
| 675 | int busnr); | 672 | int busnr); |
| 676 | void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); | 673 | void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); |
| @@ -794,8 +791,11 @@ static inline int pci_is_managed(struct pci_dev *pdev) | |||
| 794 | } | 791 | } |
| 795 | 792 | ||
| 796 | void pci_disable_device(struct pci_dev *dev); | 793 | void pci_disable_device(struct pci_dev *dev); |
| 794 | |||
| 795 | extern unsigned int pcibios_max_latency; | ||
| 797 | void pci_set_master(struct pci_dev *dev); | 796 | void pci_set_master(struct pci_dev *dev); |
| 798 | void pci_clear_master(struct pci_dev *dev); | 797 | void pci_clear_master(struct pci_dev *dev); |
| 798 | |||
| 799 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); | 799 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); |
| 800 | int pci_set_cacheline_size(struct pci_dev *dev); | 800 | int pci_set_cacheline_size(struct pci_dev *dev); |
| 801 | #define HAVE_PCI_SET_MWI | 801 | #define HAVE_PCI_SET_MWI |
| @@ -803,6 +803,9 @@ int __must_check pci_set_mwi(struct pci_dev *dev); | |||
| 803 | int pci_try_set_mwi(struct pci_dev *dev); | 803 | int pci_try_set_mwi(struct pci_dev *dev); |
| 804 | void pci_clear_mwi(struct pci_dev *dev); | 804 | void pci_clear_mwi(struct pci_dev *dev); |
| 805 | void pci_intx(struct pci_dev *dev, int enable); | 805 | void pci_intx(struct pci_dev *dev, int enable); |
| 806 | bool pci_intx_mask_supported(struct pci_dev *dev); | ||
| 807 | bool pci_check_and_mask_intx(struct pci_dev *dev); | ||
| 808 | bool pci_check_and_unmask_intx(struct pci_dev *dev); | ||
| 806 | void pci_msi_off(struct pci_dev *dev); | 809 | void pci_msi_off(struct pci_dev *dev); |
| 807 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); | 810 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); |
| 808 | int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); | 811 | int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); |
| @@ -910,6 +913,8 @@ int pci_request_selected_regions_exclusive(struct pci_dev *, int, const char *); | |||
| 910 | void pci_release_selected_regions(struct pci_dev *, int); | 913 | void pci_release_selected_regions(struct pci_dev *, int); |
| 911 | 914 | ||
| 912 | /* drivers/pci/bus.c */ | 915 | /* drivers/pci/bus.c */ |
| 916 | void pci_add_resource(struct list_head *resources, struct resource *res); | ||
| 917 | void pci_free_resource_list(struct list_head *resources); | ||
| 913 | void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags); | 918 | void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags); |
| 914 | struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n); | 919 | struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n); |
| 915 | void pci_bus_remove_resources(struct pci_bus *bus); | 920 | void pci_bus_remove_resources(struct pci_bus *bus); |
| @@ -1084,8 +1089,9 @@ int ht_create_irq(struct pci_dev *dev, int idx); | |||
| 1084 | void ht_destroy_irq(unsigned int irq); | 1089 | void ht_destroy_irq(unsigned int irq); |
| 1085 | #endif /* CONFIG_HT_IRQ */ | 1090 | #endif /* CONFIG_HT_IRQ */ |
| 1086 | 1091 | ||
| 1087 | extern void pci_block_user_cfg_access(struct pci_dev *dev); | 1092 | extern void pci_cfg_access_lock(struct pci_dev *dev); |
| 1088 | extern void pci_unblock_user_cfg_access(struct pci_dev *dev); | 1093 | extern bool pci_cfg_access_trylock(struct pci_dev *dev); |
| 1094 | extern void pci_cfg_access_unlock(struct pci_dev *dev); | ||
| 1089 | 1095 | ||
| 1090 | /* | 1096 | /* |
| 1091 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), | 1097 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), |
| @@ -1282,10 +1288,13 @@ static inline void pci_release_regions(struct pci_dev *dev) | |||
| 1282 | 1288 | ||
| 1283 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) | 1289 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) |
| 1284 | 1290 | ||
| 1285 | static inline void pci_block_user_cfg_access(struct pci_dev *dev) | 1291 | static inline void pci_block_cfg_access(struct pci_dev *dev) |
| 1286 | { } | 1292 | { } |
| 1287 | 1293 | ||
| 1288 | static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) | 1294 | static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev) |
| 1295 | { return 0; } | ||
| 1296 | |||
| 1297 | static inline void pci_unblock_cfg_access(struct pci_dev *dev) | ||
| 1289 | { } | 1298 | { } |
| 1290 | 1299 | ||
| 1291 | static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) | 1300 | static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) |
| @@ -1423,10 +1432,10 @@ static inline void pci_fixup_device(enum pci_fixup_pass pass, | |||
| 1423 | void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); | 1432 | void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); |
| 1424 | void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); | 1433 | void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); |
| 1425 | void __iomem * const *pcim_iomap_table(struct pci_dev *pdev); | 1434 | void __iomem * const *pcim_iomap_table(struct pci_dev *pdev); |
| 1426 | int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name); | 1435 | int pcim_iomap_regions(struct pci_dev *pdev, int mask, const char *name); |
| 1427 | int pcim_iomap_regions_request_all(struct pci_dev *pdev, u16 mask, | 1436 | int pcim_iomap_regions_request_all(struct pci_dev *pdev, int mask, |
| 1428 | const char *name); | 1437 | const char *name); |
| 1429 | void pcim_iounmap_regions(struct pci_dev *pdev, u16 mask); | 1438 | void pcim_iounmap_regions(struct pci_dev *pdev, int mask); |
| 1430 | 1439 | ||
| 1431 | extern int pci_pci_problems; | 1440 | extern int pci_pci_problems; |
| 1432 | #define PCIPCI_FAIL 1 /* No PCI PCI DMA */ | 1441 | #define PCIPCI_FAIL 1 /* No PCI PCI DMA */ |
| @@ -1445,8 +1454,10 @@ extern u8 pci_cache_line_size; | |||
| 1445 | extern unsigned long pci_hotplug_io_size; | 1454 | extern unsigned long pci_hotplug_io_size; |
| 1446 | extern unsigned long pci_hotplug_mem_size; | 1455 | extern unsigned long pci_hotplug_mem_size; |
| 1447 | 1456 | ||
| 1457 | /* Architecture specific versions may override these (weak) */ | ||
| 1448 | int pcibios_add_platform_entries(struct pci_dev *dev); | 1458 | int pcibios_add_platform_entries(struct pci_dev *dev); |
| 1449 | void pcibios_disable_device(struct pci_dev *dev); | 1459 | void pcibios_disable_device(struct pci_dev *dev); |
| 1460 | void pcibios_set_master(struct pci_dev *dev); | ||
| 1450 | int pcibios_set_pcie_reset_state(struct pci_dev *dev, | 1461 | int pcibios_set_pcie_reset_state(struct pci_dev *dev, |
| 1451 | enum pcie_reset_state state); | 1462 | enum pcie_reset_state state); |
| 1452 | 1463 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 2aaee0ca9da8..31d77af2ef42 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -776,6 +776,29 @@ | |||
| 776 | #define PCI_DEVICE_ID_ELSA_QS3000 0x3000 | 776 | #define PCI_DEVICE_ID_ELSA_QS3000 0x3000 |
| 777 | 777 | ||
| 778 | #define PCI_VENDOR_ID_STMICRO 0x104A | 778 | #define PCI_VENDOR_ID_STMICRO 0x104A |
| 779 | #define PCI_DEVICE_ID_STMICRO_USB_HOST 0xCC00 | ||
| 780 | #define PCI_DEVICE_ID_STMICRO_USB_OHCI 0xCC01 | ||
| 781 | #define PCI_DEVICE_ID_STMICRO_USB_OTG 0xCC02 | ||
| 782 | #define PCI_DEVICE_ID_STMICRO_UART_HWFC 0xCC03 | ||
| 783 | #define PCI_DEVICE_ID_STMICRO_UART_NO_HWFC 0xCC04 | ||
| 784 | #define PCI_DEVICE_ID_STMICRO_SOC_DMA 0xCC05 | ||
| 785 | #define PCI_DEVICE_ID_STMICRO_SATA 0xCC06 | ||
| 786 | #define PCI_DEVICE_ID_STMICRO_I2C 0xCC07 | ||
| 787 | #define PCI_DEVICE_ID_STMICRO_SPI_HS 0xCC08 | ||
| 788 | #define PCI_DEVICE_ID_STMICRO_MAC 0xCC09 | ||
| 789 | #define PCI_DEVICE_ID_STMICRO_SDIO_EMMC 0xCC0A | ||
| 790 | #define PCI_DEVICE_ID_STMICRO_SDIO 0xCC0B | ||
| 791 | #define PCI_DEVICE_ID_STMICRO_GPIO 0xCC0C | ||
| 792 | #define PCI_DEVICE_ID_STMICRO_VIP 0xCC0D | ||
| 793 | #define PCI_DEVICE_ID_STMICRO_AUDIO_ROUTER_DMA 0xCC0E | ||
| 794 | #define PCI_DEVICE_ID_STMICRO_AUDIO_ROUTER_SRCS 0xCC0F | ||
| 795 | #define PCI_DEVICE_ID_STMICRO_AUDIO_ROUTER_MSPS 0xCC10 | ||
| 796 | #define PCI_DEVICE_ID_STMICRO_CAN 0xCC11 | ||
| 797 | #define PCI_DEVICE_ID_STMICRO_MLB 0xCC12 | ||
| 798 | #define PCI_DEVICE_ID_STMICRO_DBP 0xCC13 | ||
| 799 | #define PCI_DEVICE_ID_STMICRO_SATA_PHY 0xCC14 | ||
| 800 | #define PCI_DEVICE_ID_STMICRO_ESRAM 0xCC15 | ||
| 801 | #define PCI_DEVICE_ID_STMICRO_VIC 0xCC16 | ||
| 779 | 802 | ||
| 780 | #define PCI_VENDOR_ID_BUSLOGIC 0x104B | 803 | #define PCI_VENDOR_ID_BUSLOGIC 0x104B |
| 781 | #define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 | 804 | #define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index b5d9657f3100..e41a10f5ae83 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
| @@ -392,7 +392,7 @@ | |||
| 392 | #define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */ | 392 | #define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */ |
| 393 | #define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */ | 393 | #define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */ |
| 394 | #define PCI_EXP_TYPE_RC_END 0x9 /* Root Complex Integrated Endpoint */ | 394 | #define PCI_EXP_TYPE_RC_END 0x9 /* Root Complex Integrated Endpoint */ |
| 395 | #define PCI_EXP_TYPE_RC_EC 0x10 /* Root Complex Event Collector */ | 395 | #define PCI_EXP_TYPE_RC_EC 0xa /* Root Complex Event Collector */ |
| 396 | #define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */ | 396 | #define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */ |
| 397 | #define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */ | 397 | #define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */ |
| 398 | #define PCI_EXP_DEVCAP 4 /* Device capabilities */ | 398 | #define PCI_EXP_DEVCAP 4 /* Device capabilities */ |
| @@ -537,7 +537,9 @@ | |||
| 537 | #define PCI_EXT_CAP_ID_ARI 14 | 537 | #define PCI_EXT_CAP_ID_ARI 14 |
| 538 | #define PCI_EXT_CAP_ID_ATS 15 | 538 | #define PCI_EXT_CAP_ID_ATS 15 |
| 539 | #define PCI_EXT_CAP_ID_SRIOV 16 | 539 | #define PCI_EXT_CAP_ID_SRIOV 16 |
| 540 | #define PCI_EXT_CAP_ID_PRI 19 | ||
| 540 | #define PCI_EXT_CAP_ID_LTR 24 | 541 | #define PCI_EXT_CAP_ID_LTR 24 |
| 542 | #define PCI_EXT_CAP_ID_PASID 27 | ||
| 541 | 543 | ||
| 542 | /* Advanced Error Reporting */ | 544 | /* Advanced Error Reporting */ |
| 543 | #define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ | 545 | #define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ |
| @@ -664,24 +666,24 @@ | |||
| 664 | #define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ | 666 | #define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ |
| 665 | 667 | ||
| 666 | /* Page Request Interface */ | 668 | /* Page Request Interface */ |
| 667 | #define PCI_PRI_CAP 0x13 /* PRI capability ID */ | 669 | #define PCI_PRI_CTRL 0x04 /* PRI control register */ |
| 668 | #define PCI_PRI_CONTROL_OFF 0x04 /* Offset of control register */ | 670 | #define PCI_PRI_CTRL_ENABLE 0x01 /* Enable */ |
| 669 | #define PCI_PRI_STATUS_OFF 0x06 /* Offset of status register */ | 671 | #define PCI_PRI_CTRL_RESET 0x02 /* Reset */ |
| 670 | #define PCI_PRI_ENABLE 0x0001 /* Enable mask */ | 672 | #define PCI_PRI_STATUS 0x06 /* PRI status register */ |
| 671 | #define PCI_PRI_RESET 0x0002 /* Reset bit mask */ | 673 | #define PCI_PRI_STATUS_RF 0x001 /* Response Failure */ |
| 672 | #define PCI_PRI_STATUS_RF 0x0001 /* Request Failure */ | 674 | #define PCI_PRI_STATUS_UPRGI 0x002 /* Unexpected PRG index */ |
| 673 | #define PCI_PRI_STATUS_UPRGI 0x0002 /* Unexpected PRG index */ | 675 | #define PCI_PRI_STATUS_STOPPED 0x100 /* PRI Stopped */ |
| 674 | #define PCI_PRI_STATUS_STOPPED 0x0100 /* PRI Stopped */ | 676 | #define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */ |
| 675 | #define PCI_PRI_MAX_REQ_OFF 0x08 /* Cap offset for max reqs supported */ | 677 | #define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */ |
| 676 | #define PCI_PRI_ALLOC_REQ_OFF 0x0c /* Cap offset for max reqs allowed */ | ||
| 677 | 678 | ||
| 678 | /* PASID capability */ | 679 | /* PASID capability */ |
| 679 | #define PCI_PASID_CAP 0x1b /* PASID capability ID */ | 680 | #define PCI_PASID_CAP 0x04 /* PASID feature register */ |
| 680 | #define PCI_PASID_CAP_OFF 0x04 /* PASID feature register */ | 681 | #define PCI_PASID_CAP_EXEC 0x02 /* Exec permissions Supported */ |
| 681 | #define PCI_PASID_CONTROL_OFF 0x06 /* PASID control register */ | 682 | #define PCI_PASID_CAP_PRIV 0x04 /* Priviledge Mode Supported */ |
| 682 | #define PCI_PASID_ENABLE 0x01 /* Enable/Supported bit */ | 683 | #define PCI_PASID_CTRL 0x06 /* PASID control register */ |
| 683 | #define PCI_PASID_EXEC 0x02 /* Exec permissions Enable/Supported */ | 684 | #define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */ |
| 684 | #define PCI_PASID_PRIV 0x04 /* Priviledge Mode Enable/Support */ | 685 | #define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */ |
| 686 | #define PCI_PASID_CTRL_PRIV 0x04 /* Priviledge Mode Enable */ | ||
| 685 | 687 | ||
| 686 | /* Single Root I/O Virtualization */ | 688 | /* Single Root I/O Virtualization */ |
| 687 | #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ | 689 | #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ |
diff --git a/include/linux/pda_power.h b/include/linux/pda_power.h index c9e4d814ff77..2bb62bf296ac 100644 --- a/include/linux/pda_power.h +++ b/include/linux/pda_power.h | |||
| @@ -35,6 +35,8 @@ struct pda_power_pdata { | |||
| 35 | unsigned int polling_interval; /* msecs, default is 2000 */ | 35 | unsigned int polling_interval; /* msecs, default is 2000 */ |
| 36 | 36 | ||
| 37 | unsigned long ac_max_uA; /* current to draw when on AC */ | 37 | unsigned long ac_max_uA; /* current to draw when on AC */ |
| 38 | |||
| 39 | bool use_otg_notifier; | ||
| 38 | }; | 40 | }; |
| 39 | 41 | ||
| 40 | #endif /* __PDA_POWER_H__ */ | 42 | #endif /* __PDA_POWER_H__ */ |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 9ca008f0c542..32cd1f67462e 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
| @@ -172,10 +172,10 @@ extern phys_addr_t per_cpu_ptr_to_phys(void *addr); | |||
| 172 | * equal char, int or long. percpu_read() evaluates to a lvalue and | 172 | * equal char, int or long. percpu_read() evaluates to a lvalue and |
| 173 | * all others to void. | 173 | * all others to void. |
| 174 | * | 174 | * |
| 175 | * These operations are guaranteed to be atomic w.r.t. preemption. | 175 | * These operations are guaranteed to be atomic. |
| 176 | * The generic versions use plain get/put_cpu_var(). Archs are | 176 | * The generic versions disable interrupts. Archs are |
| 177 | * encouraged to implement single-instruction alternatives which don't | 177 | * encouraged to implement single-instruction alternatives which don't |
| 178 | * require preemption protection. | 178 | * require protection. |
| 179 | */ | 179 | */ |
| 180 | #ifndef percpu_read | 180 | #ifndef percpu_read |
| 181 | # define percpu_read(var) \ | 181 | # define percpu_read(var) \ |
| @@ -347,9 +347,10 @@ do { \ | |||
| 347 | 347 | ||
| 348 | #define _this_cpu_generic_to_op(pcp, val, op) \ | 348 | #define _this_cpu_generic_to_op(pcp, val, op) \ |
| 349 | do { \ | 349 | do { \ |
| 350 | preempt_disable(); \ | 350 | unsigned long flags; \ |
| 351 | local_irq_save(flags); \ | ||
| 351 | *__this_cpu_ptr(&(pcp)) op val; \ | 352 | *__this_cpu_ptr(&(pcp)) op val; \ |
| 352 | preempt_enable(); \ | 353 | local_irq_restore(flags); \ |
| 353 | } while (0) | 354 | } while (0) |
| 354 | 355 | ||
| 355 | #ifndef this_cpu_write | 356 | #ifndef this_cpu_write |
| @@ -447,10 +448,11 @@ do { \ | |||
| 447 | #define _this_cpu_generic_add_return(pcp, val) \ | 448 | #define _this_cpu_generic_add_return(pcp, val) \ |
| 448 | ({ \ | 449 | ({ \ |
| 449 | typeof(pcp) ret__; \ | 450 | typeof(pcp) ret__; \ |
| 450 | preempt_disable(); \ | 451 | unsigned long flags; \ |
| 452 | local_irq_save(flags); \ | ||
| 451 | __this_cpu_add(pcp, val); \ | 453 | __this_cpu_add(pcp, val); \ |
| 452 | ret__ = __this_cpu_read(pcp); \ | 454 | ret__ = __this_cpu_read(pcp); \ |
| 453 | preempt_enable(); \ | 455 | local_irq_restore(flags); \ |
| 454 | ret__; \ | 456 | ret__; \ |
| 455 | }) | 457 | }) |
| 456 | 458 | ||
| @@ -476,10 +478,11 @@ do { \ | |||
| 476 | 478 | ||
| 477 | #define _this_cpu_generic_xchg(pcp, nval) \ | 479 | #define _this_cpu_generic_xchg(pcp, nval) \ |
| 478 | ({ typeof(pcp) ret__; \ | 480 | ({ typeof(pcp) ret__; \ |
| 479 | preempt_disable(); \ | 481 | unsigned long flags; \ |
| 482 | local_irq_save(flags); \ | ||
| 480 | ret__ = __this_cpu_read(pcp); \ | 483 | ret__ = __this_cpu_read(pcp); \ |
| 481 | __this_cpu_write(pcp, nval); \ | 484 | __this_cpu_write(pcp, nval); \ |
| 482 | preempt_enable(); \ | 485 | local_irq_restore(flags); \ |
| 483 | ret__; \ | 486 | ret__; \ |
| 484 | }) | 487 | }) |
| 485 | 488 | ||
| @@ -501,12 +504,14 @@ do { \ | |||
| 501 | #endif | 504 | #endif |
| 502 | 505 | ||
| 503 | #define _this_cpu_generic_cmpxchg(pcp, oval, nval) \ | 506 | #define _this_cpu_generic_cmpxchg(pcp, oval, nval) \ |
| 504 | ({ typeof(pcp) ret__; \ | 507 | ({ \ |
| 505 | preempt_disable(); \ | 508 | typeof(pcp) ret__; \ |
| 509 | unsigned long flags; \ | ||
| 510 | local_irq_save(flags); \ | ||
| 506 | ret__ = __this_cpu_read(pcp); \ | 511 | ret__ = __this_cpu_read(pcp); \ |
| 507 | if (ret__ == (oval)) \ | 512 | if (ret__ == (oval)) \ |
| 508 | __this_cpu_write(pcp, nval); \ | 513 | __this_cpu_write(pcp, nval); \ |
| 509 | preempt_enable(); \ | 514 | local_irq_restore(flags); \ |
| 510 | ret__; \ | 515 | ret__; \ |
| 511 | }) | 516 | }) |
| 512 | 517 | ||
| @@ -538,10 +543,11 @@ do { \ | |||
| 538 | #define _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | 543 | #define _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ |
| 539 | ({ \ | 544 | ({ \ |
| 540 | int ret__; \ | 545 | int ret__; \ |
| 541 | preempt_disable(); \ | 546 | unsigned long flags; \ |
| 547 | local_irq_save(flags); \ | ||
| 542 | ret__ = __this_cpu_generic_cmpxchg_double(pcp1, pcp2, \ | 548 | ret__ = __this_cpu_generic_cmpxchg_double(pcp1, pcp2, \ |
| 543 | oval1, oval2, nval1, nval2); \ | 549 | oval1, oval2, nval1, nval2); \ |
| 544 | preempt_enable(); \ | 550 | local_irq_restore(flags); \ |
| 545 | ret__; \ | 551 | ret__; \ |
| 546 | }) | 552 | }) |
| 547 | 553 | ||
| @@ -567,9 +573,9 @@ do { \ | |||
| 567 | #endif | 573 | #endif |
| 568 | 574 | ||
| 569 | /* | 575 | /* |
| 570 | * Generic percpu operations that do not require preemption handling. | 576 | * Generic percpu operations for context that are safe from preemption/interrupts. |
| 571 | * Either we do not care about races or the caller has the | 577 | * Either we do not care about races or the caller has the |
| 572 | * responsibility of handling preemptions issues. Arch code can still | 578 | * responsibility of handling preemption/interrupt issues. Arch code can still |
| 573 | * override these instructions since the arch per cpu code may be more | 579 | * override these instructions since the arch per cpu code may be more |
| 574 | * efficient and may actually get race freeness for free (that is the | 580 | * efficient and may actually get race freeness for free (that is the |
| 575 | * case for x86 for example). | 581 | * case for x86 for example). |
| @@ -802,156 +808,4 @@ do { \ | |||
| 802 | __pcpu_double_call_return_bool(__this_cpu_cmpxchg_double_, (pcp1), (pcp2), (oval1), (oval2), (nval1), (nval2)) | 808 | __pcpu_double_call_return_bool(__this_cpu_cmpxchg_double_, (pcp1), (pcp2), (oval1), (oval2), (nval1), (nval2)) |
| 803 | #endif | 809 | #endif |
| 804 | 810 | ||
| 805 | /* | ||
| 806 | * IRQ safe versions of the per cpu RMW operations. Note that these operations | ||
| 807 | * are *not* safe against modification of the same variable from another | ||
| 808 | * processors (which one gets when using regular atomic operations) | ||
| 809 | * They are guaranteed to be atomic vs. local interrupts and | ||
| 810 | * preemption only. | ||
| 811 | */ | ||
| 812 | #define irqsafe_cpu_generic_to_op(pcp, val, op) \ | ||
| 813 | do { \ | ||
| 814 | unsigned long flags; \ | ||
| 815 | local_irq_save(flags); \ | ||
| 816 | *__this_cpu_ptr(&(pcp)) op val; \ | ||
| 817 | local_irq_restore(flags); \ | ||
| 818 | } while (0) | ||
| 819 | |||
| 820 | #ifndef irqsafe_cpu_add | ||
| 821 | # ifndef irqsafe_cpu_add_1 | ||
| 822 | # define irqsafe_cpu_add_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=) | ||
| 823 | # endif | ||
| 824 | # ifndef irqsafe_cpu_add_2 | ||
| 825 | # define irqsafe_cpu_add_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=) | ||
| 826 | # endif | ||
| 827 | # ifndef irqsafe_cpu_add_4 | ||
| 828 | # define irqsafe_cpu_add_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=) | ||
| 829 | # endif | ||
| 830 | # ifndef irqsafe_cpu_add_8 | ||
| 831 | # define irqsafe_cpu_add_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=) | ||
| 832 | # endif | ||
| 833 | # define irqsafe_cpu_add(pcp, val) __pcpu_size_call(irqsafe_cpu_add_, (pcp), (val)) | ||
| 834 | #endif | ||
| 835 | |||
| 836 | #ifndef irqsafe_cpu_sub | ||
| 837 | # define irqsafe_cpu_sub(pcp, val) irqsafe_cpu_add((pcp), -(val)) | ||
| 838 | #endif | ||
| 839 | |||
| 840 | #ifndef irqsafe_cpu_inc | ||
| 841 | # define irqsafe_cpu_inc(pcp) irqsafe_cpu_add((pcp), 1) | ||
| 842 | #endif | ||
| 843 | |||
| 844 | #ifndef irqsafe_cpu_dec | ||
| 845 | # define irqsafe_cpu_dec(pcp) irqsafe_cpu_sub((pcp), 1) | ||
| 846 | #endif | ||
| 847 | |||
| 848 | #ifndef irqsafe_cpu_and | ||
| 849 | # ifndef irqsafe_cpu_and_1 | ||
| 850 | # define irqsafe_cpu_and_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=) | ||
| 851 | # endif | ||
| 852 | # ifndef irqsafe_cpu_and_2 | ||
| 853 | # define irqsafe_cpu_and_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=) | ||
| 854 | # endif | ||
| 855 | # ifndef irqsafe_cpu_and_4 | ||
| 856 | # define irqsafe_cpu_and_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=) | ||
| 857 | # endif | ||
| 858 | # ifndef irqsafe_cpu_and_8 | ||
| 859 | # define irqsafe_cpu_and_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=) | ||
| 860 | # endif | ||
| 861 | # define irqsafe_cpu_and(pcp, val) __pcpu_size_call(irqsafe_cpu_and_, (val)) | ||
| 862 | #endif | ||
| 863 | |||
| 864 | #ifndef irqsafe_cpu_or | ||
| 865 | # ifndef irqsafe_cpu_or_1 | ||
| 866 | # define irqsafe_cpu_or_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=) | ||
| 867 | # endif | ||
| 868 | # ifndef irqsafe_cpu_or_2 | ||
| 869 | # define irqsafe_cpu_or_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=) | ||
| 870 | # endif | ||
| 871 | # ifndef irqsafe_cpu_or_4 | ||
| 872 | # define irqsafe_cpu_or_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=) | ||
| 873 | # endif | ||
| 874 | # ifndef irqsafe_cpu_or_8 | ||
| 875 | # define irqsafe_cpu_or_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=) | ||
| 876 | # endif | ||
| 877 | # define irqsafe_cpu_or(pcp, val) __pcpu_size_call(irqsafe_cpu_or_, (val)) | ||
| 878 | #endif | ||
| 879 | |||
| 880 | #ifndef irqsafe_cpu_xor | ||
| 881 | # ifndef irqsafe_cpu_xor_1 | ||
| 882 | # define irqsafe_cpu_xor_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=) | ||
| 883 | # endif | ||
| 884 | # ifndef irqsafe_cpu_xor_2 | ||
| 885 | # define irqsafe_cpu_xor_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=) | ||
| 886 | # endif | ||
| 887 | # ifndef irqsafe_cpu_xor_4 | ||
| 888 | # define irqsafe_cpu_xor_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=) | ||
| 889 | # endif | ||
| 890 | # ifndef irqsafe_cpu_xor_8 | ||
| 891 | # define irqsafe_cpu_xor_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=) | ||
| 892 | # endif | ||
| 893 | # define irqsafe_cpu_xor(pcp, val) __pcpu_size_call(irqsafe_cpu_xor_, (val)) | ||
| 894 | #endif | ||
| 895 | |||
| 896 | #define irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) \ | ||
| 897 | ({ \ | ||
| 898 | typeof(pcp) ret__; \ | ||
| 899 | unsigned long flags; \ | ||
| 900 | local_irq_save(flags); \ | ||
| 901 | ret__ = __this_cpu_read(pcp); \ | ||
| 902 | if (ret__ == (oval)) \ | ||
| 903 | __this_cpu_write(pcp, nval); \ | ||
| 904 | local_irq_restore(flags); \ | ||
| 905 | ret__; \ | ||
| 906 | }) | ||
| 907 | |||
| 908 | #ifndef irqsafe_cpu_cmpxchg | ||
| 909 | # ifndef irqsafe_cpu_cmpxchg_1 | ||
| 910 | # define irqsafe_cpu_cmpxchg_1(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 911 | # endif | ||
| 912 | # ifndef irqsafe_cpu_cmpxchg_2 | ||
| 913 | # define irqsafe_cpu_cmpxchg_2(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 914 | # endif | ||
| 915 | # ifndef irqsafe_cpu_cmpxchg_4 | ||
| 916 | # define irqsafe_cpu_cmpxchg_4(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 917 | # endif | ||
| 918 | # ifndef irqsafe_cpu_cmpxchg_8 | ||
| 919 | # define irqsafe_cpu_cmpxchg_8(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 920 | # endif | ||
| 921 | # define irqsafe_cpu_cmpxchg(pcp, oval, nval) \ | ||
| 922 | __pcpu_size_call_return2(irqsafe_cpu_cmpxchg_, (pcp), oval, nval) | ||
| 923 | #endif | ||
| 924 | |||
| 925 | #define irqsafe_generic_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 926 | ({ \ | ||
| 927 | int ret__; \ | ||
| 928 | unsigned long flags; \ | ||
| 929 | local_irq_save(flags); \ | ||
| 930 | ret__ = __this_cpu_generic_cmpxchg_double(pcp1, pcp2, \ | ||
| 931 | oval1, oval2, nval1, nval2); \ | ||
| 932 | local_irq_restore(flags); \ | ||
| 933 | ret__; \ | ||
| 934 | }) | ||
| 935 | |||
| 936 | #ifndef irqsafe_cpu_cmpxchg_double | ||
| 937 | # ifndef irqsafe_cpu_cmpxchg_double_1 | ||
| 938 | # define irqsafe_cpu_cmpxchg_double_1(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 939 | irqsafe_generic_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 940 | # endif | ||
| 941 | # ifndef irqsafe_cpu_cmpxchg_double_2 | ||
| 942 | # define irqsafe_cpu_cmpxchg_double_2(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 943 | irqsafe_generic_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 944 | # endif | ||
| 945 | # ifndef irqsafe_cpu_cmpxchg_double_4 | ||
| 946 | # define irqsafe_cpu_cmpxchg_double_4(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 947 | irqsafe_generic_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 948 | # endif | ||
| 949 | # ifndef irqsafe_cpu_cmpxchg_double_8 | ||
| 950 | # define irqsafe_cpu_cmpxchg_double_8(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 951 | irqsafe_generic_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 952 | # endif | ||
| 953 | # define irqsafe_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 954 | __pcpu_double_call_return_bool(irqsafe_cpu_cmpxchg_double_, (pcp1), (pcp2), (oval1), (oval2), (nval1), (nval2)) | ||
| 955 | #endif | ||
| 956 | |||
| 957 | #endif /* __LINUX_PERCPU_H */ | 811 | #endif /* __LINUX_PERCPU_H */ |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 08855613ceb3..abb2776be1ba 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -587,6 +587,7 @@ struct hw_perf_event { | |||
| 587 | u64 sample_period; | 587 | u64 sample_period; |
| 588 | u64 last_period; | 588 | u64 last_period; |
| 589 | local64_t period_left; | 589 | local64_t period_left; |
| 590 | u64 interrupts_seq; | ||
| 590 | u64 interrupts; | 591 | u64 interrupts; |
| 591 | 592 | ||
| 592 | u64 freq_time_stamp; | 593 | u64 freq_time_stamp; |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 79f337c47388..c599f7eca1e7 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
| @@ -129,7 +129,12 @@ struct mii_bus { | |||
| 129 | }; | 129 | }; |
| 130 | #define to_mii_bus(d) container_of(d, struct mii_bus, dev) | 130 | #define to_mii_bus(d) container_of(d, struct mii_bus, dev) |
| 131 | 131 | ||
| 132 | struct mii_bus *mdiobus_alloc(void); | 132 | struct mii_bus *mdiobus_alloc_size(size_t); |
| 133 | static inline struct mii_bus *mdiobus_alloc(void) | ||
| 134 | { | ||
| 135 | return mdiobus_alloc_size(0); | ||
| 136 | } | ||
| 137 | |||
| 133 | int mdiobus_register(struct mii_bus *bus); | 138 | int mdiobus_register(struct mii_bus *bus); |
| 134 | void mdiobus_unregister(struct mii_bus *bus); | 139 | void mdiobus_unregister(struct mii_bus *bus); |
| 135 | void mdiobus_free(struct mii_bus *bus); | 140 | void mdiobus_free(struct mii_bus *bus); |
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index 38d10326246a..e7cf6669ac34 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h | |||
| @@ -30,6 +30,8 @@ struct pid_namespace { | |||
| 30 | #ifdef CONFIG_BSD_PROCESS_ACCT | 30 | #ifdef CONFIG_BSD_PROCESS_ACCT |
| 31 | struct bsd_acct_struct *bacct; | 31 | struct bsd_acct_struct *bacct; |
| 32 | #endif | 32 | #endif |
| 33 | gid_t pid_gid; | ||
| 34 | int hide_pid; | ||
| 33 | }; | 35 | }; |
| 34 | 36 | ||
| 35 | extern struct pid_namespace init_pid_ns; | 37 | extern struct pid_namespace init_pid_ns; |
diff --git a/include/linux/pinctrl/machine.h b/include/linux/pinctrl/machine.h index 88863531d862..d0aecb7f6fb9 100644 --- a/include/linux/pinctrl/machine.h +++ b/include/linux/pinctrl/machine.h | |||
| @@ -48,7 +48,7 @@ struct pinmux_map { | |||
| 48 | const char *group; | 48 | const char *group; |
| 49 | struct device *dev; | 49 | struct device *dev; |
| 50 | const char *dev_name; | 50 | const char *dev_name; |
| 51 | const bool hog_on_boot; | 51 | bool hog_on_boot; |
| 52 | }; | 52 | }; |
| 53 | 53 | ||
| 54 | /* | 54 | /* |
| @@ -66,30 +66,22 @@ struct pinmux_map { | |||
| 66 | { .name = a, .ctrl_dev_name = b, .function = c } | 66 | { .name = a, .ctrl_dev_name = b, .function = c } |
| 67 | 67 | ||
| 68 | /* | 68 | /* |
| 69 | * Convenience macro to map a function onto the primary device pinctrl device | 69 | * Convenience macro to map a system function onto a certain pinctrl device, |
| 70 | * this is especially helpful on systems that have only one pin controller | 70 | * to be hogged by the pinmux core until the system shuts down. |
| 71 | * or need to set up a lot of mappings on the primary controller. | ||
| 72 | */ | ||
| 73 | #define PINMUX_MAP_PRIMARY(a, b, c) \ | ||
| 74 | { .name = a, .ctrl_dev_name = "pinctrl.0", .function = b, \ | ||
| 75 | .dev_name = c } | ||
| 76 | |||
| 77 | /* | ||
| 78 | * Convenience macro to map a system function onto the primary pinctrl device. | ||
| 79 | * System functions are not assigned to a particular device. | ||
| 80 | */ | 71 | */ |
| 81 | #define PINMUX_MAP_PRIMARY_SYS(a, b) \ | 72 | #define PINMUX_MAP_SYS_HOG(a, b, c) \ |
| 82 | { .name = a, .ctrl_dev_name = "pinctrl.0", .function = b } | 73 | { .name = a, .ctrl_dev_name = b, .function = c, \ |
| 74 | .hog_on_boot = true } | ||
| 83 | 75 | ||
| 84 | /* | 76 | /* |
| 85 | * Convenience macro to map a system function onto the primary pinctrl device, | 77 | * Convenience macro to map a system function onto a certain pinctrl device |
| 86 | * to be hogged by the pinmux core until the system shuts down. | 78 | * using a specified group, to be hogged by the pinmux core until the system |
| 79 | * shuts down. | ||
| 87 | */ | 80 | */ |
| 88 | #define PINMUX_MAP_PRIMARY_SYS_HOG(a, b) \ | 81 | #define PINMUX_MAP_SYS_HOG_GROUP(a, b, c, d) \ |
| 89 | { .name = a, .ctrl_dev_name = "pinctrl.0", .function = b, \ | 82 | { .name = a, .ctrl_dev_name = b, .function = c, .group = d, \ |
| 90 | .hog_on_boot = true } | 83 | .hog_on_boot = true } |
| 91 | 84 | ||
| 92 | |||
| 93 | #ifdef CONFIG_PINMUX | 85 | #ifdef CONFIG_PINMUX |
| 94 | 86 | ||
| 95 | extern int pinmux_register_mappings(struct pinmux_map const *map, | 87 | extern int pinmux_register_mappings(struct pinmux_map const *map, |
diff --git a/include/linux/pinctrl/pinconf.h b/include/linux/pinctrl/pinconf.h new file mode 100644 index 000000000000..477922cf043a --- /dev/null +++ b/include/linux/pinctrl/pinconf.h | |||
| @@ -0,0 +1,97 @@ | |||
| 1 | /* | ||
| 2 | * Interface the pinconfig portions of the pinctrl subsystem | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 ST-Ericsson SA | ||
| 5 | * Written on behalf of Linaro for ST-Ericsson | ||
| 6 | * This interface is used in the core to keep track of pins. | ||
| 7 | * | ||
| 8 | * Author: Linus Walleij <linus.walleij@linaro.org> | ||
| 9 | * | ||
| 10 | * License terms: GNU General Public License (GPL) version 2 | ||
| 11 | */ | ||
| 12 | #ifndef __LINUX_PINCTRL_PINCONF_H | ||
| 13 | #define __LINUX_PINCTRL_PINCONF_H | ||
| 14 | |||
| 15 | #ifdef CONFIG_PINCONF | ||
| 16 | |||
| 17 | struct pinctrl_dev; | ||
| 18 | struct seq_file; | ||
| 19 | |||
| 20 | /** | ||
| 21 | * struct pinconf_ops - pin config operations, to be implemented by | ||
| 22 | * pin configuration capable drivers. | ||
| 23 | * @pin_config_get: get the config of a certain pin, if the requested config | ||
| 24 | * is not available on this controller this should return -ENOTSUPP | ||
| 25 | * and if it is available but disabled it should return -EINVAL | ||
| 26 | * @pin_config_get: get the config of a certain pin | ||
| 27 | * @pin_config_set: configure an individual pin | ||
| 28 | * @pin_config_group_get: get configurations for an entire pin group | ||
| 29 | * @pin_config_group_set: configure all pins in a group | ||
| 30 | * @pin_config_dbg_show: optional debugfs display hook that will provide | ||
| 31 | * per-device info for a certain pin in debugfs | ||
| 32 | * @pin_config_group_dbg_show: optional debugfs display hook that will provide | ||
| 33 | * per-device info for a certain group in debugfs | ||
| 34 | */ | ||
| 35 | struct pinconf_ops { | ||
| 36 | int (*pin_config_get) (struct pinctrl_dev *pctldev, | ||
| 37 | unsigned pin, | ||
| 38 | unsigned long *config); | ||
| 39 | int (*pin_config_set) (struct pinctrl_dev *pctldev, | ||
| 40 | unsigned pin, | ||
| 41 | unsigned long config); | ||
| 42 | int (*pin_config_group_get) (struct pinctrl_dev *pctldev, | ||
| 43 | unsigned selector, | ||
| 44 | unsigned long *config); | ||
| 45 | int (*pin_config_group_set) (struct pinctrl_dev *pctldev, | ||
| 46 | unsigned selector, | ||
| 47 | unsigned long config); | ||
| 48 | void (*pin_config_dbg_show) (struct pinctrl_dev *pctldev, | ||
| 49 | struct seq_file *s, | ||
| 50 | unsigned offset); | ||
| 51 | void (*pin_config_group_dbg_show) (struct pinctrl_dev *pctldev, | ||
| 52 | struct seq_file *s, | ||
| 53 | unsigned selector); | ||
| 54 | }; | ||
| 55 | |||
| 56 | extern int pin_config_get(const char *dev_name, const char *name, | ||
| 57 | unsigned long *config); | ||
| 58 | extern int pin_config_set(const char *dev_name, const char *name, | ||
| 59 | unsigned long config); | ||
| 60 | extern int pin_config_group_get(const char *dev_name, | ||
| 61 | const char *pin_group, | ||
| 62 | unsigned long *config); | ||
| 63 | extern int pin_config_group_set(const char *dev_name, | ||
| 64 | const char *pin_group, | ||
| 65 | unsigned long config); | ||
| 66 | |||
| 67 | #else | ||
| 68 | |||
| 69 | static inline int pin_config_get(const char *dev_name, const char *name, | ||
| 70 | unsigned long *config) | ||
| 71 | { | ||
| 72 | return 0; | ||
| 73 | } | ||
| 74 | |||
| 75 | static inline int pin_config_set(const char *dev_name, const char *name, | ||
| 76 | unsigned long config) | ||
| 77 | { | ||
| 78 | return 0; | ||
| 79 | } | ||
| 80 | |||
| 81 | static inline int pin_config_group_get(const char *dev_name, | ||
| 82 | const char *pin_group, | ||
| 83 | unsigned long *config) | ||
| 84 | { | ||
| 85 | return 0; | ||
| 86 | } | ||
| 87 | |||
| 88 | static inline int pin_config_group_set(const char *dev_name, | ||
| 89 | const char *pin_group, | ||
| 90 | unsigned long config) | ||
| 91 | { | ||
| 92 | return 0; | ||
| 93 | } | ||
| 94 | |||
| 95 | #endif | ||
| 96 | |||
| 97 | #endif /* __LINUX_PINCTRL_PINCONF_H */ | ||
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 04c011038f32..8bd22ee7aa09 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | struct pinctrl_dev; | 22 | struct pinctrl_dev; |
| 23 | struct pinmux_ops; | 23 | struct pinmux_ops; |
| 24 | struct pinconf_ops; | ||
| 24 | struct gpio_chip; | 25 | struct gpio_chip; |
| 25 | 26 | ||
| 26 | /** | 27 | /** |
| @@ -45,6 +46,7 @@ struct pinctrl_pin_desc { | |||
| 45 | * @name: a name for the chip in this range | 46 | * @name: a name for the chip in this range |
| 46 | * @id: an ID number for the chip in this range | 47 | * @id: an ID number for the chip in this range |
| 47 | * @base: base offset of the GPIO range | 48 | * @base: base offset of the GPIO range |
| 49 | * @pin_base: base pin number of the GPIO range | ||
| 48 | * @npins: number of pins in the GPIO range, including the base number | 50 | * @npins: number of pins in the GPIO range, including the base number |
| 49 | * @gc: an optional pointer to a gpio_chip | 51 | * @gc: an optional pointer to a gpio_chip |
| 50 | */ | 52 | */ |
| @@ -53,6 +55,7 @@ struct pinctrl_gpio_range { | |||
| 53 | const char *name; | 55 | const char *name; |
| 54 | unsigned int id; | 56 | unsigned int id; |
| 55 | unsigned int base; | 57 | unsigned int base; |
| 58 | unsigned int pin_base; | ||
| 56 | unsigned int npins; | 59 | unsigned int npins; |
| 57 | struct gpio_chip *gc; | 60 | struct gpio_chip *gc; |
| 58 | }; | 61 | }; |
| @@ -89,22 +92,20 @@ struct pinctrl_ops { | |||
| 89 | * this pin controller | 92 | * this pin controller |
| 90 | * @npins: number of descriptors in the array, usually just ARRAY_SIZE() | 93 | * @npins: number of descriptors in the array, usually just ARRAY_SIZE() |
| 91 | * of the pins field above | 94 | * of the pins field above |
| 92 | * @maxpin: since pin spaces may be sparse, there can he "holes" in the | ||
| 93 | * pin range, this attribute gives the maximum pin number in the | ||
| 94 | * total range. This should not be lower than npins for example, | ||
| 95 | * but may be equal to npins if you have no holes in the pin range. | ||
| 96 | * @pctlops: pin control operation vtable, to support global concepts like | 95 | * @pctlops: pin control operation vtable, to support global concepts like |
| 97 | * grouping of pins, this is optional. | 96 | * grouping of pins, this is optional. |
| 98 | * @pmxops: pinmux operation vtable, if you support pinmuxing in your driver | 97 | * @pmxops: pinmux operations vtable, if you support pinmuxing in your driver |
| 98 | * @confops: pin config operations vtable, if you support pin configuration in | ||
| 99 | * your driver | ||
| 99 | * @owner: module providing the pin controller, used for refcounting | 100 | * @owner: module providing the pin controller, used for refcounting |
| 100 | */ | 101 | */ |
| 101 | struct pinctrl_desc { | 102 | struct pinctrl_desc { |
| 102 | const char *name; | 103 | const char *name; |
| 103 | struct pinctrl_pin_desc const *pins; | 104 | struct pinctrl_pin_desc const *pins; |
| 104 | unsigned int npins; | 105 | unsigned int npins; |
| 105 | unsigned int maxpin; | ||
| 106 | struct pinctrl_ops *pctlops; | 106 | struct pinctrl_ops *pctlops; |
| 107 | struct pinmux_ops *pmxops; | 107 | struct pinmux_ops *pmxops; |
| 108 | struct pinconf_ops *confops; | ||
| 108 | struct module *owner; | 109 | struct module *owner; |
| 109 | }; | 110 | }; |
| 110 | 111 | ||
| @@ -123,7 +124,7 @@ extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); | |||
| 123 | 124 | ||
| 124 | struct pinctrl_dev; | 125 | struct pinctrl_dev; |
| 125 | 126 | ||
| 126 | /* Sufficiently stupid default function when pinctrl is not in use */ | 127 | /* Sufficiently stupid default functions when pinctrl is not in use */ |
| 127 | static inline bool pin_is_valid(struct pinctrl_dev *pctldev, int pin) | 128 | static inline bool pin_is_valid(struct pinctrl_dev *pctldev, int pin) |
| 128 | { | 129 | { |
| 129 | return pin >= 0; | 130 | return pin >= 0; |
diff --git a/include/linux/pinctrl/pinmux.h b/include/linux/pinctrl/pinmux.h index 3c430e797efc..937b3e2fa36f 100644 --- a/include/linux/pinctrl/pinmux.h +++ b/include/linux/pinctrl/pinmux.h | |||
| @@ -52,9 +52,15 @@ struct pinctrl_dev; | |||
| 52 | * @disable: disable a certain muxing selector with a certain pin group | 52 | * @disable: disable a certain muxing selector with a certain pin group |
| 53 | * @gpio_request_enable: requests and enables GPIO on a certain pin. | 53 | * @gpio_request_enable: requests and enables GPIO on a certain pin. |
| 54 | * Implement this only if you can mux every pin individually as GPIO. The | 54 | * Implement this only if you can mux every pin individually as GPIO. The |
| 55 | * affected GPIO range is passed along with an offset into that | 55 | * affected GPIO range is passed along with an offset(pin number) into that |
| 56 | * specific GPIO range - function selectors and pin groups are orthogonal | 56 | * specific GPIO range - function selectors and pin groups are orthogonal |
| 57 | * to this, the core will however make sure the pins do not collide | 57 | * to this, the core will however make sure the pins do not collide. |
| 58 | * @gpio_disable_free: free up GPIO muxing on a certain pin, the reverse of | ||
| 59 | * @gpio_request_enable | ||
| 60 | * @gpio_set_direction: Since controllers may need different configurations | ||
| 61 | * depending on whether the GPIO is configured as input or output, | ||
| 62 | * a direction selector function may be implemented as a backing | ||
| 63 | * to the GPIO controllers that need pin muxing. | ||
| 58 | */ | 64 | */ |
| 59 | struct pinmux_ops { | 65 | struct pinmux_ops { |
| 60 | int (*request) (struct pinctrl_dev *pctldev, unsigned offset); | 66 | int (*request) (struct pinctrl_dev *pctldev, unsigned offset); |
| @@ -73,11 +79,20 @@ struct pinmux_ops { | |||
| 73 | int (*gpio_request_enable) (struct pinctrl_dev *pctldev, | 79 | int (*gpio_request_enable) (struct pinctrl_dev *pctldev, |
| 74 | struct pinctrl_gpio_range *range, | 80 | struct pinctrl_gpio_range *range, |
| 75 | unsigned offset); | 81 | unsigned offset); |
| 82 | void (*gpio_disable_free) (struct pinctrl_dev *pctldev, | ||
| 83 | struct pinctrl_gpio_range *range, | ||
| 84 | unsigned offset); | ||
| 85 | int (*gpio_set_direction) (struct pinctrl_dev *pctldev, | ||
| 86 | struct pinctrl_gpio_range *range, | ||
| 87 | unsigned offset, | ||
| 88 | bool input); | ||
| 76 | }; | 89 | }; |
| 77 | 90 | ||
| 78 | /* External interface to pinmux */ | 91 | /* External interface to pinmux */ |
| 79 | extern int pinmux_request_gpio(unsigned gpio); | 92 | extern int pinmux_request_gpio(unsigned gpio); |
| 80 | extern void pinmux_free_gpio(unsigned gpio); | 93 | extern void pinmux_free_gpio(unsigned gpio); |
| 94 | extern int pinmux_gpio_direction_input(unsigned gpio); | ||
| 95 | extern int pinmux_gpio_direction_output(unsigned gpio); | ||
| 81 | extern struct pinmux * __must_check pinmux_get(struct device *dev, const char *name); | 96 | extern struct pinmux * __must_check pinmux_get(struct device *dev, const char *name); |
| 82 | extern void pinmux_put(struct pinmux *pmx); | 97 | extern void pinmux_put(struct pinmux *pmx); |
| 83 | extern int pinmux_enable(struct pinmux *pmx); | 98 | extern int pinmux_enable(struct pinmux *pmx); |
| @@ -94,6 +109,16 @@ static inline void pinmux_free_gpio(unsigned gpio) | |||
| 94 | { | 109 | { |
| 95 | } | 110 | } |
| 96 | 111 | ||
| 112 | static inline int pinmux_gpio_direction_input(unsigned gpio) | ||
| 113 | { | ||
| 114 | return 0; | ||
| 115 | } | ||
| 116 | |||
| 117 | static inline int pinmux_gpio_direction_output(unsigned gpio) | ||
| 118 | { | ||
| 119 | return 0; | ||
| 120 | } | ||
| 121 | |||
| 97 | static inline struct pinmux * __must_check pinmux_get(struct device *dev, const char *name) | 122 | static inline struct pinmux * __must_check pinmux_get(struct device *dev, const char *name) |
| 98 | { | 123 | { |
| 99 | return NULL; | 124 | return NULL; |
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index 8f1b928f777c..0d5b79365d03 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h | |||
| @@ -162,10 +162,30 @@ struct tc_sfq_qopt { | |||
| 162 | unsigned flows; /* Maximal number of flows */ | 162 | unsigned flows; /* Maximal number of flows */ |
| 163 | }; | 163 | }; |
| 164 | 164 | ||
| 165 | struct tc_sfqred_stats { | ||
| 166 | __u32 prob_drop; /* Early drops, below max threshold */ | ||
| 167 | __u32 forced_drop; /* Early drops, after max threshold */ | ||
| 168 | __u32 prob_mark; /* Marked packets, below max threshold */ | ||
| 169 | __u32 forced_mark; /* Marked packets, after max threshold */ | ||
| 170 | __u32 prob_mark_head; /* Marked packets, below max threshold */ | ||
| 171 | __u32 forced_mark_head;/* Marked packets, after max threshold */ | ||
| 172 | }; | ||
| 173 | |||
| 165 | struct tc_sfq_qopt_v1 { | 174 | struct tc_sfq_qopt_v1 { |
| 166 | struct tc_sfq_qopt v0; | 175 | struct tc_sfq_qopt v0; |
| 167 | unsigned int depth; /* max number of packets per flow */ | 176 | unsigned int depth; /* max number of packets per flow */ |
| 168 | unsigned int headdrop; | 177 | unsigned int headdrop; |
| 178 | /* SFQRED parameters */ | ||
| 179 | __u32 limit; /* HARD maximal flow queue length (bytes) */ | ||
| 180 | __u32 qth_min; /* Min average length threshold (bytes) */ | ||
| 181 | __u32 qth_max; /* Max average length threshold (bytes) */ | ||
| 182 | unsigned char Wlog; /* log(W) */ | ||
| 183 | unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */ | ||
| 184 | unsigned char Scell_log; /* cell size for idle damping */ | ||
| 185 | unsigned char flags; | ||
| 186 | __u32 max_P; /* probability, high resolution */ | ||
| 187 | /* SFQRED stats */ | ||
| 188 | struct tc_sfqred_stats stats; | ||
| 169 | }; | 189 | }; |
| 170 | 190 | ||
| 171 | 191 | ||
diff --git a/include/linux/platform_data/macb.h b/include/linux/platform_data/macb.h new file mode 100644 index 000000000000..b081c7245ec8 --- /dev/null +++ b/include/linux/platform_data/macb.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2004-2006 Atmel Corporation | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 as | ||
| 6 | * published by the Free Software Foundation. | ||
| 7 | */ | ||
| 8 | #ifndef __MACB_PDATA_H__ | ||
| 9 | #define __MACB_PDATA_H__ | ||
| 10 | |||
| 11 | struct macb_platform_data { | ||
| 12 | u32 phy_mask; | ||
| 13 | int phy_irq_pin; /* PHY IRQ */ | ||
| 14 | u8 is_rmii; /* using RMII interface? */ | ||
| 15 | }; | ||
| 16 | |||
| 17 | #endif /* __MACB_PDATA_H__ */ | ||
diff --git a/include/linux/platform_data/mv_usb.h b/include/linux/platform_data/mv_usb.h index e9d9149ddf38..d94804aca764 100644 --- a/include/linux/platform_data/mv_usb.h +++ b/include/linux/platform_data/mv_usb.h | |||
| @@ -42,9 +42,23 @@ struct mv_usb_platform_data { | |||
| 42 | /* only valid for HCD. OTG or Host only*/ | 42 | /* only valid for HCD. OTG or Host only*/ |
| 43 | unsigned int mode; | 43 | unsigned int mode; |
| 44 | 44 | ||
| 45 | int (*phy_init)(unsigned int regbase); | 45 | /* This flag is used for that needs id pin checked by otg */ |
| 46 | void (*phy_deinit)(unsigned int regbase); | 46 | unsigned int disable_otg_clock_gating:1; |
| 47 | /* Force a_bus_req to be asserted */ | ||
| 48 | unsigned int otg_force_a_bus_req:1; | ||
| 49 | |||
| 50 | int (*phy_init)(void __iomem *regbase); | ||
| 51 | void (*phy_deinit)(void __iomem *regbase); | ||
| 47 | int (*set_vbus)(unsigned int vbus); | 52 | int (*set_vbus)(unsigned int vbus); |
| 53 | int (*private_init)(void __iomem *opregs, void __iomem *phyregs); | ||
| 48 | }; | 54 | }; |
| 49 | 55 | ||
| 56 | #ifndef CONFIG_HAVE_CLK | ||
| 57 | /* Dummy stub for clk framework */ | ||
| 58 | #define clk_get(dev, id) NULL | ||
| 59 | #define clk_put(clock) do {} while (0) | ||
| 60 | #define clk_enable(clock) do {} while (0) | ||
| 61 | #define clk_disable(clock) do {} while (0) | ||
| 62 | #endif | ||
| 63 | |||
| 50 | #endif | 64 | #endif |
diff --git a/include/linux/platform_data/s3c-hsudc.h b/include/linux/platform_data/s3c-hsudc.h new file mode 100644 index 000000000000..6fa109339bf9 --- /dev/null +++ b/include/linux/platform_data/s3c-hsudc.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * S3C24XX USB 2.0 High-speed USB controller gadget driver | ||
| 3 | * | ||
| 4 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
| 5 | * http://www.samsung.com/ | ||
| 6 | * | ||
| 7 | * The S3C24XX USB 2.0 high-speed USB controller supports upto 9 endpoints. | ||
| 8 | * Each endpoint can be configured as either in or out endpoint. Endpoints | ||
| 9 | * can be configured for Bulk or Interrupt transfer mode. | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or modify | ||
| 12 | * it under the terms of the GNU General Public License version 2 as | ||
| 13 | * published by the Free Software Foundation. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef __LINUX_USB_S3C_HSUDC_H | ||
| 17 | #define __LINUX_USB_S3C_HSUDC_H | ||
| 18 | |||
| 19 | /** | ||
| 20 | * s3c24xx_hsudc_platdata - Platform data for USB High-Speed gadget controller. | ||
| 21 | * @epnum: Number of endpoints to be instantiated by the controller driver. | ||
| 22 | * @gpio_init: Platform specific USB related GPIO initialization. | ||
| 23 | * @gpio_uninit: Platform specific USB releted GPIO uninitialzation. | ||
| 24 | * | ||
| 25 | * Representation of platform data for the S3C24XX USB 2.0 High Speed gadget | ||
| 26 | * controllers. | ||
| 27 | */ | ||
| 28 | struct s3c24xx_hsudc_platdata { | ||
| 29 | unsigned int epnum; | ||
| 30 | void (*gpio_init)(void); | ||
| 31 | void (*gpio_uninit)(void); | ||
| 32 | }; | ||
| 33 | |||
| 34 | #endif /* __LINUX_USB_S3C_HSUDC_H */ | ||
diff --git a/include/linux/pmu.h b/include/linux/pmu.h index cafe98d96948..84e6a55a1202 100644 --- a/include/linux/pmu.h +++ b/include/linux/pmu.h | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | * Copyright (C) 1998 Paul Mackerras. | 6 | * Copyright (C) 1998 Paul Mackerras. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #ifndef _LINUX_PMU_H | ||
| 10 | #define _LINUX_PMU_H | ||
| 9 | 11 | ||
| 10 | #define PMU_DRIVER_VERSION 2 | 12 | #define PMU_DRIVER_VERSION 2 |
| 11 | 13 | ||
| @@ -207,3 +209,5 @@ extern int pmu_sys_suspended; | |||
| 207 | #endif | 209 | #endif |
| 208 | 210 | ||
| 209 | #endif /* __KERNEL__ */ | 211 | #endif /* __KERNEL__ */ |
| 212 | |||
| 213 | #endif /* _LINUX_PMU_H */ | ||
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h new file mode 100644 index 000000000000..4f75e531c112 --- /dev/null +++ b/include/linux/power/charger-manager.h | |||
| @@ -0,0 +1,147 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2011 Samsung Electronics Co., Ltd. | ||
| 3 | * MyungJoo.Ham <myungjoo.ham@samsung.com> | ||
| 4 | * | ||
| 5 | * Charger Manager. | ||
| 6 | * This framework enables to control and multiple chargers and to | ||
| 7 | * monitor charging even in the context of suspend-to-RAM with | ||
| 8 | * an interface combining the chargers. | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | **/ | ||
| 14 | |||
| 15 | #ifndef _CHARGER_MANAGER_H | ||
| 16 | #define _CHARGER_MANAGER_H | ||
| 17 | |||
| 18 | #include <linux/power_supply.h> | ||
| 19 | |||
| 20 | enum data_source { | ||
| 21 | CM_FUEL_GAUGE, | ||
| 22 | CM_CHARGER_STAT, | ||
| 23 | }; | ||
| 24 | |||
| 25 | enum polling_modes { | ||
| 26 | CM_POLL_DISABLE = 0, | ||
| 27 | CM_POLL_ALWAYS, | ||
| 28 | CM_POLL_EXTERNAL_POWER_ONLY, | ||
| 29 | CM_POLL_CHARGING_ONLY, | ||
| 30 | }; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * struct charger_global_desc | ||
| 34 | * @rtc_name: the name of RTC used to wake up the system from suspend. | ||
| 35 | * @rtc_only_wakeup: | ||
| 36 | * If the system is woken up by waekup-sources other than the RTC or | ||
| 37 | * callbacks, Charger Manager should recognize with | ||
| 38 | * rtc_only_wakeup() returning false. | ||
| 39 | * If the RTC given to CM is the only wakeup reason, | ||
| 40 | * rtc_only_wakeup should return true. | ||
| 41 | */ | ||
| 42 | struct charger_global_desc { | ||
| 43 | char *rtc_name; | ||
| 44 | |||
| 45 | bool (*rtc_only_wakeup)(void); | ||
| 46 | }; | ||
| 47 | |||
| 48 | /** | ||
| 49 | * struct charger_desc | ||
| 50 | * @psy_name: the name of power-supply-class for charger manager | ||
| 51 | * @polling_mode: | ||
| 52 | * Determine which polling mode will be used | ||
| 53 | * @fullbatt_uV: voltage in microvolt | ||
| 54 | * If it is not being charged and VBATT >= fullbatt_uV, | ||
| 55 | * it is assumed to be full. | ||
| 56 | * @polling_interval_ms: interval in millisecond at which | ||
| 57 | * charger manager will monitor battery health | ||
| 58 | * @battery_present: | ||
| 59 | * Specify where information for existance of battery can be obtained | ||
| 60 | * @psy_charger_stat: the names of power-supply for chargers | ||
| 61 | * @num_charger_regulator: the number of entries in charger_regulators | ||
| 62 | * @charger_regulators: array of regulator_bulk_data for chargers | ||
| 63 | * @psy_fuel_gauge: the name of power-supply for fuel gauge | ||
| 64 | * @temperature_out_of_range: | ||
| 65 | * Determine whether the status is overheat or cold or normal. | ||
| 66 | * return_value > 0: overheat | ||
| 67 | * return_value == 0: normal | ||
| 68 | * return_value < 0: cold | ||
| 69 | * @measure_battery_temp: | ||
| 70 | * true: measure battery temperature | ||
| 71 | * false: measure ambient temperature | ||
| 72 | */ | ||
| 73 | struct charger_desc { | ||
| 74 | char *psy_name; | ||
| 75 | |||
| 76 | enum polling_modes polling_mode; | ||
| 77 | unsigned int polling_interval_ms; | ||
| 78 | |||
| 79 | unsigned int fullbatt_uV; | ||
| 80 | |||
| 81 | enum data_source battery_present; | ||
| 82 | |||
| 83 | char **psy_charger_stat; | ||
| 84 | |||
| 85 | int num_charger_regulators; | ||
| 86 | struct regulator_bulk_data *charger_regulators; | ||
| 87 | |||
| 88 | char *psy_fuel_gauge; | ||
| 89 | |||
| 90 | int (*temperature_out_of_range)(int *mC); | ||
| 91 | bool measure_battery_temp; | ||
| 92 | }; | ||
| 93 | |||
| 94 | #define PSY_NAME_MAX 30 | ||
| 95 | |||
| 96 | /** | ||
| 97 | * struct charger_manager | ||
| 98 | * @entry: entry for list | ||
| 99 | * @dev: device pointer | ||
| 100 | * @desc: instance of charger_desc | ||
| 101 | * @fuel_gauge: power_supply for fuel gauge | ||
| 102 | * @charger_stat: array of power_supply for chargers | ||
| 103 | * @charger_enabled: the state of charger | ||
| 104 | * @emergency_stop: | ||
| 105 | * When setting true, stop charging | ||
| 106 | * @last_temp_mC: the measured temperature in milli-Celsius | ||
| 107 | * @psy_name_buf: the name of power-supply-class for charger manager | ||
| 108 | * @charger_psy: power_supply for charger manager | ||
| 109 | * @status_save_ext_pwr_inserted: | ||
| 110 | * saved status of external power before entering suspend-to-RAM | ||
| 111 | * @status_save_batt: | ||
| 112 | * saved status of battery before entering suspend-to-RAM | ||
| 113 | */ | ||
| 114 | struct charger_manager { | ||
| 115 | struct list_head entry; | ||
| 116 | struct device *dev; | ||
| 117 | struct charger_desc *desc; | ||
| 118 | |||
| 119 | struct power_supply *fuel_gauge; | ||
| 120 | struct power_supply **charger_stat; | ||
| 121 | |||
| 122 | bool charger_enabled; | ||
| 123 | |||
| 124 | int emergency_stop; | ||
| 125 | int last_temp_mC; | ||
| 126 | |||
| 127 | char psy_name_buf[PSY_NAME_MAX + 1]; | ||
| 128 | struct power_supply charger_psy; | ||
| 129 | |||
| 130 | bool status_save_ext_pwr_inserted; | ||
| 131 | bool status_save_batt; | ||
| 132 | }; | ||
| 133 | |||
| 134 | #ifdef CONFIG_CHARGER_MANAGER | ||
| 135 | extern int setup_charger_manager(struct charger_global_desc *gd); | ||
| 136 | extern bool cm_suspend_again(void); | ||
| 137 | #else | ||
| 138 | static void __maybe_unused setup_charger_manager(struct charger_global_desc *gd) | ||
| 139 | { } | ||
| 140 | |||
| 141 | static bool __maybe_unused cm_suspend_again(void) | ||
| 142 | { | ||
| 143 | return false; | ||
| 144 | } | ||
| 145 | #endif | ||
| 146 | |||
| 147 | #endif /* _CHARGER_MANAGER_H */ | ||
diff --git a/include/linux/power/bq20z75.h b/include/linux/power/sbs-battery.h index 1398eb004e83..2b0a9d9ff57e 100644 --- a/include/linux/power/bq20z75.h +++ b/include/linux/power/sbs-battery.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Gas Gauge driver for TI's BQ20Z75 | 2 | * Gas Gauge driver for SBS Compliant Gas Gauges |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2010, NVIDIA Corporation. | 4 | * Copyright (c) 2010, NVIDIA Corporation. |
| 5 | * | 5 | * |
| @@ -18,21 +18,21 @@ | |||
| 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | #ifndef __LINUX_POWER_BQ20Z75_H_ | 21 | #ifndef __LINUX_POWER_SBS_BATTERY_H_ |
| 22 | #define __LINUX_POWER_BQ20Z75_H_ | 22 | #define __LINUX_POWER_SBS_BATTERY_H_ |
| 23 | 23 | ||
| 24 | #include <linux/power_supply.h> | 24 | #include <linux/power_supply.h> |
| 25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
| 26 | 26 | ||
| 27 | /** | 27 | /** |
| 28 | * struct bq20z75_platform_data - platform data for bq20z75 devices | 28 | * struct sbs_platform_data - platform data for sbs devices |
| 29 | * @battery_detect: GPIO which is used to detect battery presence | 29 | * @battery_detect: GPIO which is used to detect battery presence |
| 30 | * @battery_detect_present: gpio state when battery is present (0 / 1) | 30 | * @battery_detect_present: gpio state when battery is present (0 / 1) |
| 31 | * @i2c_retry_count: # of times to retry on i2c IO failure | 31 | * @i2c_retry_count: # of times to retry on i2c IO failure |
| 32 | * @poll_retry_count: # of times to retry looking for new status after | 32 | * @poll_retry_count: # of times to retry looking for new status after |
| 33 | * external change notification | 33 | * external change notification |
| 34 | */ | 34 | */ |
| 35 | struct bq20z75_platform_data { | 35 | struct sbs_platform_data { |
| 36 | int battery_detect; | 36 | int battery_detect; |
| 37 | int battery_detect_present; | 37 | int battery_detect_present; |
| 38 | int i2c_retry_count; | 38 | int i2c_retry_count; |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 204c18dfdc9e..fa9b962aec12 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
| @@ -74,6 +74,12 @@ enum { | |||
| 74 | POWER_SUPPLY_CAPACITY_LEVEL_FULL, | 74 | POWER_SUPPLY_CAPACITY_LEVEL_FULL, |
| 75 | }; | 75 | }; |
| 76 | 76 | ||
| 77 | enum { | ||
| 78 | POWER_SUPPLY_SCOPE_UNKNOWN = 0, | ||
| 79 | POWER_SUPPLY_SCOPE_SYSTEM, | ||
| 80 | POWER_SUPPLY_SCOPE_DEVICE, | ||
| 81 | }; | ||
| 82 | |||
| 77 | enum power_supply_property { | 83 | enum power_supply_property { |
| 78 | /* Properties of type `int' */ | 84 | /* Properties of type `int' */ |
| 79 | POWER_SUPPLY_PROP_STATUS = 0, | 85 | POWER_SUPPLY_PROP_STATUS = 0, |
| @@ -116,6 +122,7 @@ enum power_supply_property { | |||
| 116 | POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, | 122 | POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, |
| 117 | POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, | 123 | POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, |
| 118 | POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */ | 124 | POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */ |
| 125 | POWER_SUPPLY_PROP_SCOPE, | ||
| 119 | /* Properties of type `const char *' */ | 126 | /* Properties of type `const char *' */ |
| 120 | POWER_SUPPLY_PROP_MODEL_NAME, | 127 | POWER_SUPPLY_PROP_MODEL_NAME, |
| 121 | POWER_SUPPLY_PROP_MANUFACTURER, | 128 | POWER_SUPPLY_PROP_MANUFACTURER, |
| @@ -123,7 +130,8 @@ enum power_supply_property { | |||
| 123 | }; | 130 | }; |
| 124 | 131 | ||
| 125 | enum power_supply_type { | 132 | enum power_supply_type { |
| 126 | POWER_SUPPLY_TYPE_BATTERY = 0, | 133 | POWER_SUPPLY_TYPE_UNKNOWN = 0, |
| 134 | POWER_SUPPLY_TYPE_BATTERY, | ||
| 127 | POWER_SUPPLY_TYPE_UPS, | 135 | POWER_SUPPLY_TYPE_UPS, |
| 128 | POWER_SUPPLY_TYPE_MAINS, | 136 | POWER_SUPPLY_TYPE_MAINS, |
| 129 | POWER_SUPPLY_TYPE_USB, /* Standard Downstream Port */ | 137 | POWER_SUPPLY_TYPE_USB, /* Standard Downstream Port */ |
| @@ -211,6 +219,7 @@ static inline int power_supply_is_system_supplied(void) { return -ENOSYS; } | |||
| 211 | extern int power_supply_register(struct device *parent, | 219 | extern int power_supply_register(struct device *parent, |
| 212 | struct power_supply *psy); | 220 | struct power_supply *psy); |
| 213 | extern void power_supply_unregister(struct power_supply *psy); | 221 | extern void power_supply_unregister(struct power_supply *psy); |
| 222 | extern int power_supply_powers(struct power_supply *psy, struct device *dev); | ||
| 214 | 223 | ||
| 215 | /* For APM emulation, think legacy userspace. */ | 224 | /* For APM emulation, think legacy userspace. */ |
| 216 | extern struct class *power_supply_class; | 225 | extern struct class *power_supply_class; |
diff --git a/include/linux/prctl.h b/include/linux/prctl.h index a3baeb2c2161..7ddc7f1b480f 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h | |||
| @@ -102,4 +102,16 @@ | |||
| 102 | 102 | ||
| 103 | #define PR_MCE_KILL_GET 34 | 103 | #define PR_MCE_KILL_GET 34 |
| 104 | 104 | ||
| 105 | /* | ||
| 106 | * Tune up process memory map specifics. | ||
| 107 | */ | ||
| 108 | #define PR_SET_MM 35 | ||
| 109 | # define PR_SET_MM_START_CODE 1 | ||
| 110 | # define PR_SET_MM_END_CODE 2 | ||
| 111 | # define PR_SET_MM_START_DATA 3 | ||
| 112 | # define PR_SET_MM_END_DATA 4 | ||
| 113 | # define PR_SET_MM_START_STACK 5 | ||
| 114 | # define PR_SET_MM_START_BRK 6 | ||
| 115 | # define PR_SET_MM_BRK 7 | ||
| 116 | |||
| 105 | #endif /* _LINUX_PRCTL_H */ | 117 | #endif /* _LINUX_PRCTL_H */ |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 6d9e575519cc..85c507306239 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
| @@ -253,7 +253,7 @@ extern const struct proc_ns_operations utsns_operations; | |||
| 253 | extern const struct proc_ns_operations ipcns_operations; | 253 | extern const struct proc_ns_operations ipcns_operations; |
| 254 | 254 | ||
| 255 | union proc_op { | 255 | union proc_op { |
| 256 | int (*proc_get_link)(struct inode *, struct path *); | 256 | int (*proc_get_link)(struct dentry *, struct path *); |
| 257 | int (*proc_read)(struct task_struct *task, char *page); | 257 | int (*proc_read)(struct task_struct *task, char *page); |
| 258 | int (*proc_show)(struct seq_file *m, | 258 | int (*proc_show)(struct seq_file *m, |
| 259 | struct pid_namespace *ns, struct pid *pid, | 259 | struct pid_namespace *ns, struct pid *pid, |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 800f113bea66..c2f1f6a5fcb8 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
| @@ -112,6 +112,7 @@ | |||
| 112 | 112 | ||
| 113 | #include <linux/compiler.h> /* For unlikely. */ | 113 | #include <linux/compiler.h> /* For unlikely. */ |
| 114 | #include <linux/sched.h> /* For struct task_struct. */ | 114 | #include <linux/sched.h> /* For struct task_struct. */ |
| 115 | #include <linux/err.h> /* for IS_ERR_VALUE */ | ||
| 115 | 116 | ||
| 116 | 117 | ||
| 117 | extern long arch_ptrace(struct task_struct *child, long request, | 118 | extern long arch_ptrace(struct task_struct *child, long request, |
| @@ -127,8 +128,9 @@ extern void __ptrace_link(struct task_struct *child, | |||
| 127 | struct task_struct *new_parent); | 128 | struct task_struct *new_parent); |
| 128 | extern void __ptrace_unlink(struct task_struct *child); | 129 | extern void __ptrace_unlink(struct task_struct *child); |
| 129 | extern void exit_ptrace(struct task_struct *tracer); | 130 | extern void exit_ptrace(struct task_struct *tracer); |
| 130 | #define PTRACE_MODE_READ 1 | 131 | #define PTRACE_MODE_READ 0x01 |
| 131 | #define PTRACE_MODE_ATTACH 2 | 132 | #define PTRACE_MODE_ATTACH 0x02 |
| 133 | #define PTRACE_MODE_NOAUDIT 0x04 | ||
| 132 | /* Returns 0 on success, -errno on denial. */ | 134 | /* Returns 0 on success, -errno on denial. */ |
| 133 | extern int __ptrace_may_access(struct task_struct *task, unsigned int mode); | 135 | extern int __ptrace_may_access(struct task_struct *task, unsigned int mode); |
| 134 | /* Returns true on success, false on denial. */ | 136 | /* Returns true on success, false on denial. */ |
| @@ -265,6 +267,15 @@ static inline void ptrace_release_task(struct task_struct *task) | |||
| 265 | #define force_successful_syscall_return() do { } while (0) | 267 | #define force_successful_syscall_return() do { } while (0) |
| 266 | #endif | 268 | #endif |
| 267 | 269 | ||
| 270 | #ifndef is_syscall_success | ||
| 271 | /* | ||
| 272 | * On most systems we can tell if a syscall is a success based on if the retval | ||
| 273 | * is an error value. On some systems like ia64 and powerpc they have different | ||
| 274 | * indicators of success/failure and must define their own. | ||
| 275 | */ | ||
| 276 | #define is_syscall_success(regs) (!IS_ERR_VALUE((unsigned long)(regs_return_value(regs)))) | ||
| 277 | #endif | ||
| 278 | |||
| 268 | /* | 279 | /* |
| 269 | * <asm/ptrace.h> should define the following things inside #ifdef __KERNEL__. | 280 | * <asm/ptrace.h> should define the following things inside #ifdef __KERNEL__. |
| 270 | * | 281 | * |
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/radix-tree.h b/include/linux/radix-tree.h index 9d4539c52e53..07e360b1b282 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
| @@ -49,9 +49,6 @@ | |||
| 49 | #define RADIX_TREE_EXCEPTIONAL_ENTRY 2 | 49 | #define RADIX_TREE_EXCEPTIONAL_ENTRY 2 |
| 50 | #define RADIX_TREE_EXCEPTIONAL_SHIFT 2 | 50 | #define RADIX_TREE_EXCEPTIONAL_SHIFT 2 |
| 51 | 51 | ||
| 52 | #define radix_tree_indirect_to_ptr(ptr) \ | ||
| 53 | radix_tree_indirect_to_ptr((void __force *)(ptr)) | ||
| 54 | |||
| 55 | static inline int radix_tree_is_indirect_ptr(void *ptr) | 52 | static inline int radix_tree_is_indirect_ptr(void *ptr) |
| 56 | { | 53 | { |
| 57 | return (int)((unsigned long)ptr & RADIX_TREE_INDIRECT_PTR); | 54 | return (int)((unsigned long)ptr & RADIX_TREE_INDIRECT_PTR); |
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index 9e65d9e20662..6f6df86f1ae5 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
| @@ -277,7 +277,10 @@ struct mdp_superblock_1 { | |||
| 277 | */ | 277 | */ |
| 278 | #define MD_FEATURE_RESHAPE_ACTIVE 4 | 278 | #define MD_FEATURE_RESHAPE_ACTIVE 4 |
| 279 | #define MD_FEATURE_BAD_BLOCKS 8 /* badblock list is not empty */ | 279 | #define MD_FEATURE_BAD_BLOCKS 8 /* badblock list is not empty */ |
| 280 | 280 | #define MD_FEATURE_REPLACEMENT 16 /* This device is replacing an | |
| 281 | #define MD_FEATURE_ALL (1|2|4|8) | 281 | * active device with same 'role'. |
| 282 | * 'recovery_offset' is also set. | ||
| 283 | */ | ||
| 284 | #define MD_FEATURE_ALL (1|2|4|8|16) | ||
| 282 | 285 | ||
| 283 | #endif | 286 | #endif |
diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h index 2b59cc824395..53272e9860a7 100644 --- a/include/linux/raid/pq.h +++ b/include/linux/raid/pq.h | |||
| @@ -132,7 +132,7 @@ void raid6_dual_recov(int disks, size_t bytes, int faila, int failb, | |||
| 132 | PROT_READ|PROT_WRITE, \ | 132 | PROT_READ|PROT_WRITE, \ |
| 133 | MAP_PRIVATE|MAP_ANONYMOUS,\ | 133 | MAP_PRIVATE|MAP_ANONYMOUS,\ |
| 134 | 0, 0)) | 134 | 0, 0)) |
| 135 | # define free_pages(x, y) munmap((void *)(x), (y)*PAGE_SIZE) | 135 | # define free_pages(x, y) munmap((void *)(x), PAGE_SIZE << (y)) |
| 136 | 136 | ||
| 137 | static inline void cpu_relax(void) | 137 | static inline void cpu_relax(void) |
| 138 | { | 138 | { |
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 690276a642cf..eb93921cdd30 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
| @@ -23,9 +23,8 @@ struct spi_device; | |||
| 23 | /* An enum of all the supported cache types */ | 23 | /* An enum of all the supported cache types */ |
| 24 | enum regcache_type { | 24 | enum regcache_type { |
| 25 | REGCACHE_NONE, | 25 | REGCACHE_NONE, |
| 26 | REGCACHE_INDEXED, | ||
| 27 | REGCACHE_RBTREE, | 26 | REGCACHE_RBTREE, |
| 28 | REGCACHE_LZO | 27 | REGCACHE_COMPRESSED |
| 29 | }; | 28 | }; |
| 30 | 29 | ||
| 31 | /** | 30 | /** |
| @@ -83,7 +82,7 @@ struct regmap_config { | |||
| 83 | bool (*precious_reg)(struct device *dev, unsigned int reg); | 82 | bool (*precious_reg)(struct device *dev, unsigned int reg); |
| 84 | 83 | ||
| 85 | unsigned int max_register; | 84 | unsigned int max_register; |
| 86 | struct reg_default *reg_defaults; | 85 | const struct reg_default *reg_defaults; |
| 87 | unsigned int num_reg_defaults; | 86 | unsigned int num_reg_defaults; |
| 88 | enum regcache_type cache_type; | 87 | enum regcache_type cache_type; |
| 89 | const void *reg_defaults_raw; | 88 | const void *reg_defaults_raw; |
| @@ -129,6 +128,8 @@ struct regmap *regmap_init_spi(struct spi_device *dev, | |||
| 129 | const struct regmap_config *config); | 128 | const struct regmap_config *config); |
| 130 | 129 | ||
| 131 | void regmap_exit(struct regmap *map); | 130 | void regmap_exit(struct regmap *map); |
| 131 | int regmap_reinit_cache(struct regmap *map, | ||
| 132 | const struct regmap_config *config); | ||
| 132 | int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); | 133 | int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); |
| 133 | int regmap_raw_write(struct regmap *map, unsigned int reg, | 134 | int regmap_raw_write(struct regmap *map, unsigned int reg, |
| 134 | const void *val, size_t val_len); | 135 | const void *val, size_t val_len); |
| @@ -139,9 +140,61 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val, | |||
| 139 | size_t val_count); | 140 | size_t val_count); |
| 140 | int regmap_update_bits(struct regmap *map, unsigned int reg, | 141 | int regmap_update_bits(struct regmap *map, unsigned int reg, |
| 141 | unsigned int mask, unsigned int val); | 142 | unsigned int mask, unsigned int val); |
| 143 | int regmap_update_bits_check(struct regmap *map, unsigned int reg, | ||
| 144 | unsigned int mask, unsigned int val, | ||
| 145 | bool *change); | ||
| 142 | 146 | ||
| 143 | int regcache_sync(struct regmap *map); | 147 | int regcache_sync(struct regmap *map); |
| 144 | void regcache_cache_only(struct regmap *map, bool enable); | 148 | void regcache_cache_only(struct regmap *map, bool enable); |
| 145 | void regcache_cache_bypass(struct regmap *map, bool enable); | 149 | void regcache_cache_bypass(struct regmap *map, bool enable); |
| 150 | void regcache_mark_dirty(struct regmap *map); | ||
| 151 | |||
| 152 | /** | ||
| 153 | * Description of an IRQ for the generic regmap irq_chip. | ||
| 154 | * | ||
| 155 | * @reg_offset: Offset of the status/mask register within the bank | ||
| 156 | * @mask: Mask used to flag/control the register. | ||
| 157 | */ | ||
| 158 | struct regmap_irq { | ||
| 159 | unsigned int reg_offset; | ||
| 160 | unsigned int mask; | ||
| 161 | }; | ||
| 162 | |||
| 163 | /** | ||
| 164 | * Description of a generic regmap irq_chip. This is not intended to | ||
| 165 | * handle every possible interrupt controller, but it should handle a | ||
| 166 | * substantial proportion of those that are found in the wild. | ||
| 167 | * | ||
| 168 | * @name: Descriptive name for IRQ controller. | ||
| 169 | * | ||
| 170 | * @status_base: Base status register address. | ||
| 171 | * @mask_base: Base mask register address. | ||
| 172 | * @ack_base: Base ack address. If zero then the chip is clear on read. | ||
| 173 | * | ||
| 174 | * @num_regs: Number of registers in each control bank. | ||
| 175 | * @irqs: Descriptors for individual IRQs. Interrupt numbers are | ||
| 176 | * assigned based on the index in the array of the interrupt. | ||
| 177 | * @num_irqs: Number of descriptors. | ||
| 178 | */ | ||
| 179 | struct regmap_irq_chip { | ||
| 180 | const char *name; | ||
| 181 | |||
| 182 | unsigned int status_base; | ||
| 183 | unsigned int mask_base; | ||
| 184 | unsigned int ack_base; | ||
| 185 | |||
| 186 | int num_regs; | ||
| 187 | |||
| 188 | const struct regmap_irq *irqs; | ||
| 189 | int num_irqs; | ||
| 190 | }; | ||
| 191 | |||
| 192 | struct regmap_irq_chip_data; | ||
| 193 | |||
| 194 | int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, | ||
| 195 | int irq_base, struct regmap_irq_chip *chip, | ||
| 196 | struct regmap_irq_chip_data **data); | ||
| 197 | void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); | ||
| 198 | int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data); | ||
| 146 | 199 | ||
| 147 | #endif | 200 | #endif |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index f7756d146c61..f2698a0edfc4 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
| @@ -149,6 +149,8 @@ int regulator_bulk_enable(int num_consumers, | |||
| 149 | struct regulator_bulk_data *consumers); | 149 | struct regulator_bulk_data *consumers); |
| 150 | int regulator_bulk_disable(int num_consumers, | 150 | int regulator_bulk_disable(int num_consumers, |
| 151 | struct regulator_bulk_data *consumers); | 151 | struct regulator_bulk_data *consumers); |
| 152 | int regulator_bulk_force_disable(int num_consumers, | ||
| 153 | struct regulator_bulk_data *consumers); | ||
| 152 | void regulator_bulk_free(int num_consumers, | 154 | void regulator_bulk_free(int num_consumers, |
| 153 | struct regulator_bulk_data *consumers); | 155 | struct regulator_bulk_data *consumers); |
| 154 | 156 | ||
| @@ -212,6 +214,11 @@ static inline int regulator_disable(struct regulator *regulator) | |||
| 212 | return 0; | 214 | return 0; |
| 213 | } | 215 | } |
| 214 | 216 | ||
| 217 | static inline int regulator_force_disable(struct regulator *regulator) | ||
| 218 | { | ||
| 219 | return 0; | ||
| 220 | } | ||
| 221 | |||
| 215 | static inline int regulator_disable_deferred(struct regulator *regulator, | 222 | static inline int regulator_disable_deferred(struct regulator *regulator, |
| 216 | int ms) | 223 | int ms) |
| 217 | { | 224 | { |
| @@ -242,6 +249,12 @@ static inline int regulator_bulk_disable(int num_consumers, | |||
| 242 | return 0; | 249 | return 0; |
| 243 | } | 250 | } |
| 244 | 251 | ||
| 252 | static inline int regulator_bulk_force_disable(int num_consumers, | ||
| 253 | struct regulator_bulk_data *consumers) | ||
| 254 | { | ||
| 255 | return 0; | ||
| 256 | } | ||
| 257 | |||
| 245 | static inline void regulator_bulk_free(int num_consumers, | 258 | static inline void regulator_bulk_free(int num_consumers, |
| 246 | struct regulator_bulk_data *consumers) | 259 | struct regulator_bulk_data *consumers) |
| 247 | { | 260 | { |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 52c89ae32f64..4214b9a9d1c9 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
| @@ -154,6 +154,7 @@ enum regulator_type { | |||
| 154 | * this type. | 154 | * this type. |
| 155 | * | 155 | * |
| 156 | * @name: Identifying name for the regulator. | 156 | * @name: Identifying name for the regulator. |
| 157 | * @supply_name: Identifying the regulator supply | ||
| 157 | * @id: Numerical identifier for the regulator. | 158 | * @id: Numerical identifier for the regulator. |
| 158 | * @n_voltages: Number of selectors available for ops.list_voltage(). | 159 | * @n_voltages: Number of selectors available for ops.list_voltage(). |
| 159 | * @ops: Regulator operations table. | 160 | * @ops: Regulator operations table. |
| @@ -163,6 +164,7 @@ enum regulator_type { | |||
| 163 | */ | 164 | */ |
| 164 | struct regulator_desc { | 165 | struct regulator_desc { |
| 165 | const char *name; | 166 | const char *name; |
| 167 | const char *supply_name; | ||
| 166 | int id; | 168 | int id; |
| 167 | unsigned n_voltages; | 169 | unsigned n_voltages; |
| 168 | struct regulator_ops *ops; | 170 | struct regulator_ops *ops; |
| @@ -212,7 +214,7 @@ struct regulator_dev { | |||
| 212 | 214 | ||
| 213 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | 215 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, |
| 214 | struct device *dev, const struct regulator_init_data *init_data, | 216 | struct device *dev, const struct regulator_init_data *init_data, |
| 215 | void *driver_data); | 217 | void *driver_data, struct device_node *of_node); |
| 216 | void regulator_unregister(struct regulator_dev *rdev); | 218 | void regulator_unregister(struct regulator_dev *rdev); |
| 217 | 219 | ||
| 218 | int regulator_notifier_call_chain(struct regulator_dev *rdev, | 220 | int regulator_notifier_call_chain(struct regulator_dev *rdev, |
diff --git a/include/linux/regulator/of_regulator.h b/include/linux/regulator/of_regulator.h new file mode 100644 index 000000000000..769704f296e5 --- /dev/null +++ b/include/linux/regulator/of_regulator.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* | ||
| 2 | * OpenFirmware regulator support routines | ||
| 3 | * | ||
| 4 | */ | ||
| 5 | |||
| 6 | #ifndef __LINUX_OF_REG_H | ||
| 7 | #define __LINUX_OF_REG_H | ||
| 8 | |||
| 9 | #if defined(CONFIG_OF) | ||
| 10 | extern struct regulator_init_data | ||
| 11 | *of_get_regulator_init_data(struct device *dev, | ||
| 12 | struct device_node *node); | ||
| 13 | #else | ||
| 14 | static inline struct regulator_init_data | ||
| 15 | *of_get_regulator_init_data(struct device *dev, | ||
| 16 | struct device_node *node) | ||
| 17 | { | ||
| 18 | return NULL; | ||
| 19 | } | ||
| 20 | #endif /* CONFIG_OF */ | ||
| 21 | |||
| 22 | #endif /* __LINUX_OF_REG_H */ | ||
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/rmap.h b/include/linux/rmap.h index 2148b122779b..1cdd62a2788a 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
| @@ -120,6 +120,7 @@ void anon_vma_init(void); /* create anon_vma_cachep */ | |||
| 120 | int anon_vma_prepare(struct vm_area_struct *); | 120 | int anon_vma_prepare(struct vm_area_struct *); |
| 121 | void unlink_anon_vmas(struct vm_area_struct *); | 121 | void unlink_anon_vmas(struct vm_area_struct *); |
| 122 | int anon_vma_clone(struct vm_area_struct *, struct vm_area_struct *); | 122 | int anon_vma_clone(struct vm_area_struct *, struct vm_area_struct *); |
| 123 | void anon_vma_moveto_tail(struct vm_area_struct *); | ||
| 123 | int anon_vma_fork(struct vm_area_struct *, struct vm_area_struct *); | 124 | int anon_vma_fork(struct vm_area_struct *, struct vm_area_struct *); |
| 124 | void __anon_vma_link(struct vm_area_struct *); | 125 | void __anon_vma_link(struct vm_area_struct *); |
| 125 | 126 | ||
| @@ -157,7 +158,7 @@ static inline void page_dup_rmap(struct page *page) | |||
| 157 | * Called from mm/vmscan.c to handle paging out | 158 | * Called from mm/vmscan.c to handle paging out |
| 158 | */ | 159 | */ |
| 159 | int page_referenced(struct page *, int is_locked, | 160 | int page_referenced(struct page *, int is_locked, |
| 160 | struct mem_cgroup *cnt, unsigned long *vm_flags); | 161 | struct mem_cgroup *memcg, unsigned long *vm_flags); |
| 161 | int page_referenced_one(struct page *, struct vm_area_struct *, | 162 | int page_referenced_one(struct page *, struct vm_area_struct *, |
| 162 | unsigned long address, unsigned int *mapcount, unsigned long *vm_flags); | 163 | unsigned long address, unsigned int *mapcount, unsigned long *vm_flags); |
| 163 | 164 | ||
| @@ -235,7 +236,7 @@ int rmap_walk(struct page *page, int (*rmap_one)(struct page *, | |||
| 235 | #define anon_vma_link(vma) do {} while (0) | 236 | #define anon_vma_link(vma) do {} while (0) |
| 236 | 237 | ||
| 237 | static inline int page_referenced(struct page *page, int is_locked, | 238 | static inline int page_referenced(struct page *page, int is_locked, |
| 238 | struct mem_cgroup *cnt, | 239 | struct mem_cgroup *memcg, |
| 239 | unsigned long *vm_flags) | 240 | unsigned long *vm_flags) |
| 240 | { | 241 | { |
| 241 | *vm_flags = 0; | 242 | *vm_flags = 0; |
diff --git a/include/linux/s3c_adc_battery.h b/include/linux/s3c_adc_battery.h index fbe58b7e63eb..99dadbffdd4f 100644 --- a/include/linux/s3c_adc_battery.h +++ b/include/linux/s3c_adc_battery.h | |||
| @@ -25,6 +25,10 @@ struct s3c_adc_bat_pdata { | |||
| 25 | const unsigned int current_channel; | 25 | const unsigned int current_channel; |
| 26 | const unsigned int backup_volt_channel; | 26 | const unsigned int backup_volt_channel; |
| 27 | 27 | ||
| 28 | const unsigned int volt_samples; | ||
| 29 | const unsigned int current_samples; | ||
| 30 | const unsigned int backup_volt_samples; | ||
| 31 | |||
| 28 | const unsigned int volt_mult; | 32 | const unsigned int volt_mult; |
| 29 | const unsigned int current_mult; | 33 | const unsigned int current_mult; |
| 30 | const unsigned int backup_volt_mult; | 34 | const unsigned int backup_volt_mult; |
diff --git a/include/linux/sched.h b/include/linux/sched.h index ad93e1ec8c65..7d379a6bfd88 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -637,13 +637,15 @@ struct signal_struct { | |||
| 637 | #endif | 637 | #endif |
| 638 | #ifdef CONFIG_CGROUPS | 638 | #ifdef CONFIG_CGROUPS |
| 639 | /* | 639 | /* |
| 640 | * The threadgroup_fork_lock prevents threads from forking with | 640 | * group_rwsem prevents new tasks from entering the threadgroup and |
| 641 | * CLONE_THREAD while held for writing. Use this for fork-sensitive | 641 | * member tasks from exiting,a more specifically, setting of |
| 642 | * threadgroup-wide operations. It's taken for reading in fork.c in | 642 | * PF_EXITING. fork and exit paths are protected with this rwsem |
| 643 | * copy_process(). | 643 | * using threadgroup_change_begin/end(). Users which require |
| 644 | * Currently only needed write-side by cgroups. | 644 | * threadgroup to remain stable should use threadgroup_[un]lock() |
| 645 | * which also takes care of exec path. Currently, cgroup is the | ||
| 646 | * only user. | ||
| 645 | */ | 647 | */ |
| 646 | struct rw_semaphore threadgroup_fork_lock; | 648 | struct rw_semaphore group_rwsem; |
| 647 | #endif | 649 | #endif |
| 648 | 650 | ||
| 649 | int oom_adj; /* OOM kill score adjustment (bit shift) */ | 651 | int oom_adj; /* OOM kill score adjustment (bit shift) */ |
| @@ -1542,6 +1544,7 @@ struct task_struct { | |||
| 1542 | */ | 1544 | */ |
| 1543 | int nr_dirtied; | 1545 | int nr_dirtied; |
| 1544 | int nr_dirtied_pause; | 1546 | int nr_dirtied_pause; |
| 1547 | unsigned long dirty_paused_when; /* start of a write-and-pause period */ | ||
| 1545 | 1548 | ||
| 1546 | #ifdef CONFIG_LATENCYTOP | 1549 | #ifdef CONFIG_LATENCYTOP |
| 1547 | int latency_record_count; | 1550 | int latency_record_count; |
| @@ -2085,9 +2088,9 @@ extern int sched_setscheduler_nocheck(struct task_struct *, int, | |||
| 2085 | extern struct task_struct *idle_task(int cpu); | 2088 | extern struct task_struct *idle_task(int cpu); |
| 2086 | /** | 2089 | /** |
| 2087 | * is_idle_task - is the specified task an idle task? | 2090 | * is_idle_task - is the specified task an idle task? |
| 2088 | * @tsk: the task in question. | 2091 | * @p: the task in question. |
| 2089 | */ | 2092 | */ |
| 2090 | static inline bool is_idle_task(struct task_struct *p) | 2093 | static inline bool is_idle_task(const struct task_struct *p) |
| 2091 | { | 2094 | { |
| 2092 | return p->pid == 0; | 2095 | return p->pid == 0; |
| 2093 | } | 2096 | } |
| @@ -2256,6 +2259,12 @@ static inline void mmdrop(struct mm_struct * mm) | |||
| 2256 | extern void mmput(struct mm_struct *); | 2259 | extern void mmput(struct mm_struct *); |
| 2257 | /* Grab a reference to a task's mm, if it is not already going away */ | 2260 | /* Grab a reference to a task's mm, if it is not already going away */ |
| 2258 | extern struct mm_struct *get_task_mm(struct task_struct *task); | 2261 | extern struct mm_struct *get_task_mm(struct task_struct *task); |
| 2262 | /* | ||
| 2263 | * Grab a reference to a task's mm, if it is not already going away | ||
| 2264 | * and ptrace_may_access with the mode parameter passed to it | ||
| 2265 | * succeeds. | ||
| 2266 | */ | ||
| 2267 | extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode); | ||
| 2259 | /* Remove the current tasks stale references to the old mm_struct */ | 2268 | /* Remove the current tasks stale references to the old mm_struct */ |
| 2260 | extern void mm_release(struct task_struct *, struct mm_struct *); | 2269 | extern void mm_release(struct task_struct *, struct mm_struct *); |
| 2261 | /* Allocate a new mm structure and copy contents from tsk->mm */ | 2270 | /* Allocate a new mm structure and copy contents from tsk->mm */ |
| @@ -2272,7 +2281,7 @@ extern void __cleanup_sighand(struct sighand_struct *); | |||
| 2272 | extern void exit_itimers(struct signal_struct *); | 2281 | extern void exit_itimers(struct signal_struct *); |
| 2273 | extern void flush_itimer_signals(void); | 2282 | extern void flush_itimer_signals(void); |
| 2274 | 2283 | ||
| 2275 | extern NORET_TYPE void do_group_exit(int); | 2284 | extern void do_group_exit(int); |
| 2276 | 2285 | ||
| 2277 | extern void daemonize(const char *, ...); | 2286 | extern void daemonize(const char *, ...); |
| 2278 | extern int allow_signal(int); | 2287 | extern int allow_signal(int); |
| @@ -2394,29 +2403,62 @@ static inline void unlock_task_sighand(struct task_struct *tsk, | |||
| 2394 | spin_unlock_irqrestore(&tsk->sighand->siglock, *flags); | 2403 | spin_unlock_irqrestore(&tsk->sighand->siglock, *flags); |
| 2395 | } | 2404 | } |
| 2396 | 2405 | ||
| 2397 | /* See the declaration of threadgroup_fork_lock in signal_struct. */ | ||
| 2398 | #ifdef CONFIG_CGROUPS | 2406 | #ifdef CONFIG_CGROUPS |
| 2399 | static inline void threadgroup_fork_read_lock(struct task_struct *tsk) | 2407 | static inline void threadgroup_change_begin(struct task_struct *tsk) |
| 2400 | { | 2408 | { |
| 2401 | down_read(&tsk->signal->threadgroup_fork_lock); | 2409 | down_read(&tsk->signal->group_rwsem); |
| 2402 | } | 2410 | } |
| 2403 | static inline void threadgroup_fork_read_unlock(struct task_struct *tsk) | 2411 | static inline void threadgroup_change_end(struct task_struct *tsk) |
| 2404 | { | 2412 | { |
| 2405 | up_read(&tsk->signal->threadgroup_fork_lock); | 2413 | up_read(&tsk->signal->group_rwsem); |
| 2406 | } | 2414 | } |
| 2407 | static inline void threadgroup_fork_write_lock(struct task_struct *tsk) | 2415 | |
| 2416 | /** | ||
| 2417 | * threadgroup_lock - lock threadgroup | ||
| 2418 | * @tsk: member task of the threadgroup to lock | ||
| 2419 | * | ||
| 2420 | * Lock the threadgroup @tsk belongs to. No new task is allowed to enter | ||
| 2421 | * and member tasks aren't allowed to exit (as indicated by PF_EXITING) or | ||
| 2422 | * perform exec. This is useful for cases where the threadgroup needs to | ||
| 2423 | * stay stable across blockable operations. | ||
| 2424 | * | ||
| 2425 | * fork and exit paths explicitly call threadgroup_change_{begin|end}() for | ||
| 2426 | * synchronization. While held, no new task will be added to threadgroup | ||
| 2427 | * and no existing live task will have its PF_EXITING set. | ||
| 2428 | * | ||
| 2429 | * During exec, a task goes and puts its thread group through unusual | ||
| 2430 | * changes. After de-threading, exclusive access is assumed to resources | ||
| 2431 | * which are usually shared by tasks in the same group - e.g. sighand may | ||
| 2432 | * be replaced with a new one. Also, the exec'ing task takes over group | ||
| 2433 | * leader role including its pid. Exclude these changes while locked by | ||
| 2434 | * grabbing cred_guard_mutex which is used to synchronize exec path. | ||
| 2435 | */ | ||
| 2436 | static inline void threadgroup_lock(struct task_struct *tsk) | ||
| 2408 | { | 2437 | { |
| 2409 | down_write(&tsk->signal->threadgroup_fork_lock); | 2438 | /* |
| 2439 | * exec uses exit for de-threading nesting group_rwsem inside | ||
| 2440 | * cred_guard_mutex. Grab cred_guard_mutex first. | ||
| 2441 | */ | ||
| 2442 | mutex_lock(&tsk->signal->cred_guard_mutex); | ||
| 2443 | down_write(&tsk->signal->group_rwsem); | ||
| 2410 | } | 2444 | } |
| 2411 | static inline void threadgroup_fork_write_unlock(struct task_struct *tsk) | 2445 | |
| 2446 | /** | ||
| 2447 | * threadgroup_unlock - unlock threadgroup | ||
| 2448 | * @tsk: member task of the threadgroup to unlock | ||
| 2449 | * | ||
| 2450 | * Reverse threadgroup_lock(). | ||
| 2451 | */ | ||
| 2452 | static inline void threadgroup_unlock(struct task_struct *tsk) | ||
| 2412 | { | 2453 | { |
| 2413 | up_write(&tsk->signal->threadgroup_fork_lock); | 2454 | up_write(&tsk->signal->group_rwsem); |
| 2455 | mutex_unlock(&tsk->signal->cred_guard_mutex); | ||
| 2414 | } | 2456 | } |
| 2415 | #else | 2457 | #else |
| 2416 | static inline void threadgroup_fork_read_lock(struct task_struct *tsk) {} | 2458 | static inline void threadgroup_change_begin(struct task_struct *tsk) {} |
| 2417 | static inline void threadgroup_fork_read_unlock(struct task_struct *tsk) {} | 2459 | static inline void threadgroup_change_end(struct task_struct *tsk) {} |
| 2418 | static inline void threadgroup_fork_write_lock(struct task_struct *tsk) {} | 2460 | static inline void threadgroup_lock(struct task_struct *tsk) {} |
| 2419 | static inline void threadgroup_fork_write_unlock(struct task_struct *tsk) {} | 2461 | static inline void threadgroup_unlock(struct task_struct *tsk) {} |
| 2420 | #endif | 2462 | #endif |
| 2421 | 2463 | ||
| 2422 | #ifndef __HAVE_THREAD_FUNCTIONS | 2464 | #ifndef __HAVE_THREAD_FUNCTIONS |
diff --git a/include/linux/security.h b/include/linux/security.h index 98112cf93884..83c18e8c846d 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -54,8 +54,8 @@ struct user_namespace; | |||
| 54 | * These functions are in security/capability.c and are used | 54 | * These functions are in security/capability.c and are used |
| 55 | * as the default capabilities functions | 55 | * as the default capabilities functions |
| 56 | */ | 56 | */ |
| 57 | extern int cap_capable(struct task_struct *tsk, const struct cred *cred, | 57 | extern int cap_capable(const struct cred *cred, struct user_namespace *ns, |
| 58 | struct user_namespace *ns, int cap, int audit); | 58 | int cap, int audit); |
| 59 | extern int cap_settime(const struct timespec *ts, const struct timezone *tz); | 59 | extern int cap_settime(const struct timespec *ts, const struct timezone *tz); |
| 60 | extern int cap_ptrace_access_check(struct task_struct *child, unsigned int mode); | 60 | extern int cap_ptrace_access_check(struct task_struct *child, unsigned int mode); |
| 61 | extern int cap_ptrace_traceme(struct task_struct *parent); | 61 | extern int cap_ptrace_traceme(struct task_struct *parent); |
| @@ -96,7 +96,6 @@ struct xfrm_user_sec_ctx; | |||
| 96 | struct seq_file; | 96 | struct seq_file; |
| 97 | 97 | ||
| 98 | extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); | 98 | extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); |
| 99 | extern int cap_netlink_recv(struct sk_buff *skb, int cap); | ||
| 100 | 99 | ||
| 101 | void reset_security_ops(void); | 100 | void reset_security_ops(void); |
| 102 | 101 | ||
| @@ -590,6 +589,8 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 590 | * @reqprot contains the protection requested by the application. | 589 | * @reqprot contains the protection requested by the application. |
| 591 | * @prot contains the protection that will be applied by the kernel. | 590 | * @prot contains the protection that will be applied by the kernel. |
| 592 | * @flags contains the operational flags. | 591 | * @flags contains the operational flags. |
| 592 | * @addr contains virtual address that will be used for the operation. | ||
| 593 | * @addr_only contains a boolean: 0 if file-backed VMA, otherwise 1. | ||
| 593 | * Return 0 if permission is granted. | 594 | * Return 0 if permission is granted. |
| 594 | * @file_mprotect: | 595 | * @file_mprotect: |
| 595 | * Check permissions before changing memory access permissions. | 596 | * Check permissions before changing memory access permissions. |
| @@ -797,12 +798,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 797 | * @skb contains the sk_buff structure for the netlink message. | 798 | * @skb contains the sk_buff structure for the netlink message. |
| 798 | * Return 0 if the information was successfully saved and message | 799 | * Return 0 if the information was successfully saved and message |
| 799 | * is allowed to be transmitted. | 800 | * is allowed to be transmitted. |
| 800 | * @netlink_recv: | ||
| 801 | * Check permission before processing the received netlink message in | ||
| 802 | * @skb. | ||
| 803 | * @skb contains the sk_buff structure for the netlink message. | ||
| 804 | * @cap indicates the capability required | ||
| 805 | * Return 0 if permission is granted. | ||
| 806 | * | 801 | * |
| 807 | * Security hooks for Unix domain networking. | 802 | * Security hooks for Unix domain networking. |
| 808 | * | 803 | * |
| @@ -1266,7 +1261,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 1266 | * @capable: | 1261 | * @capable: |
| 1267 | * Check whether the @tsk process has the @cap capability in the indicated | 1262 | * Check whether the @tsk process has the @cap capability in the indicated |
| 1268 | * credentials. | 1263 | * credentials. |
| 1269 | * @tsk contains the task_struct for the process. | ||
| 1270 | * @cred contains the credentials to use. | 1264 | * @cred contains the credentials to use. |
| 1271 | * @ns contains the user namespace we want the capability in | 1265 | * @ns contains the user namespace we want the capability in |
| 1272 | * @cap contains the capability <include/linux/capability.h>. | 1266 | * @cap contains the capability <include/linux/capability.h>. |
| @@ -1390,8 +1384,8 @@ struct security_operations { | |||
| 1390 | const kernel_cap_t *effective, | 1384 | const kernel_cap_t *effective, |
| 1391 | const kernel_cap_t *inheritable, | 1385 | const kernel_cap_t *inheritable, |
| 1392 | const kernel_cap_t *permitted); | 1386 | const kernel_cap_t *permitted); |
| 1393 | int (*capable) (struct task_struct *tsk, const struct cred *cred, | 1387 | int (*capable) (const struct cred *cred, struct user_namespace *ns, |
| 1394 | struct user_namespace *ns, int cap, int audit); | 1388 | int cap, int audit); |
| 1395 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); | 1389 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); |
| 1396 | int (*quota_on) (struct dentry *dentry); | 1390 | int (*quota_on) (struct dentry *dentry); |
| 1397 | int (*syslog) (int type); | 1391 | int (*syslog) (int type); |
| @@ -1561,7 +1555,6 @@ struct security_operations { | |||
| 1561 | struct sembuf *sops, unsigned nsops, int alter); | 1555 | struct sembuf *sops, unsigned nsops, int alter); |
| 1562 | 1556 | ||
| 1563 | int (*netlink_send) (struct sock *sk, struct sk_buff *skb); | 1557 | int (*netlink_send) (struct sock *sk, struct sk_buff *skb); |
| 1564 | int (*netlink_recv) (struct sk_buff *skb, int cap); | ||
| 1565 | 1558 | ||
| 1566 | void (*d_instantiate) (struct dentry *dentry, struct inode *inode); | 1559 | void (*d_instantiate) (struct dentry *dentry, struct inode *inode); |
| 1567 | 1560 | ||
| @@ -1673,12 +1666,10 @@ int security_capset(struct cred *new, const struct cred *old, | |||
| 1673 | const kernel_cap_t *effective, | 1666 | const kernel_cap_t *effective, |
| 1674 | const kernel_cap_t *inheritable, | 1667 | const kernel_cap_t *inheritable, |
| 1675 | const kernel_cap_t *permitted); | 1668 | const kernel_cap_t *permitted); |
| 1676 | int security_capable(struct user_namespace *ns, const struct cred *cred, | 1669 | int security_capable(const struct cred *cred, struct user_namespace *ns, |
| 1677 | int cap); | ||
| 1678 | int security_real_capable(struct task_struct *tsk, struct user_namespace *ns, | ||
| 1679 | int cap); | 1670 | int cap); |
| 1680 | int security_real_capable_noaudit(struct task_struct *tsk, | 1671 | int security_capable_noaudit(const struct cred *cred, struct user_namespace *ns, |
| 1681 | struct user_namespace *ns, int cap); | 1672 | int cap); |
| 1682 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); | 1673 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); |
| 1683 | int security_quota_on(struct dentry *dentry); | 1674 | int security_quota_on(struct dentry *dentry); |
| 1684 | int security_syslog(int type); | 1675 | int security_syslog(int type); |
| @@ -1815,7 +1806,6 @@ void security_d_instantiate(struct dentry *dentry, struct inode *inode); | |||
| 1815 | int security_getprocattr(struct task_struct *p, char *name, char **value); | 1806 | int security_getprocattr(struct task_struct *p, char *name, char **value); |
| 1816 | int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size); | 1807 | int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size); |
| 1817 | int security_netlink_send(struct sock *sk, struct sk_buff *skb); | 1808 | int security_netlink_send(struct sock *sk, struct sk_buff *skb); |
| 1818 | int security_netlink_recv(struct sk_buff *skb, int cap); | ||
| 1819 | int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen); | 1809 | int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen); |
| 1820 | int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid); | 1810 | int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid); |
| 1821 | void security_release_secctx(char *secdata, u32 seclen); | 1811 | void security_release_secctx(char *secdata, u32 seclen); |
| @@ -1873,32 +1863,15 @@ static inline int security_capset(struct cred *new, | |||
| 1873 | return cap_capset(new, old, effective, inheritable, permitted); | 1863 | return cap_capset(new, old, effective, inheritable, permitted); |
| 1874 | } | 1864 | } |
| 1875 | 1865 | ||
| 1876 | static inline int security_capable(struct user_namespace *ns, | 1866 | static inline int security_capable(const struct cred *cred, |
| 1877 | const struct cred *cred, int cap) | 1867 | struct user_namespace *ns, int cap) |
| 1878 | { | ||
| 1879 | return cap_capable(current, cred, ns, cap, SECURITY_CAP_AUDIT); | ||
| 1880 | } | ||
| 1881 | |||
| 1882 | static inline int security_real_capable(struct task_struct *tsk, struct user_namespace *ns, int cap) | ||
| 1883 | { | 1868 | { |
| 1884 | int ret; | 1869 | return cap_capable(cred, ns, cap, SECURITY_CAP_AUDIT); |
| 1885 | |||
| 1886 | rcu_read_lock(); | ||
| 1887 | ret = cap_capable(tsk, __task_cred(tsk), ns, cap, SECURITY_CAP_AUDIT); | ||
| 1888 | rcu_read_unlock(); | ||
| 1889 | return ret; | ||
| 1890 | } | 1870 | } |
| 1891 | 1871 | ||
| 1892 | static inline | 1872 | static inline int security_capable_noaudit(const struct cred *cred, |
| 1893 | int security_real_capable_noaudit(struct task_struct *tsk, struct user_namespace *ns, int cap) | 1873 | struct user_namespace *ns, int cap) { |
| 1894 | { | 1874 | return cap_capable(cred, ns, cap, SECURITY_CAP_NOAUDIT); |
| 1895 | int ret; | ||
| 1896 | |||
| 1897 | rcu_read_lock(); | ||
| 1898 | ret = cap_capable(tsk, __task_cred(tsk), ns, cap, | ||
| 1899 | SECURITY_CAP_NOAUDIT); | ||
| 1900 | rcu_read_unlock(); | ||
| 1901 | return ret; | ||
| 1902 | } | 1875 | } |
| 1903 | 1876 | ||
| 1904 | static inline int security_quotactl(int cmds, int type, int id, | 1877 | static inline int security_quotactl(int cmds, int type, int id, |
| @@ -2043,7 +2016,7 @@ static inline void security_inode_free(struct inode *inode) | |||
| 2043 | static inline int security_inode_init_security(struct inode *inode, | 2016 | static inline int security_inode_init_security(struct inode *inode, |
| 2044 | struct inode *dir, | 2017 | struct inode *dir, |
| 2045 | const struct qstr *qstr, | 2018 | const struct qstr *qstr, |
| 2046 | initxattrs initxattrs, | 2019 | const initxattrs initxattrs, |
| 2047 | void *fs_data) | 2020 | void *fs_data) |
| 2048 | { | 2021 | { |
| 2049 | return 0; | 2022 | return 0; |
| @@ -2515,11 +2488,6 @@ static inline int security_netlink_send(struct sock *sk, struct sk_buff *skb) | |||
| 2515 | return cap_netlink_send(sk, skb); | 2488 | return cap_netlink_send(sk, skb); |
| 2516 | } | 2489 | } |
| 2517 | 2490 | ||
| 2518 | static inline int security_netlink_recv(struct sk_buff *skb, int cap) | ||
| 2519 | { | ||
| 2520 | return cap_netlink_recv(skb, cap); | ||
| 2521 | } | ||
| 2522 | |||
| 2523 | static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) | 2491 | static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) |
| 2524 | { | 2492 | { |
| 2525 | return -EOPNOTSUPP; | 2493 | return -EOPNOTSUPP; |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index 1f05bbeac01e..8f012f8ac8e9 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
| @@ -66,6 +66,7 @@ enum { | |||
| 66 | * dependent on the 8250 driver. | 66 | * dependent on the 8250 driver. |
| 67 | */ | 67 | */ |
| 68 | struct uart_port; | 68 | struct uart_port; |
| 69 | struct uart_8250_port; | ||
| 69 | 70 | ||
| 70 | int serial8250_register_port(struct uart_port *); | 71 | int serial8250_register_port(struct uart_port *); |
| 71 | void serial8250_unregister_port(int line); | 72 | void serial8250_unregister_port(int line); |
| @@ -81,7 +82,11 @@ extern void serial8250_do_set_termios(struct uart_port *port, | |||
| 81 | struct ktermios *termios, struct ktermios *old); | 82 | struct ktermios *termios, struct ktermios *old); |
| 82 | extern void serial8250_do_pm(struct uart_port *port, unsigned int state, | 83 | extern void serial8250_do_pm(struct uart_port *port, unsigned int state, |
| 83 | unsigned int oldstate); | 84 | unsigned int oldstate); |
| 85 | extern int fsl8250_handle_irq(struct uart_port *port); | ||
| 84 | int serial8250_handle_irq(struct uart_port *port, unsigned int iir); | 86 | int serial8250_handle_irq(struct uart_port *port, unsigned int iir); |
| 87 | unsigned char serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr); | ||
| 88 | void serial8250_tx_chars(struct uart_8250_port *up); | ||
| 89 | unsigned int serial8250_modem_status(struct uart_8250_port *up); | ||
| 85 | 90 | ||
| 86 | extern void serial8250_set_isa_configurator(void (*v) | 91 | extern void serial8250_set_isa_configurator(void (*v) |
| 87 | (int port, struct uart_port *up, | 92 | (int port, struct uart_port *up, |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index eadf33d0abba..c91ace70c21d 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
| @@ -207,6 +207,10 @@ | |||
| 207 | /* Xilinx PSS UART */ | 207 | /* Xilinx PSS UART */ |
| 208 | #define PORT_XUARTPS 98 | 208 | #define PORT_XUARTPS 98 |
| 209 | 209 | ||
| 210 | /* Atheros AR933X SoC */ | ||
| 211 | #define PORT_AR933X 99 | ||
| 212 | |||
| 213 | |||
| 210 | #ifdef __KERNEL__ | 214 | #ifdef __KERNEL__ |
| 211 | 215 | ||
| 212 | #include <linux/compiler.h> | 216 | #include <linux/compiler.h> |
| @@ -351,6 +355,7 @@ struct uart_port { | |||
| 351 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) | 355 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) |
| 352 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) | 356 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) |
| 353 | #define UPF_EXAR_EFR ((__force upf_t) (1 << 25)) | 357 | #define UPF_EXAR_EFR ((__force upf_t) (1 << 25)) |
| 358 | #define UPF_IIR_ONCE ((__force upf_t) (1 << 26)) | ||
| 354 | /* The exact UART type is known and should not be probed. */ | 359 | /* The exact UART type is known and should not be probed. */ |
| 355 | #define UPF_FIXED_TYPE ((__force upf_t) (1 << 27)) | 360 | #define UPF_FIXED_TYPE ((__force upf_t) (1 << 27)) |
| 356 | #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) | 361 | #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) |
| @@ -483,10 +488,19 @@ static inline int uart_tx_stopped(struct uart_port *port) | |||
| 483 | /* | 488 | /* |
| 484 | * The following are helper functions for the low level drivers. | 489 | * The following are helper functions for the low level drivers. |
| 485 | */ | 490 | */ |
| 491 | |||
| 492 | extern void uart_handle_dcd_change(struct uart_port *uport, | ||
| 493 | unsigned int status); | ||
| 494 | extern void uart_handle_cts_change(struct uart_port *uport, | ||
| 495 | unsigned int status); | ||
| 496 | |||
| 497 | extern void uart_insert_char(struct uart_port *port, unsigned int status, | ||
| 498 | unsigned int overrun, unsigned int ch, unsigned int flag); | ||
| 499 | |||
| 500 | #ifdef SUPPORT_SYSRQ | ||
| 486 | static inline int | 501 | static inline int |
| 487 | uart_handle_sysrq_char(struct uart_port *port, unsigned int ch) | 502 | uart_handle_sysrq_char(struct uart_port *port, unsigned int ch) |
| 488 | { | 503 | { |
| 489 | #ifdef SUPPORT_SYSRQ | ||
| 490 | if (port->sysrq) { | 504 | if (port->sysrq) { |
| 491 | if (ch && time_before(jiffies, port->sysrq)) { | 505 | if (ch && time_before(jiffies, port->sysrq)) { |
| 492 | handle_sysrq(ch); | 506 | handle_sysrq(ch); |
| @@ -495,11 +509,10 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch) | |||
| 495 | } | 509 | } |
| 496 | port->sysrq = 0; | 510 | port->sysrq = 0; |
| 497 | } | 511 | } |
| 498 | #endif | ||
| 499 | return 0; | 512 | return 0; |
| 500 | } | 513 | } |
| 501 | #ifndef SUPPORT_SYSRQ | 514 | #else |
| 502 | #define uart_handle_sysrq_char(port,ch) uart_handle_sysrq_char(port, 0) | 515 | #define uart_handle_sysrq_char(port,ch) ({ (void)port; 0; }) |
| 503 | #endif | 516 | #endif |
| 504 | 517 | ||
| 505 | /* | 518 | /* |
| @@ -522,89 +535,6 @@ static inline int uart_handle_break(struct uart_port *port) | |||
| 522 | return 0; | 535 | return 0; |
| 523 | } | 536 | } |
| 524 | 537 | ||
| 525 | /** | ||
| 526 | * uart_handle_dcd_change - handle a change of carrier detect state | ||
| 527 | * @uport: uart_port structure for the open port | ||
| 528 | * @status: new carrier detect status, nonzero if active | ||
| 529 | */ | ||
| 530 | static inline void | ||
| 531 | uart_handle_dcd_change(struct uart_port *uport, unsigned int status) | ||
| 532 | { | ||
| 533 | struct uart_state *state = uport->state; | ||
| 534 | struct tty_port *port = &state->port; | ||
| 535 | struct tty_ldisc *ld = tty_ldisc_ref(port->tty); | ||
| 536 | struct pps_event_time ts; | ||
| 537 | |||
| 538 | if (ld && ld->ops->dcd_change) | ||
| 539 | pps_get_ts(&ts); | ||
| 540 | |||
| 541 | uport->icount.dcd++; | ||
| 542 | #ifdef CONFIG_HARD_PPS | ||
| 543 | if ((uport->flags & UPF_HARDPPS_CD) && status) | ||
| 544 | hardpps(); | ||
| 545 | #endif | ||
| 546 | |||
| 547 | if (port->flags & ASYNC_CHECK_CD) { | ||
| 548 | if (status) | ||
| 549 | wake_up_interruptible(&port->open_wait); | ||
| 550 | else if (port->tty) | ||
| 551 | tty_hangup(port->tty); | ||
| 552 | } | ||
| 553 | |||
| 554 | if (ld && ld->ops->dcd_change) | ||
| 555 | ld->ops->dcd_change(port->tty, status, &ts); | ||
| 556 | if (ld) | ||
| 557 | tty_ldisc_deref(ld); | ||
| 558 | } | ||
| 559 | |||
| 560 | /** | ||
| 561 | * uart_handle_cts_change - handle a change of clear-to-send state | ||
| 562 | * @uport: uart_port structure for the open port | ||
| 563 | * @status: new clear to send status, nonzero if active | ||
| 564 | */ | ||
| 565 | static inline void | ||
| 566 | uart_handle_cts_change(struct uart_port *uport, unsigned int status) | ||
| 567 | { | ||
| 568 | struct tty_port *port = &uport->state->port; | ||
| 569 | struct tty_struct *tty = port->tty; | ||
| 570 | |||
| 571 | uport->icount.cts++; | ||
| 572 | |||
| 573 | if (port->flags & ASYNC_CTS_FLOW) { | ||
| 574 | if (tty->hw_stopped) { | ||
| 575 | if (status) { | ||
| 576 | tty->hw_stopped = 0; | ||
| 577 | uport->ops->start_tx(uport); | ||
| 578 | uart_write_wakeup(uport); | ||
| 579 | } | ||
| 580 | } else { | ||
| 581 | if (!status) { | ||
| 582 | tty->hw_stopped = 1; | ||
| 583 | uport->ops->stop_tx(uport); | ||
| 584 | } | ||
| 585 | } | ||
| 586 | } | ||
| 587 | } | ||
| 588 | |||
| 589 | #include <linux/tty_flip.h> | ||
| 590 | |||
| 591 | static inline void | ||
| 592 | uart_insert_char(struct uart_port *port, unsigned int status, | ||
| 593 | unsigned int overrun, unsigned int ch, unsigned int flag) | ||
| 594 | { | ||
| 595 | struct tty_struct *tty = port->state->port.tty; | ||
| 596 | |||
| 597 | if ((status & port->ignore_status_mask & ~overrun) == 0) | ||
| 598 | tty_insert_flip_char(tty, ch, flag); | ||
| 599 | |||
| 600 | /* | ||
| 601 | * Overrun is special. Since it's reported immediately, | ||
| 602 | * it doesn't affect the current character. | ||
| 603 | */ | ||
| 604 | if (status & ~port->ignore_status_mask & overrun) | ||
| 605 | tty_insert_flip_char(tty, 0, TTY_OVERRUN); | ||
| 606 | } | ||
| 607 | |||
| 608 | /* | 538 | /* |
| 609 | * UART_ENABLE_MS - determine if port should enable modem status irqs | 539 | * UART_ENABLE_MS - determine if port should enable modem status irqs |
| 610 | */ | 540 | */ |
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index 369273a52679..78779074f6e8 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
| @@ -49,6 +49,10 @@ enum { | |||
| 49 | 49 | ||
| 50 | #define SCIF_DEFAULT_ERROR_MASK (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK) | 50 | #define SCIF_DEFAULT_ERROR_MASK (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK) |
| 51 | 51 | ||
| 52 | /* SCSPTR, optional */ | ||
| 53 | #define SCSPTR_RTSIO (1 << 7) | ||
| 54 | #define SCSPTR_CTSIO (1 << 5) | ||
| 55 | |||
| 52 | /* Offsets into the sci_port->irqs array */ | 56 | /* Offsets into the sci_port->irqs array */ |
| 53 | enum { | 57 | enum { |
| 54 | SCIx_ERI_IRQ, | 58 | SCIx_ERI_IRQ, |
| @@ -60,6 +64,17 @@ enum { | |||
| 60 | SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */ | 64 | SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */ |
| 61 | }; | 65 | }; |
| 62 | 66 | ||
| 67 | /* Offsets into the sci_port->gpios array */ | ||
| 68 | enum { | ||
| 69 | SCIx_SCK, | ||
| 70 | SCIx_RXD, | ||
| 71 | SCIx_TXD, | ||
| 72 | SCIx_CTS, | ||
| 73 | SCIx_RTS, | ||
| 74 | |||
| 75 | SCIx_NR_FNS, | ||
| 76 | }; | ||
| 77 | |||
| 63 | enum { | 78 | enum { |
| 64 | SCIx_PROBE_REGTYPE, | 79 | SCIx_PROBE_REGTYPE, |
| 65 | 80 | ||
| @@ -109,13 +124,20 @@ struct plat_sci_port_ops { | |||
| 109 | }; | 124 | }; |
| 110 | 125 | ||
| 111 | /* | 126 | /* |
| 127 | * Port-specific capabilities | ||
| 128 | */ | ||
| 129 | #define SCIx_HAVE_RTSCTS (1 << 0) | ||
| 130 | |||
| 131 | /* | ||
| 112 | * Platform device specific platform_data struct | 132 | * Platform device specific platform_data struct |
| 113 | */ | 133 | */ |
| 114 | struct plat_sci_port { | 134 | struct plat_sci_port { |
| 115 | unsigned long mapbase; /* resource base */ | 135 | unsigned long mapbase; /* resource base */ |
| 116 | unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */ | 136 | unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */ |
| 137 | unsigned int gpios[SCIx_NR_FNS]; /* SCK, RXD, TXD, CTS, RTS */ | ||
| 117 | unsigned int type; /* SCI / SCIF / IRDA */ | 138 | unsigned int type; /* SCI / SCIF / IRDA */ |
| 118 | upf_t flags; /* UPF_* flags */ | 139 | upf_t flags; /* UPF_* flags */ |
| 140 | unsigned long capabilities; /* Port features/capabilities */ | ||
| 119 | 141 | ||
| 120 | unsigned int scbrr_algo_id; /* SCBRR calculation algo */ | 142 | unsigned int scbrr_algo_id; /* SCBRR calculation algo */ |
| 121 | unsigned int scscr; /* SCSCR initialization */ | 143 | unsigned int scscr; /* SCSCR initialization */ |
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h index a20831cf336a..54341d811685 100644 --- a/include/linux/sh_clk.h +++ b/include/linux/sh_clk.h | |||
| @@ -49,6 +49,7 @@ struct clk { | |||
| 49 | 49 | ||
| 50 | void __iomem *enable_reg; | 50 | void __iomem *enable_reg; |
| 51 | unsigned int enable_bit; | 51 | unsigned int enable_bit; |
| 52 | void __iomem *mapped_reg; | ||
| 52 | 53 | ||
| 53 | unsigned long arch_flags; | 54 | unsigned long arch_flags; |
| 54 | void *priv; | 55 | void *priv; |
| @@ -131,10 +132,9 @@ int sh_clk_div4_enable_register(struct clk *clks, int nr, | |||
| 131 | int sh_clk_div4_reparent_register(struct clk *clks, int nr, | 132 | int sh_clk_div4_reparent_register(struct clk *clks, int nr, |
| 132 | struct clk_div4_table *table); | 133 | struct clk_div4_table *table); |
| 133 | 134 | ||
| 134 | #define SH_CLK_DIV6_EXT(_parent, _reg, _flags, _parents, \ | 135 | #define SH_CLK_DIV6_EXT(_reg, _flags, _parents, \ |
| 135 | _num_parents, _src_shift, _src_width) \ | 136 | _num_parents, _src_shift, _src_width) \ |
| 136 | { \ | 137 | { \ |
| 137 | .parent = _parent, \ | ||
| 138 | .enable_reg = (void __iomem *)_reg, \ | 138 | .enable_reg = (void __iomem *)_reg, \ |
| 139 | .flags = _flags, \ | 139 | .flags = _flags, \ |
| 140 | .parent_table = _parents, \ | 140 | .parent_table = _parents, \ |
| @@ -144,7 +144,11 @@ int sh_clk_div4_reparent_register(struct clk *clks, int nr, | |||
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | #define SH_CLK_DIV6(_parent, _reg, _flags) \ | 146 | #define SH_CLK_DIV6(_parent, _reg, _flags) \ |
| 147 | SH_CLK_DIV6_EXT(_parent, _reg, _flags, NULL, 0, 0, 0) | 147 | { \ |
| 148 | .parent = _parent, \ | ||
| 149 | .enable_reg = (void __iomem *)_reg, \ | ||
| 150 | .flags = _flags, \ | ||
| 151 | } | ||
| 148 | 152 | ||
| 149 | int sh_clk_div6_register(struct clk *clks, int nr); | 153 | int sh_clk_div6_register(struct clk *clks, int nr); |
| 150 | int sh_clk_div6_reparent_register(struct clk *clks, int nr); | 154 | int sh_clk_div6_reparent_register(struct clk *clks, int nr); |
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h index cb2dd118cc0f..8cd7fe59cf1a 100644 --- a/include/linux/sh_dma.h +++ b/include/linux/sh_dma.h | |||
| @@ -30,7 +30,7 @@ struct sh_desc { | |||
| 30 | struct sh_dmae_regs hw; | 30 | struct sh_dmae_regs hw; |
| 31 | struct list_head node; | 31 | struct list_head node; |
| 32 | struct dma_async_tx_descriptor async_tx; | 32 | struct dma_async_tx_descriptor async_tx; |
| 33 | enum dma_data_direction direction; | 33 | enum dma_transfer_direction direction; |
| 34 | dma_cookie_t cookie; | 34 | dma_cookie_t cookie; |
| 35 | size_t partial; | 35 | size_t partial; |
| 36 | int chunks; | 36 | int chunks; |
| @@ -48,6 +48,7 @@ struct sh_dmae_channel { | |||
| 48 | unsigned int offset; | 48 | unsigned int offset; |
| 49 | unsigned int dmars; | 49 | unsigned int dmars; |
| 50 | unsigned int dmars_bit; | 50 | unsigned int dmars_bit; |
| 51 | unsigned int chclr_offset; | ||
| 51 | }; | 52 | }; |
| 52 | 53 | ||
| 53 | struct sh_dmae_pdata { | 54 | struct sh_dmae_pdata { |
| @@ -68,6 +69,7 @@ struct sh_dmae_pdata { | |||
| 68 | unsigned int dmaor_is_32bit:1; | 69 | unsigned int dmaor_is_32bit:1; |
| 69 | unsigned int needs_tend_set:1; | 70 | unsigned int needs_tend_set:1; |
| 70 | unsigned int no_dmars:1; | 71 | unsigned int no_dmars:1; |
| 72 | unsigned int chclr_present:1; | ||
| 71 | }; | 73 | }; |
| 72 | 74 | ||
| 73 | /* DMA register */ | 75 | /* DMA register */ |
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h index 8446789216e5..5c15aed9c4b2 100644 --- a/include/linux/sh_pfc.h +++ b/include/linux/sh_pfc.h | |||
| @@ -45,16 +45,24 @@ struct pinmux_cfg_reg { | |||
| 45 | unsigned long reg, reg_width, field_width; | 45 | unsigned long reg, reg_width, field_width; |
| 46 | unsigned long *cnt; | 46 | unsigned long *cnt; |
| 47 | pinmux_enum_t *enum_ids; | 47 | pinmux_enum_t *enum_ids; |
| 48 | unsigned long *var_field_width; | ||
| 48 | }; | 49 | }; |
| 49 | 50 | ||
| 50 | #define PINMUX_CFG_REG(name, r, r_width, f_width) \ | 51 | #define PINMUX_CFG_REG(name, r, r_width, f_width) \ |
| 51 | .reg = r, .reg_width = r_width, .field_width = f_width, \ | 52 | .reg = r, .reg_width = r_width, .field_width = f_width, \ |
| 52 | .cnt = (unsigned long [r_width / f_width]) {}, \ | 53 | .cnt = (unsigned long [r_width / f_width]) {}, \ |
| 53 | .enum_ids = (pinmux_enum_t [(r_width / f_width) * (1 << f_width)]) \ | 54 | .enum_ids = (pinmux_enum_t [(r_width / f_width) * (1 << f_width)]) |
| 55 | |||
| 56 | #define PINMUX_CFG_REG_VAR(name, r, r_width, var_fw0, var_fwn...) \ | ||
| 57 | .reg = r, .reg_width = r_width, \ | ||
| 58 | .cnt = (unsigned long [r_width]) {}, \ | ||
| 59 | .var_field_width = (unsigned long [r_width]) { var_fw0, var_fwn, 0 }, \ | ||
| 60 | .enum_ids = (pinmux_enum_t []) | ||
| 54 | 61 | ||
| 55 | struct pinmux_data_reg { | 62 | struct pinmux_data_reg { |
| 56 | unsigned long reg, reg_width, reg_shadow; | 63 | unsigned long reg, reg_width, reg_shadow; |
| 57 | pinmux_enum_t *enum_ids; | 64 | pinmux_enum_t *enum_ids; |
| 65 | void __iomem *mapped_reg; | ||
| 58 | }; | 66 | }; |
| 59 | 67 | ||
| 60 | #define PINMUX_DATA_REG(name, r, r_width) \ | 68 | #define PINMUX_DATA_REG(name, r, r_width) \ |
| @@ -75,6 +83,12 @@ struct pinmux_range { | |||
| 75 | pinmux_enum_t force; | 83 | pinmux_enum_t force; |
| 76 | }; | 84 | }; |
| 77 | 85 | ||
| 86 | struct pfc_window { | ||
| 87 | phys_addr_t phys; | ||
| 88 | void __iomem *virt; | ||
| 89 | unsigned long size; | ||
| 90 | }; | ||
| 91 | |||
| 78 | struct pinmux_info { | 92 | struct pinmux_info { |
| 79 | char *name; | 93 | char *name; |
| 80 | pinmux_enum_t reserved_id; | 94 | pinmux_enum_t reserved_id; |
| @@ -98,6 +112,12 @@ struct pinmux_info { | |||
| 98 | struct pinmux_irq *gpio_irq; | 112 | struct pinmux_irq *gpio_irq; |
| 99 | unsigned int gpio_irq_size; | 113 | unsigned int gpio_irq_size; |
| 100 | 114 | ||
| 115 | struct resource *resource; | ||
| 116 | unsigned int num_resources; | ||
| 117 | struct pfc_window *window; | ||
| 118 | |||
| 119 | unsigned long unlock_reg; | ||
| 120 | |||
| 101 | struct gpio_chip chip; | 121 | struct gpio_chip chip; |
| 102 | }; | 122 | }; |
| 103 | 123 | ||
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/sigma.h b/include/linux/sigma.h deleted file mode 100644 index d0de882c0d96..000000000000 --- a/include/linux/sigma.h +++ /dev/null | |||
| @@ -1,55 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Load firmware files from Analog Devices SigmaStudio | ||
| 3 | * | ||
| 4 | * Copyright 2009-2011 Analog Devices Inc. | ||
| 5 | * | ||
| 6 | * Licensed under the GPL-2 or later. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __SIGMA_FIRMWARE_H__ | ||
| 10 | #define __SIGMA_FIRMWARE_H__ | ||
| 11 | |||
| 12 | #include <linux/firmware.h> | ||
| 13 | #include <linux/types.h> | ||
| 14 | |||
| 15 | struct i2c_client; | ||
| 16 | |||
| 17 | #define SIGMA_MAGIC "ADISIGM" | ||
| 18 | |||
| 19 | struct sigma_firmware { | ||
| 20 | const struct firmware *fw; | ||
| 21 | size_t pos; | ||
| 22 | }; | ||
| 23 | |||
| 24 | struct sigma_firmware_header { | ||
| 25 | unsigned char magic[7]; | ||
| 26 | u8 version; | ||
| 27 | __le32 crc; | ||
| 28 | }; | ||
| 29 | |||
| 30 | enum { | ||
| 31 | SIGMA_ACTION_WRITEXBYTES = 0, | ||
| 32 | SIGMA_ACTION_WRITESINGLE, | ||
| 33 | SIGMA_ACTION_WRITESAFELOAD, | ||
| 34 | SIGMA_ACTION_DELAY, | ||
| 35 | SIGMA_ACTION_PLLWAIT, | ||
| 36 | SIGMA_ACTION_NOOP, | ||
| 37 | SIGMA_ACTION_END, | ||
| 38 | }; | ||
| 39 | |||
| 40 | struct sigma_action { | ||
| 41 | u8 instr; | ||
| 42 | u8 len_hi; | ||
| 43 | __le16 len; | ||
| 44 | __be16 addr; | ||
| 45 | unsigned char payload[]; | ||
| 46 | }; | ||
| 47 | |||
| 48 | static inline u32 sigma_action_len(struct sigma_action *sa) | ||
| 49 | { | ||
| 50 | return (sa->len_hi << 16) | le16_to_cpu(sa->len); | ||
| 51 | } | ||
| 52 | |||
| 53 | extern int process_sigma_firmware(struct i2c_client *client, const char *name); | ||
| 54 | |||
| 55 | #endif | ||
diff --git a/include/linux/signal.h b/include/linux/signal.h index a822300a253b..7987ce74874b 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
| @@ -254,6 +254,7 @@ extern void set_current_blocked(const sigset_t *); | |||
| 254 | extern int show_unhandled_signals; | 254 | extern int show_unhandled_signals; |
| 255 | 255 | ||
| 256 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); | 256 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); |
| 257 | extern void block_sigmask(struct k_sigaction *ka, int signr); | ||
| 257 | extern void exit_signals(struct task_struct *tsk); | 258 | extern void exit_signals(struct task_struct *tsk); |
| 258 | 259 | ||
| 259 | extern struct kmem_cache *sighand_cachep; | 260 | extern struct kmem_cache *sighand_cachep; |
diff --git a/include/linux/sirfsoc_dma.h b/include/linux/sirfsoc_dma.h new file mode 100644 index 000000000000..29d959333d81 --- /dev/null +++ b/include/linux/sirfsoc_dma.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef _SIRFSOC_DMA_H_ | ||
| 2 | #define _SIRFSOC_DMA_H_ | ||
| 3 | |||
| 4 | bool sirfsoc_dma_filter_id(struct dma_chan *chan, void *chan_id); | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index d00e0bacda93..fbd1117fdfde 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
| @@ -15,8 +15,6 @@ | |||
| 15 | #include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */ | 15 | #include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */ |
| 16 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
| 17 | 17 | ||
| 18 | #include <trace/events/kmem.h> | ||
| 19 | |||
| 20 | /* | 18 | /* |
| 21 | * struct kmem_cache | 19 | * struct kmem_cache |
| 22 | * | 20 | * |
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/sound.h b/include/linux/sound.h index 44dcf0570432..fae20ba01fbf 100644 --- a/include/linux/sound.h +++ b/include/linux/sound.h | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | #ifndef _LINUX_SOUND_H | ||
| 2 | #define _LINUX_SOUND_H | ||
| 1 | 3 | ||
| 2 | /* | 4 | /* |
| 3 | * Minor numbers for the sound driver. | 5 | * Minor numbers for the sound driver. |
| @@ -42,3 +44,5 @@ extern void unregister_sound_mixer(int unit); | |||
| 42 | extern void unregister_sound_midi(int unit); | 44 | extern void unregister_sound_midi(int unit); |
| 43 | extern void unregister_sound_dsp(int unit); | 45 | extern void unregister_sound_dsp(int unit); |
| 44 | #endif /* __KERNEL__ */ | 46 | #endif /* __KERNEL__ */ |
| 47 | |||
| 48 | #endif /* _LINUX_SOUND_H */ | ||
diff --git a/include/linux/soundcard.h b/include/linux/soundcard.h index fe204fe39f7c..dfcf86f013a9 100644 --- a/include/linux/soundcard.h +++ b/include/linux/soundcard.h | |||
| @@ -198,7 +198,8 @@ typedef struct seq_event_rec { | |||
| 198 | # else | 198 | # else |
| 199 | # error "could not determine byte order" | 199 | # error "could not determine byte order" |
| 200 | # endif | 200 | # endif |
| 201 | #elif defined(__BYTE_ORDER) | 201 | #else |
| 202 | # if defined(__BYTE_ORDER) | ||
| 202 | # if __BYTE_ORDER == __BIG_ENDIAN | 203 | # if __BYTE_ORDER == __BIG_ENDIAN |
| 203 | # define AFMT_S16_NE AFMT_S16_BE | 204 | # define AFMT_S16_NE AFMT_S16_BE |
| 204 | # elif __BYTE_ORDER == __LITTLE_ENDIAN | 205 | # elif __BYTE_ORDER == __LITTLE_ENDIAN |
| @@ -206,6 +207,7 @@ typedef struct seq_event_rec { | |||
| 206 | # else | 207 | # else |
| 207 | # error "could not determine byte order" | 208 | # error "could not determine byte order" |
| 208 | # endif | 209 | # endif |
| 210 | # endif | ||
| 209 | #endif | 211 | #endif |
| 210 | 212 | ||
| 211 | /* | 213 | /* |
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index febc4dbec2ca..7874a8a56638 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
| @@ -26,6 +26,7 @@ struct auth_cred { | |||
| 26 | uid_t uid; | 26 | uid_t uid; |
| 27 | gid_t gid; | 27 | gid_t gid; |
| 28 | struct group_info *group_info; | 28 | struct group_info *group_info; |
| 29 | const char *principal; | ||
| 29 | unsigned char machine_cred : 1; | 30 | unsigned char machine_cred : 1; |
| 30 | }; | 31 | }; |
| 31 | 32 | ||
| @@ -127,7 +128,7 @@ void rpc_destroy_generic_auth(void); | |||
| 127 | void rpc_destroy_authunix(void); | 128 | void rpc_destroy_authunix(void); |
| 128 | 129 | ||
| 129 | struct rpc_cred * rpc_lookup_cred(void); | 130 | struct rpc_cred * rpc_lookup_cred(void); |
| 130 | struct rpc_cred * rpc_lookup_machine_cred(void); | 131 | struct rpc_cred * rpc_lookup_machine_cred(const char *service_name); |
| 131 | int rpcauth_register(const struct rpc_authops *); | 132 | int rpcauth_register(const struct rpc_authops *); |
| 132 | int rpcauth_unregister(const struct rpc_authops *); | 133 | int rpcauth_unregister(const struct rpc_authops *); |
| 133 | struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); | 134 | struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); |
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h index 8eee9dbbfe7a..f1cfd4c85cd0 100644 --- a/include/linux/sunrpc/auth_gss.h +++ b/include/linux/sunrpc/auth_gss.h | |||
| @@ -82,8 +82,8 @@ struct gss_cred { | |||
| 82 | enum rpc_gss_svc gc_service; | 82 | enum rpc_gss_svc gc_service; |
| 83 | struct gss_cl_ctx __rcu *gc_ctx; | 83 | struct gss_cl_ctx __rcu *gc_ctx; |
| 84 | struct gss_upcall_msg *gc_upcall; | 84 | struct gss_upcall_msg *gc_upcall; |
| 85 | const char *gc_principal; | ||
| 85 | unsigned long gc_upcall_timestamp; | 86 | unsigned long gc_upcall_timestamp; |
| 86 | unsigned char gc_machine_cred : 1; | ||
| 87 | }; | 87 | }; |
| 88 | 88 | ||
| 89 | #endif /* __KERNEL__ */ | 89 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index 8620f79658d4..dfa900948af7 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h | |||
| @@ -109,7 +109,7 @@ static inline int register_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u | |||
| 109 | 109 | ||
| 110 | int svc_reg_xprt_class(struct svc_xprt_class *); | 110 | int svc_reg_xprt_class(struct svc_xprt_class *); |
| 111 | void svc_unreg_xprt_class(struct svc_xprt_class *); | 111 | void svc_unreg_xprt_class(struct svc_xprt_class *); |
| 112 | void svc_xprt_init(struct svc_xprt_class *, struct svc_xprt *, | 112 | void svc_xprt_init(struct net *, struct svc_xprt_class *, struct svc_xprt *, |
| 113 | struct svc_serv *); | 113 | struct svc_serv *); |
| 114 | int svc_create_xprt(struct svc_serv *, const char *, struct net *, | 114 | int svc_create_xprt(struct svc_serv *, const char *, struct net *, |
| 115 | const int, const unsigned short, int); | 115 | const int, const unsigned short, int); |
| @@ -118,7 +118,6 @@ void svc_xprt_received(struct svc_xprt *); | |||
| 118 | void svc_xprt_put(struct svc_xprt *xprt); | 118 | void svc_xprt_put(struct svc_xprt *xprt); |
| 119 | void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt); | 119 | void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt); |
| 120 | void svc_close_xprt(struct svc_xprt *xprt); | 120 | void svc_close_xprt(struct svc_xprt *xprt); |
| 121 | void svc_delete_xprt(struct svc_xprt *xprt); | ||
| 122 | int svc_port_is_privileged(struct sockaddr *sin); | 121 | int svc_port_is_privileged(struct sockaddr *sin); |
| 123 | int svc_print_xprts(char *buf, int maxlen); | 122 | int svc_print_xprts(char *buf, int maxlen); |
| 124 | struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name, | 123 | struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name, |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 85c50b40759d..c84e9741cb2a 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
| @@ -34,7 +34,7 @@ struct svc_sock { | |||
| 34 | /* | 34 | /* |
| 35 | * Function prototypes. | 35 | * Function prototypes. |
| 36 | */ | 36 | */ |
| 37 | void svc_close_all(struct list_head *); | 37 | void svc_close_all(struct svc_serv *); |
| 38 | int svc_recv(struct svc_rqst *, long); | 38 | int svc_recv(struct svc_rqst *, long); |
| 39 | int svc_send(struct svc_rqst *); | 39 | int svc_send(struct svc_rqst *); |
| 40 | void svc_drop(struct svc_rqst *); | 40 | void svc_drop(struct svc_rqst *); |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index a20970ef9e4e..af70af333546 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
| @@ -191,6 +191,8 @@ extern int xdr_decode_array2(struct xdr_buf *buf, unsigned int base, | |||
| 191 | struct xdr_array2_desc *desc); | 191 | struct xdr_array2_desc *desc); |
| 192 | extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base, | 192 | extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base, |
| 193 | struct xdr_array2_desc *desc); | 193 | struct xdr_array2_desc *desc); |
| 194 | extern void _copy_from_pages(char *p, struct page **pages, size_t pgbase, | ||
| 195 | size_t len); | ||
| 194 | 196 | ||
| 195 | /* | 197 | /* |
| 196 | * Provide some simple tools for XDR buffer overflow-checking etc. | 198 | * Provide some simple tools for XDR buffer overflow-checking etc. |
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 1e22e126d2ac..3e60228e7299 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -207,6 +207,7 @@ struct swap_list_t { | |||
| 207 | /* linux/mm/page_alloc.c */ | 207 | /* linux/mm/page_alloc.c */ |
| 208 | extern unsigned long totalram_pages; | 208 | extern unsigned long totalram_pages; |
| 209 | extern unsigned long totalreserve_pages; | 209 | extern unsigned long totalreserve_pages; |
| 210 | extern unsigned long dirty_balance_reserve; | ||
| 210 | extern unsigned int nr_free_buffer_pages(void); | 211 | extern unsigned int nr_free_buffer_pages(void); |
| 211 | extern unsigned int nr_free_pagecache_pages(void); | 212 | extern unsigned int nr_free_pagecache_pages(void); |
| 212 | 213 | ||
| @@ -272,7 +273,7 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) | |||
| 272 | #endif | 273 | #endif |
| 273 | 274 | ||
| 274 | 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); |
| 275 | extern void scan_mapping_unevictable_pages(struct address_space *); | 276 | extern void check_move_unevictable_pages(struct page **, int nr_pages); |
| 276 | 277 | ||
| 277 | extern unsigned long scan_unevictable_pages; | 278 | extern unsigned long scan_unevictable_pages; |
| 278 | extern int scan_unevictable_handler(struct ctl_table *, int, | 279 | extern int scan_unevictable_handler(struct ctl_table *, int, |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 445702c60d04..e872526fdc5f 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
| @@ -24,7 +24,7 @@ extern int swiotlb_force; | |||
| 24 | 24 | ||
| 25 | extern void swiotlb_init(int verbose); | 25 | extern void swiotlb_init(int verbose); |
| 26 | extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); | 26 | extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); |
| 27 | extern unsigned long swioltb_nr_tbl(void); | 27 | extern unsigned long swiotlb_nr_tbl(void); |
| 28 | 28 | ||
| 29 | /* | 29 | /* |
| 30 | * Enumeration for sync targets | 30 | * Enumeration for sync targets |
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/tty_driver.h b/include/linux/tty_driver.h index ecdaeb98b293..5cf685086dd3 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
| @@ -312,7 +312,6 @@ struct tty_driver { | |||
| 312 | */ | 312 | */ |
| 313 | struct tty_struct **ttys; | 313 | struct tty_struct **ttys; |
| 314 | struct ktermios **termios; | 314 | struct ktermios **termios; |
| 315 | struct ktermios **termios_locked; | ||
| 316 | void *driver_state; | 315 | void *driver_state; |
| 317 | 316 | ||
| 318 | /* | 317 | /* |
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h index 5c75153f9441..d21b33c4c6ca 100644 --- a/include/linux/ucb1400.h +++ b/include/linux/ucb1400.h | |||
| @@ -96,13 +96,11 @@ struct ucb1400_gpio { | |||
| 96 | 96 | ||
| 97 | struct ucb1400_ts { | 97 | struct ucb1400_ts { |
| 98 | struct input_dev *ts_idev; | 98 | struct input_dev *ts_idev; |
| 99 | struct task_struct *ts_task; | ||
| 100 | int id; | 99 | int id; |
| 101 | wait_queue_head_t ts_wait; | ||
| 102 | unsigned int ts_restart:1; | ||
| 103 | int irq; | 100 | int irq; |
| 104 | unsigned int irq_pending; /* not bit field shared */ | ||
| 105 | struct snd_ac97 *ac97; | 101 | struct snd_ac97 *ac97; |
| 102 | wait_queue_head_t ts_wait; | ||
| 103 | bool stopped; | ||
| 106 | }; | 104 | }; |
| 107 | 105 | ||
| 108 | struct ucb1400 { | 106 | struct ucb1400 { |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 7f8d4d61ca47..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 |
| @@ -1233,6 +1234,7 @@ struct urb { | |||
| 1233 | void *transfer_buffer; /* (in) associated data buffer */ | 1234 | void *transfer_buffer; /* (in) associated data buffer */ |
| 1234 | dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ | 1235 | dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ |
| 1235 | struct scatterlist *sg; /* (in) scatter gather buffer list */ | 1236 | struct scatterlist *sg; /* (in) scatter gather buffer list */ |
| 1237 | int num_mapped_sgs; /* (internal) mapped sg entries */ | ||
| 1236 | int num_sgs; /* (in) number of entries in the sg list */ | 1238 | int num_sgs; /* (in) number of entries in the sg list */ |
| 1237 | u32 transfer_buffer_length; /* (in) data buffer length */ | 1239 | u32 transfer_buffer_length; /* (in) data buffer length */ |
| 1238 | u32 actual_length; /* (return) actual transfer length */ | 1240 | u32 actual_length; /* (return) actual transfer length */ |
| @@ -1610,6 +1612,19 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out) | |||
| 1610 | 1612 | ||
| 1611 | /* ----------------------------------------------------------------------- */ | 1613 | /* ----------------------------------------------------------------------- */ |
| 1612 | 1614 | ||
| 1615 | /* translate USB error codes to codes user space understands */ | ||
| 1616 | static inline int usb_translate_errors(int error_code) | ||
| 1617 | { | ||
| 1618 | switch (error_code) { | ||
| 1619 | case 0: | ||
| 1620 | case -ENOMEM: | ||
| 1621 | case -ENODEV: | ||
| 1622 | return error_code; | ||
| 1623 | default: | ||
| 1624 | return -EIO; | ||
| 1625 | } | ||
| 1626 | } | ||
| 1627 | |||
| 1613 | /* Events from the usb core */ | 1628 | /* Events from the usb core */ |
| 1614 | #define USB_DEVICE_ADD 0x0001 | 1629 | #define USB_DEVICE_ADD 0x0001 |
| 1615 | #define USB_DEVICE_REMOVE 0x0002 | 1630 | #define USB_DEVICE_REMOVE 0x0002 |
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h index 4ebaf0824179..31fdb4c6ee3d 100644 --- a/include/linux/usb/ch11.h +++ b/include/linux/usb/ch11.h | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #define HUB_RESET_TT 9 | 26 | #define HUB_RESET_TT 9 |
| 27 | #define HUB_GET_TT_STATE 10 | 27 | #define HUB_GET_TT_STATE 10 |
| 28 | #define HUB_STOP_TT 11 | 28 | #define HUB_STOP_TT 11 |
| 29 | #define HUB_SET_DEPTH 12 | ||
| 30 | 29 | ||
| 31 | /* | 30 | /* |
| 32 | * Hub class additional requests defined by USB 3.0 spec | 31 | * Hub class additional requests defined by USB 3.0 spec |
| @@ -165,11 +164,20 @@ struct usb_port_status { | |||
| 165 | * wHubCharacteristics (masks) | 164 | * wHubCharacteristics (masks) |
| 166 | * See USB 2.0 spec Table 11-13, offset 3 | 165 | * See USB 2.0 spec Table 11-13, offset 3 |
| 167 | */ | 166 | */ |
| 168 | #define HUB_CHAR_LPSM 0x0003 /* D1 .. D0 */ | 167 | #define HUB_CHAR_LPSM 0x0003 /* Logical Power Switching Mode mask */ |
| 169 | #define HUB_CHAR_COMPOUND 0x0004 /* D2 */ | 168 | #define HUB_CHAR_COMMON_LPSM 0x0000 /* All ports power control at once */ |
| 170 | #define HUB_CHAR_OCPM 0x0018 /* D4 .. D3 */ | 169 | #define HUB_CHAR_INDV_PORT_LPSM 0x0001 /* per-port power control */ |
| 171 | #define HUB_CHAR_TTTT 0x0060 /* D6 .. D5 */ | 170 | #define HUB_CHAR_NO_LPSM 0x0002 /* no power switching */ |
| 172 | #define HUB_CHAR_PORTIND 0x0080 /* D7 */ | 171 | |
| 172 | #define HUB_CHAR_COMPOUND 0x0004 /* hub is part of a compound device */ | ||
| 173 | |||
| 174 | #define HUB_CHAR_OCPM 0x0018 /* Over-Current Protection Mode mask */ | ||
| 175 | #define HUB_CHAR_COMMON_OCPM 0x0000 /* All ports Over-Current reporting */ | ||
| 176 | #define HUB_CHAR_INDV_PORT_OCPM 0x0008 /* per-port Over-current reporting */ | ||
| 177 | #define HUB_CHAR_NO_OCPM 0x0010 /* No Over-current Protection support */ | ||
| 178 | |||
| 179 | #define HUB_CHAR_TTTT 0x0060 /* TT Think Time mask */ | ||
| 180 | #define HUB_CHAR_PORTIND 0x0080 /* per-port indicators (LEDs) */ | ||
| 173 | 181 | ||
| 174 | struct usb_hub_status { | 182 | struct usb_hub_status { |
| 175 | __le16 wHubStatus; | 183 | __le16 wHubStatus; |
| @@ -198,6 +206,17 @@ struct usb_hub_status { | |||
| 198 | #define USB_DT_HUB_NONVAR_SIZE 7 | 206 | #define USB_DT_HUB_NONVAR_SIZE 7 |
| 199 | #define USB_DT_SS_HUB_SIZE 12 | 207 | #define USB_DT_SS_HUB_SIZE 12 |
| 200 | 208 | ||
| 209 | /* | ||
| 210 | * Hub Device descriptor | ||
| 211 | * USB Hub class device protocols | ||
| 212 | */ | ||
| 213 | |||
| 214 | #define USB_HUB_PR_FS 0 /* Full speed hub */ | ||
| 215 | #define USB_HUB_PR_HS_NO_TT 0 /* Hi-speed hub without TT */ | ||
| 216 | #define USB_HUB_PR_HS_SINGLE_TT 1 /* Hi-speed hub with single TT */ | ||
| 217 | #define USB_HUB_PR_HS_MULTI_TT 2 /* Hi-speed hub with multiple TT */ | ||
| 218 | #define USB_HUB_PR_SS 3 /* Super speed hub */ | ||
| 219 | |||
| 201 | struct usb_hub_descriptor { | 220 | struct usb_hub_descriptor { |
| 202 | __u8 bDescLength; | 221 | __u8 bDescLength; |
| 203 | __u8 bDescriptorType; | 222 | __u8 bDescriptorType; |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index d5da6c68c250..61b29057b054 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
| @@ -605,8 +605,26 @@ struct usb_ss_ep_comp_descriptor { | |||
| 605 | } __attribute__ ((packed)); | 605 | } __attribute__ ((packed)); |
| 606 | 606 | ||
| 607 | #define USB_DT_SS_EP_COMP_SIZE 6 | 607 | #define USB_DT_SS_EP_COMP_SIZE 6 |
| 608 | |||
| 608 | /* Bits 4:0 of bmAttributes if this is a bulk endpoint */ | 609 | /* Bits 4:0 of bmAttributes if this is a bulk endpoint */ |
| 609 | #define USB_SS_MAX_STREAMS(p) (1 << ((p) & 0x1f)) | 610 | static inline int |
| 611 | usb_ss_max_streams(const struct usb_ss_ep_comp_descriptor *comp) | ||
| 612 | { | ||
| 613 | int max_streams; | ||
| 614 | |||
| 615 | if (!comp) | ||
| 616 | return 0; | ||
| 617 | |||
| 618 | max_streams = comp->bmAttributes & 0x1f; | ||
| 619 | |||
| 620 | if (!max_streams) | ||
| 621 | return 0; | ||
| 622 | |||
| 623 | max_streams = 1 << max_streams; | ||
| 624 | |||
| 625 | return max_streams; | ||
| 626 | } | ||
| 627 | |||
| 610 | /* Bits 1:0 of bmAttributes if this is an isoc endpoint */ | 628 | /* Bits 1:0 of bmAttributes if this is an isoc endpoint */ |
| 611 | #define USB_SS_MULT(p) (1 + ((p) & 0x3)) | 629 | #define USB_SS_MULT(p) (1 + ((p) & 0x3)) |
| 612 | 630 | ||
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 1d3a67523ffc..da653b5c7134 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
| 21 | #include <linux/list.h> | 21 | #include <linux/list.h> |
| 22 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
| 23 | #include <linux/scatterlist.h> | ||
| 23 | #include <linux/types.h> | 24 | #include <linux/types.h> |
| 24 | #include <linux/usb/ch9.h> | 25 | #include <linux/usb/ch9.h> |
| 25 | 26 | ||
| @@ -32,6 +33,9 @@ struct usb_ep; | |||
| 32 | * @dma: DMA address corresponding to 'buf'. If you don't set this | 33 | * @dma: DMA address corresponding to 'buf'. If you don't set this |
| 33 | * field, and the usb controller needs one, it is responsible | 34 | * field, and the usb controller needs one, it is responsible |
| 34 | * for mapping and unmapping the buffer. | 35 | * for mapping and unmapping the buffer. |
| 36 | * @sg: a scatterlist for SG-capable controllers. | ||
| 37 | * @num_sgs: number of SG entries | ||
| 38 | * @num_mapped_sgs: number of SG entries mapped to DMA (internal) | ||
| 35 | * @length: Length of that data | 39 | * @length: Length of that data |
| 36 | * @stream_id: The stream id, when USB3.0 bulk streams are being used | 40 | * @stream_id: The stream id, when USB3.0 bulk streams are being used |
| 37 | * @no_interrupt: If true, hints that no completion irq is needed. | 41 | * @no_interrupt: If true, hints that no completion irq is needed. |
| @@ -88,6 +92,10 @@ struct usb_request { | |||
| 88 | unsigned length; | 92 | unsigned length; |
| 89 | dma_addr_t dma; | 93 | dma_addr_t dma; |
| 90 | 94 | ||
| 95 | struct scatterlist *sg; | ||
| 96 | unsigned num_sgs; | ||
| 97 | unsigned num_mapped_sgs; | ||
| 98 | |||
| 91 | unsigned stream_id:16; | 99 | unsigned stream_id:16; |
| 92 | unsigned no_interrupt:1; | 100 | unsigned no_interrupt:1; |
| 93 | unsigned zero:1; | 101 | unsigned zero:1; |
| @@ -164,7 +172,7 @@ struct usb_ep { | |||
| 164 | unsigned maxpacket:16; | 172 | unsigned maxpacket:16; |
| 165 | unsigned max_streams:16; | 173 | unsigned max_streams:16; |
| 166 | unsigned mult:2; | 174 | unsigned mult:2; |
| 167 | unsigned maxburst:4; | 175 | unsigned maxburst:5; |
| 168 | u8 address; | 176 | u8 address; |
| 169 | const struct usb_endpoint_descriptor *desc; | 177 | const struct usb_endpoint_descriptor *desc; |
| 170 | const struct usb_ss_ep_comp_descriptor *comp_desc; | 178 | const struct usb_ss_ep_comp_descriptor *comp_desc; |
| @@ -477,8 +485,9 @@ struct usb_gadget_ops { | |||
| 477 | * driver setup() requests | 485 | * driver setup() requests |
| 478 | * @ep_list: List of other endpoints supported by the device. | 486 | * @ep_list: List of other endpoints supported by the device. |
| 479 | * @speed: Speed of current connection to USB host. | 487 | * @speed: Speed of current connection to USB host. |
| 480 | * @is_dualspeed: True if the controller supports both high and full speed | 488 | * @max_speed: Maximal speed the UDC can handle. UDC must support this |
| 481 | * operation. If it does, the gadget driver must also support both. | 489 | * and all slower speeds. |
| 490 | * @sg_supported: true if we can handle scatter-gather | ||
| 482 | * @is_otg: True if the USB device port uses a Mini-AB jack, so that the | 491 | * @is_otg: True if the USB device port uses a Mini-AB jack, so that the |
| 483 | * gadget driver must provide a USB OTG descriptor. | 492 | * gadget driver must provide a USB OTG descriptor. |
| 484 | * @is_a_peripheral: False unless is_otg, the "A" end of a USB cable | 493 | * @is_a_peripheral: False unless is_otg, the "A" end of a USB cable |
| @@ -518,7 +527,8 @@ struct usb_gadget { | |||
| 518 | struct usb_ep *ep0; | 527 | struct usb_ep *ep0; |
| 519 | struct list_head ep_list; /* of usb_ep */ | 528 | struct list_head ep_list; /* of usb_ep */ |
| 520 | enum usb_device_speed speed; | 529 | enum usb_device_speed speed; |
| 521 | unsigned is_dualspeed:1; | 530 | enum usb_device_speed max_speed; |
| 531 | unsigned sg_supported:1; | ||
| 522 | unsigned is_otg:1; | 532 | unsigned is_otg:1; |
| 523 | unsigned is_a_peripheral:1; | 533 | unsigned is_a_peripheral:1; |
| 524 | unsigned b_hnp_enable:1; | 534 | unsigned b_hnp_enable:1; |
| @@ -549,7 +559,7 @@ static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev) | |||
| 549 | static inline int gadget_is_dualspeed(struct usb_gadget *g) | 559 | static inline int gadget_is_dualspeed(struct usb_gadget *g) |
| 550 | { | 560 | { |
| 551 | #ifdef CONFIG_USB_GADGET_DUALSPEED | 561 | #ifdef CONFIG_USB_GADGET_DUALSPEED |
| 552 | /* runtime test would check "g->is_dualspeed" ... that might be | 562 | /* runtime test would check "g->max_speed" ... that might be |
| 553 | * useful to work around hardware bugs, but is mostly pointless | 563 | * useful to work around hardware bugs, but is mostly pointless |
| 554 | */ | 564 | */ |
| 555 | return 1; | 565 | return 1; |
| @@ -567,7 +577,7 @@ static inline int gadget_is_superspeed(struct usb_gadget *g) | |||
| 567 | { | 577 | { |
| 568 | #ifdef CONFIG_USB_GADGET_SUPERSPEED | 578 | #ifdef CONFIG_USB_GADGET_SUPERSPEED |
| 569 | /* | 579 | /* |
| 570 | * runtime test would check "g->is_superspeed" ... that might be | 580 | * runtime test would check "g->max_speed" ... that might be |
| 571 | * useful to work around hardware bugs, but is mostly pointless | 581 | * useful to work around hardware bugs, but is mostly pointless |
| 572 | */ | 582 | */ |
| 573 | return 1; | 583 | return 1; |
| @@ -760,7 +770,7 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget) | |||
| 760 | /** | 770 | /** |
| 761 | * struct usb_gadget_driver - driver for usb 'slave' devices | 771 | * struct usb_gadget_driver - driver for usb 'slave' devices |
| 762 | * @function: String describing the gadget's function | 772 | * @function: String describing the gadget's function |
| 763 | * @speed: Highest speed the driver handles. | 773 | * @max_speed: Highest speed the driver handles. |
| 764 | * @setup: Invoked for ep0 control requests that aren't handled by | 774 | * @setup: Invoked for ep0 control requests that aren't handled by |
| 765 | * the hardware level driver. Most calls must be handled by | 775 | * the hardware level driver. Most calls must be handled by |
| 766 | * the gadget driver, including descriptor and configuration | 776 | * the gadget driver, including descriptor and configuration |
| @@ -824,7 +834,7 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget) | |||
| 824 | */ | 834 | */ |
| 825 | struct usb_gadget_driver { | 835 | struct usb_gadget_driver { |
| 826 | char *function; | 836 | char *function; |
| 827 | enum usb_device_speed speed; | 837 | enum usb_device_speed max_speed; |
| 828 | void (*unbind)(struct usb_gadget *); | 838 | void (*unbind)(struct usb_gadget *); |
| 829 | int (*setup)(struct usb_gadget *, | 839 | int (*setup)(struct usb_gadget *, |
| 830 | const struct usb_ctrlrequest *); | 840 | const struct usb_ctrlrequest *); |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 03354d557b79..b2f62f3a32af 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
| @@ -99,7 +99,6 @@ struct usb_hcd { | |||
| 99 | */ | 99 | */ |
| 100 | unsigned long flags; | 100 | unsigned long flags; |
| 101 | #define HCD_FLAG_HW_ACCESSIBLE 0 /* at full power */ | 101 | #define HCD_FLAG_HW_ACCESSIBLE 0 /* at full power */ |
| 102 | #define HCD_FLAG_SAW_IRQ 1 | ||
| 103 | #define HCD_FLAG_POLL_RH 2 /* poll for rh status? */ | 102 | #define HCD_FLAG_POLL_RH 2 /* poll for rh status? */ |
| 104 | #define HCD_FLAG_POLL_PENDING 3 /* status has changed? */ | 103 | #define HCD_FLAG_POLL_PENDING 3 /* status has changed? */ |
| 105 | #define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */ | 104 | #define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */ |
| @@ -110,7 +109,6 @@ struct usb_hcd { | |||
| 110 | * be slightly faster than test_bit(). | 109 | * be slightly faster than test_bit(). |
| 111 | */ | 110 | */ |
| 112 | #define HCD_HW_ACCESSIBLE(hcd) ((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE)) | 111 | #define HCD_HW_ACCESSIBLE(hcd) ((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE)) |
| 113 | #define HCD_SAW_IRQ(hcd) ((hcd)->flags & (1U << HCD_FLAG_SAW_IRQ)) | ||
| 114 | #define HCD_POLL_RH(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_RH)) | 112 | #define HCD_POLL_RH(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_RH)) |
| 115 | #define HCD_POLL_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING)) | 113 | #define HCD_POLL_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING)) |
| 116 | #define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING)) | 114 | #define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING)) |
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__ */ | ||
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h index e5a40c318548..0d3f98879256 100644 --- a/include/linux/usb/renesas_usbhs.h +++ b/include/linux/usb/renesas_usbhs.h | |||
| @@ -67,6 +67,14 @@ struct renesas_usbhs_platform_callback { | |||
| 67 | /* | 67 | /* |
| 68 | * option: | 68 | * option: |
| 69 | * | 69 | * |
| 70 | * for board specific clock control | ||
| 71 | */ | ||
| 72 | void (*power_ctrl)(struct platform_device *pdev, | ||
| 73 | void __iomem *base, int enable); | ||
| 74 | |||
| 75 | /* | ||
| 76 | * option: | ||
| 77 | * | ||
| 70 | * Phy reset for platform | 78 | * Phy reset for platform |
| 71 | */ | 79 | */ |
| 72 | void (*phy_reset)(struct platform_device *pdev); | 80 | void (*phy_reset)(struct platform_device *pdev); |
| @@ -118,7 +126,7 @@ struct renesas_usbhs_driver_param { | |||
| 118 | * | 126 | * |
| 119 | * delay time from notify_hotplug callback | 127 | * delay time from notify_hotplug callback |
| 120 | */ | 128 | */ |
| 121 | int detection_delay; | 129 | int detection_delay; /* msec */ |
| 122 | 130 | ||
| 123 | /* | 131 | /* |
| 124 | * option: | 132 | * option: |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index b29f70b2ecae..4267a9c717ba 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
| @@ -58,11 +58,13 @@ enum port_dev_state { | |||
| 58 | * @read_urb: pointer to the bulk in struct urb for this port. | 58 | * @read_urb: pointer to the bulk in struct urb for this port. |
| 59 | * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this | 59 | * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this |
| 60 | * port. | 60 | * port. |
| 61 | * @bulk_in_buffers: pointers to the bulk in buffers for this port | ||
| 62 | * @read_urbs: pointers to the bulk in urbs for this port | ||
| 63 | * @read_urbs_free: status bitmap the for bulk in urbs | ||
| 61 | * @bulk_out_buffer: pointer to the bulk out buffer for this port. | 64 | * @bulk_out_buffer: pointer to the bulk out buffer for this port. |
| 62 | * @bulk_out_size: the size of the bulk_out_buffer, in bytes. | 65 | * @bulk_out_size: the size of the bulk_out_buffer, in bytes. |
| 63 | * @write_urb: pointer to the bulk out struct urb for this port. | 66 | * @write_urb: pointer to the bulk out struct urb for this port. |
| 64 | * @write_fifo: kfifo used to buffer outgoing data | 67 | * @write_fifo: kfifo used to buffer outgoing data |
| 65 | * @write_urb_busy: port`s writing status | ||
| 66 | * @bulk_out_buffers: pointers to the bulk out buffers for this port | 68 | * @bulk_out_buffers: pointers to the bulk out buffers for this port |
| 67 | * @write_urbs: pointers to the bulk out urbs for this port | 69 | * @write_urbs: pointers to the bulk out urbs for this port |
| 68 | * @write_urbs_free: status bitmap the for bulk out urbs | 70 | * @write_urbs_free: status bitmap the for bulk out urbs |
| @@ -99,11 +101,14 @@ struct usb_serial_port { | |||
| 99 | struct urb *read_urb; | 101 | struct urb *read_urb; |
| 100 | __u8 bulk_in_endpointAddress; | 102 | __u8 bulk_in_endpointAddress; |
| 101 | 103 | ||
| 104 | unsigned char *bulk_in_buffers[2]; | ||
| 105 | struct urb *read_urbs[2]; | ||
| 106 | unsigned long read_urbs_free; | ||
| 107 | |||
| 102 | unsigned char *bulk_out_buffer; | 108 | unsigned char *bulk_out_buffer; |
| 103 | int bulk_out_size; | 109 | int bulk_out_size; |
| 104 | struct urb *write_urb; | 110 | struct urb *write_urb; |
| 105 | struct kfifo write_fifo; | 111 | struct kfifo write_fifo; |
| 106 | int write_urb_busy; | ||
| 107 | 112 | ||
| 108 | unsigned char *bulk_out_buffers[2]; | 113 | unsigned char *bulk_out_buffers[2]; |
| 109 | struct urb *write_urbs[2]; | 114 | struct urb *write_urbs[2]; |
| @@ -340,7 +345,7 @@ extern void usb_serial_generic_disconnect(struct usb_serial *serial); | |||
| 340 | extern void usb_serial_generic_release(struct usb_serial *serial); | 345 | extern void usb_serial_generic_release(struct usb_serial *serial); |
| 341 | extern int usb_serial_generic_register(int debug); | 346 | extern int usb_serial_generic_register(int debug); |
| 342 | extern void usb_serial_generic_deregister(void); | 347 | extern void usb_serial_generic_deregister(void); |
| 343 | extern int usb_serial_generic_submit_read_urb(struct usb_serial_port *port, | 348 | extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, |
| 344 | gfp_t mem_flags); | 349 | gfp_t mem_flags); |
| 345 | extern void usb_serial_generic_process_read_urb(struct urb *urb); | 350 | extern void usb_serial_generic_process_read_urb(struct urb *urb); |
| 346 | extern int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port, | 351 | extern int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port, |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 4b752d5ee80e..5e11f8a1f867 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
| @@ -343,6 +343,8 @@ struct v4l2_pix_format { | |||
| 343 | #define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */ | 343 | #define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */ |
| 344 | #define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ | 344 | #define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ |
| 345 | #define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ | 345 | #define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ |
| 346 | #define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */ | ||
| 347 | #define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */ | ||
| 346 | 348 | ||
| 347 | /* two non contiguous planes - one Y, one Cr + Cb interleaved */ | 349 | /* two non contiguous planes - one Y, one Cr + Cb interleaved */ |
| 348 | #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */ | 350 | #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */ |
| @@ -401,6 +403,7 @@ struct v4l2_pix_format { | |||
| 401 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ | 403 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ |
| 402 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ | 404 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ |
| 403 | #define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ | 405 | #define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ |
| 406 | #define V4L2_PIX_FMT_JL2005BCD v4l2_fourcc('J', 'L', '2', '0') /* compressed RGGB bayer */ | ||
| 404 | #define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */ | 407 | #define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */ |
| 405 | #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ | 408 | #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ |
| 406 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ | 409 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ |
| @@ -742,6 +745,48 @@ struct v4l2_crop { | |||
| 742 | struct v4l2_rect c; | 745 | struct v4l2_rect c; |
| 743 | }; | 746 | }; |
| 744 | 747 | ||
| 748 | /* Hints for adjustments of selection rectangle */ | ||
| 749 | #define V4L2_SEL_FLAG_GE 0x00000001 | ||
| 750 | #define V4L2_SEL_FLAG_LE 0x00000002 | ||
| 751 | |||
| 752 | /* Selection targets */ | ||
| 753 | |||
| 754 | /* current cropping area */ | ||
| 755 | #define V4L2_SEL_TGT_CROP_ACTIVE 0 | ||
| 756 | /* default cropping area */ | ||
| 757 | #define V4L2_SEL_TGT_CROP_DEFAULT 1 | ||
| 758 | /* cropping bounds */ | ||
| 759 | #define V4L2_SEL_TGT_CROP_BOUNDS 2 | ||
| 760 | /* current composing area */ | ||
| 761 | #define V4L2_SEL_TGT_COMPOSE_ACTIVE 256 | ||
| 762 | /* default composing area */ | ||
| 763 | #define V4L2_SEL_TGT_COMPOSE_DEFAULT 257 | ||
| 764 | /* composing bounds */ | ||
| 765 | #define V4L2_SEL_TGT_COMPOSE_BOUNDS 258 | ||
| 766 | /* current composing area plus all padding pixels */ | ||
| 767 | #define V4L2_SEL_TGT_COMPOSE_PADDED 259 | ||
| 768 | |||
| 769 | /** | ||
| 770 | * struct v4l2_selection - selection info | ||
| 771 | * @type: buffer type (do not use *_MPLANE types) | ||
| 772 | * @target: selection target, used to choose one of possible rectangles | ||
| 773 | * @flags: constraints flags | ||
| 774 | * @r: coordinates of selection window | ||
| 775 | * @reserved: for future use, rounds structure size to 64 bytes, set to zero | ||
| 776 | * | ||
| 777 | * Hardware may use multiple helper window to process a video stream. | ||
| 778 | * The structure is used to exchange this selection areas between | ||
| 779 | * an application and a driver. | ||
| 780 | */ | ||
| 781 | struct v4l2_selection { | ||
| 782 | __u32 type; | ||
| 783 | __u32 target; | ||
| 784 | __u32 flags; | ||
| 785 | struct v4l2_rect r; | ||
| 786 | __u32 reserved[9]; | ||
| 787 | }; | ||
| 788 | |||
| 789 | |||
| 745 | /* | 790 | /* |
| 746 | * A N A L O G V I D E O S T A N D A R D | 791 | * A N A L O G V I D E O S T A N D A R D |
| 747 | */ | 792 | */ |
| @@ -1131,6 +1176,7 @@ struct v4l2_querymenu { | |||
| 1131 | #define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000 | 1176 | #define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000 |
| 1132 | 1177 | ||
| 1133 | /* User-class control IDs defined by V4L2 */ | 1178 | /* User-class control IDs defined by V4L2 */ |
| 1179 | #define V4L2_CID_MAX_CTRLS 1024 | ||
| 1134 | #define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900) | 1180 | #define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900) |
| 1135 | #define V4L2_CID_USER_BASE V4L2_CID_BASE | 1181 | #define V4L2_CID_USER_BASE V4L2_CID_BASE |
| 1136 | /* IDs reserved for driver specific controls */ | 1182 | /* IDs reserved for driver specific controls */ |
| @@ -1204,10 +1250,10 @@ enum v4l2_colorfx { | |||
| 1204 | #define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+39) | 1250 | #define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+39) |
| 1205 | #define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40) | 1251 | #define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40) |
| 1206 | 1252 | ||
| 1207 | /* last CID + 1 */ | 1253 | #define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41) |
| 1208 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+41) | ||
| 1209 | 1254 | ||
| 1210 | /* Minimum number of buffer neede by the device */ | 1255 | /* last CID + 1 */ |
| 1256 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+42) | ||
| 1211 | 1257 | ||
| 1212 | /* MPEG-class control IDs defined by V4L2 */ | 1258 | /* MPEG-class control IDs defined by V4L2 */ |
| 1213 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) | 1259 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) |
| @@ -1682,6 +1728,8 @@ enum v4l2_flash_strobe_source { | |||
| 1682 | #define V4L2_FLASH_FAULT_TIMEOUT (1 << 1) | 1728 | #define V4L2_FLASH_FAULT_TIMEOUT (1 << 1) |
| 1683 | #define V4L2_FLASH_FAULT_OVER_TEMPERATURE (1 << 2) | 1729 | #define V4L2_FLASH_FAULT_OVER_TEMPERATURE (1 << 2) |
| 1684 | #define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3) | 1730 | #define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3) |
| 1731 | #define V4L2_FLASH_FAULT_OVER_CURRENT (1 << 4) | ||
| 1732 | #define V4L2_FLASH_FAULT_INDICATOR (1 << 5) | ||
| 1685 | 1733 | ||
| 1686 | #define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11) | 1734 | #define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11) |
| 1687 | #define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12) | 1735 | #define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12) |
| @@ -2255,6 +2303,10 @@ struct v4l2_create_buffers { | |||
| 2255 | #define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers) | 2303 | #define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers) |
| 2256 | #define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer) | 2304 | #define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer) |
| 2257 | 2305 | ||
| 2306 | /* Experimental selection API */ | ||
| 2307 | #define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection) | ||
| 2308 | #define VIDIOC_S_SELECTION _IOWR('V', 95, struct v4l2_selection) | ||
| 2309 | |||
| 2258 | /* Reminder: when adding new ioctls please add support for them to | 2310 | /* Reminder: when adding new ioctls please add support for them to |
| 2259 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ | 2311 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ |
| 2260 | 2312 | ||
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 4c069d8bd740..d0018d27c281 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
| @@ -25,70 +25,18 @@ struct virtqueue { | |||
| 25 | void *priv; | 25 | void *priv; |
| 26 | }; | 26 | }; |
| 27 | 27 | ||
| 28 | /** | 28 | int virtqueue_add_buf(struct virtqueue *vq, |
| 29 | * operations for virtqueue | 29 | struct scatterlist sg[], |
| 30 | * virtqueue_add_buf: expose buffer to other end | 30 | unsigned int out_num, |
| 31 | * vq: the struct virtqueue we're talking about. | 31 | unsigned int in_num, |
| 32 | * sg: the description of the buffer(s). | 32 | void *data, |
| 33 | * out_num: the number of sg readable by other side | 33 | gfp_t gfp); |
| 34 | * in_num: the number of sg which are writable (after readable ones) | ||
| 35 | * data: the token identifying the buffer. | ||
| 36 | * gfp: how to do memory allocations (if necessary). | ||
| 37 | * Returns remaining capacity of queue (sg segments) or a negative error. | ||
| 38 | * virtqueue_kick: update after add_buf | ||
| 39 | * vq: the struct virtqueue | ||
| 40 | * After one or more add_buf calls, invoke this to kick the other side. | ||
| 41 | * virtqueue_get_buf: get the next used buffer | ||
| 42 | * vq: the struct virtqueue we're talking about. | ||
| 43 | * len: the length written into the buffer | ||
| 44 | * Returns NULL or the "data" token handed to add_buf. | ||
| 45 | * virtqueue_disable_cb: disable callbacks | ||
| 46 | * vq: the struct virtqueue we're talking about. | ||
| 47 | * Note that this is not necessarily synchronous, hence unreliable and only | ||
| 48 | * useful as an optimization. | ||
| 49 | * virtqueue_enable_cb: restart callbacks after disable_cb. | ||
| 50 | * vq: the struct virtqueue we're talking about. | ||
| 51 | * This re-enables callbacks; it returns "false" if there are pending | ||
| 52 | * buffers in the queue, to detect a possible race between the driver | ||
| 53 | * checking for more work, and enabling callbacks. | ||
| 54 | * virtqueue_enable_cb_delayed: restart callbacks after disable_cb. | ||
| 55 | * vq: the struct virtqueue we're talking about. | ||
| 56 | * This re-enables callbacks but hints to the other side to delay | ||
| 57 | * interrupts until most of the available buffers have been processed; | ||
| 58 | * it returns "false" if there are many pending buffers in the queue, | ||
| 59 | * to detect a possible race between the driver checking for more work, | ||
| 60 | * and enabling callbacks. | ||
| 61 | * virtqueue_detach_unused_buf: detach first unused buffer | ||
| 62 | * vq: the struct virtqueue we're talking about. | ||
| 63 | * Returns NULL or the "data" token handed to add_buf | ||
| 64 | * virtqueue_get_vring_size: return the size of the virtqueue's vring | ||
| 65 | * vq: the struct virtqueue containing the vring of interest. | ||
| 66 | * Returns the size of the vring. | ||
| 67 | * | ||
| 68 | * Locking rules are straightforward: the driver is responsible for | ||
| 69 | * locking. No two operations may be invoked simultaneously, with the exception | ||
| 70 | * of virtqueue_disable_cb. | ||
| 71 | * | ||
| 72 | * All operations can be called in any context. | ||
| 73 | */ | ||
| 74 | 34 | ||
| 75 | int virtqueue_add_buf_gfp(struct virtqueue *vq, | 35 | void virtqueue_kick(struct virtqueue *vq); |
| 76 | struct scatterlist sg[], | ||
| 77 | unsigned int out_num, | ||
| 78 | unsigned int in_num, | ||
| 79 | void *data, | ||
| 80 | gfp_t gfp); | ||
| 81 | 36 | ||
| 82 | static inline int virtqueue_add_buf(struct virtqueue *vq, | 37 | bool virtqueue_kick_prepare(struct virtqueue *vq); |
| 83 | struct scatterlist sg[], | ||
| 84 | unsigned int out_num, | ||
| 85 | unsigned int in_num, | ||
| 86 | void *data) | ||
| 87 | { | ||
| 88 | return virtqueue_add_buf_gfp(vq, sg, out_num, in_num, data, GFP_ATOMIC); | ||
| 89 | } | ||
| 90 | 38 | ||
| 91 | void virtqueue_kick(struct virtqueue *vq); | 39 | void virtqueue_notify(struct virtqueue *vq); |
| 92 | 40 | ||
| 93 | void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len); | 41 | void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len); |
| 94 | 42 | ||
| @@ -146,6 +94,11 @@ struct virtio_driver { | |||
| 146 | int (*probe)(struct virtio_device *dev); | 94 | int (*probe)(struct virtio_device *dev); |
| 147 | void (*remove)(struct virtio_device *dev); | 95 | void (*remove)(struct virtio_device *dev); |
| 148 | void (*config_changed)(struct virtio_device *dev); | 96 | void (*config_changed)(struct virtio_device *dev); |
| 97 | #ifdef CONFIG_PM | ||
| 98 | int (*freeze)(struct virtio_device *dev); | ||
| 99 | int (*thaw)(struct virtio_device *dev); | ||
| 100 | int (*restore)(struct virtio_device *dev); | ||
| 101 | #endif | ||
| 149 | }; | 102 | }; |
| 150 | 103 | ||
| 151 | int register_virtio_driver(struct virtio_driver *drv); | 104 | int register_virtio_driver(struct virtio_driver *drv); |
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 36be0f6e18a9..e338730c2660 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h | |||
| @@ -168,6 +168,7 @@ struct virtqueue; | |||
| 168 | struct virtqueue *vring_new_virtqueue(unsigned int num, | 168 | struct virtqueue *vring_new_virtqueue(unsigned int num, |
| 169 | unsigned int vring_align, | 169 | unsigned int vring_align, |
| 170 | struct virtio_device *vdev, | 170 | struct virtio_device *vdev, |
| 171 | bool weak_barriers, | ||
| 171 | void *pages, | 172 | void *pages, |
| 172 | void (*notify)(struct virtqueue *vq), | 173 | void (*notify)(struct virtqueue *vq), |
| 173 | void (*callback)(struct virtqueue *vq), | 174 | void (*callback)(struct virtqueue *vq), |
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h index 111843f88b2a..43ba5b3ce2a3 100644 --- a/include/linux/watchdog.h +++ b/include/linux/watchdog.h | |||
| @@ -53,11 +53,7 @@ struct watchdog_info { | |||
| 53 | 53 | ||
| 54 | #ifdef __KERNEL__ | 54 | #ifdef __KERNEL__ |
| 55 | 55 | ||
| 56 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 56 | #include <linux/bitops.h> |
| 57 | #define WATCHDOG_NOWAYOUT 1 | ||
| 58 | #else | ||
| 59 | #define WATCHDOG_NOWAYOUT 0 | ||
| 60 | #endif | ||
| 61 | 57 | ||
| 62 | struct watchdog_ops; | 58 | struct watchdog_ops; |
| 63 | struct watchdog_device; | 59 | struct watchdog_device; |
| @@ -122,6 +118,21 @@ struct watchdog_device { | |||
| 122 | #define WDOG_NO_WAY_OUT 3 /* Is 'nowayout' feature set ? */ | 118 | #define WDOG_NO_WAY_OUT 3 /* Is 'nowayout' feature set ? */ |
| 123 | }; | 119 | }; |
| 124 | 120 | ||
| 121 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | ||
| 122 | #define WATCHDOG_NOWAYOUT 1 | ||
| 123 | #define WATCHDOG_NOWAYOUT_INIT_STATUS (1 << WDOG_NO_WAY_OUT) | ||
| 124 | #else | ||
| 125 | #define WATCHDOG_NOWAYOUT 0 | ||
| 126 | #define WATCHDOG_NOWAYOUT_INIT_STATUS 0 | ||
| 127 | #endif | ||
| 128 | |||
| 129 | /* Use the following function to set the nowayout feature */ | ||
| 130 | static inline void watchdog_set_nowayout(struct watchdog_device *wdd, int nowayout) | ||
| 131 | { | ||
| 132 | if (nowayout) | ||
| 133 | set_bit(WDOG_NO_WAY_OUT, &wdd->status); | ||
| 134 | } | ||
| 135 | |||
| 125 | /* Use the following functions to manipulate watchdog driver specific data */ | 136 | /* Use the following functions to manipulate watchdog driver specific data */ |
| 126 | static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data) | 137 | static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data) |
| 127 | { | 138 | { |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 0d556deb497b..eb8b9f15f2e0 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -297,32 +297,50 @@ extern struct workqueue_struct *system_unbound_wq; | |||
| 297 | extern struct workqueue_struct *system_freezable_wq; | 297 | extern struct workqueue_struct *system_freezable_wq; |
| 298 | 298 | ||
| 299 | extern struct workqueue_struct * | 299 | extern struct workqueue_struct * |
| 300 | __alloc_workqueue_key(const char *name, unsigned int flags, int max_active, | 300 | __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active, |
| 301 | struct lock_class_key *key, const char *lock_name); | 301 | struct lock_class_key *key, const char *lock_name, ...) __printf(1, 6); |
| 302 | 302 | ||
| 303 | /** | ||
| 304 | * alloc_workqueue - allocate a workqueue | ||
| 305 | * @fmt: printf format for the name of the workqueue | ||
| 306 | * @flags: WQ_* flags | ||
| 307 | * @max_active: max in-flight work items, 0 for default | ||
| 308 | * @args: args for @fmt | ||
| 309 | * | ||
| 310 | * Allocate a workqueue with the specified parameters. For detailed | ||
| 311 | * information on WQ_* flags, please refer to Documentation/workqueue.txt. | ||
| 312 | * | ||
| 313 | * The __lock_name macro dance is to guarantee that single lock_class_key | ||
| 314 | * doesn't end up with different namesm, which isn't allowed by lockdep. | ||
| 315 | * | ||
| 316 | * RETURNS: | ||
| 317 | * Pointer to the allocated workqueue on success, %NULL on failure. | ||
| 318 | */ | ||
| 303 | #ifdef CONFIG_LOCKDEP | 319 | #ifdef CONFIG_LOCKDEP |
| 304 | #define alloc_workqueue(name, flags, max_active) \ | 320 | #define alloc_workqueue(fmt, flags, max_active, args...) \ |
| 305 | ({ \ | 321 | ({ \ |
| 306 | static struct lock_class_key __key; \ | 322 | static struct lock_class_key __key; \ |
| 307 | const char *__lock_name; \ | 323 | const char *__lock_name; \ |
| 308 | \ | 324 | \ |
| 309 | if (__builtin_constant_p(name)) \ | 325 | if (__builtin_constant_p(fmt)) \ |
| 310 | __lock_name = (name); \ | 326 | __lock_name = (fmt); \ |
| 311 | else \ | 327 | else \ |
| 312 | __lock_name = #name; \ | 328 | __lock_name = #fmt; \ |
| 313 | \ | 329 | \ |
| 314 | __alloc_workqueue_key((name), (flags), (max_active), \ | 330 | __alloc_workqueue_key((fmt), (flags), (max_active), \ |
| 315 | &__key, __lock_name); \ | 331 | &__key, __lock_name, ##args); \ |
| 316 | }) | 332 | }) |
| 317 | #else | 333 | #else |
| 318 | #define alloc_workqueue(name, flags, max_active) \ | 334 | #define alloc_workqueue(fmt, flags, max_active, args...) \ |
| 319 | __alloc_workqueue_key((name), (flags), (max_active), NULL, NULL) | 335 | __alloc_workqueue_key((fmt), (flags), (max_active), \ |
| 336 | NULL, NULL, ##args) | ||
| 320 | #endif | 337 | #endif |
| 321 | 338 | ||
| 322 | /** | 339 | /** |
| 323 | * alloc_ordered_workqueue - allocate an ordered workqueue | 340 | * alloc_ordered_workqueue - allocate an ordered workqueue |
| 324 | * @name: name of the workqueue | 341 | * @fmt: printf format for the name of the workqueue |
| 325 | * @flags: WQ_* flags (only WQ_FREEZABLE and WQ_MEM_RECLAIM are meaningful) | 342 | * @flags: WQ_* flags (only WQ_FREEZABLE and WQ_MEM_RECLAIM are meaningful) |
| 343 | * @args: args for @fmt | ||
| 326 | * | 344 | * |
| 327 | * Allocate an ordered workqueue. An ordered workqueue executes at | 345 | * Allocate an ordered workqueue. An ordered workqueue executes at |
| 328 | * most one work item at any given time in the queued order. They are | 346 | * most one work item at any given time in the queued order. They are |
| @@ -331,11 +349,8 @@ __alloc_workqueue_key(const char *name, unsigned int flags, int max_active, | |||
| 331 | * RETURNS: | 349 | * RETURNS: |
| 332 | * Pointer to the allocated workqueue on success, %NULL on failure. | 350 | * Pointer to the allocated workqueue on success, %NULL on failure. |
| 333 | */ | 351 | */ |
| 334 | static inline struct workqueue_struct * | 352 | #define alloc_ordered_workqueue(fmt, flags, args...) \ |
| 335 | alloc_ordered_workqueue(const char *name, unsigned int flags) | 353 | alloc_workqueue(fmt, WQ_UNBOUND | (flags), 1, ##args) |
| 336 | { | ||
| 337 | return alloc_workqueue(name, WQ_UNBOUND | flags, 1); | ||
| 338 | } | ||
| 339 | 354 | ||
| 340 | #define create_workqueue(name) \ | 355 | #define create_workqueue(name) \ |
| 341 | alloc_workqueue((name), WQ_MEM_RECLAIM, 1) | 356 | alloc_workqueue((name), WQ_MEM_RECLAIM, 1) |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index a378c295851f..995b8bf630ac 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
| 8 | #include <linux/fs.h> | 8 | #include <linux/fs.h> |
| 9 | 9 | ||
| 10 | DECLARE_PER_CPU(int, dirty_throttle_leaks); | ||
| 11 | |||
| 10 | /* | 12 | /* |
| 11 | * The 1/4 region under the global dirty thresh is for smooth dirty throttling: | 13 | * The 1/4 region under the global dirty thresh is for smooth dirty throttling: |
| 12 | * | 14 | * |
| @@ -23,11 +25,6 @@ | |||
| 23 | #define DIRTY_SCOPE 8 | 25 | #define DIRTY_SCOPE 8 |
| 24 | #define DIRTY_FULL_SCOPE (DIRTY_SCOPE / 2) | 26 | #define DIRTY_FULL_SCOPE (DIRTY_SCOPE / 2) |
| 25 | 27 | ||
| 26 | /* | ||
| 27 | * 4MB minimal write chunk size | ||
| 28 | */ | ||
| 29 | #define MIN_WRITEBACK_PAGES (4096UL >> (PAGE_CACHE_SHIFT - 10)) | ||
| 30 | |||
| 31 | struct backing_dev_info; | 28 | struct backing_dev_info; |
| 32 | 29 | ||
| 33 | /* | 30 | /* |
| @@ -124,6 +121,7 @@ void laptop_mode_timer_fn(unsigned long data); | |||
| 124 | static inline void laptop_sync_completion(void) { } | 121 | static inline void laptop_sync_completion(void) { } |
| 125 | #endif | 122 | #endif |
| 126 | void throttle_vm_writeout(gfp_t gfp_mask); | 123 | void throttle_vm_writeout(gfp_t gfp_mask); |
| 124 | bool zone_dirty_ok(struct zone *zone); | ||
| 127 | 125 | ||
| 128 | extern unsigned long global_dirty_limit; | 126 | extern unsigned long global_dirty_limit; |
| 129 | 127 | ||
| @@ -138,8 +136,6 @@ extern int vm_highmem_is_dirtyable; | |||
| 138 | extern int block_dump; | 136 | extern int block_dump; |
| 139 | extern int laptop_mode; | 137 | extern int laptop_mode; |
| 140 | 138 | ||
| 141 | extern unsigned long determine_dirtyable_memory(void); | ||
| 142 | |||
| 143 | extern int dirty_background_ratio_handler(struct ctl_table *table, int write, | 139 | extern int dirty_background_ratio_handler(struct ctl_table *table, int write, |
| 144 | void __user *buffer, size_t *lenp, | 140 | void __user *buffer, size_t *lenp, |
| 145 | loff_t *ppos); | 141 | loff_t *ppos); |
| @@ -195,6 +191,8 @@ void writeback_set_ratelimit(void); | |||
| 195 | void tag_pages_for_writeback(struct address_space *mapping, | 191 | void tag_pages_for_writeback(struct address_space *mapping, |
| 196 | pgoff_t start, pgoff_t end); | 192 | pgoff_t start, pgoff_t end); |
| 197 | 193 | ||
| 194 | void account_page_redirty(struct page *page); | ||
| 195 | |||
| 198 | /* pdflush.c */ | 196 | /* pdflush.c */ |
| 199 | extern int nr_pdflush_threads; /* Global so it can be exported to sysctl | 197 | extern int nr_pdflush_threads; /* Global so it can be exported to sysctl |
| 200 | read-only. */ | 198 | read-only. */ |
diff --git a/include/linux/zorro_ids.h b/include/linux/zorro_ids.h index 7e749088910d..74bc53bcfdcf 100644 --- a/include/linux/zorro_ids.h +++ b/include/linux/zorro_ids.h | |||
| @@ -360,8 +360,8 @@ | |||
| 360 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM ZORRO_ID(VILLAGE_TRONIC, 0x0B, 0) | 360 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM ZORRO_ID(VILLAGE_TRONIC, 0x0B, 0) |
| 361 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_REG ZORRO_ID(VILLAGE_TRONIC, 0x0C, 0) | 361 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_REG ZORRO_ID(VILLAGE_TRONIC, 0x0C, 0) |
| 362 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_SEGMENTED_MODE ZORRO_ID(VILLAGE_TRONIC, 0x0D, 0) | 362 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_SEGMENTED_MODE ZORRO_ID(VILLAGE_TRONIC, 0x0D, 0) |
| 363 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_MEM1 ZORRO_ID(VILLAGE_TRONIC, 0x15, 0) | 363 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM1 ZORRO_ID(VILLAGE_TRONIC, 0x15, 0) |
| 364 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_MEM2 ZORRO_ID(VILLAGE_TRONIC, 0x16, 0) | 364 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM2 ZORRO_ID(VILLAGE_TRONIC, 0x16, 0) |
| 365 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_REG ZORRO_ID(VILLAGE_TRONIC, 0x17, 0) | 365 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_REG ZORRO_ID(VILLAGE_TRONIC, 0x17, 0) |
| 366 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3 ZORRO_ID(VILLAGE_TRONIC, 0x18, 0) | 366 | #define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3 ZORRO_ID(VILLAGE_TRONIC, 0x18, 0) |
| 367 | #define ZORRO_PROD_VILLAGE_TRONIC_ARIADNE ZORRO_ID(VILLAGE_TRONIC, 0xC9, 0) | 367 | #define ZORRO_PROD_VILLAGE_TRONIC_ARIADNE ZORRO_ID(VILLAGE_TRONIC, 0xC9, 0) |
