diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2009-12-14 22:10:10 -0500 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2009-12-14 22:10:10 -0500 |
| commit | e0aa51f54faa0659b529143de6c608e76675326f (patch) | |
| tree | 22fc566b74bfe6bd612a858ba354818900cdc394 /include/linux | |
| parent | 9f815a1765b0ce766ab1d26ef192d30410f70b2b (diff) | |
| parent | 3ea6b3d0e6d0ffd91c0f8cadeb69b7133c038b32 (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include/linux')
67 files changed, 2317 insertions, 596 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 5a5385749e16..f72914db2a11 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -214,7 +214,6 @@ unifdef-y += futex.h | |||
| 214 | unifdef-y += fs.h | 214 | unifdef-y += fs.h |
| 215 | unifdef-y += gameport.h | 215 | unifdef-y += gameport.h |
| 216 | unifdef-y += generic_serial.h | 216 | unifdef-y += generic_serial.h |
| 217 | unifdef-y += hayesesp.h | ||
| 218 | unifdef-y += hdlcdrv.h | 217 | unifdef-y += hdlcdrv.h |
| 219 | unifdef-y += hdlc.h | 218 | unifdef-y += hdlc.h |
| 220 | unifdef-y += hdreg.h | 219 | unifdef-y += hdreg.h |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 47536197ffdd..e287863ac053 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
| @@ -43,6 +43,8 @@ extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls); | |||
| 43 | 43 | ||
| 44 | #ifdef CONFIG_HOTPLUG_CPU | 44 | #ifdef CONFIG_HOTPLUG_CPU |
| 45 | extern void unregister_cpu(struct cpu *cpu); | 45 | extern void unregister_cpu(struct cpu *cpu); |
| 46 | extern ssize_t arch_cpu_probe(const char *, size_t); | ||
| 47 | extern ssize_t arch_cpu_release(const char *, size_t); | ||
| 46 | #endif | 48 | #endif |
| 47 | struct notifier_block; | 49 | struct notifier_block; |
| 48 | 50 | ||
| @@ -115,6 +117,19 @@ extern void put_online_cpus(void); | |||
| 115 | #define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) | 117 | #define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) |
| 116 | int cpu_down(unsigned int cpu); | 118 | int cpu_down(unsigned int cpu); |
| 117 | 119 | ||
| 120 | #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE | ||
| 121 | extern void cpu_hotplug_driver_lock(void); | ||
| 122 | extern void cpu_hotplug_driver_unlock(void); | ||
| 123 | #else | ||
| 124 | static inline void cpu_hotplug_driver_lock(void) | ||
| 125 | { | ||
| 126 | } | ||
| 127 | |||
| 128 | static inline void cpu_hotplug_driver_unlock(void) | ||
| 129 | { | ||
| 130 | } | ||
| 131 | #endif | ||
| 132 | |||
| 118 | #else /* CONFIG_HOTPLUG_CPU */ | 133 | #else /* CONFIG_HOTPLUG_CPU */ |
| 119 | 134 | ||
| 120 | #define get_online_cpus() do { } while (0) | 135 | #define get_online_cpus() do { } while (0) |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 79a2340d83cd..4de02b10007f 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
| @@ -232,6 +232,7 @@ struct cpufreq_driver { | |||
| 232 | /* optional */ | 232 | /* optional */ |
| 233 | unsigned int (*getavg) (struct cpufreq_policy *policy, | 233 | unsigned int (*getavg) (struct cpufreq_policy *policy, |
| 234 | unsigned int cpu); | 234 | unsigned int cpu); |
| 235 | int (*bios_limit) (int cpu, unsigned int *limit); | ||
| 235 | 236 | ||
| 236 | int (*exit) (struct cpufreq_policy *policy); | 237 | int (*exit) (struct cpufreq_policy *policy); |
| 237 | int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); | 238 | int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 789cf5f920ce..d77b54733c5b 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
| @@ -84,6 +84,7 @@ extern const struct cpumask *const cpu_active_mask; | |||
| 84 | #define num_online_cpus() cpumask_weight(cpu_online_mask) | 84 | #define num_online_cpus() cpumask_weight(cpu_online_mask) |
| 85 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask) | 85 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask) |
| 86 | #define num_present_cpus() cpumask_weight(cpu_present_mask) | 86 | #define num_present_cpus() cpumask_weight(cpu_present_mask) |
| 87 | #define num_active_cpus() cpumask_weight(cpu_active_mask) | ||
| 87 | #define cpu_online(cpu) cpumask_test_cpu((cpu), cpu_online_mask) | 88 | #define cpu_online(cpu) cpumask_test_cpu((cpu), cpu_online_mask) |
| 88 | #define cpu_possible(cpu) cpumask_test_cpu((cpu), cpu_possible_mask) | 89 | #define cpu_possible(cpu) cpumask_test_cpu((cpu), cpu_possible_mask) |
| 89 | #define cpu_present(cpu) cpumask_test_cpu((cpu), cpu_present_mask) | 90 | #define cpu_present(cpu) cpumask_test_cpu((cpu), cpu_present_mask) |
| @@ -92,6 +93,7 @@ extern const struct cpumask *const cpu_active_mask; | |||
| 92 | #define num_online_cpus() 1 | 93 | #define num_online_cpus() 1 |
| 93 | #define num_possible_cpus() 1 | 94 | #define num_possible_cpus() 1 |
| 94 | #define num_present_cpus() 1 | 95 | #define num_present_cpus() 1 |
| 96 | #define num_active_cpus() 1 | ||
| 95 | #define cpu_online(cpu) ((cpu) == 0) | 97 | #define cpu_online(cpu) ((cpu) == 0) |
| 96 | #define cpu_possible(cpu) ((cpu) == 0) | 98 | #define cpu_possible(cpu) ((cpu) == 0) |
| 97 | #define cpu_present(cpu) ((cpu) == 0) | 99 | #define cpu_present(cpu) ((cpu) == 0) |
diff --git a/include/linux/device.h b/include/linux/device.h index 2ea3e4921812..2a73d9bcbc9c 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -558,7 +558,7 @@ extern void wait_for_device_probe(void); | |||
| 558 | #ifdef CONFIG_DEVTMPFS | 558 | #ifdef CONFIG_DEVTMPFS |
| 559 | extern int devtmpfs_create_node(struct device *dev); | 559 | extern int devtmpfs_create_node(struct device *dev); |
| 560 | extern int devtmpfs_delete_node(struct device *dev); | 560 | extern int devtmpfs_delete_node(struct device *dev); |
| 561 | extern int devtmpfs_mount(const char *mountpoint); | 561 | extern int devtmpfs_mount(const char *mntdir); |
| 562 | #else | 562 | #else |
| 563 | static inline int devtmpfs_create_node(struct device *dev) { return 0; } | 563 | static inline int devtmpfs_create_node(struct device *dev) { return 0; } |
| 564 | static inline int devtmpfs_delete_node(struct device *dev) { return 0; } | 564 | static inline int devtmpfs_delete_node(struct device *dev) { return 0; } |
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 121720d74e15..2dfa7076e8b6 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h | |||
| @@ -565,14 +565,14 @@ struct ext2_dir_entry_2 { | |||
| 565 | * other bits are reserved for now. | 565 | * other bits are reserved for now. |
| 566 | */ | 566 | */ |
| 567 | enum { | 567 | enum { |
| 568 | EXT2_FT_UNKNOWN, | 568 | EXT2_FT_UNKNOWN = 0, |
| 569 | EXT2_FT_REG_FILE, | 569 | EXT2_FT_REG_FILE = 1, |
| 570 | EXT2_FT_DIR, | 570 | EXT2_FT_DIR = 2, |
| 571 | EXT2_FT_CHRDEV, | 571 | EXT2_FT_CHRDEV = 3, |
| 572 | EXT2_FT_BLKDEV, | 572 | EXT2_FT_BLKDEV = 4, |
| 573 | EXT2_FT_FIFO, | 573 | EXT2_FT_FIFO = 5, |
| 574 | EXT2_FT_SOCK, | 574 | EXT2_FT_SOCK = 6, |
| 575 | EXT2_FT_SYMLINK, | 575 | EXT2_FT_SYMLINK = 7, |
| 576 | EXT2_FT_MAX | 576 | EXT2_FT_MAX |
| 577 | }; | 577 | }; |
| 578 | 578 | ||
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 7499b3667798..6b049030fbe6 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
| @@ -918,6 +918,8 @@ extern void ext3_abort (struct super_block *, const char *, const char *, ...) | |||
| 918 | __attribute__ ((format (printf, 3, 4))); | 918 | __attribute__ ((format (printf, 3, 4))); |
| 919 | extern void ext3_warning (struct super_block *, const char *, const char *, ...) | 919 | extern void ext3_warning (struct super_block *, const char *, const char *, ...) |
| 920 | __attribute__ ((format (printf, 3, 4))); | 920 | __attribute__ ((format (printf, 3, 4))); |
| 921 | extern void ext3_msg(struct super_block *, const char *, const char *, ...) | ||
| 922 | __attribute__ ((format (printf, 3, 4))); | ||
| 921 | extern void ext3_update_dynamic_rev (struct super_block *sb); | 923 | extern void ext3_update_dynamic_rev (struct super_block *sb); |
| 922 | 924 | ||
| 923 | #define ext3_std_error(sb, errno) \ | 925 | #define ext3_std_error(sb, errno) \ |
diff --git a/include/linux/fb.h b/include/linux/fb.h index de9c722e7b90..369767bd873e 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
| @@ -763,6 +763,7 @@ struct fb_tile_ops { | |||
| 763 | * takes over; acceleration engine should be in a quiescent state */ | 763 | * takes over; acceleration engine should be in a quiescent state */ |
| 764 | 764 | ||
| 765 | /* hints */ | 765 | /* hints */ |
| 766 | #define FBINFO_VIRTFB 0x0004 /* FB is System RAM, not device. */ | ||
| 766 | #define FBINFO_PARTIAL_PAN_OK 0x0040 /* otw use pan only for double-buffering */ | 767 | #define FBINFO_PARTIAL_PAN_OK 0x0040 /* otw use pan only for double-buffering */ |
| 767 | #define FBINFO_READS_FAST 0x0080 /* soft-copy faster than rendering */ | 768 | #define FBINFO_READS_FAST 0x0080 /* soft-copy faster than rendering */ |
| 768 | 769 | ||
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index d31544628436..043811f0d277 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
| 5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
| 6 | #include <linux/compiler.h> | 6 | #include <linux/compiler.h> |
| 7 | #include <linux/gfp.h> | ||
| 7 | 8 | ||
| 8 | #define FW_ACTION_NOHOTPLUG 0 | 9 | #define FW_ACTION_NOHOTPLUG 0 |
| 9 | #define FW_ACTION_HOTPLUG 1 | 10 | #define FW_ACTION_HOTPLUG 1 |
| @@ -38,7 +39,7 @@ int request_firmware(const struct firmware **fw, const char *name, | |||
| 38 | struct device *device); | 39 | struct device *device); |
| 39 | int request_firmware_nowait( | 40 | int request_firmware_nowait( |
| 40 | struct module *module, int uevent, | 41 | struct module *module, int uevent, |
| 41 | const char *name, struct device *device, void *context, | 42 | const char *name, struct device *device, gfp_t gfp, void *context, |
| 42 | void (*cont)(const struct firmware *fw, void *context)); | 43 | void (*cont)(const struct firmware *fw, void *context)); |
| 43 | 44 | ||
| 44 | void release_firmware(const struct firmware *fw); | 45 | void release_firmware(const struct firmware *fw); |
| @@ -51,7 +52,7 @@ static inline int request_firmware(const struct firmware **fw, | |||
| 51 | } | 52 | } |
| 52 | static inline int request_firmware_nowait( | 53 | static inline int request_firmware_nowait( |
| 53 | struct module *module, int uevent, | 54 | struct module *module, int uevent, |
| 54 | const char *name, struct device *device, void *context, | 55 | const char *name, struct device *device, gfp_t gfp, void *context, |
| 55 | void (*cont)(const struct firmware *fw, void *context)) | 56 | void (*cont)(const struct firmware *fw, void *context)) |
| 56 | { | 57 | { |
| 57 | return -EINVAL; | 58 | return -EINVAL; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 891f7d642e5c..a057f48eb156 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -2091,8 +2091,6 @@ extern int filemap_fdatawait_range(struct address_space *, loff_t lstart, | |||
| 2091 | extern int filemap_write_and_wait(struct address_space *mapping); | 2091 | extern int filemap_write_and_wait(struct address_space *mapping); |
| 2092 | extern int filemap_write_and_wait_range(struct address_space *mapping, | 2092 | extern int filemap_write_and_wait_range(struct address_space *mapping, |
| 2093 | loff_t lstart, loff_t lend); | 2093 | loff_t lstart, loff_t lend); |
| 2094 | extern int wait_on_page_writeback_range(struct address_space *mapping, | ||
| 2095 | pgoff_t start, pgoff_t end); | ||
| 2096 | extern int __filemap_fdatawrite_range(struct address_space *mapping, | 2094 | extern int __filemap_fdatawrite_range(struct address_space *mapping, |
| 2097 | loff_t start, loff_t end, int sync_mode); | 2095 | loff_t start, loff_t end, int sync_mode); |
| 2098 | extern int filemap_fdatawrite_range(struct address_space *mapping, | 2096 | extern int filemap_fdatawrite_range(struct address_space *mapping, |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 43fc95d822d5..28e33fea5107 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
| @@ -74,7 +74,12 @@ struct spi_device; | |||
| 74 | struct fsl_spi_platform_data { | 74 | struct fsl_spi_platform_data { |
| 75 | u32 initial_spmode; /* initial SPMODE value */ | 75 | u32 initial_spmode; /* initial SPMODE value */ |
| 76 | s16 bus_num; | 76 | s16 bus_num; |
| 77 | bool qe_mode; | 77 | unsigned int flags; |
| 78 | #define SPI_QE_CPU_MODE (1 << 0) /* QE CPU ("PIO") mode */ | ||
| 79 | #define SPI_CPM_MODE (1 << 1) /* CPM/QE ("DMA") mode */ | ||
| 80 | #define SPI_CPM1 (1 << 2) /* SPI unit is in CPM1 block */ | ||
| 81 | #define SPI_CPM2 (1 << 3) /* SPI unit is in CPM2 block */ | ||
| 82 | #define SPI_QE (1 << 4) /* SPI unit is in QE block */ | ||
| 78 | /* board specific information */ | 83 | /* board specific information */ |
| 79 | u16 max_chipselect; | 84 | u16 max_chipselect; |
| 80 | void (*cs_control)(struct spi_device *spi, bool on); | 85 | void (*cs_control)(struct spi_device *spi, bool on); |
| @@ -90,6 +95,10 @@ struct mpc8xx_pcmcia_ops { | |||
| 90 | * lead to a deep sleep (i.e. power removed from the core, | 95 | * lead to a deep sleep (i.e. power removed from the core, |
| 91 | * instead of just the clock). | 96 | * instead of just the clock). |
| 92 | */ | 97 | */ |
| 98 | #if defined(CONFIG_PPC_83xx) && defined(CONFIG_SUSPEND) | ||
| 93 | int fsl_deep_sleep(void); | 99 | int fsl_deep_sleep(void); |
| 100 | #else | ||
| 101 | static inline int fsl_deep_sleep(void) { return 0; } | ||
| 102 | #endif | ||
| 94 | 103 | ||
| 95 | #endif /* _FSL_DEVICE_H_ */ | 104 | #endif /* _FSL_DEVICE_H_ */ |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 47bbdf9c38d0..38f8d6553831 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -57,6 +57,7 @@ struct trace_iterator { | |||
| 57 | /* The below is zeroed out in pipe_read */ | 57 | /* The below is zeroed out in pipe_read */ |
| 58 | struct trace_seq seq; | 58 | struct trace_seq seq; |
| 59 | struct trace_entry *ent; | 59 | struct trace_entry *ent; |
| 60 | int leftover; | ||
| 60 | int cpu; | 61 | int cpu; |
| 61 | u64 ts; | 62 | u64 ts; |
| 62 | 63 | ||
diff --git a/include/linux/gigaset_dev.h b/include/linux/gigaset_dev.h index 5dc4a316ca37..258ba82937e7 100644 --- a/include/linux/gigaset_dev.h +++ b/include/linux/gigaset_dev.h | |||
| @@ -16,15 +16,23 @@ | |||
| 16 | 16 | ||
| 17 | #include <linux/ioctl.h> | 17 | #include <linux/ioctl.h> |
| 18 | 18 | ||
| 19 | /* The magic IOCTL value for this interface. */ | ||
| 19 | #define GIGASET_IOCTL 0x47 | 20 | #define GIGASET_IOCTL 0x47 |
| 20 | 21 | ||
| 21 | #define GIGVER_DRIVER 0 | 22 | /* enable/disable device control via character device (lock out ISDN subsys) */ |
| 22 | #define GIGVER_COMPAT 1 | 23 | #define GIGASET_REDIR _IOWR(GIGASET_IOCTL, 0, int) |
| 23 | #define GIGVER_FWBASE 2 | ||
| 24 | 24 | ||
| 25 | #define GIGASET_REDIR _IOWR (GIGASET_IOCTL, 0, int) | 25 | /* enable adapter configuration mode (M10x only) */ |
| 26 | #define GIGASET_CONFIG _IOWR (GIGASET_IOCTL, 1, int) | 26 | #define GIGASET_CONFIG _IOWR(GIGASET_IOCTL, 1, int) |
| 27 | #define GIGASET_BRKCHARS _IOW (GIGASET_IOCTL, 2, unsigned char[6]) //FIXME [6] okay? | 27 | |
| 28 | #define GIGASET_VERSION _IOWR (GIGASET_IOCTL, 3, unsigned[4]) | 28 | /* set break characters (M105 only) */ |
| 29 | #define GIGASET_BRKCHARS _IOW(GIGASET_IOCTL, 2, unsigned char[6]) | ||
| 30 | |||
| 31 | /* get version information selected by arg[0] */ | ||
| 32 | #define GIGASET_VERSION _IOWR(GIGASET_IOCTL, 3, unsigned[4]) | ||
| 33 | /* values for GIGASET_VERSION arg[0] */ | ||
| 34 | #define GIGVER_DRIVER 0 /* get driver version */ | ||
| 35 | #define GIGVER_COMPAT 1 /* get interface compatibility version */ | ||
| 36 | #define GIGVER_FWBASE 2 /* get base station firmware version */ | ||
| 29 | 37 | ||
| 30 | #endif | 38 | #endif |
diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h deleted file mode 100644 index 92b08cfe4a75..000000000000 --- a/include/linux/hayesesp.h +++ /dev/null | |||
| @@ -1,114 +0,0 @@ | |||
| 1 | #ifndef HAYESESP_H | ||
| 2 | #define HAYESESP_H | ||
| 3 | |||
| 4 | struct hayes_esp_config { | ||
| 5 | short flow_on; | ||
| 6 | short flow_off; | ||
| 7 | short rx_trigger; | ||
| 8 | short tx_trigger; | ||
| 9 | short pio_threshold; | ||
| 10 | unsigned char rx_timeout; | ||
| 11 | char dma_channel; | ||
| 12 | }; | ||
| 13 | |||
| 14 | #ifdef __KERNEL__ | ||
| 15 | |||
| 16 | #define ESP_DMA_CHANNEL 0 | ||
| 17 | #define ESP_RX_TRIGGER 768 | ||
| 18 | #define ESP_TX_TRIGGER 768 | ||
| 19 | #define ESP_FLOW_OFF 1016 | ||
| 20 | #define ESP_FLOW_ON 944 | ||
| 21 | #define ESP_RX_TMOUT 128 | ||
| 22 | #define ESP_PIO_THRESHOLD 32 | ||
| 23 | |||
| 24 | #define ESP_IN_MAJOR 57 /* major dev # for dial in */ | ||
| 25 | #define ESP_OUT_MAJOR 58 /* major dev # for dial out */ | ||
| 26 | #define ESPC_SCALE 3 | ||
| 27 | #define UART_ESI_BASE 0x00 | ||
| 28 | #define UART_ESI_SID 0x01 | ||
| 29 | #define UART_ESI_RX 0x02 | ||
| 30 | #define UART_ESI_TX 0x02 | ||
| 31 | #define UART_ESI_CMD1 0x04 | ||
| 32 | #define UART_ESI_CMD2 0x05 | ||
| 33 | #define UART_ESI_STAT1 0x04 | ||
| 34 | #define UART_ESI_STAT2 0x05 | ||
| 35 | #define UART_ESI_RWS 0x07 | ||
| 36 | |||
| 37 | #define UART_IER_DMA_TMOUT 0x80 | ||
| 38 | #define UART_IER_DMA_TC 0x08 | ||
| 39 | |||
| 40 | #define ESI_SET_IRQ 0x04 | ||
| 41 | #define ESI_SET_DMA_TMOUT 0x05 | ||
| 42 | #define ESI_SET_SRV_MASK 0x06 | ||
| 43 | #define ESI_SET_ERR_MASK 0x07 | ||
| 44 | #define ESI_SET_FLOW_CNTL 0x08 | ||
| 45 | #define ESI_SET_FLOW_CHARS 0x09 | ||
| 46 | #define ESI_SET_FLOW_LVL 0x0a | ||
| 47 | #define ESI_SET_TRIGGER 0x0b | ||
| 48 | #define ESI_SET_RX_TIMEOUT 0x0c | ||
| 49 | #define ESI_SET_FLOW_TMOUT 0x0d | ||
| 50 | #define ESI_WRITE_UART 0x0e | ||
| 51 | #define ESI_READ_UART 0x0f | ||
| 52 | #define ESI_SET_MODE 0x10 | ||
| 53 | #define ESI_GET_ERR_STAT 0x12 | ||
| 54 | #define ESI_GET_UART_STAT 0x13 | ||
| 55 | #define ESI_GET_RX_AVAIL 0x14 | ||
| 56 | #define ESI_GET_TX_AVAIL 0x15 | ||
| 57 | #define ESI_START_DMA_RX 0x16 | ||
| 58 | #define ESI_START_DMA_TX 0x17 | ||
| 59 | #define ESI_ISSUE_BREAK 0x1a | ||
| 60 | #define ESI_FLUSH_RX 0x1b | ||
| 61 | #define ESI_FLUSH_TX 0x1c | ||
| 62 | #define ESI_SET_BAUD 0x1d | ||
| 63 | #define ESI_SET_ENH_IRQ 0x1f | ||
| 64 | #define ESI_SET_REINTR 0x20 | ||
| 65 | #define ESI_SET_PRESCALAR 0x23 | ||
| 66 | #define ESI_NO_COMMAND 0xff | ||
| 67 | |||
| 68 | #define ESP_STAT_RX_TIMEOUT 0x01 | ||
| 69 | #define ESP_STAT_DMA_RX 0x02 | ||
| 70 | #define ESP_STAT_DMA_TX 0x04 | ||
| 71 | #define ESP_STAT_NEVER_DMA 0x08 | ||
| 72 | #define ESP_STAT_USE_PIO 0x10 | ||
| 73 | |||
| 74 | #define ESP_MAGIC 0x53ee | ||
| 75 | #define ESP_XMIT_SIZE 4096 | ||
| 76 | |||
| 77 | struct esp_struct { | ||
| 78 | int magic; | ||
| 79 | struct tty_port port; | ||
| 80 | spinlock_t lock; | ||
| 81 | int io_port; | ||
| 82 | int irq; | ||
| 83 | int read_status_mask; | ||
| 84 | int ignore_status_mask; | ||
| 85 | int timeout; | ||
| 86 | int stat_flags; | ||
| 87 | int custom_divisor; | ||
| 88 | int close_delay; | ||
| 89 | unsigned short closing_wait; | ||
| 90 | unsigned short closing_wait2; | ||
| 91 | int IER; /* Interrupt Enable Register */ | ||
| 92 | int MCR; /* Modem control register */ | ||
| 93 | unsigned long last_active; | ||
| 94 | int line; | ||
| 95 | unsigned char *xmit_buf; | ||
| 96 | int xmit_head; | ||
| 97 | int xmit_tail; | ||
| 98 | int xmit_cnt; | ||
| 99 | wait_queue_head_t break_wait; | ||
| 100 | struct async_icount icount; /* kernel counters for the 4 input interrupts */ | ||
| 101 | struct hayes_esp_config config; /* port configuration */ | ||
| 102 | struct esp_struct *next_port; /* For the linked list */ | ||
| 103 | }; | ||
| 104 | |||
| 105 | struct esp_pio_buffer { | ||
| 106 | unsigned char data[1024]; | ||
| 107 | struct esp_pio_buffer *next; | ||
| 108 | }; | ||
| 109 | |||
| 110 | #endif /* __KERNEL__ */ | ||
| 111 | |||
| 112 | |||
| 113 | #endif /* ESP_H */ | ||
| 114 | |||
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 9bace4b9f4fe..af634e95871d 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
| @@ -162,10 +162,11 @@ struct hrtimer_clock_base { | |||
| 162 | * @expires_next: absolute time of the next event which was scheduled | 162 | * @expires_next: absolute time of the next event which was scheduled |
| 163 | * via clock_set_next_event() | 163 | * via clock_set_next_event() |
| 164 | * @hres_active: State of high resolution mode | 164 | * @hres_active: State of high resolution mode |
| 165 | * @check_clocks: Indictator, when set evaluate time source and clock | 165 | * @hang_detected: The last hrtimer interrupt detected a hang |
| 166 | * event devices whether high resolution mode can be | 166 | * @nr_events: Total number of hrtimer interrupt events |
| 167 | * activated. | 167 | * @nr_retries: Total number of hrtimer interrupt retries |
| 168 | * @nr_events: Total number of timer interrupt events | 168 | * @nr_hangs: Total number of hrtimer interrupt hangs |
| 169 | * @max_hang_time: Maximum time spent in hrtimer_interrupt | ||
| 169 | */ | 170 | */ |
| 170 | struct hrtimer_cpu_base { | 171 | struct hrtimer_cpu_base { |
| 171 | spinlock_t lock; | 172 | spinlock_t lock; |
| @@ -173,7 +174,11 @@ struct hrtimer_cpu_base { | |||
| 173 | #ifdef CONFIG_HIGH_RES_TIMERS | 174 | #ifdef CONFIG_HIGH_RES_TIMERS |
| 174 | ktime_t expires_next; | 175 | ktime_t expires_next; |
| 175 | int hres_active; | 176 | int hres_active; |
| 177 | int hang_detected; | ||
| 176 | unsigned long nr_events; | 178 | unsigned long nr_events; |
| 179 | unsigned long nr_retries; | ||
| 180 | unsigned long nr_hangs; | ||
| 181 | ktime_t max_hang_time; | ||
| 177 | #endif | 182 | #endif |
| 178 | }; | 183 | }; |
| 179 | 184 | ||
| @@ -435,47 +440,4 @@ extern u64 ktime_divns(const ktime_t kt, s64 div); | |||
| 435 | /* Show pending timers: */ | 440 | /* Show pending timers: */ |
| 436 | extern void sysrq_timer_list_show(void); | 441 | extern void sysrq_timer_list_show(void); |
| 437 | 442 | ||
| 438 | /* | ||
| 439 | * Timer-statistics info: | ||
| 440 | */ | ||
| 441 | #ifdef CONFIG_TIMER_STATS | ||
| 442 | |||
| 443 | extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, | ||
| 444 | void *timerf, char *comm, | ||
| 445 | unsigned int timer_flag); | ||
| 446 | |||
| 447 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) | ||
| 448 | { | ||
| 449 | if (likely(!timer_stats_active)) | ||
| 450 | return; | ||
| 451 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, | ||
| 452 | timer->function, timer->start_comm, 0); | ||
| 453 | } | ||
| 454 | |||
| 455 | extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer, | ||
| 456 | void *addr); | ||
| 457 | |||
| 458 | static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) | ||
| 459 | { | ||
| 460 | __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0)); | ||
| 461 | } | ||
| 462 | |||
| 463 | static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer) | ||
| 464 | { | ||
| 465 | timer->start_site = NULL; | ||
| 466 | } | ||
| 467 | #else | ||
| 468 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) | ||
| 469 | { | ||
| 470 | } | ||
| 471 | |||
| 472 | static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) | ||
| 473 | { | ||
| 474 | } | ||
| 475 | |||
| 476 | static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer) | ||
| 477 | { | ||
| 478 | } | ||
| 479 | #endif | ||
| 480 | |||
| 481 | #endif | 443 | #endif |
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index a03daed08c59..41235c93e4e9 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h | |||
| @@ -20,19 +20,18 @@ enum { | |||
| 20 | 20 | ||
| 21 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 21 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
| 22 | 22 | ||
| 23 | /* As it's for in-kernel or ptrace use, we want it to be pinned */ | ||
| 24 | #define DEFINE_BREAKPOINT_ATTR(name) \ | ||
| 25 | struct perf_event_attr name = { \ | ||
| 26 | .type = PERF_TYPE_BREAKPOINT, \ | ||
| 27 | .size = sizeof(name), \ | ||
| 28 | .pinned = 1, \ | ||
| 29 | }; | ||
| 30 | |||
| 31 | static inline void hw_breakpoint_init(struct perf_event_attr *attr) | 23 | static inline void hw_breakpoint_init(struct perf_event_attr *attr) |
| 32 | { | 24 | { |
| 25 | memset(attr, 0, sizeof(*attr)); | ||
| 26 | |||
| 33 | attr->type = PERF_TYPE_BREAKPOINT; | 27 | attr->type = PERF_TYPE_BREAKPOINT; |
| 34 | attr->size = sizeof(*attr); | 28 | attr->size = sizeof(*attr); |
| 29 | /* | ||
| 30 | * As it's for in-kernel or ptrace use, we want it to be pinned | ||
| 31 | * and to call its callback every hits. | ||
| 32 | */ | ||
| 35 | attr->pinned = 1; | 33 | attr->pinned = 1; |
| 34 | attr->sample_period = 1; | ||
| 36 | } | 35 | } |
| 37 | 36 | ||
| 38 | static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) | 37 | static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) |
| @@ -52,27 +51,24 @@ static inline int hw_breakpoint_len(struct perf_event *bp) | |||
| 52 | 51 | ||
| 53 | extern struct perf_event * | 52 | extern struct perf_event * |
| 54 | register_user_hw_breakpoint(struct perf_event_attr *attr, | 53 | register_user_hw_breakpoint(struct perf_event_attr *attr, |
| 55 | perf_callback_t triggered, | 54 | perf_overflow_handler_t triggered, |
| 56 | struct task_struct *tsk); | 55 | struct task_struct *tsk); |
| 57 | 56 | ||
| 58 | /* FIXME: only change from the attr, and don't unregister */ | 57 | /* FIXME: only change from the attr, and don't unregister */ |
| 59 | extern struct perf_event * | 58 | extern int |
| 60 | modify_user_hw_breakpoint(struct perf_event *bp, | 59 | modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr); |
| 61 | struct perf_event_attr *attr, | ||
| 62 | perf_callback_t triggered, | ||
| 63 | struct task_struct *tsk); | ||
| 64 | 60 | ||
| 65 | /* | 61 | /* |
| 66 | * Kernel breakpoints are not associated with any particular thread. | 62 | * Kernel breakpoints are not associated with any particular thread. |
| 67 | */ | 63 | */ |
| 68 | extern struct perf_event * | 64 | extern struct perf_event * |
| 69 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | 65 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, |
| 70 | perf_callback_t triggered, | 66 | perf_overflow_handler_t triggered, |
| 71 | int cpu); | 67 | int cpu); |
| 72 | 68 | ||
| 73 | extern struct perf_event ** | 69 | extern struct perf_event ** |
| 74 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | 70 | register_wide_hw_breakpoint(struct perf_event_attr *attr, |
| 75 | perf_callback_t triggered); | 71 | perf_overflow_handler_t triggered); |
| 76 | 72 | ||
| 77 | extern int register_perf_hw_breakpoint(struct perf_event *bp); | 73 | extern int register_perf_hw_breakpoint(struct perf_event *bp); |
| 78 | extern int __register_perf_hw_breakpoint(struct perf_event *bp); | 74 | extern int __register_perf_hw_breakpoint(struct perf_event *bp); |
| @@ -93,20 +89,18 @@ static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp) | |||
| 93 | 89 | ||
| 94 | static inline struct perf_event * | 90 | static inline struct perf_event * |
| 95 | register_user_hw_breakpoint(struct perf_event_attr *attr, | 91 | register_user_hw_breakpoint(struct perf_event_attr *attr, |
| 96 | perf_callback_t triggered, | 92 | perf_overflow_handler_t triggered, |
| 97 | struct task_struct *tsk) { return NULL; } | 93 | struct task_struct *tsk) { return NULL; } |
| 98 | static inline struct perf_event * | 94 | static inline int |
| 99 | modify_user_hw_breakpoint(struct perf_event *bp, | 95 | modify_user_hw_breakpoint(struct perf_event *bp, |
| 100 | struct perf_event_attr *attr, | 96 | struct perf_event_attr *attr) { return -ENOSYS; } |
| 101 | perf_callback_t triggered, | ||
| 102 | struct task_struct *tsk) { return NULL; } | ||
| 103 | static inline struct perf_event * | 97 | static inline struct perf_event * |
| 104 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | 98 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, |
| 105 | perf_callback_t triggered, | 99 | perf_overflow_handler_t triggered, |
| 106 | int cpu) { return NULL; } | 100 | int cpu) { return NULL; } |
| 107 | static inline struct perf_event ** | 101 | static inline struct perf_event ** |
| 108 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | 102 | register_wide_hw_breakpoint(struct perf_event_attr *attr, |
| 109 | perf_callback_t triggered) { return NULL; } | 103 | perf_overflow_handler_t triggered) { return NULL; } |
| 110 | static inline int | 104 | static inline int |
| 111 | register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } | 105 | register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } |
| 112 | static inline int | 106 | static inline int |
diff --git a/include/linux/i2c/tps65010.h b/include/linux/i2c/tps65010.h index 918c5354d9b8..08aa92278d71 100644 --- a/include/linux/i2c/tps65010.h +++ b/include/linux/i2c/tps65010.h | |||
| @@ -72,6 +72,21 @@ | |||
| 72 | #define TPS_VDCDC1 0x0c | 72 | #define TPS_VDCDC1 0x0c |
| 73 | # define TPS_ENABLE_LP (1 << 3) | 73 | # define TPS_ENABLE_LP (1 << 3) |
| 74 | #define TPS_VDCDC2 0x0d | 74 | #define TPS_VDCDC2 0x0d |
| 75 | # define TPS_LP_COREOFF (1 << 7) | ||
| 76 | # define TPS_VCORE_1_8V (7<<4) | ||
| 77 | # define TPS_VCORE_1_5V (6 << 4) | ||
| 78 | # define TPS_VCORE_1_4V (5 << 4) | ||
| 79 | # define TPS_VCORE_1_3V (4 << 4) | ||
| 80 | # define TPS_VCORE_1_2V (3 << 4) | ||
| 81 | # define TPS_VCORE_1_1V (2 << 4) | ||
| 82 | # define TPS_VCORE_1_0V (1 << 4) | ||
| 83 | # define TPS_VCORE_0_85V (0 << 4) | ||
| 84 | # define TPS_VCORE_LP_1_2V (3 << 2) | ||
| 85 | # define TPS_VCORE_LP_1_1V (2 << 2) | ||
| 86 | # define TPS_VCORE_LP_1_0V (1 << 2) | ||
| 87 | # define TPS_VCORE_LP_0_85V (0 << 2) | ||
| 88 | # define TPS_VIB (1 << 1) | ||
| 89 | # define TPS_VCORE_DISCH (1 << 0) | ||
| 75 | #define TPS_VREGS1 0x0e | 90 | #define TPS_VREGS1 0x0e |
| 76 | # define TPS_LDO2_ENABLE (1 << 7) | 91 | # define TPS_LDO2_ENABLE (1 << 7) |
| 77 | # define TPS_LDO2_OFF (1 << 6) | 92 | # define TPS_LDO2_OFF (1 << 6) |
| @@ -152,6 +167,10 @@ extern int tps65010_config_vregs1(unsigned value); | |||
| 152 | */ | 167 | */ |
| 153 | extern int tps65013_set_low_pwr(unsigned mode); | 168 | extern int tps65013_set_low_pwr(unsigned mode); |
| 154 | 169 | ||
| 170 | /* tps65010_set_vdcdc2 | ||
| 171 | * value to be written to VDCDC2 | ||
| 172 | */ | ||
| 173 | extern int tps65010_config_vdcdc2(unsigned value); | ||
| 155 | 174 | ||
| 156 | struct i2c_client; | 175 | struct i2c_client; |
| 157 | 176 | ||
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl.h index 5306a759cbde..bf1c5be1f5b6 100644 --- a/include/linux/i2c/twl4030.h +++ b/include/linux/i2c/twl.h | |||
| @@ -22,8 +22,8 @@ | |||
| 22 | * | 22 | * |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | #ifndef __TWL4030_H_ | 25 | #ifndef __TWL_H_ |
| 26 | #define __TWL4030_H_ | 26 | #define __TWL_H_ |
| 27 | 27 | ||
| 28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
| 29 | #include <linux/input/matrix_keypad.h> | 29 | #include <linux/input/matrix_keypad.h> |
| @@ -61,28 +61,112 @@ | |||
| 61 | #define TWL4030_MODULE_PWMA 0x0E | 61 | #define TWL4030_MODULE_PWMA 0x0E |
| 62 | #define TWL4030_MODULE_PWMB 0x0F | 62 | #define TWL4030_MODULE_PWMB 0x0F |
| 63 | 63 | ||
| 64 | #define TWL5031_MODULE_ACCESSORY 0x10 | ||
| 65 | #define TWL5031_MODULE_INTERRUPTS 0x11 | ||
| 66 | |||
| 64 | /* Slave 3 (i2c address 0x4b) */ | 67 | /* Slave 3 (i2c address 0x4b) */ |
| 65 | #define TWL4030_MODULE_BACKUP 0x10 | 68 | #define TWL4030_MODULE_BACKUP 0x12 |
| 66 | #define TWL4030_MODULE_INT 0x11 | 69 | #define TWL4030_MODULE_INT 0x13 |
| 67 | #define TWL4030_MODULE_PM_MASTER 0x12 | 70 | #define TWL4030_MODULE_PM_MASTER 0x14 |
| 68 | #define TWL4030_MODULE_PM_RECEIVER 0x13 | 71 | #define TWL4030_MODULE_PM_RECEIVER 0x15 |
| 69 | #define TWL4030_MODULE_RTC 0x14 | 72 | #define TWL4030_MODULE_RTC 0x16 |
| 70 | #define TWL4030_MODULE_SECURED_REG 0x15 | 73 | #define TWL4030_MODULE_SECURED_REG 0x17 |
| 74 | |||
| 75 | #define TWL_MODULE_USB TWL4030_MODULE_USB | ||
| 76 | #define TWL_MODULE_AUDIO_VOICE TWL4030_MODULE_AUDIO_VOICE | ||
| 77 | #define TWL_MODULE_PIH TWL4030_MODULE_PIH | ||
| 78 | #define TWL_MODULE_MADC TWL4030_MODULE_MADC | ||
| 79 | #define TWL_MODULE_MAIN_CHARGE TWL4030_MODULE_MAIN_CHARGE | ||
| 80 | #define TWL_MODULE_PM_MASTER TWL4030_MODULE_PM_MASTER | ||
| 81 | #define TWL_MODULE_PM_RECEIVER TWL4030_MODULE_PM_RECEIVER | ||
| 82 | #define TWL_MODULE_RTC TWL4030_MODULE_RTC | ||
| 83 | |||
| 84 | #define GPIO_INTR_OFFSET 0 | ||
| 85 | #define KEYPAD_INTR_OFFSET 1 | ||
| 86 | #define BCI_INTR_OFFSET 2 | ||
| 87 | #define MADC_INTR_OFFSET 3 | ||
| 88 | #define USB_INTR_OFFSET 4 | ||
| 89 | #define BCI_PRES_INTR_OFFSET 9 | ||
| 90 | #define USB_PRES_INTR_OFFSET 10 | ||
| 91 | #define RTC_INTR_OFFSET 11 | ||
| 92 | |||
| 93 | /* | ||
| 94 | * Offset from TWL6030_IRQ_BASE / pdata->irq_base | ||
| 95 | */ | ||
| 96 | #define PWR_INTR_OFFSET 0 | ||
| 97 | #define HOTDIE_INTR_OFFSET 12 | ||
| 98 | #define SMPSLDO_INTR_OFFSET 13 | ||
| 99 | #define BATDETECT_INTR_OFFSET 14 | ||
| 100 | #define SIMDETECT_INTR_OFFSET 15 | ||
| 101 | #define MMCDETECT_INTR_OFFSET 16 | ||
| 102 | #define GASGAUGE_INTR_OFFSET 17 | ||
| 103 | #define USBOTG_INTR_OFFSET 4 | ||
| 104 | #define CHARGER_INTR_OFFSET 2 | ||
| 105 | #define RSV_INTR_OFFSET 0 | ||
| 106 | |||
| 107 | /* INT register offsets */ | ||
| 108 | #define REG_INT_STS_A 0x00 | ||
| 109 | #define REG_INT_STS_B 0x01 | ||
| 110 | #define REG_INT_STS_C 0x02 | ||
| 111 | |||
| 112 | #define REG_INT_MSK_LINE_A 0x03 | ||
| 113 | #define REG_INT_MSK_LINE_B 0x04 | ||
| 114 | #define REG_INT_MSK_LINE_C 0x05 | ||
| 115 | |||
| 116 | #define REG_INT_MSK_STS_A 0x06 | ||
| 117 | #define REG_INT_MSK_STS_B 0x07 | ||
| 118 | #define REG_INT_MSK_STS_C 0x08 | ||
| 119 | |||
| 120 | /* MASK INT REG GROUP A */ | ||
| 121 | #define TWL6030_PWR_INT_MASK 0x07 | ||
| 122 | #define TWL6030_RTC_INT_MASK 0x18 | ||
| 123 | #define TWL6030_HOTDIE_INT_MASK 0x20 | ||
| 124 | #define TWL6030_SMPSLDOA_INT_MASK 0xC0 | ||
| 125 | |||
| 126 | /* MASK INT REG GROUP B */ | ||
| 127 | #define TWL6030_SMPSLDOB_INT_MASK 0x01 | ||
| 128 | #define TWL6030_BATDETECT_INT_MASK 0x02 | ||
| 129 | #define TWL6030_SIMDETECT_INT_MASK 0x04 | ||
| 130 | #define TWL6030_MMCDETECT_INT_MASK 0x08 | ||
| 131 | #define TWL6030_GPADC_INT_MASK 0x60 | ||
| 132 | #define TWL6030_GASGAUGE_INT_MASK 0x80 | ||
| 133 | |||
| 134 | /* MASK INT REG GROUP C */ | ||
| 135 | #define TWL6030_USBOTG_INT_MASK 0x0F | ||
| 136 | #define TWL6030_CHARGER_CTRL_INT_MASK 0x10 | ||
| 137 | #define TWL6030_CHARGER_FAULT_INT_MASK 0x60 | ||
| 138 | |||
| 139 | |||
| 140 | #define TWL4030_CLASS_ID 0x4030 | ||
| 141 | #define TWL6030_CLASS_ID 0x6030 | ||
| 142 | unsigned int twl_rev(void); | ||
| 143 | #define GET_TWL_REV (twl_rev()) | ||
| 144 | #define TWL_CLASS_IS(class, id) \ | ||
| 145 | static inline int twl_class_is_ ##class(void) \ | ||
| 146 | { \ | ||
| 147 | return ((id) == (GET_TWL_REV)) ? 1 : 0; \ | ||
| 148 | } | ||
| 149 | |||
| 150 | TWL_CLASS_IS(4030, TWL4030_CLASS_ID) | ||
| 151 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) | ||
| 71 | 152 | ||
| 72 | /* | 153 | /* |
| 73 | * Read and write single 8-bit registers | 154 | * Read and write single 8-bit registers |
| 74 | */ | 155 | */ |
| 75 | int twl4030_i2c_write_u8(u8 mod_no, u8 val, u8 reg); | 156 | int twl_i2c_write_u8(u8 mod_no, u8 val, u8 reg); |
| 76 | int twl4030_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); | 157 | int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); |
| 77 | 158 | ||
| 78 | /* | 159 | /* |
| 79 | * Read and write several 8-bit registers at once. | 160 | * Read and write several 8-bit registers at once. |
| 80 | * | 161 | * |
| 81 | * IMPORTANT: For twl4030_i2c_write(), allocate num_bytes + 1 | 162 | * IMPORTANT: For twl_i2c_write(), allocate num_bytes + 1 |
| 82 | * for the value, and populate your data starting at offset 1. | 163 | * for the value, and populate your data starting at offset 1. |
| 83 | */ | 164 | */ |
| 84 | int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | 165 | int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
| 85 | int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | 166 | int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
| 167 | |||
| 168 | int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); | ||
| 169 | int twl6030_interrupt_mask(u8 bit_mask, u8 offset); | ||
| 86 | 170 | ||
| 87 | /*----------------------------------------------------------------------*/ | 171 | /*----------------------------------------------------------------------*/ |
| 88 | 172 | ||
| @@ -221,6 +305,38 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | |||
| 221 | 305 | ||
| 222 | /*----------------------------------------------------------------------*/ | 306 | /*----------------------------------------------------------------------*/ |
| 223 | 307 | ||
| 308 | /* | ||
| 309 | * Accessory Interrupts | ||
| 310 | */ | ||
| 311 | #define TWL5031_ACIIMR_LSB 0x05 | ||
| 312 | #define TWL5031_ACIIMR_MSB 0x06 | ||
| 313 | #define TWL5031_ACIIDR_LSB 0x07 | ||
| 314 | #define TWL5031_ACIIDR_MSB 0x08 | ||
| 315 | #define TWL5031_ACCISR1 0x0F | ||
| 316 | #define TWL5031_ACCIMR1 0x10 | ||
| 317 | #define TWL5031_ACCISR2 0x11 | ||
| 318 | #define TWL5031_ACCIMR2 0x12 | ||
| 319 | #define TWL5031_ACCSIR 0x13 | ||
| 320 | #define TWL5031_ACCEDR1 0x14 | ||
| 321 | #define TWL5031_ACCSIHCTRL 0x15 | ||
| 322 | |||
| 323 | /*----------------------------------------------------------------------*/ | ||
| 324 | |||
| 325 | /* | ||
| 326 | * Battery Charger Controller | ||
| 327 | */ | ||
| 328 | |||
| 329 | #define TWL5031_INTERRUPTS_BCIISR1 0x0 | ||
| 330 | #define TWL5031_INTERRUPTS_BCIIMR1 0x1 | ||
| 331 | #define TWL5031_INTERRUPTS_BCIISR2 0x2 | ||
| 332 | #define TWL5031_INTERRUPTS_BCIIMR2 0x3 | ||
| 333 | #define TWL5031_INTERRUPTS_BCISIR 0x4 | ||
| 334 | #define TWL5031_INTERRUPTS_BCIEDR1 0x5 | ||
| 335 | #define TWL5031_INTERRUPTS_BCIEDR2 0x6 | ||
| 336 | #define TWL5031_INTERRUPTS_BCISIHCTRL 0x7 | ||
| 337 | |||
| 338 | /*----------------------------------------------------------------------*/ | ||
| 339 | |||
| 224 | /* Power bus message definitions */ | 340 | /* Power bus message definitions */ |
| 225 | 341 | ||
| 226 | /* The TWL4030/5030 splits its power-management resources (the various | 342 | /* The TWL4030/5030 splits its power-management resources (the various |
| @@ -250,6 +366,7 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | |||
| 250 | 366 | ||
| 251 | #define RES_TYPE_ALL 0x7 | 367 | #define RES_TYPE_ALL 0x7 |
| 252 | 368 | ||
| 369 | /* Resource states */ | ||
| 253 | #define RES_STATE_WRST 0xF | 370 | #define RES_STATE_WRST 0xF |
| 254 | #define RES_STATE_ACTIVE 0xE | 371 | #define RES_STATE_ACTIVE 0xE |
| 255 | #define RES_STATE_SLEEP 0x8 | 372 | #define RES_STATE_SLEEP 0x8 |
| @@ -310,8 +427,18 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | |||
| 310 | #define MSG_SINGULAR(devgrp, id, state) \ | 427 | #define MSG_SINGULAR(devgrp, id, state) \ |
| 311 | ((devgrp) << 13 | 0 << 12 | (id) << 4 | (state)) | 428 | ((devgrp) << 13 | 0 << 12 | (id) << 4 | (state)) |
| 312 | 429 | ||
| 430 | #define MSG_BROADCAST_ALL(devgrp, state) \ | ||
| 431 | ((devgrp) << 5 | (state)) | ||
| 432 | |||
| 433 | #define MSG_BROADCAST_REF MSG_BROADCAST_ALL | ||
| 434 | #define MSG_BROADCAST_PROV MSG_BROADCAST_ALL | ||
| 435 | #define MSG_BROADCAST__CLK_RST MSG_BROADCAST_ALL | ||
| 313 | /*----------------------------------------------------------------------*/ | 436 | /*----------------------------------------------------------------------*/ |
| 314 | 437 | ||
| 438 | struct twl4030_clock_init_data { | ||
| 439 | bool ck32k_lowpwr_enable; | ||
| 440 | }; | ||
| 441 | |||
| 315 | struct twl4030_bci_platform_data { | 442 | struct twl4030_bci_platform_data { |
| 316 | int *battery_tmp_tbl; | 443 | int *battery_tmp_tbl; |
| 317 | unsigned int tblsize; | 444 | unsigned int tblsize; |
| @@ -391,12 +518,15 @@ struct twl4030_resconfig { | |||
| 391 | u8 devgroup; /* Processor group that Power resource belongs to */ | 518 | u8 devgroup; /* Processor group that Power resource belongs to */ |
| 392 | u8 type; /* Power resource addressed, 6 / broadcast message */ | 519 | u8 type; /* Power resource addressed, 6 / broadcast message */ |
| 393 | u8 type2; /* Power resource addressed, 3 / broadcast message */ | 520 | u8 type2; /* Power resource addressed, 3 / broadcast message */ |
| 521 | u8 remap_off; /* off state remapping */ | ||
| 522 | u8 remap_sleep; /* sleep state remapping */ | ||
| 394 | }; | 523 | }; |
| 395 | 524 | ||
| 396 | struct twl4030_power_data { | 525 | struct twl4030_power_data { |
| 397 | struct twl4030_script **scripts; | 526 | struct twl4030_script **scripts; |
| 398 | unsigned num; | 527 | unsigned num; |
| 399 | struct twl4030_resconfig *resource_config; | 528 | struct twl4030_resconfig *resource_config; |
| 529 | #define TWL4030_RESCONFIG_UNDEF ((u8)-1) | ||
| 400 | }; | 530 | }; |
| 401 | 531 | ||
| 402 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); | 532 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); |
| @@ -421,6 +551,7 @@ struct twl4030_codec_data { | |||
| 421 | 551 | ||
| 422 | struct twl4030_platform_data { | 552 | struct twl4030_platform_data { |
| 423 | unsigned irq_base, irq_end; | 553 | unsigned irq_base, irq_end; |
| 554 | struct twl4030_clock_init_data *clock; | ||
| 424 | struct twl4030_bci_platform_data *bci; | 555 | struct twl4030_bci_platform_data *bci; |
| 425 | struct twl4030_gpio_platform_data *gpio; | 556 | struct twl4030_gpio_platform_data *gpio; |
| 426 | struct twl4030_madc_platform_data *madc; | 557 | struct twl4030_madc_platform_data *madc; |
| @@ -429,19 +560,31 @@ struct twl4030_platform_data { | |||
| 429 | struct twl4030_power_data *power; | 560 | struct twl4030_power_data *power; |
| 430 | struct twl4030_codec_data *codec; | 561 | struct twl4030_codec_data *codec; |
| 431 | 562 | ||
| 432 | /* LDO regulators */ | 563 | /* Common LDO regulators for TWL4030/TWL6030 */ |
| 433 | struct regulator_init_data *vdac; | 564 | struct regulator_init_data *vdac; |
| 565 | struct regulator_init_data *vaux1; | ||
| 566 | struct regulator_init_data *vaux2; | ||
| 567 | struct regulator_init_data *vaux3; | ||
| 568 | /* TWL4030 LDO regulators */ | ||
| 434 | struct regulator_init_data *vpll1; | 569 | struct regulator_init_data *vpll1; |
| 435 | struct regulator_init_data *vpll2; | 570 | struct regulator_init_data *vpll2; |
| 436 | struct regulator_init_data *vmmc1; | 571 | struct regulator_init_data *vmmc1; |
| 437 | struct regulator_init_data *vmmc2; | 572 | struct regulator_init_data *vmmc2; |
| 438 | struct regulator_init_data *vsim; | 573 | struct regulator_init_data *vsim; |
| 439 | struct regulator_init_data *vaux1; | ||
| 440 | struct regulator_init_data *vaux2; | ||
| 441 | struct regulator_init_data *vaux3; | ||
| 442 | struct regulator_init_data *vaux4; | 574 | struct regulator_init_data *vaux4; |
| 443 | 575 | struct regulator_init_data *vio; | |
| 444 | /* REVISIT more to come ... _nothing_ should be hard-wired */ | 576 | struct regulator_init_data *vdd1; |
| 577 | struct regulator_init_data *vdd2; | ||
| 578 | struct regulator_init_data *vintana1; | ||
| 579 | struct regulator_init_data *vintana2; | ||
| 580 | struct regulator_init_data *vintdig; | ||
| 581 | /* TWL6030 LDO regulators */ | ||
| 582 | struct regulator_init_data *vmmc; | ||
| 583 | struct regulator_init_data *vpp; | ||
| 584 | struct regulator_init_data *vusim; | ||
| 585 | struct regulator_init_data *vana; | ||
| 586 | struct regulator_init_data *vcxio; | ||
| 587 | struct regulator_init_data *vusb; | ||
| 445 | }; | 588 | }; |
| 446 | 589 | ||
| 447 | /*----------------------------------------------------------------------*/ | 590 | /*----------------------------------------------------------------------*/ |
| @@ -473,6 +616,7 @@ int twl4030_sih_setup(int module); | |||
| 473 | * VIO is generally fixed. | 616 | * VIO is generally fixed. |
| 474 | */ | 617 | */ |
| 475 | 618 | ||
| 619 | /* TWL4030 SMPS/LDO's */ | ||
| 476 | /* EXTERNAL dc-to-dc buck converters */ | 620 | /* EXTERNAL dc-to-dc buck converters */ |
| 477 | #define TWL4030_REG_VDD1 0 | 621 | #define TWL4030_REG_VDD1 0 |
| 478 | #define TWL4030_REG_VDD2 1 | 622 | #define TWL4030_REG_VDD2 1 |
| @@ -499,4 +643,31 @@ int twl4030_sih_setup(int module); | |||
| 499 | #define TWL4030_REG_VUSB1V8 18 | 643 | #define TWL4030_REG_VUSB1V8 18 |
| 500 | #define TWL4030_REG_VUSB3V1 19 | 644 | #define TWL4030_REG_VUSB3V1 19 |
| 501 | 645 | ||
| 646 | /* TWL6030 SMPS/LDO's */ | ||
| 647 | /* EXTERNAL dc-to-dc buck convertor contollable via SR */ | ||
| 648 | #define TWL6030_REG_VDD1 30 | ||
| 649 | #define TWL6030_REG_VDD2 31 | ||
| 650 | #define TWL6030_REG_VDD3 32 | ||
| 651 | |||
| 652 | /* Non SR compliant dc-to-dc buck convertors */ | ||
| 653 | #define TWL6030_REG_VMEM 33 | ||
| 654 | #define TWL6030_REG_V2V1 34 | ||
| 655 | #define TWL6030_REG_V1V29 35 | ||
| 656 | #define TWL6030_REG_V1V8 36 | ||
| 657 | |||
| 658 | /* EXTERNAL LDOs */ | ||
| 659 | #define TWL6030_REG_VAUX1_6030 37 | ||
| 660 | #define TWL6030_REG_VAUX2_6030 38 | ||
| 661 | #define TWL6030_REG_VAUX3_6030 39 | ||
| 662 | #define TWL6030_REG_VMMC 40 | ||
| 663 | #define TWL6030_REG_VPP 41 | ||
| 664 | #define TWL6030_REG_VUSIM 42 | ||
| 665 | #define TWL6030_REG_VANA 43 | ||
| 666 | #define TWL6030_REG_VCXIO 44 | ||
| 667 | #define TWL6030_REG_VDAC 45 | ||
| 668 | #define TWL6030_REG_VUSB 46 | ||
| 669 | |||
| 670 | /* INTERNAL LDOs */ | ||
| 671 | #define TWL6030_REG_VRTC 47 | ||
| 672 | |||
| 502 | #endif /* End of __TWL4030_H */ | 673 | #endif /* End of __TWL4030_H */ |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 005e1525ab86..299b4121f914 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
| @@ -137,8 +137,6 @@ extern struct ctl_table ether_table[]; | |||
| 137 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); | 137 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); |
| 138 | 138 | ||
| 139 | #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" | 139 | #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" |
| 140 | #define MAC_BUF_SIZE 18 | ||
| 141 | #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] | ||
| 142 | 140 | ||
| 143 | #endif | 141 | #endif |
| 144 | 142 | ||
diff --git a/include/linux/isicom.h b/include/linux/isicom.h index bbd42197298f..b92e05650639 100644 --- a/include/linux/isicom.h +++ b/include/linux/isicom.h | |||
| @@ -67,6 +67,7 @@ | |||
| 67 | 67 | ||
| 68 | #define FIRMWARE_LOADED 0x0001 | 68 | #define FIRMWARE_LOADED 0x0001 |
| 69 | #define BOARD_ACTIVE 0x0002 | 69 | #define BOARD_ACTIVE 0x0002 |
| 70 | #define BOARD_INIT 0x0004 | ||
| 70 | 71 | ||
| 71 | /* isi_port status bitmap */ | 72 | /* isi_port status bitmap */ |
| 72 | 73 | ||
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 2d241da07236..a24de0b1858e 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
| @@ -496,6 +496,7 @@ struct kvm_ioeventfd { | |||
| 496 | #define KVM_CAP_VCPU_EVENTS 41 | 496 | #define KVM_CAP_VCPU_EVENTS 41 |
| 497 | #endif | 497 | #endif |
| 498 | #define KVM_CAP_S390_PSW 42 | 498 | #define KVM_CAP_S390_PSW 42 |
| 499 | #define KVM_CAP_PPC_SEGSTATE 43 | ||
| 499 | 500 | ||
| 500 | #ifdef KVM_CAP_IRQ_ROUTING | 501 | #ifdef KVM_CAP_IRQ_ROUTING |
| 501 | 502 | ||
diff --git a/include/linux/mfd/88pm8607.h b/include/linux/mfd/88pm8607.h new file mode 100644 index 000000000000..f41b428d2cec --- /dev/null +++ b/include/linux/mfd/88pm8607.h | |||
| @@ -0,0 +1,217 @@ | |||
| 1 | /* | ||
| 2 | * Marvell 88PM8607 Interface | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009 Marvell International Ltd. | ||
| 5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __LINUX_MFD_88PM8607_H | ||
| 13 | #define __LINUX_MFD_88PM8607_H | ||
| 14 | |||
| 15 | enum { | ||
| 16 | PM8607_ID_BUCK1 = 0, | ||
| 17 | PM8607_ID_BUCK2, | ||
| 18 | PM8607_ID_BUCK3, | ||
| 19 | |||
| 20 | PM8607_ID_LDO1, | ||
| 21 | PM8607_ID_LDO2, | ||
| 22 | PM8607_ID_LDO3, | ||
| 23 | PM8607_ID_LDO4, | ||
| 24 | PM8607_ID_LDO5, | ||
| 25 | PM8607_ID_LDO6, | ||
| 26 | PM8607_ID_LDO7, | ||
| 27 | PM8607_ID_LDO8, | ||
| 28 | PM8607_ID_LDO9, | ||
| 29 | PM8607_ID_LDO10, | ||
| 30 | PM8607_ID_LDO12, | ||
| 31 | PM8607_ID_LDO14, | ||
| 32 | |||
| 33 | PM8607_ID_RG_MAX, | ||
| 34 | }; | ||
| 35 | |||
| 36 | #define CHIP_ID (0x40) | ||
| 37 | #define CHIP_ID_MASK (0xF8) | ||
| 38 | |||
| 39 | /* Interrupt Registers */ | ||
| 40 | #define PM8607_STATUS_1 (0x01) | ||
| 41 | #define PM8607_STATUS_2 (0x02) | ||
| 42 | #define PM8607_INT_STATUS1 (0x03) | ||
| 43 | #define PM8607_INT_STATUS2 (0x04) | ||
| 44 | #define PM8607_INT_STATUS3 (0x05) | ||
| 45 | #define PM8607_INT_MASK_1 (0x06) | ||
| 46 | #define PM8607_INT_MASK_2 (0x07) | ||
| 47 | #define PM8607_INT_MASK_3 (0x08) | ||
| 48 | |||
| 49 | /* Regulator Control Registers */ | ||
| 50 | #define PM8607_LDO1 (0x10) | ||
| 51 | #define PM8607_LDO2 (0x11) | ||
| 52 | #define PM8607_LDO3 (0x12) | ||
| 53 | #define PM8607_LDO4 (0x13) | ||
| 54 | #define PM8607_LDO5 (0x14) | ||
| 55 | #define PM8607_LDO6 (0x15) | ||
| 56 | #define PM8607_LDO7 (0x16) | ||
| 57 | #define PM8607_LDO8 (0x17) | ||
| 58 | #define PM8607_LDO9 (0x18) | ||
| 59 | #define PM8607_LDO10 (0x19) | ||
| 60 | #define PM8607_LDO12 (0x1A) | ||
| 61 | #define PM8607_LDO14 (0x1B) | ||
| 62 | #define PM8607_SLEEP_MODE1 (0x1C) | ||
| 63 | #define PM8607_SLEEP_MODE2 (0x1D) | ||
| 64 | #define PM8607_SLEEP_MODE3 (0x1E) | ||
| 65 | #define PM8607_SLEEP_MODE4 (0x1F) | ||
| 66 | #define PM8607_GO (0x20) | ||
| 67 | #define PM8607_SLEEP_BUCK1 (0x21) | ||
| 68 | #define PM8607_SLEEP_BUCK2 (0x22) | ||
| 69 | #define PM8607_SLEEP_BUCK3 (0x23) | ||
| 70 | #define PM8607_BUCK1 (0x24) | ||
| 71 | #define PM8607_BUCK2 (0x25) | ||
| 72 | #define PM8607_BUCK3 (0x26) | ||
| 73 | #define PM8607_BUCK_CONTROLS (0x27) | ||
| 74 | #define PM8607_SUPPLIES_EN11 (0x2B) | ||
| 75 | #define PM8607_SUPPLIES_EN12 (0x2C) | ||
| 76 | #define PM8607_GROUP1 (0x2D) | ||
| 77 | #define PM8607_GROUP2 (0x2E) | ||
| 78 | #define PM8607_GROUP3 (0x2F) | ||
| 79 | #define PM8607_GROUP4 (0x30) | ||
| 80 | #define PM8607_GROUP5 (0x31) | ||
| 81 | #define PM8607_GROUP6 (0x32) | ||
| 82 | #define PM8607_SUPPLIES_EN21 (0x33) | ||
| 83 | #define PM8607_SUPPLIES_EN22 (0x34) | ||
| 84 | |||
| 85 | /* RTC Control Registers */ | ||
| 86 | #define PM8607_RTC1 (0xA0) | ||
| 87 | #define PM8607_RTC_COUNTER1 (0xA1) | ||
| 88 | #define PM8607_RTC_COUNTER2 (0xA2) | ||
| 89 | #define PM8607_RTC_COUNTER3 (0xA3) | ||
| 90 | #define PM8607_RTC_COUNTER4 (0xA4) | ||
| 91 | #define PM8607_RTC_EXPIRE1 (0xA5) | ||
| 92 | #define PM8607_RTC_EXPIRE2 (0xA6) | ||
| 93 | #define PM8607_RTC_EXPIRE3 (0xA7) | ||
| 94 | #define PM8607_RTC_EXPIRE4 (0xA8) | ||
| 95 | #define PM8607_RTC_TRIM1 (0xA9) | ||
| 96 | #define PM8607_RTC_TRIM2 (0xAA) | ||
| 97 | #define PM8607_RTC_TRIM3 (0xAB) | ||
| 98 | #define PM8607_RTC_TRIM4 (0xAC) | ||
| 99 | #define PM8607_RTC_MISC1 (0xAD) | ||
| 100 | #define PM8607_RTC_MISC2 (0xAE) | ||
| 101 | #define PM8607_RTC_MISC3 (0xAF) | ||
| 102 | |||
| 103 | /* Misc Registers */ | ||
| 104 | #define PM8607_CHIP_ID (0x00) | ||
| 105 | #define PM8607_LDO1 (0x10) | ||
| 106 | #define PM8607_DVC3 (0x26) | ||
| 107 | #define PM8607_MISC1 (0x40) | ||
| 108 | |||
| 109 | /* bit definitions for PM8607 events */ | ||
| 110 | #define PM8607_EVENT_ONKEY (1 << 0) | ||
| 111 | #define PM8607_EVENT_EXTON (1 << 1) | ||
| 112 | #define PM8607_EVENT_CHG (1 << 2) | ||
| 113 | #define PM8607_EVENT_BAT (1 << 3) | ||
| 114 | #define PM8607_EVENT_RTC (1 << 4) | ||
| 115 | #define PM8607_EVENT_CC (1 << 5) | ||
| 116 | #define PM8607_EVENT_VBAT (1 << 8) | ||
| 117 | #define PM8607_EVENT_VCHG (1 << 9) | ||
| 118 | #define PM8607_EVENT_VSYS (1 << 10) | ||
| 119 | #define PM8607_EVENT_TINT (1 << 11) | ||
| 120 | #define PM8607_EVENT_GPADC0 (1 << 12) | ||
| 121 | #define PM8607_EVENT_GPADC1 (1 << 13) | ||
| 122 | #define PM8607_EVENT_GPADC2 (1 << 14) | ||
| 123 | #define PM8607_EVENT_GPADC3 (1 << 15) | ||
| 124 | #define PM8607_EVENT_AUDIO_SHORT (1 << 16) | ||
| 125 | #define PM8607_EVENT_PEN (1 << 17) | ||
| 126 | #define PM8607_EVENT_HEADSET (1 << 18) | ||
| 127 | #define PM8607_EVENT_HOOK (1 << 19) | ||
| 128 | #define PM8607_EVENT_MICIN (1 << 20) | ||
| 129 | #define PM8607_EVENT_CHG_TIMEOUT (1 << 21) | ||
| 130 | #define PM8607_EVENT_CHG_DONE (1 << 22) | ||
| 131 | #define PM8607_EVENT_CHG_FAULT (1 << 23) | ||
| 132 | |||
| 133 | /* bit definitions of Status Query Interface */ | ||
| 134 | #define PM8607_STATUS_CC (1 << 3) | ||
| 135 | #define PM8607_STATUS_PEN (1 << 4) | ||
| 136 | #define PM8607_STATUS_HEADSET (1 << 5) | ||
| 137 | #define PM8607_STATUS_HOOK (1 << 6) | ||
| 138 | #define PM8607_STATUS_MICIN (1 << 7) | ||
| 139 | #define PM8607_STATUS_ONKEY (1 << 8) | ||
| 140 | #define PM8607_STATUS_EXTON (1 << 9) | ||
| 141 | #define PM8607_STATUS_CHG (1 << 10) | ||
| 142 | #define PM8607_STATUS_BAT (1 << 11) | ||
| 143 | #define PM8607_STATUS_VBUS (1 << 12) | ||
| 144 | #define PM8607_STATUS_OV (1 << 13) | ||
| 145 | |||
| 146 | /* bit definitions of BUCK3 */ | ||
| 147 | #define PM8607_BUCK3_DOUBLE (1 << 6) | ||
| 148 | |||
| 149 | /* bit definitions of Misc1 */ | ||
| 150 | #define PM8607_MISC1_PI2C (1 << 0) | ||
| 151 | |||
| 152 | /* Interrupt Number in 88PM8607 */ | ||
| 153 | enum { | ||
| 154 | PM8607_IRQ_ONKEY = 0, | ||
| 155 | PM8607_IRQ_EXTON, | ||
| 156 | PM8607_IRQ_CHG, | ||
| 157 | PM8607_IRQ_BAT, | ||
| 158 | PM8607_IRQ_RTC, | ||
| 159 | PM8607_IRQ_VBAT = 8, | ||
| 160 | PM8607_IRQ_VCHG, | ||
| 161 | PM8607_IRQ_VSYS, | ||
| 162 | PM8607_IRQ_TINT, | ||
| 163 | PM8607_IRQ_GPADC0, | ||
| 164 | PM8607_IRQ_GPADC1, | ||
| 165 | PM8607_IRQ_GPADC2, | ||
| 166 | PM8607_IRQ_GPADC3, | ||
| 167 | PM8607_IRQ_AUDIO_SHORT = 16, | ||
| 168 | PM8607_IRQ_PEN, | ||
| 169 | PM8607_IRQ_HEADSET, | ||
| 170 | PM8607_IRQ_HOOK, | ||
| 171 | PM8607_IRQ_MICIN, | ||
| 172 | PM8607_IRQ_CHG_FAIL, | ||
| 173 | PM8607_IRQ_CHG_DONE, | ||
| 174 | PM8607_IRQ_CHG_FAULT, | ||
| 175 | }; | ||
| 176 | |||
| 177 | enum { | ||
| 178 | PM8607_CHIP_A0 = 0x40, | ||
| 179 | PM8607_CHIP_A1 = 0x41, | ||
| 180 | PM8607_CHIP_B0 = 0x48, | ||
| 181 | }; | ||
| 182 | |||
| 183 | |||
| 184 | struct pm8607_chip { | ||
| 185 | struct device *dev; | ||
| 186 | struct mutex io_lock; | ||
| 187 | struct i2c_client *client; | ||
| 188 | |||
| 189 | int (*read)(struct pm8607_chip *chip, int reg, int bytes, void *dest); | ||
| 190 | int (*write)(struct pm8607_chip *chip, int reg, int bytes, void *src); | ||
| 191 | |||
| 192 | int buck3_double; /* DVC ramp slope double */ | ||
| 193 | unsigned char chip_id; | ||
| 194 | |||
| 195 | }; | ||
| 196 | |||
| 197 | #define PM8607_MAX_REGULATOR 15 /* 3 Bucks, 12 LDOs */ | ||
| 198 | |||
| 199 | enum { | ||
| 200 | GI2C_PORT = 0, | ||
| 201 | PI2C_PORT, | ||
| 202 | }; | ||
| 203 | |||
| 204 | struct pm8607_platform_data { | ||
| 205 | int i2c_port; /* Controlled by GI2C or PI2C */ | ||
| 206 | struct regulator_init_data *regulator[PM8607_MAX_REGULATOR]; | ||
| 207 | }; | ||
| 208 | |||
| 209 | extern int pm8607_reg_read(struct pm8607_chip *, int); | ||
| 210 | extern int pm8607_reg_write(struct pm8607_chip *, int, unsigned char); | ||
| 211 | extern int pm8607_bulk_read(struct pm8607_chip *, int, int, | ||
| 212 | unsigned char *); | ||
| 213 | extern int pm8607_bulk_write(struct pm8607_chip *, int, int, | ||
| 214 | unsigned char *); | ||
| 215 | extern int pm8607_set_bits(struct pm8607_chip *, int, unsigned char, | ||
| 216 | unsigned char); | ||
| 217 | #endif /* __LINUX_MFD_88PM8607_H */ | ||
diff --git a/include/linux/mfd/ab4500.h b/include/linux/mfd/ab4500.h new file mode 100644 index 000000000000..a42a7033ae53 --- /dev/null +++ b/include/linux/mfd/ab4500.h | |||
| @@ -0,0 +1,262 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2009 ST-Ericsson | ||
| 3 | * | ||
| 4 | * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2, as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * AB4500 device core funtions, for client access | ||
| 11 | */ | ||
| 12 | #ifndef MFD_AB4500_H | ||
| 13 | #define MFD_AB4500_H | ||
| 14 | |||
| 15 | #include <linux/device.h> | ||
| 16 | |||
| 17 | /* | ||
| 18 | * AB4500 bank addresses | ||
| 19 | */ | ||
| 20 | #define AB4500_SYS_CTRL1_BLOCK 0x1 | ||
| 21 | #define AB4500_SYS_CTRL2_BLOCK 0x2 | ||
| 22 | #define AB4500_REGU_CTRL1 0x3 | ||
| 23 | #define AB4500_REGU_CTRL2 0x4 | ||
| 24 | #define AB4500_USB 0x5 | ||
| 25 | #define AB4500_TVOUT 0x6 | ||
| 26 | #define AB4500_DBI 0x7 | ||
| 27 | #define AB4500_ECI_AV_ACC 0x8 | ||
| 28 | #define AB4500_RESERVED 0x9 | ||
| 29 | #define AB4500_GPADC 0xA | ||
| 30 | #define AB4500_CHARGER 0xB | ||
| 31 | #define AB4500_GAS_GAUGE 0xC | ||
| 32 | #define AB4500_AUDIO 0xD | ||
| 33 | #define AB4500_INTERRUPT 0xE | ||
| 34 | #define AB4500_RTC 0xF | ||
| 35 | #define AB4500_MISC 0x10 | ||
| 36 | #define AB4500_DEBUG 0x12 | ||
| 37 | #define AB4500_PROD_TEST 0x13 | ||
| 38 | #define AB4500_OTP_EMUL 0x15 | ||
| 39 | |||
| 40 | /* | ||
| 41 | * System control 1 register offsets. | ||
| 42 | * Bank = 0x01 | ||
| 43 | */ | ||
| 44 | #define AB4500_TURNON_STAT_REG 0x0100 | ||
| 45 | #define AB4500_RESET_STAT_REG 0x0101 | ||
| 46 | #define AB4500_PONKEY1_PRESS_STAT_REG 0x0102 | ||
| 47 | |||
| 48 | #define AB4500_FSM_STAT1_REG 0x0140 | ||
| 49 | #define AB4500_FSM_STAT2_REG 0x0141 | ||
| 50 | #define AB4500_SYSCLK_REQ_STAT_REG 0x0142 | ||
| 51 | #define AB4500_USB_STAT1_REG 0x0143 | ||
| 52 | #define AB4500_USB_STAT2_REG 0x0144 | ||
| 53 | #define AB4500_STATUS_SPARE1_REG 0x0145 | ||
| 54 | #define AB4500_STATUS_SPARE2_REG 0x0146 | ||
| 55 | |||
| 56 | #define AB4500_CTRL1_REG 0x0180 | ||
| 57 | #define AB4500_CTRL2_REG 0x0181 | ||
| 58 | |||
| 59 | /* | ||
| 60 | * System control 2 register offsets. | ||
| 61 | * bank = 0x02 | ||
| 62 | */ | ||
| 63 | #define AB4500_CTRL3_REG 0x0200 | ||
| 64 | #define AB4500_MAIN_WDOG_CTRL_REG 0x0201 | ||
| 65 | #define AB4500_MAIN_WDOG_TIMER_REG 0x0202 | ||
| 66 | #define AB4500_LOW_BAT_REG 0x0203 | ||
| 67 | #define AB4500_BATT_OK_REG 0x0204 | ||
| 68 | #define AB4500_SYSCLK_TIMER_REG 0x0205 | ||
| 69 | #define AB4500_SMPSCLK_CTRL_REG 0x0206 | ||
| 70 | #define AB4500_SMPSCLK_SEL1_REG 0x0207 | ||
| 71 | #define AB4500_SMPSCLK_SEL2_REG 0x0208 | ||
| 72 | #define AB4500_SMPSCLK_SEL3_REG 0x0209 | ||
| 73 | #define AB4500_SYSULPCLK_CONF_REG 0x020A | ||
| 74 | #define AB4500_SYSULPCLK_CTRL1_REG 0x020B | ||
| 75 | #define AB4500_SYSCLK_CTRL_REG 0x020C | ||
| 76 | #define AB4500_SYSCLK_REQ1_VALID_REG 0x020D | ||
| 77 | #define AB4500_SYSCLK_REQ_VALID_REG 0x020E | ||
| 78 | #define AB4500_SYSCTRL_SPARE_REG 0x020F | ||
| 79 | #define AB4500_PAD_CONF_REG 0x0210 | ||
| 80 | |||
| 81 | /* | ||
| 82 | * Regu control1 register offsets | ||
| 83 | * Bank = 0x03 | ||
| 84 | */ | ||
| 85 | #define AB4500_REGU_SERIAL_CTRL1_REG 0x0300 | ||
| 86 | #define AB4500_REGU_SERIAL_CTRL2_REG 0x0301 | ||
| 87 | #define AB4500_REGU_SERIAL_CTRL3_REG 0x0302 | ||
| 88 | #define AB4500_REGU_REQ_CTRL1_REG 0x0303 | ||
| 89 | #define AB4500_REGU_REQ_CTRL2_REG 0x0304 | ||
| 90 | #define AB4500_REGU_REQ_CTRL3_REG 0x0305 | ||
| 91 | #define AB4500_REGU_REQ_CTRL4_REG 0x0306 | ||
| 92 | #define AB4500_REGU_MISC1_REG 0x0380 | ||
| 93 | #define AB4500_REGU_OTGSUPPLY_CTRL_REG 0x0381 | ||
| 94 | #define AB4500_REGU_VUSB_CTRL_REG 0x0382 | ||
| 95 | #define AB4500_REGU_VAUDIO_SUPPLY_REG 0x0383 | ||
| 96 | #define AB4500_REGU_CTRL1_SPARE_REG 0x0384 | ||
| 97 | |||
| 98 | /* | ||
| 99 | * Regu control2 Vmod register offsets | ||
| 100 | */ | ||
| 101 | #define AB4500_REGU_VMOD_REGU_REG 0x0440 | ||
| 102 | #define AB4500_REGU_VMOD_SEL1_REG 0x0441 | ||
| 103 | #define AB4500_REGU_VMOD_SEL2_REG 0x0442 | ||
| 104 | #define AB4500_REGU_CTRL_DISCH_REG 0x0443 | ||
| 105 | #define AB4500_REGU_CTRL_DISCH2_REG 0x0444 | ||
| 106 | |||
| 107 | /* | ||
| 108 | * USB/ULPI register offsets | ||
| 109 | * Bank : 0x5 | ||
| 110 | */ | ||
| 111 | #define AB4500_USB_LINE_STAT_REG 0x0580 | ||
| 112 | #define AB4500_USB_LINE_CTRL1_REG 0x0581 | ||
| 113 | #define AB4500_USB_LINE_CTRL2_REG 0x0582 | ||
| 114 | #define AB4500_USB_LINE_CTRL3_REG 0x0583 | ||
| 115 | #define AB4500_USB_LINE_CTRL4_REG 0x0584 | ||
| 116 | #define AB4500_USB_LINE_CTRL5_REG 0x0585 | ||
| 117 | #define AB4500_USB_OTG_CTRL_REG 0x0587 | ||
| 118 | #define AB4500_USB_OTG_STAT_REG 0x0588 | ||
| 119 | #define AB4500_USB_OTG_STAT_REG 0x0588 | ||
| 120 | #define AB4500_USB_CTRL_SPARE_REG 0x0589 | ||
| 121 | #define AB4500_USB_PHY_CTRL_REG 0x058A | ||
| 122 | |||
| 123 | /* | ||
| 124 | * TVOUT / CTRL register offsets | ||
| 125 | * Bank : 0x06 | ||
| 126 | */ | ||
| 127 | #define AB4500_TVOUT_CTRL_REG 0x0680 | ||
| 128 | |||
| 129 | /* | ||
| 130 | * DBI register offsets | ||
| 131 | * Bank : 0x07 | ||
| 132 | */ | ||
| 133 | #define AB4500_DBI_REG1_REG 0x0700 | ||
| 134 | #define AB4500_DBI_REG2_REG 0x0701 | ||
| 135 | |||
| 136 | /* | ||
| 137 | * ECI regsiter offsets | ||
| 138 | * Bank : 0x08 | ||
| 139 | */ | ||
| 140 | #define AB4500_ECI_CTRL_REG 0x0800 | ||
| 141 | #define AB4500_ECI_HOOKLEVEL_REG 0x0801 | ||
| 142 | #define AB4500_ECI_DATAOUT_REG 0x0802 | ||
| 143 | #define AB4500_ECI_DATAIN_REG 0x0803 | ||
| 144 | |||
| 145 | /* | ||
| 146 | * AV Connector register offsets | ||
| 147 | * Bank : 0x08 | ||
| 148 | */ | ||
| 149 | #define AB4500_AV_CONN_REG 0x0840 | ||
| 150 | |||
| 151 | /* | ||
| 152 | * Accessory detection register offsets | ||
| 153 | * Bank : 0x08 | ||
| 154 | */ | ||
| 155 | #define AB4500_ACC_DET_DB1_REG 0x0880 | ||
| 156 | #define AB4500_ACC_DET_DB2_REG 0x0881 | ||
| 157 | |||
| 158 | /* | ||
| 159 | * GPADC register offsets | ||
| 160 | * Bank : 0x0A | ||
| 161 | */ | ||
| 162 | #define AB4500_GPADC_CTRL1_REG 0x0A00 | ||
| 163 | #define AB4500_GPADC_CTRL2_REG 0x0A01 | ||
| 164 | #define AB4500_GPADC_CTRL3_REG 0x0A02 | ||
| 165 | #define AB4500_GPADC_AUTO_TIMER_REG 0x0A03 | ||
| 166 | #define AB4500_GPADC_STAT_REG 0x0A04 | ||
| 167 | #define AB4500_GPADC_MANDATAL_REG 0x0A05 | ||
| 168 | #define AB4500_GPADC_MANDATAH_REG 0x0A06 | ||
| 169 | #define AB4500_GPADC_AUTODATAL_REG 0x0A07 | ||
| 170 | #define AB4500_GPADC_AUTODATAH_REG 0x0A08 | ||
| 171 | #define AB4500_GPADC_MUX_CTRL_REG 0x0A09 | ||
| 172 | |||
| 173 | /* | ||
| 174 | * Charger / status register offfsets | ||
| 175 | * Bank : 0x0B | ||
| 176 | */ | ||
| 177 | #define AB4500_CH_STATUS1_REG 0x0B00 | ||
| 178 | #define AB4500_CH_STATUS2_REG 0x0B01 | ||
| 179 | #define AB4500_CH_USBCH_STAT1_REG 0x0B02 | ||
| 180 | #define AB4500_CH_USBCH_STAT2_REG 0x0B03 | ||
| 181 | #define AB4500_CH_FSM_STAT_REG 0x0B04 | ||
| 182 | #define AB4500_CH_STAT_REG 0x0B05 | ||
| 183 | |||
| 184 | /* | ||
| 185 | * Charger / control register offfsets | ||
| 186 | * Bank : 0x0B | ||
| 187 | */ | ||
| 188 | #define AB4500_CH_VOLT_LVL_REG 0x0B40 | ||
| 189 | |||
| 190 | /* | ||
| 191 | * Charger / main control register offfsets | ||
| 192 | * Bank : 0x0B | ||
| 193 | */ | ||
| 194 | #define AB4500_MCH_CTRL1 0x0B80 | ||
| 195 | #define AB4500_MCH_CTRL2 0x0B81 | ||
| 196 | #define AB4500_MCH_IPT_CURLVL_REG 0x0B82 | ||
| 197 | #define AB4500_CH_WD_REG 0x0B83 | ||
| 198 | |||
| 199 | /* | ||
| 200 | * Charger / USB control register offsets | ||
| 201 | * Bank : 0x0B | ||
| 202 | */ | ||
| 203 | #define AB4500_USBCH_CTRL1_REG 0x0BC0 | ||
| 204 | #define AB4500_USBCH_CTRL2_REG 0x0BC1 | ||
| 205 | #define AB4500_USBCH_IPT_CRNTLVL_REG 0x0BC2 | ||
| 206 | |||
| 207 | /* | ||
| 208 | * RTC bank register offsets | ||
| 209 | * Bank : 0xF | ||
| 210 | */ | ||
| 211 | #define AB4500_RTC_SOFF_STAT_REG 0x0F00 | ||
| 212 | #define AB4500_RTC_CC_CONF_REG 0x0F01 | ||
| 213 | #define AB4500_RTC_READ_REQ_REG 0x0F02 | ||
| 214 | #define AB4500_RTC_WATCH_TSECMID_REG 0x0F03 | ||
| 215 | #define AB4500_RTC_WATCH_TSECHI_REG 0x0F04 | ||
| 216 | #define AB4500_RTC_WATCH_TMIN_LOW_REG 0x0F05 | ||
| 217 | #define AB4500_RTC_WATCH_TMIN_MID_REG 0x0F06 | ||
| 218 | #define AB4500_RTC_WATCH_TMIN_HI_REG 0x0F07 | ||
| 219 | #define AB4500_RTC_ALRM_MIN_LOW_REG 0x0F08 | ||
| 220 | #define AB4500_RTC_ALRM_MIN_MID_REG 0x0F09 | ||
| 221 | #define AB4500_RTC_ALRM_MIN_HI_REG 0x0F0A | ||
| 222 | #define AB4500_RTC_STAT_REG 0x0F0B | ||
| 223 | #define AB4500_RTC_BKUP_CHG_REG 0x0F0C | ||
| 224 | #define AB4500_RTC_FORCE_BKUP_REG 0x0F0D | ||
| 225 | #define AB4500_RTC_CALIB_REG 0x0F0E | ||
| 226 | #define AB4500_RTC_SWITCH_STAT_REG 0x0F0F | ||
| 227 | |||
| 228 | /* | ||
| 229 | * PWM Out generators | ||
| 230 | * Bank: 0x10 | ||
| 231 | */ | ||
| 232 | #define AB4500_PWM_OUT_CTRL1_REG 0x1060 | ||
| 233 | #define AB4500_PWM_OUT_CTRL2_REG 0x1061 | ||
| 234 | #define AB4500_PWM_OUT_CTRL3_REG 0x1062 | ||
| 235 | #define AB4500_PWM_OUT_CTRL4_REG 0x1063 | ||
| 236 | #define AB4500_PWM_OUT_CTRL5_REG 0x1064 | ||
| 237 | #define AB4500_PWM_OUT_CTRL6_REG 0x1065 | ||
| 238 | #define AB4500_PWM_OUT_CTRL7_REG 0x1066 | ||
| 239 | |||
| 240 | #define AB4500_I2C_PAD_CTRL_REG 0x1067 | ||
| 241 | #define AB4500_REV_REG 0x1080 | ||
| 242 | |||
| 243 | /** | ||
| 244 | * struct ab4500 | ||
| 245 | * @spi: spi device structure | ||
| 246 | * @tx_buf: transmit buffer | ||
| 247 | * @rx_buf: receive buffer | ||
| 248 | * @lock: sync primitive | ||
| 249 | */ | ||
| 250 | struct ab4500 { | ||
| 251 | struct spi_device *spi; | ||
| 252 | unsigned long tx_buf[4]; | ||
| 253 | unsigned long rx_buf[4]; | ||
| 254 | struct mutex lock; | ||
| 255 | }; | ||
| 256 | |||
| 257 | int ab4500_write(struct ab4500 *ab4500, unsigned char block, | ||
| 258 | unsigned long addr, unsigned char data); | ||
| 259 | int ab4500_read(struct ab4500 *ab4500, unsigned char block, | ||
| 260 | unsigned long addr); | ||
| 261 | |||
| 262 | #endif /* MFD_AB4500_H */ | ||
diff --git a/include/linux/mfd/adp5520.h b/include/linux/mfd/adp5520.h new file mode 100644 index 000000000000..ac37558a4673 --- /dev/null +++ b/include/linux/mfd/adp5520.h | |||
| @@ -0,0 +1,299 @@ | |||
| 1 | /* | ||
| 2 | * Definitions and platform data for Analog Devices | ||
| 3 | * ADP5520/ADP5501 MFD PMICs (Backlight, LED, GPIO and Keys) | ||
| 4 | * | ||
| 5 | * Copyright 2009 Analog Devices Inc. | ||
| 6 | * | ||
| 7 | * Licensed under the GPL-2 or later. | ||
| 8 | */ | ||
| 9 | |||
| 10 | |||
| 11 | #ifndef __LINUX_MFD_ADP5520_H | ||
| 12 | #define __LINUX_MFD_ADP5520_H | ||
| 13 | |||
| 14 | #define ID_ADP5520 5520 | ||
| 15 | #define ID_ADP5501 5501 | ||
| 16 | |||
| 17 | /* | ||
| 18 | * ADP5520/ADP5501 Register Map | ||
| 19 | */ | ||
| 20 | |||
| 21 | #define ADP5520_MODE_STATUS 0x00 | ||
| 22 | #define ADP5520_INTERRUPT_ENABLE 0x01 | ||
| 23 | #define ADP5520_BL_CONTROL 0x02 | ||
| 24 | #define ADP5520_BL_TIME 0x03 | ||
| 25 | #define ADP5520_BL_FADE 0x04 | ||
| 26 | #define ADP5520_DAYLIGHT_MAX 0x05 | ||
| 27 | #define ADP5520_DAYLIGHT_DIM 0x06 | ||
| 28 | #define ADP5520_OFFICE_MAX 0x07 | ||
| 29 | #define ADP5520_OFFICE_DIM 0x08 | ||
| 30 | #define ADP5520_DARK_MAX 0x09 | ||
| 31 | #define ADP5520_DARK_DIM 0x0A | ||
| 32 | #define ADP5520_BL_VALUE 0x0B | ||
| 33 | #define ADP5520_ALS_CMPR_CFG 0x0C | ||
| 34 | #define ADP5520_L2_TRIP 0x0D | ||
| 35 | #define ADP5520_L2_HYS 0x0E | ||
| 36 | #define ADP5520_L3_TRIP 0x0F | ||
| 37 | #define ADP5520_L3_HYS 0x10 | ||
| 38 | #define ADP5520_LED_CONTROL 0x11 | ||
| 39 | #define ADP5520_LED_TIME 0x12 | ||
| 40 | #define ADP5520_LED_FADE 0x13 | ||
| 41 | #define ADP5520_LED1_CURRENT 0x14 | ||
| 42 | #define ADP5520_LED2_CURRENT 0x15 | ||
| 43 | #define ADP5520_LED3_CURRENT 0x16 | ||
| 44 | |||
| 45 | /* | ||
| 46 | * ADP5520 Register Map | ||
| 47 | */ | ||
| 48 | |||
| 49 | #define ADP5520_GPIO_CFG_1 0x17 | ||
| 50 | #define ADP5520_GPIO_CFG_2 0x18 | ||
| 51 | #define ADP5520_GPIO_IN 0x19 | ||
| 52 | #define ADP5520_GPIO_OUT 0x1A | ||
| 53 | #define ADP5520_GPIO_INT_EN 0x1B | ||
| 54 | #define ADP5520_GPIO_INT_STAT 0x1C | ||
| 55 | #define ADP5520_GPIO_INT_LVL 0x1D | ||
| 56 | #define ADP5520_GPIO_DEBOUNCE 0x1E | ||
| 57 | #define ADP5520_GPIO_PULLUP 0x1F | ||
| 58 | #define ADP5520_KP_INT_STAT_1 0x20 | ||
| 59 | #define ADP5520_KP_INT_STAT_2 0x21 | ||
| 60 | #define ADP5520_KR_INT_STAT_1 0x22 | ||
| 61 | #define ADP5520_KR_INT_STAT_2 0x23 | ||
| 62 | #define ADP5520_KEY_STAT_1 0x24 | ||
| 63 | #define ADP5520_KEY_STAT_2 0x25 | ||
| 64 | |||
| 65 | /* | ||
| 66 | * MODE_STATUS bits | ||
| 67 | */ | ||
| 68 | |||
| 69 | #define ADP5520_nSTNBY (1 << 7) | ||
| 70 | #define ADP5520_BL_EN (1 << 6) | ||
| 71 | #define ADP5520_DIM_EN (1 << 5) | ||
| 72 | #define ADP5520_OVP_INT (1 << 4) | ||
| 73 | #define ADP5520_CMPR_INT (1 << 3) | ||
| 74 | #define ADP5520_GPI_INT (1 << 2) | ||
| 75 | #define ADP5520_KR_INT (1 << 1) | ||
| 76 | #define ADP5520_KP_INT (1 << 0) | ||
| 77 | |||
| 78 | /* | ||
| 79 | * INTERRUPT_ENABLE bits | ||
| 80 | */ | ||
| 81 | |||
| 82 | #define ADP5520_AUTO_LD_EN (1 << 4) | ||
| 83 | #define ADP5520_CMPR_IEN (1 << 3) | ||
| 84 | #define ADP5520_OVP_IEN (1 << 2) | ||
| 85 | #define ADP5520_KR_IEN (1 << 1) | ||
| 86 | #define ADP5520_KP_IEN (1 << 0) | ||
| 87 | |||
| 88 | /* | ||
| 89 | * BL_CONTROL bits | ||
| 90 | */ | ||
| 91 | |||
| 92 | #define ADP5520_BL_LVL ((x) << 5) | ||
| 93 | #define ADP5520_BL_LAW ((x) << 4) | ||
| 94 | #define ADP5520_BL_AUTO_ADJ (1 << 3) | ||
| 95 | #define ADP5520_OVP_EN (1 << 2) | ||
| 96 | #define ADP5520_FOVR (1 << 1) | ||
| 97 | #define ADP5520_KP_BL_EN (1 << 0) | ||
| 98 | |||
| 99 | /* | ||
| 100 | * ALS_CMPR_CFG bits | ||
| 101 | */ | ||
| 102 | |||
| 103 | #define ADP5520_L3_OUT (1 << 3) | ||
| 104 | #define ADP5520_L2_OUT (1 << 2) | ||
| 105 | #define ADP5520_L3_EN (1 << 1) | ||
| 106 | |||
| 107 | #define ADP5020_MAX_BRIGHTNESS 0x7F | ||
| 108 | |||
| 109 | #define FADE_VAL(in, out) ((0xF & (in)) | ((0xF & (out)) << 4)) | ||
| 110 | #define BL_CTRL_VAL(law, auto) (((1 & (auto)) << 3) | ((0x3 & (law)) << 4)) | ||
| 111 | #define ALS_CMPR_CFG_VAL(filt, l3_en) (((0x7 & filt) << 5) | l3_en) | ||
| 112 | |||
| 113 | /* | ||
| 114 | * LEDs subdevice bits and masks | ||
| 115 | */ | ||
| 116 | |||
| 117 | #define ADP5520_01_MAXLEDS 3 | ||
| 118 | |||
| 119 | #define ADP5520_FLAG_LED_MASK 0x3 | ||
| 120 | #define ADP5520_FLAG_OFFT_SHIFT 8 | ||
| 121 | #define ADP5520_FLAG_OFFT_MASK 0x3 | ||
| 122 | |||
| 123 | #define ADP5520_R3_MODE (1 << 5) | ||
| 124 | #define ADP5520_C3_MODE (1 << 4) | ||
| 125 | #define ADP5520_LED_LAW (1 << 3) | ||
| 126 | #define ADP5520_LED3_EN (1 << 2) | ||
| 127 | #define ADP5520_LED2_EN (1 << 1) | ||
| 128 | #define ADP5520_LED1_EN (1 << 0) | ||
| 129 | |||
| 130 | /* | ||
| 131 | * GPIO subdevice bits and masks | ||
| 132 | */ | ||
| 133 | |||
| 134 | #define ADP5520_MAXGPIOS 8 | ||
| 135 | |||
| 136 | #define ADP5520_GPIO_C3 (1 << 7) /* LED2 or GPIO7 aka C3 */ | ||
| 137 | #define ADP5520_GPIO_C2 (1 << 6) | ||
| 138 | #define ADP5520_GPIO_C1 (1 << 5) | ||
| 139 | #define ADP5520_GPIO_C0 (1 << 4) | ||
| 140 | #define ADP5520_GPIO_R3 (1 << 3) /* LED3 or GPIO3 aka R3 */ | ||
| 141 | #define ADP5520_GPIO_R2 (1 << 2) | ||
| 142 | #define ADP5520_GPIO_R1 (1 << 1) | ||
| 143 | #define ADP5520_GPIO_R0 (1 << 0) | ||
| 144 | |||
| 145 | struct adp5520_gpio_platform_data { | ||
| 146 | unsigned gpio_start; | ||
| 147 | u8 gpio_en_mask; | ||
| 148 | u8 gpio_pullup_mask; | ||
| 149 | }; | ||
| 150 | |||
| 151 | /* | ||
| 152 | * Keypad subdevice bits and masks | ||
| 153 | */ | ||
| 154 | |||
| 155 | #define ADP5520_MAXKEYS 16 | ||
| 156 | |||
| 157 | #define ADP5520_COL_C3 (1 << 7) /* LED2 or GPIO7 aka C3 */ | ||
| 158 | #define ADP5520_COL_C2 (1 << 6) | ||
| 159 | #define ADP5520_COL_C1 (1 << 5) | ||
| 160 | #define ADP5520_COL_C0 (1 << 4) | ||
| 161 | #define ADP5520_ROW_R3 (1 << 3) /* LED3 or GPIO3 aka R3 */ | ||
| 162 | #define ADP5520_ROW_R2 (1 << 2) | ||
| 163 | #define ADP5520_ROW_R1 (1 << 1) | ||
| 164 | #define ADP5520_ROW_R0 (1 << 0) | ||
| 165 | |||
| 166 | #define ADP5520_KEY(row, col) (col + row * 4) | ||
| 167 | #define ADP5520_KEYMAPSIZE ADP5520_MAXKEYS | ||
| 168 | |||
| 169 | struct adp5520_keys_platform_data { | ||
| 170 | int rows_en_mask; /* Number of rows */ | ||
| 171 | int cols_en_mask; /* Number of columns */ | ||
| 172 | const unsigned short *keymap; /* Pointer to keymap */ | ||
| 173 | unsigned short keymapsize; /* Keymap size */ | ||
| 174 | unsigned repeat:1; /* Enable key repeat */ | ||
| 175 | }; | ||
| 176 | |||
| 177 | |||
| 178 | /* | ||
| 179 | * LEDs subdevice platform data | ||
| 180 | */ | ||
| 181 | |||
| 182 | #define FLAG_ID_ADP5520_LED1_ADP5501_LED0 1 /* ADP5520 PIN ILED */ | ||
| 183 | #define FLAG_ID_ADP5520_LED2_ADP5501_LED1 2 /* ADP5520 PIN C3 */ | ||
| 184 | #define FLAG_ID_ADP5520_LED3_ADP5501_LED2 3 /* ADP5520 PIN R3 */ | ||
| 185 | |||
| 186 | #define ADP5520_LED_DIS_BLINK (0 << ADP5520_FLAG_OFFT_SHIFT) | ||
| 187 | #define ADP5520_LED_OFFT_600ms (1 << ADP5520_FLAG_OFFT_SHIFT) | ||
| 188 | #define ADP5520_LED_OFFT_800ms (2 << ADP5520_FLAG_OFFT_SHIFT) | ||
| 189 | #define ADP5520_LED_OFFT_1200ms (3 << ADP5520_FLAG_OFFT_SHIFT) | ||
| 190 | |||
| 191 | #define ADP5520_LED_ONT_200ms 0 | ||
| 192 | #define ADP5520_LED_ONT_600ms 1 | ||
| 193 | #define ADP5520_LED_ONT_800ms 2 | ||
| 194 | #define ADP5520_LED_ONT_1200ms 3 | ||
| 195 | |||
| 196 | struct adp5520_leds_platform_data { | ||
| 197 | int num_leds; | ||
| 198 | struct led_info *leds; | ||
| 199 | u8 fade_in; /* Backlight Fade-In Timer */ | ||
| 200 | u8 fade_out; /* Backlight Fade-Out Timer */ | ||
| 201 | u8 led_on_time; | ||
| 202 | }; | ||
| 203 | |||
| 204 | /* | ||
| 205 | * Backlight subdevice platform data | ||
| 206 | */ | ||
| 207 | |||
| 208 | #define ADP5520_FADE_T_DIS 0 /* Fade Timer Disabled */ | ||
| 209 | #define ADP5520_FADE_T_300ms 1 /* 0.3 Sec */ | ||
| 210 | #define ADP5520_FADE_T_600ms 2 | ||
| 211 | #define ADP5520_FADE_T_900ms 3 | ||
| 212 | #define ADP5520_FADE_T_1200ms 4 | ||
| 213 | #define ADP5520_FADE_T_1500ms 5 | ||
| 214 | #define ADP5520_FADE_T_1800ms 6 | ||
| 215 | #define ADP5520_FADE_T_2100ms 7 | ||
| 216 | #define ADP5520_FADE_T_2400ms 8 | ||
| 217 | #define ADP5520_FADE_T_2700ms 9 | ||
| 218 | #define ADP5520_FADE_T_3000ms 10 | ||
| 219 | #define ADP5520_FADE_T_3500ms 11 | ||
| 220 | #define ADP5520_FADE_T_4000ms 12 | ||
| 221 | #define ADP5520_FADE_T_4500ms 13 | ||
| 222 | #define ADP5520_FADE_T_5000ms 14 | ||
| 223 | #define ADP5520_FADE_T_5500ms 15 /* 5.5 Sec */ | ||
| 224 | |||
| 225 | #define ADP5520_BL_LAW_LINEAR 0 | ||
| 226 | #define ADP5520_BL_LAW_SQUARE 1 | ||
| 227 | #define ADP5520_BL_LAW_CUBIC1 2 | ||
| 228 | #define ADP5520_BL_LAW_CUBIC2 3 | ||
| 229 | |||
| 230 | #define ADP5520_BL_AMBL_FILT_80ms 0 /* Light sensor filter time */ | ||
| 231 | #define ADP5520_BL_AMBL_FILT_160ms 1 | ||
| 232 | #define ADP5520_BL_AMBL_FILT_320ms 2 | ||
| 233 | #define ADP5520_BL_AMBL_FILT_640ms 3 | ||
| 234 | #define ADP5520_BL_AMBL_FILT_1280ms 4 | ||
| 235 | #define ADP5520_BL_AMBL_FILT_2560ms 5 | ||
| 236 | #define ADP5520_BL_AMBL_FILT_5120ms 6 | ||
| 237 | #define ADP5520_BL_AMBL_FILT_10240ms 7 /* 10.24 sec */ | ||
| 238 | |||
| 239 | /* | ||
| 240 | * Blacklight current 0..30mA | ||
| 241 | */ | ||
| 242 | #define ADP5520_BL_CUR_mA(I) ((I * 127) / 30) | ||
| 243 | |||
| 244 | /* | ||
| 245 | * L2 comparator current 0..1000uA | ||
| 246 | */ | ||
| 247 | #define ADP5520_L2_COMP_CURR_uA(I) ((I * 255) / 1000) | ||
| 248 | |||
| 249 | /* | ||
| 250 | * L3 comparator current 0..127uA | ||
| 251 | */ | ||
| 252 | #define ADP5520_L3_COMP_CURR_uA(I) ((I * 255) / 127) | ||
| 253 | |||
| 254 | struct adp5520_backlight_platform_data { | ||
| 255 | u8 fade_in; /* Backlight Fade-In Timer */ | ||
| 256 | u8 fade_out; /* Backlight Fade-Out Timer */ | ||
| 257 | u8 fade_led_law; /* fade-on/fade-off transfer characteristic */ | ||
| 258 | |||
| 259 | u8 en_ambl_sens; /* 1 = enable ambient light sensor */ | ||
| 260 | u8 abml_filt; /* Light sensor filter time */ | ||
| 261 | u8 l1_daylight_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 262 | u8 l1_daylight_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 263 | u8 l2_office_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 264 | u8 l2_office_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 265 | u8 l3_dark_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 266 | u8 l3_dark_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
| 267 | u8 l2_trip; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1000 uA */ | ||
| 268 | u8 l2_hyst; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1000 uA */ | ||
| 269 | u8 l3_trip; /* use L3_COMP_CURR_uA(I) 0 <= I <= 127 uA */ | ||
| 270 | u8 l3_hyst; /* use L3_COMP_CURR_uA(I) 0 <= I <= 127 uA */ | ||
| 271 | }; | ||
| 272 | |||
| 273 | /* | ||
| 274 | * MFD chip platform data | ||
| 275 | */ | ||
| 276 | |||
| 277 | struct adp5520_platform_data { | ||
| 278 | struct adp5520_keys_platform_data *keys; | ||
| 279 | struct adp5520_gpio_platform_data *gpio; | ||
| 280 | struct adp5520_leds_platform_data *leds; | ||
| 281 | struct adp5520_backlight_platform_data *backlight; | ||
| 282 | }; | ||
| 283 | |||
| 284 | /* | ||
| 285 | * MFD chip functions | ||
| 286 | */ | ||
| 287 | |||
| 288 | extern int adp5520_read(struct device *dev, int reg, uint8_t *val); | ||
| 289 | extern int adp5520_write(struct device *dev, int reg, u8 val); | ||
| 290 | extern int adp5520_clr_bits(struct device *dev, int reg, uint8_t bit_mask); | ||
| 291 | extern int adp5520_set_bits(struct device *dev, int reg, uint8_t bit_mask); | ||
| 292 | |||
| 293 | extern int adp5520_register_notifier(struct device *dev, | ||
| 294 | struct notifier_block *nb, unsigned int events); | ||
| 295 | |||
| 296 | extern int adp5520_unregister_notifier(struct device *dev, | ||
| 297 | struct notifier_block *nb, unsigned int events); | ||
| 298 | |||
| 299 | #endif /* __LINUX_MFD_ADP5520_H */ | ||
diff --git a/include/linux/mfd/ezx-pcap.h b/include/linux/mfd/ezx-pcap.h index 3402042ddc31..40c372165f3e 100644 --- a/include/linux/mfd/ezx-pcap.h +++ b/include/linux/mfd/ezx-pcap.h | |||
| @@ -231,9 +231,6 @@ void pcap_set_ts_bits(struct pcap_chip *, u32); | |||
| 231 | #define PCAP_LED_4MA 1 | 231 | #define PCAP_LED_4MA 1 |
| 232 | #define PCAP_LED_5MA 2 | 232 | #define PCAP_LED_5MA 2 |
| 233 | #define PCAP_LED_9MA 3 | 233 | #define PCAP_LED_9MA 3 |
| 234 | #define PCAP_LED_GPIO_VAL_MASK 0x00ffffff | ||
| 235 | #define PCAP_LED_GPIO_EN 0x01000000 | ||
| 236 | #define PCAP_LED_GPIO_INVERT 0x02000000 | ||
| 237 | #define PCAP_LED_T_MASK 0xf | 234 | #define PCAP_LED_T_MASK 0xf |
| 238 | #define PCAP_LED_C_MASK 0x3 | 235 | #define PCAP_LED_C_MASK 0x3 |
| 239 | #define PCAP_BL_MASK 0x1f | 236 | #define PCAP_BL_MASK 0x1f |
diff --git a/include/linux/mfd/mc13783-private.h b/include/linux/mfd/mc13783-private.h index 47e698cb0f16..95cf9360553f 100644 --- a/include/linux/mfd/mc13783-private.h +++ b/include/linux/mfd/mc13783-private.h | |||
| @@ -24,52 +24,23 @@ | |||
| 24 | 24 | ||
| 25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
| 26 | #include <linux/mfd/mc13783.h> | 26 | #include <linux/mfd/mc13783.h> |
| 27 | #include <linux/workqueue.h> | ||
| 28 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
| 29 | 28 | #include <linux/interrupt.h> | |
| 30 | struct mc13783_irq { | ||
| 31 | void (*handler)(int, void *); | ||
| 32 | void *data; | ||
| 33 | }; | ||
| 34 | |||
| 35 | #define MC13783_NUM_IRQ 2 | ||
| 36 | #define MC13783_IRQ_TS 0 | ||
| 37 | #define MC13783_IRQ_REGULATOR 1 | ||
| 38 | |||
| 39 | #define MC13783_ADC_MODE_TS 1 | ||
| 40 | #define MC13783_ADC_MODE_SINGLE_CHAN 2 | ||
| 41 | #define MC13783_ADC_MODE_MULT_CHAN 3 | ||
| 42 | 29 | ||
| 43 | struct mc13783 { | 30 | struct mc13783 { |
| 44 | int revision; | 31 | struct spi_device *spidev; |
| 45 | struct device *dev; | 32 | struct mutex lock; |
| 46 | struct spi_device *spi_device; | ||
| 47 | |||
| 48 | int (*read_dev)(void *data, char reg, int count, u32 *dst); | ||
| 49 | int (*write_dev)(void *data, char reg, int count, const u32 *src); | ||
| 50 | |||
| 51 | struct mutex io_lock; | ||
| 52 | void *io_data; | ||
| 53 | int irq; | 33 | int irq; |
| 54 | unsigned int flags; | 34 | int flags; |
| 55 | 35 | ||
| 56 | struct mc13783_irq irq_handler[MC13783_NUM_IRQ]; | 36 | irq_handler_t irqhandler[MC13783_NUM_IRQ]; |
| 57 | struct work_struct work; | 37 | void *irqdata[MC13783_NUM_IRQ]; |
| 58 | struct completion adc_done; | ||
| 59 | unsigned int ts_active; | ||
| 60 | struct mutex adc_conv_lock; | ||
| 61 | 38 | ||
| 39 | /* XXX these should go as platformdata to the regulator subdevice */ | ||
| 62 | struct mc13783_regulator_init_data *regulators; | 40 | struct mc13783_regulator_init_data *regulators; |
| 63 | int num_regulators; | 41 | int num_regulators; |
| 64 | }; | 42 | }; |
| 65 | 43 | ||
| 66 | int mc13783_reg_read(struct mc13783 *, int reg_num, u32 *); | ||
| 67 | int mc13783_reg_write(struct mc13783 *, int, u32); | ||
| 68 | int mc13783_set_bits(struct mc13783 *, int, u32, u32); | ||
| 69 | int mc13783_free_irq(struct mc13783 *mc13783, int irq); | ||
| 70 | int mc13783_register_irq(struct mc13783 *mc13783, int irq, | ||
| 71 | void (*handler) (int, void *), void *data); | ||
| 72 | |||
| 73 | #define MC13783_REG_INTERRUPT_STATUS_0 0 | 44 | #define MC13783_REG_INTERRUPT_STATUS_0 0 |
| 74 | #define MC13783_REG_INTERRUPT_MASK_0 1 | 45 | #define MC13783_REG_INTERRUPT_MASK_0 1 |
| 75 | #define MC13783_REG_INTERRUPT_SENSE_0 2 | 46 | #define MC13783_REG_INTERRUPT_SENSE_0 2 |
| @@ -136,55 +107,6 @@ int mc13783_register_irq(struct mc13783 *mc13783, int irq, | |||
| 136 | #define MC13783_REG_TEST_3 63 | 107 | #define MC13783_REG_TEST_3 63 |
| 137 | #define MC13783_REG_NB 64 | 108 | #define MC13783_REG_NB 64 |
| 138 | 109 | ||
| 139 | |||
| 140 | /* | ||
| 141 | * Interrupt Status | ||
| 142 | */ | ||
| 143 | #define MC13783_INT_STAT_ADCDONEI (1 << 0) | ||
| 144 | #define MC13783_INT_STAT_ADCBISDONEI (1 << 1) | ||
| 145 | #define MC13783_INT_STAT_TSI (1 << 2) | ||
| 146 | #define MC13783_INT_STAT_WHIGHI (1 << 3) | ||
| 147 | #define MC13783_INT_STAT_WLOWI (1 << 4) | ||
| 148 | #define MC13783_INT_STAT_CHGDETI (1 << 6) | ||
| 149 | #define MC13783_INT_STAT_CHGOVI (1 << 7) | ||
| 150 | #define MC13783_INT_STAT_CHGREVI (1 << 8) | ||
| 151 | #define MC13783_INT_STAT_CHGSHORTI (1 << 9) | ||
| 152 | #define MC13783_INT_STAT_CCCVI (1 << 10) | ||
| 153 | #define MC13783_INT_STAT_CHGCURRI (1 << 11) | ||
| 154 | #define MC13783_INT_STAT_BPONI (1 << 12) | ||
| 155 | #define MC13783_INT_STAT_LOBATLI (1 << 13) | ||
| 156 | #define MC13783_INT_STAT_LOBATHI (1 << 14) | ||
| 157 | #define MC13783_INT_STAT_UDPI (1 << 15) | ||
| 158 | #define MC13783_INT_STAT_USBI (1 << 16) | ||
| 159 | #define MC13783_INT_STAT_IDI (1 << 19) | ||
| 160 | #define MC13783_INT_STAT_Unused (1 << 20) | ||
| 161 | #define MC13783_INT_STAT_SE1I (1 << 21) | ||
| 162 | #define MC13783_INT_STAT_CKDETI (1 << 22) | ||
| 163 | #define MC13783_INT_STAT_UDMI (1 << 23) | ||
| 164 | |||
| 165 | /* | ||
| 166 | * Interrupt Mask | ||
| 167 | */ | ||
| 168 | #define MC13783_INT_MASK_ADCDONEM (1 << 0) | ||
| 169 | #define MC13783_INT_MASK_ADCBISDONEM (1 << 1) | ||
| 170 | #define MC13783_INT_MASK_TSM (1 << 2) | ||
| 171 | #define MC13783_INT_MASK_WHIGHM (1 << 3) | ||
| 172 | #define MC13783_INT_MASK_WLOWM (1 << 4) | ||
| 173 | #define MC13783_INT_MASK_CHGDETM (1 << 6) | ||
| 174 | #define MC13783_INT_MASK_CHGOVM (1 << 7) | ||
| 175 | #define MC13783_INT_MASK_CHGREVM (1 << 8) | ||
| 176 | #define MC13783_INT_MASK_CHGSHORTM (1 << 9) | ||
| 177 | #define MC13783_INT_MASK_CCCVM (1 << 10) | ||
| 178 | #define MC13783_INT_MASK_CHGCURRM (1 << 11) | ||
| 179 | #define MC13783_INT_MASK_BPONM (1 << 12) | ||
| 180 | #define MC13783_INT_MASK_LOBATLM (1 << 13) | ||
| 181 | #define MC13783_INT_MASK_LOBATHM (1 << 14) | ||
| 182 | #define MC13783_INT_MASK_UDPM (1 << 15) | ||
| 183 | #define MC13783_INT_MASK_USBM (1 << 16) | ||
| 184 | #define MC13783_INT_MASK_IDM (1 << 19) | ||
| 185 | #define MC13783_INT_MASK_SE1M (1 << 21) | ||
| 186 | #define MC13783_INT_MASK_CKDETM (1 << 22) | ||
| 187 | |||
| 188 | /* | 110 | /* |
| 189 | * Reg Regulator Mode 0 | 111 | * Reg Regulator Mode 0 |
| 190 | */ | 112 | */ |
| @@ -284,113 +206,15 @@ int mc13783_register_irq(struct mc13783 *mc13783, int irq, | |||
| 284 | #define MC13783_SWCTRL_SW3_STBY (1 << 21) | 206 | #define MC13783_SWCTRL_SW3_STBY (1 << 21) |
| 285 | #define MC13783_SWCTRL_SW3_MODE (1 << 22) | 207 | #define MC13783_SWCTRL_SW3_MODE (1 << 22) |
| 286 | 208 | ||
| 287 | /* | 209 | static inline int mc13783_set_bits(struct mc13783 *mc13783, unsigned int offset, |
| 288 | * ADC/Touch | 210 | u32 mask, u32 val) |
| 289 | */ | 211 | { |
| 290 | #define MC13783_ADC0_LICELLCON (1 << 0) | 212 | int ret; |
| 291 | #define MC13783_ADC0_CHRGICON (1 << 1) | 213 | mc13783_lock(mc13783); |
| 292 | #define MC13783_ADC0_BATICON (1 << 2) | 214 | ret = mc13783_reg_rmw(mc13783, offset, mask, val); |
| 293 | #define MC13783_ADC0_RTHEN (1 << 3) | 215 | mc13783_unlock(mc13783); |
| 294 | #define MC13783_ADC0_DTHEN (1 << 4) | ||
| 295 | #define MC13783_ADC0_UIDEN (1 << 5) | ||
| 296 | #define MC13783_ADC0_ADOUTEN (1 << 6) | ||
| 297 | #define MC13783_ADC0_ADOUTPER (1 << 7) | ||
| 298 | #define MC13783_ADC0_ADREFEN (1 << 10) | ||
| 299 | #define MC13783_ADC0_ADREFMODE (1 << 11) | ||
| 300 | #define MC13783_ADC0_TSMOD0 (1 << 12) | ||
| 301 | #define MC13783_ADC0_TSMOD1 (1 << 13) | ||
| 302 | #define MC13783_ADC0_TSMOD2 (1 << 14) | ||
| 303 | #define MC13783_ADC0_CHRGRAWDIV (1 << 15) | ||
| 304 | #define MC13783_ADC0_ADINC1 (1 << 16) | ||
| 305 | #define MC13783_ADC0_ADINC2 (1 << 17) | ||
| 306 | #define MC13783_ADC0_WCOMP (1 << 18) | ||
| 307 | #define MC13783_ADC0_ADCBIS0 (1 << 23) | ||
| 308 | |||
| 309 | #define MC13783_ADC1_ADEN (1 << 0) | ||
| 310 | #define MC13783_ADC1_RAND (1 << 1) | ||
| 311 | #define MC13783_ADC1_ADSEL (1 << 3) | ||
| 312 | #define MC13783_ADC1_TRIGMASK (1 << 4) | ||
| 313 | #define MC13783_ADC1_ADA10 (1 << 5) | ||
| 314 | #define MC13783_ADC1_ADA11 (1 << 6) | ||
| 315 | #define MC13783_ADC1_ADA12 (1 << 7) | ||
| 316 | #define MC13783_ADC1_ADA20 (1 << 8) | ||
| 317 | #define MC13783_ADC1_ADA21 (1 << 9) | ||
| 318 | #define MC13783_ADC1_ADA22 (1 << 10) | ||
| 319 | #define MC13783_ADC1_ATO0 (1 << 11) | ||
| 320 | #define MC13783_ADC1_ATO1 (1 << 12) | ||
| 321 | #define MC13783_ADC1_ATO2 (1 << 13) | ||
| 322 | #define MC13783_ADC1_ATO3 (1 << 14) | ||
| 323 | #define MC13783_ADC1_ATO4 (1 << 15) | ||
| 324 | #define MC13783_ADC1_ATO5 (1 << 16) | ||
| 325 | #define MC13783_ADC1_ATO6 (1 << 17) | ||
| 326 | #define MC13783_ADC1_ATO7 (1 << 18) | ||
| 327 | #define MC13783_ADC1_ATOX (1 << 19) | ||
| 328 | #define MC13783_ADC1_ASC (1 << 20) | ||
| 329 | #define MC13783_ADC1_ADTRIGIGN (1 << 21) | ||
| 330 | #define MC13783_ADC1_ADONESHOT (1 << 22) | ||
| 331 | #define MC13783_ADC1_ADCBIS1 (1 << 23) | ||
| 332 | |||
| 333 | #define MC13783_ADC1_CHAN0_SHIFT 5 | ||
| 334 | #define MC13783_ADC1_CHAN1_SHIFT 8 | ||
| 335 | |||
| 336 | #define MC13783_ADC2_ADD10 (1 << 2) | ||
| 337 | #define MC13783_ADC2_ADD11 (1 << 3) | ||
| 338 | #define MC13783_ADC2_ADD12 (1 << 4) | ||
| 339 | #define MC13783_ADC2_ADD13 (1 << 5) | ||
| 340 | #define MC13783_ADC2_ADD14 (1 << 6) | ||
| 341 | #define MC13783_ADC2_ADD15 (1 << 7) | ||
| 342 | #define MC13783_ADC2_ADD16 (1 << 8) | ||
| 343 | #define MC13783_ADC2_ADD17 (1 << 9) | ||
| 344 | #define MC13783_ADC2_ADD18 (1 << 10) | ||
| 345 | #define MC13783_ADC2_ADD19 (1 << 11) | ||
| 346 | #define MC13783_ADC2_ADD20 (1 << 14) | ||
| 347 | #define MC13783_ADC2_ADD21 (1 << 15) | ||
| 348 | #define MC13783_ADC2_ADD22 (1 << 16) | ||
| 349 | #define MC13783_ADC2_ADD23 (1 << 17) | ||
| 350 | #define MC13783_ADC2_ADD24 (1 << 18) | ||
| 351 | #define MC13783_ADC2_ADD25 (1 << 19) | ||
| 352 | #define MC13783_ADC2_ADD26 (1 << 20) | ||
| 353 | #define MC13783_ADC2_ADD27 (1 << 21) | ||
| 354 | #define MC13783_ADC2_ADD28 (1 << 22) | ||
| 355 | #define MC13783_ADC2_ADD29 (1 << 23) | ||
| 356 | 216 | ||
| 357 | #define MC13783_ADC3_WHIGH0 (1 << 0) | 217 | return ret; |
| 358 | #define MC13783_ADC3_WHIGH1 (1 << 1) | 218 | } |
| 359 | #define MC13783_ADC3_WHIGH2 (1 << 2) | ||
| 360 | #define MC13783_ADC3_WHIGH3 (1 << 3) | ||
| 361 | #define MC13783_ADC3_WHIGH4 (1 << 4) | ||
| 362 | #define MC13783_ADC3_WHIGH5 (1 << 5) | ||
| 363 | #define MC13783_ADC3_ICID0 (1 << 6) | ||
| 364 | #define MC13783_ADC3_ICID1 (1 << 7) | ||
| 365 | #define MC13783_ADC3_ICID2 (1 << 8) | ||
| 366 | #define MC13783_ADC3_WLOW0 (1 << 9) | ||
| 367 | #define MC13783_ADC3_WLOW1 (1 << 10) | ||
| 368 | #define MC13783_ADC3_WLOW2 (1 << 11) | ||
| 369 | #define MC13783_ADC3_WLOW3 (1 << 12) | ||
| 370 | #define MC13783_ADC3_WLOW4 (1 << 13) | ||
| 371 | #define MC13783_ADC3_WLOW5 (1 << 14) | ||
| 372 | #define MC13783_ADC3_ADCBIS2 (1 << 23) | ||
| 373 | |||
| 374 | #define MC13783_ADC4_ADDBIS10 (1 << 2) | ||
| 375 | #define MC13783_ADC4_ADDBIS11 (1 << 3) | ||
| 376 | #define MC13783_ADC4_ADDBIS12 (1 << 4) | ||
| 377 | #define MC13783_ADC4_ADDBIS13 (1 << 5) | ||
| 378 | #define MC13783_ADC4_ADDBIS14 (1 << 6) | ||
| 379 | #define MC13783_ADC4_ADDBIS15 (1 << 7) | ||
| 380 | #define MC13783_ADC4_ADDBIS16 (1 << 8) | ||
| 381 | #define MC13783_ADC4_ADDBIS17 (1 << 9) | ||
| 382 | #define MC13783_ADC4_ADDBIS18 (1 << 10) | ||
| 383 | #define MC13783_ADC4_ADDBIS19 (1 << 11) | ||
| 384 | #define MC13783_ADC4_ADDBIS20 (1 << 14) | ||
| 385 | #define MC13783_ADC4_ADDBIS21 (1 << 15) | ||
| 386 | #define MC13783_ADC4_ADDBIS22 (1 << 16) | ||
| 387 | #define MC13783_ADC4_ADDBIS23 (1 << 17) | ||
| 388 | #define MC13783_ADC4_ADDBIS24 (1 << 18) | ||
| 389 | #define MC13783_ADC4_ADDBIS25 (1 << 19) | ||
| 390 | #define MC13783_ADC4_ADDBIS26 (1 << 20) | ||
| 391 | #define MC13783_ADC4_ADDBIS27 (1 << 21) | ||
| 392 | #define MC13783_ADC4_ADDBIS28 (1 << 22) | ||
| 393 | #define MC13783_ADC4_ADDBIS29 (1 << 23) | ||
| 394 | 219 | ||
| 395 | #endif /* __LINUX_MFD_MC13783_PRIV_H */ | 220 | #endif /* __LINUX_MFD_MC13783_PRIV_H */ |
| 396 | |||
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h index b3a2a7243573..35680409b8cf 100644 --- a/include/linux/mfd/mc13783.h +++ b/include/linux/mfd/mc13783.h | |||
| @@ -1,28 +1,50 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de> | 2 | * Copyright 2009 Pengutronix |
| 3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
| 3 | * | 4 | * |
| 4 | * Initial development of this code was funded by | 5 | * This program is free software; you can redistribute it and/or modify it under |
| 5 | * Phytec Messtechnik GmbH, http://www.phytec.de | 6 | * the terms of the GNU General Public License version 2 as published by the |
| 6 | * | 7 | * Free Software Foundation. |
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * 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 | ||
| 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., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 20 | */ | 8 | */ |
| 9 | #ifndef __LINUX_MFD_MC13783_H | ||
| 10 | #define __LINUX_MFD_MC13783_H | ||
| 21 | 11 | ||
| 22 | #ifndef __INCLUDE_LINUX_MFD_MC13783_H | 12 | #include <linux/interrupt.h> |
| 23 | #define __INCLUDE_LINUX_MFD_MC13783_H | ||
| 24 | 13 | ||
| 25 | struct mc13783; | 14 | struct mc13783; |
| 15 | |||
| 16 | void mc13783_lock(struct mc13783 *mc13783); | ||
| 17 | void mc13783_unlock(struct mc13783 *mc13783); | ||
| 18 | |||
| 19 | int mc13783_reg_read(struct mc13783 *mc13783, unsigned int offset, u32 *val); | ||
| 20 | int mc13783_reg_write(struct mc13783 *mc13783, unsigned int offset, u32 val); | ||
| 21 | int mc13783_reg_rmw(struct mc13783 *mc13783, unsigned int offset, | ||
| 22 | u32 mask, u32 val); | ||
| 23 | |||
| 24 | int mc13783_irq_request(struct mc13783 *mc13783, int irq, | ||
| 25 | irq_handler_t handler, const char *name, void *dev); | ||
| 26 | int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq, | ||
| 27 | irq_handler_t handler, const char *name, void *dev); | ||
| 28 | int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev); | ||
| 29 | int mc13783_ackirq(struct mc13783 *mc13783, int irq); | ||
| 30 | |||
| 31 | int mc13783_mask(struct mc13783 *mc13783, int irq); | ||
| 32 | int mc13783_unmask(struct mc13783 *mc13783, int irq); | ||
| 33 | |||
| 34 | #define MC13783_ADC0 43 | ||
| 35 | #define MC13783_ADC0_ADREFEN (1 << 10) | ||
| 36 | #define MC13783_ADC0_ADREFMODE (1 << 11) | ||
| 37 | #define MC13783_ADC0_TSMOD0 (1 << 12) | ||
| 38 | #define MC13783_ADC0_TSMOD1 (1 << 13) | ||
| 39 | #define MC13783_ADC0_TSMOD2 (1 << 14) | ||
| 40 | #define MC13783_ADC0_ADINC1 (1 << 16) | ||
| 41 | #define MC13783_ADC0_ADINC2 (1 << 17) | ||
| 42 | |||
| 43 | #define MC13783_ADC0_TSMOD_MASK (MC13783_ADC0_TSMOD0 | \ | ||
| 44 | MC13783_ADC0_TSMOD1 | \ | ||
| 45 | MC13783_ADC0_TSMOD2) | ||
| 46 | |||
| 47 | /* to be cleaned up */ | ||
| 26 | struct regulator_init_data; | 48 | struct regulator_init_data; |
| 27 | 49 | ||
| 28 | struct mc13783_regulator_init_data { | 50 | struct mc13783_regulator_init_data { |
| @@ -30,23 +52,30 @@ struct mc13783_regulator_init_data { | |||
| 30 | struct regulator_init_data *init_data; | 52 | struct regulator_init_data *init_data; |
| 31 | }; | 53 | }; |
| 32 | 54 | ||
| 33 | struct mc13783_platform_data { | 55 | struct mc13783_regulator_platform_data { |
| 34 | struct mc13783_regulator_init_data *regulators; | ||
| 35 | int num_regulators; | 56 | int num_regulators; |
| 36 | unsigned int flags; | 57 | struct mc13783_regulator_init_data *regulators; |
| 37 | }; | 58 | }; |
| 38 | 59 | ||
| 39 | /* mc13783_platform_data flags */ | 60 | struct mc13783_platform_data { |
| 61 | int num_regulators; | ||
| 62 | struct mc13783_regulator_init_data *regulators; | ||
| 63 | |||
| 40 | #define MC13783_USE_TOUCHSCREEN (1 << 0) | 64 | #define MC13783_USE_TOUCHSCREEN (1 << 0) |
| 41 | #define MC13783_USE_CODEC (1 << 1) | 65 | #define MC13783_USE_CODEC (1 << 1) |
| 42 | #define MC13783_USE_ADC (1 << 2) | 66 | #define MC13783_USE_ADC (1 << 2) |
| 43 | #define MC13783_USE_RTC (1 << 3) | 67 | #define MC13783_USE_RTC (1 << 3) |
| 44 | #define MC13783_USE_REGULATOR (1 << 4) | 68 | #define MC13783_USE_REGULATOR (1 << 4) |
| 69 | unsigned int flags; | ||
| 70 | }; | ||
| 71 | |||
| 72 | #define MC13783_ADC_MODE_TS 1 | ||
| 73 | #define MC13783_ADC_MODE_SINGLE_CHAN 2 | ||
| 74 | #define MC13783_ADC_MODE_MULT_CHAN 3 | ||
| 45 | 75 | ||
| 46 | int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, | 76 | int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, |
| 47 | unsigned int channel, unsigned int *sample); | 77 | unsigned int channel, unsigned int *sample); |
| 48 | 78 | ||
| 49 | void mc13783_adc_set_ts_status(struct mc13783 *mc13783, unsigned int status); | ||
| 50 | 79 | ||
| 51 | #define MC13783_SW_SW1A 0 | 80 | #define MC13783_SW_SW1A 0 |
| 52 | #define MC13783_SW_SW1B 1 | 81 | #define MC13783_SW_SW1B 1 |
| @@ -80,5 +109,46 @@ void mc13783_adc_set_ts_status(struct mc13783 *mc13783, unsigned int status); | |||
| 80 | #define MC13783_REGU_V3 29 | 109 | #define MC13783_REGU_V3 29 |
| 81 | #define MC13783_REGU_V4 30 | 110 | #define MC13783_REGU_V4 30 |
| 82 | 111 | ||
| 83 | #endif /* __INCLUDE_LINUX_MFD_MC13783_H */ | 112 | #define MC13783_IRQ_ADCDONE 0 |
| 113 | #define MC13783_IRQ_ADCBISDONE 1 | ||
| 114 | #define MC13783_IRQ_TS 2 | ||
| 115 | #define MC13783_IRQ_WHIGH 3 | ||
| 116 | #define MC13783_IRQ_WLOW 4 | ||
| 117 | #define MC13783_IRQ_CHGDET 6 | ||
| 118 | #define MC13783_IRQ_CHGOV 7 | ||
| 119 | #define MC13783_IRQ_CHGREV 8 | ||
| 120 | #define MC13783_IRQ_CHGSHORT 9 | ||
| 121 | #define MC13783_IRQ_CCCV 10 | ||
| 122 | #define MC13783_IRQ_CHGCURR 11 | ||
| 123 | #define MC13783_IRQ_BPON 12 | ||
| 124 | #define MC13783_IRQ_LOBATL 13 | ||
| 125 | #define MC13783_IRQ_LOBATH 14 | ||
| 126 | #define MC13783_IRQ_UDP 15 | ||
| 127 | #define MC13783_IRQ_USB 16 | ||
| 128 | #define MC13783_IRQ_ID 19 | ||
| 129 | #define MC13783_IRQ_SE1 21 | ||
| 130 | #define MC13783_IRQ_CKDET 22 | ||
| 131 | #define MC13783_IRQ_UDM 23 | ||
| 132 | #define MC13783_IRQ_1HZ 24 | ||
| 133 | #define MC13783_IRQ_TODA 25 | ||
| 134 | #define MC13783_IRQ_ONOFD1 27 | ||
| 135 | #define MC13783_IRQ_ONOFD2 28 | ||
| 136 | #define MC13783_IRQ_ONOFD3 29 | ||
| 137 | #define MC13783_IRQ_SYSRST 30 | ||
| 138 | #define MC13783_IRQ_RTCRST 31 | ||
| 139 | #define MC13783_IRQ_PC 32 | ||
| 140 | #define MC13783_IRQ_WARM 33 | ||
| 141 | #define MC13783_IRQ_MEMHLD 34 | ||
| 142 | #define MC13783_IRQ_PWRRDY 35 | ||
| 143 | #define MC13783_IRQ_THWARNL 36 | ||
| 144 | #define MC13783_IRQ_THWARNH 37 | ||
| 145 | #define MC13783_IRQ_CLK 38 | ||
| 146 | #define MC13783_IRQ_SEMAF 39 | ||
| 147 | #define MC13783_IRQ_MC2B 41 | ||
| 148 | #define MC13783_IRQ_HSDET 42 | ||
| 149 | #define MC13783_IRQ_HSL 43 | ||
| 150 | #define MC13783_IRQ_ALSPTH 44 | ||
| 151 | #define MC13783_IRQ_AHSSHORT 45 | ||
| 152 | #define MC13783_NUM_IRQ 46 | ||
| 84 | 153 | ||
| 154 | #endif /* __LINUX_MFD_MC13783_H */ | ||
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h index 9aba7b779fbc..d9034cc87f18 100644 --- a/include/linux/mfd/pcf50633/core.h +++ b/include/linux/mfd/pcf50633/core.h | |||
| @@ -40,10 +40,6 @@ struct pcf50633_platform_data { | |||
| 40 | u8 resumers[5]; | 40 | u8 resumers[5]; |
| 41 | }; | 41 | }; |
| 42 | 42 | ||
| 43 | struct pcf50633_subdev_pdata { | ||
| 44 | struct pcf50633 *pcf; | ||
| 45 | }; | ||
| 46 | |||
| 47 | struct pcf50633_irq { | 43 | struct pcf50633_irq { |
| 48 | void (*handler) (int, void *); | 44 | void (*handler) (int, void *); |
| 49 | void *data; | 45 | void *data; |
| @@ -217,5 +213,9 @@ enum pcf50633_reg_int5 { | |||
| 217 | #define PCF50633_REG_LEDCTL 0x2a | 213 | #define PCF50633_REG_LEDCTL 0x2a |
| 218 | #define PCF50633_REG_LEDDIM 0x2b | 214 | #define PCF50633_REG_LEDDIM 0x2b |
| 219 | 215 | ||
| 220 | #endif | 216 | static inline struct pcf50633 *dev_to_pcf50633(struct device *dev) |
| 217 | { | ||
| 218 | return dev_get_drvdata(dev); | ||
| 219 | } | ||
| 221 | 220 | ||
| 221 | #endif | ||
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index 91eb493bf14c..5184b79c700b 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #define __MFD_WM831X_CORE_H__ | 16 | #define __MFD_WM831X_CORE_H__ |
| 17 | 17 | ||
| 18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
| 19 | #include <linux/workqueue.h> | ||
| 20 | 19 | ||
| 21 | /* | 20 | /* |
| 22 | * Register values. | 21 | * Register values. |
| @@ -117,6 +116,7 @@ | |||
| 117 | #define WM831X_DC3_SLEEP_CONTROL 0x4063 | 116 | #define WM831X_DC3_SLEEP_CONTROL 0x4063 |
| 118 | #define WM831X_DC4_CONTROL 0x4064 | 117 | #define WM831X_DC4_CONTROL 0x4064 |
| 119 | #define WM831X_DC4_SLEEP_CONTROL 0x4065 | 118 | #define WM831X_DC4_SLEEP_CONTROL 0x4065 |
| 119 | #define WM832X_DC4_SLEEP_CONTROL 0x4067 | ||
| 120 | #define WM831X_EPE1_CONTROL 0x4066 | 120 | #define WM831X_EPE1_CONTROL 0x4066 |
| 121 | #define WM831X_EPE2_CONTROL 0x4067 | 121 | #define WM831X_EPE2_CONTROL 0x4067 |
| 122 | #define WM831X_LDO1_CONTROL 0x4068 | 122 | #define WM831X_LDO1_CONTROL 0x4068 |
| @@ -235,6 +235,8 @@ | |||
| 235 | 235 | ||
| 236 | struct regulator_dev; | 236 | struct regulator_dev; |
| 237 | 237 | ||
| 238 | #define WM831X_NUM_IRQ_REGS 5 | ||
| 239 | |||
| 238 | struct wm831x { | 240 | struct wm831x { |
| 239 | struct mutex io_lock; | 241 | struct mutex io_lock; |
| 240 | 242 | ||
| @@ -248,10 +250,11 @@ struct wm831x { | |||
| 248 | 250 | ||
| 249 | int irq; /* Our chip IRQ */ | 251 | int irq; /* Our chip IRQ */ |
| 250 | struct mutex irq_lock; | 252 | struct mutex irq_lock; |
| 251 | struct workqueue_struct *irq_wq; | ||
| 252 | struct work_struct irq_work; | ||
| 253 | unsigned int irq_base; | 253 | unsigned int irq_base; |
| 254 | int irq_masks[5]; | 254 | int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */ |
| 255 | int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ | ||
| 256 | |||
| 257 | int num_gpio; | ||
| 255 | 258 | ||
| 256 | struct mutex auxadc_lock; | 259 | struct mutex auxadc_lock; |
| 257 | 260 | ||
| @@ -278,12 +281,30 @@ int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg, | |||
| 278 | int wm831x_irq_init(struct wm831x *wm831x, int irq); | 281 | int wm831x_irq_init(struct wm831x *wm831x, int irq); |
| 279 | void wm831x_irq_exit(struct wm831x *wm831x); | 282 | void wm831x_irq_exit(struct wm831x *wm831x); |
| 280 | 283 | ||
| 281 | int __must_check wm831x_request_irq(struct wm831x *wm831x, | 284 | static inline int __must_check wm831x_request_irq(struct wm831x *wm831x, |
| 282 | unsigned int irq, irq_handler_t handler, | 285 | unsigned int irq, |
| 283 | unsigned long flags, const char *name, | 286 | irq_handler_t handler, |
| 284 | void *dev); | 287 | unsigned long flags, |
| 285 | void wm831x_free_irq(struct wm831x *wm831x, unsigned int, void *); | 288 | const char *name, |
| 286 | void wm831x_disable_irq(struct wm831x *wm831x, int irq); | 289 | void *dev) |
| 287 | void wm831x_enable_irq(struct wm831x *wm831x, int irq); | 290 | { |
| 291 | return request_threaded_irq(irq, NULL, handler, flags, name, dev); | ||
| 292 | } | ||
| 293 | |||
| 294 | static inline void wm831x_free_irq(struct wm831x *wm831x, | ||
| 295 | unsigned int irq, void *dev) | ||
| 296 | { | ||
| 297 | free_irq(irq, dev); | ||
| 298 | } | ||
| 299 | |||
| 300 | static inline void wm831x_disable_irq(struct wm831x *wm831x, int irq) | ||
| 301 | { | ||
| 302 | disable_irq(irq); | ||
| 303 | } | ||
| 304 | |||
| 305 | static inline void wm831x_enable_irq(struct wm831x *wm831x, int irq) | ||
| 306 | { | ||
| 307 | enable_irq(irq); | ||
| 308 | } | ||
| 288 | 309 | ||
| 289 | #endif | 310 | #endif |
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h index 90d820260aad..415c228743d5 100644 --- a/include/linux/mfd/wm831x/pdata.h +++ b/include/linux/mfd/wm831x/pdata.h | |||
| @@ -91,6 +91,7 @@ struct wm831x_pdata { | |||
| 91 | /** Called after subdevices are set up */ | 91 | /** Called after subdevices are set up */ |
| 92 | int (*post_init)(struct wm831x *wm831x); | 92 | int (*post_init)(struct wm831x *wm831x); |
| 93 | 93 | ||
| 94 | int irq_base; | ||
| 94 | int gpio_base; | 95 | int gpio_base; |
| 95 | struct wm831x_backlight_pdata *backlight; | 96 | struct wm831x_backlight_pdata *backlight; |
| 96 | struct wm831x_backup_pdata *backup; | 97 | struct wm831x_backup_pdata *backup; |
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h index 1d595de6a055..43868899bf49 100644 --- a/include/linux/mfd/wm8350/core.h +++ b/include/linux/mfd/wm8350/core.h | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 17 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
| 18 | #include <linux/workqueue.h> | 18 | #include <linux/interrupt.h> |
| 19 | 19 | ||
| 20 | #include <linux/mfd/wm8350/audio.h> | 20 | #include <linux/mfd/wm8350/audio.h> |
| 21 | #include <linux/mfd/wm8350/gpio.h> | 21 | #include <linux/mfd/wm8350/gpio.h> |
| @@ -601,7 +601,7 @@ extern const u16 wm8352_mode3_defaults[]; | |||
| 601 | struct wm8350; | 601 | struct wm8350; |
| 602 | 602 | ||
| 603 | struct wm8350_irq { | 603 | struct wm8350_irq { |
| 604 | void (*handler) (struct wm8350 *, int, void *); | 604 | irq_handler_t handler; |
| 605 | void *data; | 605 | void *data; |
| 606 | }; | 606 | }; |
| 607 | 607 | ||
| @@ -646,10 +646,12 @@ struct wm8350 { | |||
| 646 | * @init: Function called during driver initialisation. Should be | 646 | * @init: Function called during driver initialisation. Should be |
| 647 | * used by the platform to configure GPIO functions and similar. | 647 | * used by the platform to configure GPIO functions and similar. |
| 648 | * @irq_high: Set if WM8350 IRQ is active high. | 648 | * @irq_high: Set if WM8350 IRQ is active high. |
| 649 | * @irq_base: Base IRQ for genirq (not currently used). | ||
| 649 | */ | 650 | */ |
| 650 | struct wm8350_platform_data { | 651 | struct wm8350_platform_data { |
| 651 | int (*init)(struct wm8350 *wm8350); | 652 | int (*init)(struct wm8350 *wm8350); |
| 652 | int irq_high; | 653 | int irq_high; |
| 654 | int irq_base; | ||
| 653 | }; | 655 | }; |
| 654 | 656 | ||
| 655 | 657 | ||
| @@ -676,11 +678,13 @@ int wm8350_block_write(struct wm8350 *wm8350, int reg, int size, u16 *src); | |||
| 676 | * WM8350 internal interrupts | 678 | * WM8350 internal interrupts |
| 677 | */ | 679 | */ |
| 678 | int wm8350_register_irq(struct wm8350 *wm8350, int irq, | 680 | int wm8350_register_irq(struct wm8350 *wm8350, int irq, |
| 679 | void (*handler) (struct wm8350 *, int, void *), | 681 | irq_handler_t handler, unsigned long flags, |
| 680 | void *data); | 682 | const char *name, void *data); |
| 681 | int wm8350_free_irq(struct wm8350 *wm8350, int irq); | 683 | int wm8350_free_irq(struct wm8350 *wm8350, int irq); |
| 682 | int wm8350_mask_irq(struct wm8350 *wm8350, int irq); | 684 | int wm8350_mask_irq(struct wm8350 *wm8350, int irq); |
| 683 | int wm8350_unmask_irq(struct wm8350 *wm8350, int irq); | 685 | int wm8350_unmask_irq(struct wm8350 *wm8350, int irq); |
| 684 | 686 | int wm8350_irq_init(struct wm8350 *wm8350, int irq, | |
| 687 | struct wm8350_platform_data *pdata); | ||
| 688 | int wm8350_irq_exit(struct wm8350 *wm8350); | ||
| 685 | 689 | ||
| 686 | #endif | 690 | #endif |
diff --git a/include/linux/mfd/wm8350/gpio.h b/include/linux/mfd/wm8350/gpio.h index ed91e8f5d298..71af3d6ebe9d 100644 --- a/include/linux/mfd/wm8350/gpio.h +++ b/include/linux/mfd/wm8350/gpio.h | |||
| @@ -173,6 +173,24 @@ | |||
| 173 | #define WM8350_GPIO_DEBOUNCE_ON 1 | 173 | #define WM8350_GPIO_DEBOUNCE_ON 1 |
| 174 | 174 | ||
| 175 | /* | 175 | /* |
| 176 | * R30 (0x1E) - GPIO Interrupt Status | ||
| 177 | */ | ||
| 178 | #define WM8350_GP12_EINT 0x1000 | ||
| 179 | #define WM8350_GP11_EINT 0x0800 | ||
| 180 | #define WM8350_GP10_EINT 0x0400 | ||
| 181 | #define WM8350_GP9_EINT 0x0200 | ||
| 182 | #define WM8350_GP8_EINT 0x0100 | ||
| 183 | #define WM8350_GP7_EINT 0x0080 | ||
| 184 | #define WM8350_GP6_EINT 0x0040 | ||
| 185 | #define WM8350_GP5_EINT 0x0020 | ||
| 186 | #define WM8350_GP4_EINT 0x0010 | ||
| 187 | #define WM8350_GP3_EINT 0x0008 | ||
| 188 | #define WM8350_GP2_EINT 0x0004 | ||
| 189 | #define WM8350_GP1_EINT 0x0002 | ||
| 190 | #define WM8350_GP0_EINT 0x0001 | ||
| 191 | |||
| 192 | |||
| 193 | /* | ||
| 176 | * R128 (0x80) - GPIO Debounce | 194 | * R128 (0x80) - GPIO Debounce |
| 177 | */ | 195 | */ |
| 178 | #define WM8350_GP12_DB 0x1000 | 196 | #define WM8350_GP12_DB 0x1000 |
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h index 6913b71d9ab2..b31bd9e9bca3 100644 --- a/include/linux/mtd/ubi.h +++ b/include/linux/mtd/ubi.h | |||
| @@ -174,6 +174,8 @@ void ubi_get_volume_info(struct ubi_volume_desc *desc, | |||
| 174 | struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode); | 174 | struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode); |
| 175 | struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, | 175 | struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, |
| 176 | int mode); | 176 | int mode); |
| 177 | struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode); | ||
| 178 | |||
| 177 | int ubi_register_volume_notifier(struct notifier_block *nb, | 179 | int ubi_register_volume_notifier(struct notifier_block *nb, |
| 178 | int ignore_existing); | 180 | int ignore_existing); |
| 179 | int ubi_unregister_volume_notifier(struct notifier_block *nb); | 181 | int ubi_unregister_volume_notifier(struct notifier_block *nb); |
diff --git a/include/linux/namei.h b/include/linux/namei.h index ec0f607b364a..028946750289 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
| @@ -76,7 +76,6 @@ extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); | |||
| 76 | extern void release_open_intent(struct nameidata *); | 76 | extern void release_open_intent(struct nameidata *); |
| 77 | 77 | ||
| 78 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); | 78 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); |
| 79 | extern struct dentry *lookup_one_noperm(const char *, struct dentry *); | ||
| 80 | 79 | ||
| 81 | extern int follow_down(struct path *); | 80 | extern int follow_down(struct path *); |
| 82 | extern int follow_up(struct path *); | 81 | extern int follow_up(struct path *); |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index c4c060208109..9b8299af3741 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -128,6 +128,8 @@ | |||
| 128 | #define SEQ4_STATUS_RECALLABLE_STATE_REVOKED 0x00000040 | 128 | #define SEQ4_STATUS_RECALLABLE_STATE_REVOKED 0x00000040 |
| 129 | #define SEQ4_STATUS_LEASE_MOVED 0x00000080 | 129 | #define SEQ4_STATUS_LEASE_MOVED 0x00000080 |
| 130 | #define SEQ4_STATUS_RESTART_RECLAIM_NEEDED 0x00000100 | 130 | #define SEQ4_STATUS_RESTART_RECLAIM_NEEDED 0x00000100 |
| 131 | #define SEQ4_STATUS_CB_PATH_DOWN_SESSION 0x00000200 | ||
| 132 | #define SEQ4_STATUS_BACKCHANNEL_FAULT 0x00000400 | ||
| 131 | 133 | ||
| 132 | #define NFS4_MAX_UINT64 (~(u64)0) | 134 | #define NFS4_MAX_UINT64 (~(u64)0) |
| 133 | 135 | ||
| @@ -528,6 +530,7 @@ enum { | |||
| 528 | NFSPROC4_CLNT_DESTROY_SESSION, | 530 | NFSPROC4_CLNT_DESTROY_SESSION, |
| 529 | NFSPROC4_CLNT_SEQUENCE, | 531 | NFSPROC4_CLNT_SEQUENCE, |
| 530 | NFSPROC4_CLNT_GET_LEASE_TIME, | 532 | NFSPROC4_CLNT_GET_LEASE_TIME, |
| 533 | NFSPROC4_CLNT_RECLAIM_COMPLETE, | ||
| 531 | }; | 534 | }; |
| 532 | 535 | ||
| 533 | /* nfs41 types */ | 536 | /* nfs41 types */ |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 320569eabe3b..34fc6be5bfcf 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
| @@ -209,6 +209,7 @@ struct nfs4_session { | |||
| 209 | unsigned long session_state; | 209 | unsigned long session_state; |
| 210 | u32 hash_alg; | 210 | u32 hash_alg; |
| 211 | u32 ssv_len; | 211 | u32 ssv_len; |
| 212 | struct completion complete; | ||
| 212 | 213 | ||
| 213 | /* The fore and back channel */ | 214 | /* The fore and back channel */ |
| 214 | struct nfs4_channel_attrs fc_attrs; | 215 | struct nfs4_channel_attrs fc_attrs; |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 62f63fb0c4c8..51071b335751 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -170,8 +170,9 @@ struct nfs4_sequence_args { | |||
| 170 | struct nfs4_sequence_res { | 170 | struct nfs4_sequence_res { |
| 171 | struct nfs4_session *sr_session; | 171 | struct nfs4_session *sr_session; |
| 172 | u8 sr_slotid; /* slot used to send request */ | 172 | u8 sr_slotid; /* slot used to send request */ |
| 173 | unsigned long sr_renewal_time; | ||
| 174 | int sr_status; /* sequence operation status */ | 173 | int sr_status; /* sequence operation status */ |
| 174 | unsigned long sr_renewal_time; | ||
| 175 | u32 sr_status_flags; | ||
| 175 | }; | 176 | }; |
| 176 | 177 | ||
| 177 | struct nfs4_get_lease_time_args { | 178 | struct nfs4_get_lease_time_args { |
| @@ -938,6 +939,16 @@ struct nfs41_create_session_args { | |||
| 938 | struct nfs41_create_session_res { | 939 | struct nfs41_create_session_res { |
| 939 | struct nfs_client *client; | 940 | struct nfs_client *client; |
| 940 | }; | 941 | }; |
| 942 | |||
| 943 | struct nfs41_reclaim_complete_args { | ||
| 944 | /* In the future extend to include curr_fh for use with migration */ | ||
| 945 | unsigned char one_fs:1; | ||
| 946 | struct nfs4_sequence_args seq_args; | ||
| 947 | }; | ||
| 948 | |||
| 949 | struct nfs41_reclaim_complete_res { | ||
| 950 | struct nfs4_sequence_res seq_res; | ||
| 951 | }; | ||
| 941 | #endif /* CONFIG_NFS_V4_1 */ | 952 | #endif /* CONFIG_NFS_V4_1 */ |
| 942 | 953 | ||
| 943 | struct nfs_page; | 954 | struct nfs_page; |
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h index ce520402e840..3fe02cf8b65a 100644 --- a/include/linux/nilfs2_fs.h +++ b/include/linux/nilfs2_fs.h | |||
| @@ -151,6 +151,8 @@ struct nilfs_super_root { | |||
| 151 | #define NILFS_MOUNT_BARRIER 0x1000 /* Use block barriers */ | 151 | #define NILFS_MOUNT_BARRIER 0x1000 /* Use block barriers */ |
| 152 | #define NILFS_MOUNT_STRICT_ORDER 0x2000 /* Apply strict in-order | 152 | #define NILFS_MOUNT_STRICT_ORDER 0x2000 /* Apply strict in-order |
| 153 | semantics also for data */ | 153 | semantics also for data */ |
| 154 | #define NILFS_MOUNT_NORECOVERY 0x4000 /* Disable write access during | ||
| 155 | mount-time recovery */ | ||
| 154 | 156 | ||
| 155 | 157 | ||
| 156 | /** | 158 | /** |
| @@ -403,6 +405,28 @@ struct nilfs_segment_summary { | |||
| 403 | #define NILFS_SS_GC 0x0010 /* segment written for cleaner operation */ | 405 | #define NILFS_SS_GC 0x0010 /* segment written for cleaner operation */ |
| 404 | 406 | ||
| 405 | /** | 407 | /** |
| 408 | * struct nilfs_btree_node - B-tree node | ||
| 409 | * @bn_flags: flags | ||
| 410 | * @bn_level: level | ||
| 411 | * @bn_nchildren: number of children | ||
| 412 | * @bn_pad: padding | ||
| 413 | */ | ||
| 414 | struct nilfs_btree_node { | ||
| 415 | __u8 bn_flags; | ||
| 416 | __u8 bn_level; | ||
| 417 | __le16 bn_nchildren; | ||
| 418 | __le32 bn_pad; | ||
| 419 | }; | ||
| 420 | |||
| 421 | /* flags */ | ||
| 422 | #define NILFS_BTREE_NODE_ROOT 0x01 | ||
| 423 | |||
| 424 | /* level */ | ||
| 425 | #define NILFS_BTREE_LEVEL_DATA 0 | ||
| 426 | #define NILFS_BTREE_LEVEL_NODE_MIN (NILFS_BTREE_LEVEL_DATA + 1) | ||
| 427 | #define NILFS_BTREE_LEVEL_MAX 14 | ||
| 428 | |||
| 429 | /** | ||
| 406 | * struct nilfs_palloc_group_desc - block group descriptor | 430 | * struct nilfs_palloc_group_desc - block group descriptor |
| 407 | * @pg_nfrees: number of free entries in block group | 431 | * @pg_nfrees: number of free entries in block group |
| 408 | */ | 432 | */ |
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h new file mode 100644 index 000000000000..f46c40ac6d45 --- /dev/null +++ b/include/linux/omapfb.h | |||
| @@ -0,0 +1,251 @@ | |||
| 1 | /* | ||
| 2 | * File: include/linux/omapfb.h | ||
| 3 | * | ||
| 4 | * Framebuffer driver for TI OMAP boards | ||
| 5 | * | ||
| 6 | * Copyright (C) 2004 Nokia Corporation | ||
| 7 | * Author: Imre Deak <imre.deak@nokia.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify it | ||
| 10 | * under the terms of the GNU General Public License as published by the | ||
| 11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 12 | * option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, but | ||
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 17 | * General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License along | ||
| 20 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 21 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef __LINUX_OMAPFB_H__ | ||
| 25 | #define __LINUX_OMAPFB_H__ | ||
| 26 | |||
| 27 | #include <linux/fb.h> | ||
| 28 | #include <linux/ioctl.h> | ||
| 29 | #include <linux/types.h> | ||
| 30 | |||
| 31 | /* IOCTL commands. */ | ||
| 32 | |||
| 33 | #define OMAP_IOW(num, dtype) _IOW('O', num, dtype) | ||
| 34 | #define OMAP_IOR(num, dtype) _IOR('O', num, dtype) | ||
| 35 | #define OMAP_IOWR(num, dtype) _IOWR('O', num, dtype) | ||
| 36 | #define OMAP_IO(num) _IO('O', num) | ||
| 37 | |||
| 38 | #define OMAPFB_MIRROR OMAP_IOW(31, int) | ||
| 39 | #define OMAPFB_SYNC_GFX OMAP_IO(37) | ||
| 40 | #define OMAPFB_VSYNC OMAP_IO(38) | ||
| 41 | #define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int) | ||
| 42 | #define OMAPFB_GET_CAPS OMAP_IOR(42, struct omapfb_caps) | ||
| 43 | #define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int) | ||
| 44 | #define OMAPFB_LCD_TEST OMAP_IOW(45, int) | ||
| 45 | #define OMAPFB_CTRL_TEST OMAP_IOW(46, int) | ||
| 46 | #define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old) | ||
| 47 | #define OMAPFB_SET_COLOR_KEY OMAP_IOW(50, struct omapfb_color_key) | ||
| 48 | #define OMAPFB_GET_COLOR_KEY OMAP_IOW(51, struct omapfb_color_key) | ||
| 49 | #define OMAPFB_SETUP_PLANE OMAP_IOW(52, struct omapfb_plane_info) | ||
| 50 | #define OMAPFB_QUERY_PLANE OMAP_IOW(53, struct omapfb_plane_info) | ||
| 51 | #define OMAPFB_UPDATE_WINDOW OMAP_IOW(54, struct omapfb_update_window) | ||
| 52 | #define OMAPFB_SETUP_MEM OMAP_IOW(55, struct omapfb_mem_info) | ||
| 53 | #define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info) | ||
| 54 | #define OMAPFB_WAITFORVSYNC OMAP_IO(57) | ||
| 55 | #define OMAPFB_MEMORY_READ OMAP_IOR(58, struct omapfb_memory_read) | ||
| 56 | #define OMAPFB_GET_OVERLAY_COLORMODE OMAP_IOR(59, struct omapfb_ovl_colormode) | ||
| 57 | #define OMAPFB_WAITFORGO OMAP_IO(60) | ||
| 58 | #define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info) | ||
| 59 | #define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info) | ||
| 60 | |||
| 61 | #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff | ||
| 62 | #define OMAPFB_CAPS_LCDC_MASK 0x00fff000 | ||
| 63 | #define OMAPFB_CAPS_PANEL_MASK 0xff000000 | ||
| 64 | |||
| 65 | #define OMAPFB_CAPS_MANUAL_UPDATE 0x00001000 | ||
| 66 | #define OMAPFB_CAPS_TEARSYNC 0x00002000 | ||
| 67 | #define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000 | ||
| 68 | #define OMAPFB_CAPS_PLANE_SCALE 0x00008000 | ||
| 69 | #define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE 0x00010000 | ||
| 70 | #define OMAPFB_CAPS_WINDOW_SCALE 0x00020000 | ||
| 71 | #define OMAPFB_CAPS_WINDOW_OVERLAY 0x00040000 | ||
| 72 | #define OMAPFB_CAPS_WINDOW_ROTATE 0x00080000 | ||
| 73 | #define OMAPFB_CAPS_SET_BACKLIGHT 0x01000000 | ||
| 74 | |||
| 75 | /* Values from DSP must map to lower 16-bits */ | ||
| 76 | #define OMAPFB_FORMAT_MASK 0x00ff | ||
| 77 | #define OMAPFB_FORMAT_FLAG_DOUBLE 0x0100 | ||
| 78 | #define OMAPFB_FORMAT_FLAG_TEARSYNC 0x0200 | ||
| 79 | #define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400 | ||
| 80 | #define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY 0x0800 | ||
| 81 | #define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY 0x1000 | ||
| 82 | |||
| 83 | #define OMAPFB_MEMTYPE_SDRAM 0 | ||
| 84 | #define OMAPFB_MEMTYPE_SRAM 1 | ||
| 85 | #define OMAPFB_MEMTYPE_MAX 1 | ||
| 86 | |||
| 87 | enum omapfb_color_format { | ||
| 88 | OMAPFB_COLOR_RGB565 = 0, | ||
| 89 | OMAPFB_COLOR_YUV422, | ||
| 90 | OMAPFB_COLOR_YUV420, | ||
| 91 | OMAPFB_COLOR_CLUT_8BPP, | ||
| 92 | OMAPFB_COLOR_CLUT_4BPP, | ||
| 93 | OMAPFB_COLOR_CLUT_2BPP, | ||
| 94 | OMAPFB_COLOR_CLUT_1BPP, | ||
| 95 | OMAPFB_COLOR_RGB444, | ||
| 96 | OMAPFB_COLOR_YUY422, | ||
| 97 | |||
| 98 | OMAPFB_COLOR_ARGB16, | ||
| 99 | OMAPFB_COLOR_RGB24U, /* RGB24, 32-bit container */ | ||
| 100 | OMAPFB_COLOR_RGB24P, /* RGB24, 24-bit container */ | ||
| 101 | OMAPFB_COLOR_ARGB32, | ||
| 102 | OMAPFB_COLOR_RGBA32, | ||
| 103 | OMAPFB_COLOR_RGBX32, | ||
| 104 | }; | ||
| 105 | |||
| 106 | struct omapfb_update_window { | ||
| 107 | __u32 x, y; | ||
| 108 | __u32 width, height; | ||
| 109 | __u32 format; | ||
| 110 | __u32 out_x, out_y; | ||
| 111 | __u32 out_width, out_height; | ||
| 112 | __u32 reserved[8]; | ||
| 113 | }; | ||
| 114 | |||
| 115 | struct omapfb_update_window_old { | ||
| 116 | __u32 x, y; | ||
| 117 | __u32 width, height; | ||
| 118 | __u32 format; | ||
| 119 | }; | ||
| 120 | |||
| 121 | enum omapfb_plane { | ||
| 122 | OMAPFB_PLANE_GFX = 0, | ||
| 123 | OMAPFB_PLANE_VID1, | ||
| 124 | OMAPFB_PLANE_VID2, | ||
| 125 | }; | ||
| 126 | |||
| 127 | enum omapfb_channel_out { | ||
| 128 | OMAPFB_CHANNEL_OUT_LCD = 0, | ||
| 129 | OMAPFB_CHANNEL_OUT_DIGIT, | ||
| 130 | }; | ||
| 131 | |||
| 132 | struct omapfb_plane_info { | ||
| 133 | __u32 pos_x; | ||
| 134 | __u32 pos_y; | ||
| 135 | __u8 enabled; | ||
| 136 | __u8 channel_out; | ||
| 137 | __u8 mirror; | ||
| 138 | __u8 reserved1; | ||
| 139 | __u32 out_width; | ||
| 140 | __u32 out_height; | ||
| 141 | __u32 reserved2[12]; | ||
| 142 | }; | ||
| 143 | |||
| 144 | struct omapfb_mem_info { | ||
| 145 | __u32 size; | ||
| 146 | __u8 type; | ||
| 147 | __u8 reserved[3]; | ||
| 148 | }; | ||
| 149 | |||
| 150 | struct omapfb_caps { | ||
| 151 | __u32 ctrl; | ||
| 152 | __u32 plane_color; | ||
| 153 | __u32 wnd_color; | ||
| 154 | }; | ||
| 155 | |||
| 156 | enum omapfb_color_key_type { | ||
| 157 | OMAPFB_COLOR_KEY_DISABLED = 0, | ||
| 158 | OMAPFB_COLOR_KEY_GFX_DST, | ||
| 159 | OMAPFB_COLOR_KEY_VID_SRC, | ||
| 160 | }; | ||
| 161 | |||
| 162 | struct omapfb_color_key { | ||
| 163 | __u8 channel_out; | ||
| 164 | __u32 background; | ||
| 165 | __u32 trans_key; | ||
| 166 | __u8 key_type; | ||
| 167 | }; | ||
| 168 | |||
| 169 | enum omapfb_update_mode { | ||
| 170 | OMAPFB_UPDATE_DISABLED = 0, | ||
| 171 | OMAPFB_AUTO_UPDATE, | ||
| 172 | OMAPFB_MANUAL_UPDATE | ||
| 173 | }; | ||
| 174 | |||
| 175 | struct omapfb_memory_read { | ||
| 176 | __u16 x; | ||
| 177 | __u16 y; | ||
| 178 | __u16 w; | ||
| 179 | __u16 h; | ||
| 180 | size_t buffer_size; | ||
| 181 | void __user *buffer; | ||
| 182 | }; | ||
| 183 | |||
| 184 | struct omapfb_ovl_colormode { | ||
| 185 | __u8 overlay_idx; | ||
| 186 | __u8 mode_idx; | ||
| 187 | __u32 bits_per_pixel; | ||
| 188 | __u32 nonstd; | ||
| 189 | struct fb_bitfield red; | ||
| 190 | struct fb_bitfield green; | ||
| 191 | struct fb_bitfield blue; | ||
| 192 | struct fb_bitfield transp; | ||
| 193 | }; | ||
| 194 | |||
| 195 | struct omapfb_vram_info { | ||
| 196 | __u32 total; | ||
| 197 | __u32 free; | ||
| 198 | __u32 largest_free_block; | ||
| 199 | __u32 reserved[5]; | ||
| 200 | }; | ||
| 201 | |||
| 202 | struct omapfb_tearsync_info { | ||
| 203 | __u8 enabled; | ||
| 204 | __u8 reserved1[3]; | ||
| 205 | __u16 line; | ||
| 206 | __u16 reserved2; | ||
| 207 | }; | ||
| 208 | |||
| 209 | #ifdef __KERNEL__ | ||
| 210 | |||
| 211 | #include <plat/board.h> | ||
| 212 | |||
| 213 | #ifdef CONFIG_ARCH_OMAP1 | ||
| 214 | #define OMAPFB_PLANE_NUM 1 | ||
| 215 | #else | ||
| 216 | #define OMAPFB_PLANE_NUM 3 | ||
| 217 | #endif | ||
| 218 | |||
| 219 | struct omapfb_mem_region { | ||
| 220 | u32 paddr; | ||
| 221 | void __iomem *vaddr; | ||
| 222 | unsigned long size; | ||
| 223 | u8 type; /* OMAPFB_PLANE_MEM_* */ | ||
| 224 | enum omapfb_color_format format;/* OMAPFB_COLOR_* */ | ||
| 225 | unsigned format_used:1; /* Must be set when format is set. | ||
| 226 | * Needed b/c of the badly chosen 0 | ||
| 227 | * base for OMAPFB_COLOR_* values | ||
| 228 | */ | ||
| 229 | unsigned alloc:1; /* allocated by the driver */ | ||
| 230 | unsigned map:1; /* kernel mapped by the driver */ | ||
| 231 | }; | ||
| 232 | |||
| 233 | struct omapfb_mem_desc { | ||
| 234 | int region_cnt; | ||
| 235 | struct omapfb_mem_region region[OMAPFB_PLANE_NUM]; | ||
| 236 | }; | ||
| 237 | |||
| 238 | struct omapfb_platform_data { | ||
| 239 | struct omap_lcd_config lcd; | ||
| 240 | struct omapfb_mem_desc mem_desc; | ||
| 241 | void *ctrl_platform_data; | ||
| 242 | }; | ||
| 243 | |||
| 244 | /* in arch/arm/plat-omap/fb.c */ | ||
| 245 | extern void omapfb_set_platform_data(struct omapfb_platform_data *data); | ||
| 246 | extern void omapfb_set_ctrl_platform_data(void *pdata); | ||
| 247 | extern void omapfb_reserve_sdram(void); | ||
| 248 | |||
| 249 | #endif | ||
| 250 | |||
| 251 | #endif /* __OMAPFB_H */ | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index f5c7cd343e56..bf1e67080849 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -218,6 +218,7 @@ struct pci_dev { | |||
| 218 | unsigned int class; /* 3 bytes: (base,sub,prog-if) */ | 218 | unsigned int class; /* 3 bytes: (base,sub,prog-if) */ |
| 219 | u8 revision; /* PCI revision, low byte of class word */ | 219 | u8 revision; /* PCI revision, low byte of class word */ |
| 220 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ | 220 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ |
| 221 | u8 pcie_cap; /* PCI-E capability offset */ | ||
| 221 | u8 pcie_type; /* PCI-E device/port type */ | 222 | u8 pcie_type; /* PCI-E device/port type */ |
| 222 | u8 rom_base_reg; /* which config register controls the ROM */ | 223 | u8 rom_base_reg; /* which config register controls the ROM */ |
| 223 | u8 pin; /* which interrupt pin this device uses */ | 224 | u8 pin; /* which interrupt pin this device uses */ |
| @@ -280,6 +281,7 @@ struct pci_dev { | |||
| 280 | unsigned int is_virtfn:1; | 281 | unsigned int is_virtfn:1; |
| 281 | unsigned int reset_fn:1; | 282 | unsigned int reset_fn:1; |
| 282 | unsigned int is_hotplug_bridge:1; | 283 | unsigned int is_hotplug_bridge:1; |
| 284 | unsigned int aer_firmware_first:1; | ||
| 283 | pci_dev_flags_t dev_flags; | 285 | pci_dev_flags_t dev_flags; |
| 284 | atomic_t enable_cnt; /* pci_enable_device has been called */ | 286 | atomic_t enable_cnt; /* pci_enable_device has been called */ |
| 285 | 287 | ||
| @@ -635,7 +637,13 @@ struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, | |||
| 635 | unsigned int ss_vendor, unsigned int ss_device, | 637 | unsigned int ss_vendor, unsigned int ss_device, |
| 636 | struct pci_dev *from); | 638 | struct pci_dev *from); |
| 637 | struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); | 639 | struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); |
| 638 | struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); | 640 | struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus, |
| 641 | unsigned int devfn); | ||
| 642 | static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, | ||
| 643 | unsigned int devfn) | ||
| 644 | { | ||
| 645 | return pci_get_domain_bus_and_slot(0, bus, devfn); | ||
| 646 | } | ||
| 639 | struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); | 647 | struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); |
| 640 | int pci_dev_present(const struct pci_device_id *ids); | 648 | int pci_dev_present(const struct pci_device_id *ids); |
| 641 | 649 | ||
| @@ -701,6 +709,7 @@ void pci_disable_device(struct pci_dev *dev); | |||
| 701 | void pci_set_master(struct pci_dev *dev); | 709 | void pci_set_master(struct pci_dev *dev); |
| 702 | void pci_clear_master(struct pci_dev *dev); | 710 | void pci_clear_master(struct pci_dev *dev); |
| 703 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); | 711 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); |
| 712 | int pci_set_cacheline_size(struct pci_dev *dev); | ||
| 704 | #define HAVE_PCI_SET_MWI | 713 | #define HAVE_PCI_SET_MWI |
| 705 | int __must_check pci_set_mwi(struct pci_dev *dev); | 714 | int __must_check pci_set_mwi(struct pci_dev *dev); |
| 706 | int pci_try_set_mwi(struct pci_dev *dev); | 715 | int pci_try_set_mwi(struct pci_dev *dev); |
| @@ -1246,6 +1255,8 @@ extern int pci_pci_problems; | |||
| 1246 | 1255 | ||
| 1247 | extern unsigned long pci_cardbus_io_size; | 1256 | extern unsigned long pci_cardbus_io_size; |
| 1248 | extern unsigned long pci_cardbus_mem_size; | 1257 | extern unsigned long pci_cardbus_mem_size; |
| 1258 | extern u8 __devinitdata pci_dfl_cache_line_size; | ||
| 1259 | extern u8 pci_cache_line_size; | ||
| 1249 | 1260 | ||
| 1250 | extern unsigned long pci_hotplug_io_size; | 1261 | extern unsigned long pci_hotplug_io_size; |
| 1251 | extern unsigned long pci_hotplug_mem_size; | 1262 | extern unsigned long pci_hotplug_mem_size; |
| @@ -1290,5 +1301,34 @@ extern void pci_hp_create_module_link(struct pci_slot *pci_slot); | |||
| 1290 | extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); | 1301 | extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); |
| 1291 | #endif | 1302 | #endif |
| 1292 | 1303 | ||
| 1304 | /** | ||
| 1305 | * pci_pcie_cap - get the saved PCIe capability offset | ||
| 1306 | * @dev: PCI device | ||
| 1307 | * | ||
| 1308 | * PCIe capability offset is calculated at PCI device initialization | ||
| 1309 | * time and saved in the data structure. This function returns saved | ||
| 1310 | * PCIe capability offset. Using this instead of pci_find_capability() | ||
| 1311 | * reduces unnecessary search in the PCI configuration space. If you | ||
| 1312 | * need to calculate PCIe capability offset from raw device for some | ||
| 1313 | * reasons, please use pci_find_capability() instead. | ||
| 1314 | */ | ||
| 1315 | static inline int pci_pcie_cap(struct pci_dev *dev) | ||
| 1316 | { | ||
| 1317 | return dev->pcie_cap; | ||
| 1318 | } | ||
| 1319 | |||
| 1320 | /** | ||
| 1321 | * pci_is_pcie - check if the PCI device is PCI Express capable | ||
| 1322 | * @dev: PCI device | ||
| 1323 | * | ||
| 1324 | * Retrun true if the PCI device is PCI Express capable, false otherwise. | ||
| 1325 | */ | ||
| 1326 | static inline bool pci_is_pcie(struct pci_dev *dev) | ||
| 1327 | { | ||
| 1328 | return !!pci_pcie_cap(dev); | ||
| 1329 | } | ||
| 1330 | |||
| 1331 | void pci_request_acs(void); | ||
| 1332 | |||
| 1293 | #endif /* __KERNEL__ */ | 1333 | #endif /* __KERNEL__ */ |
| 1294 | #endif /* LINUX_PCI_H */ | 1334 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index eae1f864c934..cca8a044e2b6 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -2295,6 +2295,20 @@ | |||
| 2295 | #define PCI_DEVICE_ID_MPC8536 0x0051 | 2295 | #define PCI_DEVICE_ID_MPC8536 0x0051 |
| 2296 | #define PCI_DEVICE_ID_P2020E 0x0070 | 2296 | #define PCI_DEVICE_ID_P2020E 0x0070 |
| 2297 | #define PCI_DEVICE_ID_P2020 0x0071 | 2297 | #define PCI_DEVICE_ID_P2020 0x0071 |
| 2298 | #define PCI_DEVICE_ID_P2010E 0x0078 | ||
| 2299 | #define PCI_DEVICE_ID_P2010 0x0079 | ||
| 2300 | #define PCI_DEVICE_ID_P1020E 0x0100 | ||
| 2301 | #define PCI_DEVICE_ID_P1020 0x0101 | ||
| 2302 | #define PCI_DEVICE_ID_P1011E 0x0108 | ||
| 2303 | #define PCI_DEVICE_ID_P1011 0x0109 | ||
| 2304 | #define PCI_DEVICE_ID_P1022E 0x0110 | ||
| 2305 | #define PCI_DEVICE_ID_P1022 0x0111 | ||
| 2306 | #define PCI_DEVICE_ID_P1013E 0x0118 | ||
| 2307 | #define PCI_DEVICE_ID_P1013 0x0119 | ||
| 2308 | #define PCI_DEVICE_ID_P4080E 0x0400 | ||
| 2309 | #define PCI_DEVICE_ID_P4080 0x0401 | ||
| 2310 | #define PCI_DEVICE_ID_P4040E 0x0408 | ||
| 2311 | #define PCI_DEVICE_ID_P4040 0x0409 | ||
| 2298 | #define PCI_DEVICE_ID_MPC8641 0x7010 | 2312 | #define PCI_DEVICE_ID_MPC8641 0x7010 |
| 2299 | #define PCI_DEVICE_ID_MPC8641D 0x7011 | 2313 | #define PCI_DEVICE_ID_MPC8641D 0x7011 |
| 2300 | #define PCI_DEVICE_ID_MPC8610 0x7018 | 2314 | #define PCI_DEVICE_ID_MPC8610 0x7018 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index dd0bed4f1cf0..9f2ad0aa3c39 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
| @@ -365,6 +365,11 @@ | |||
| 365 | #define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ | 365 | #define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ |
| 366 | #define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ | 366 | #define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ |
| 367 | 367 | ||
| 368 | /* PCI Bridge Subsystem ID registers */ | ||
| 369 | |||
| 370 | #define PCI_SSVID_VENDOR_ID 4 /* PCI-Bridge subsystem vendor id register */ | ||
| 371 | #define PCI_SSVID_DEVICE_ID 6 /* PCI-Bridge subsystem device id register */ | ||
| 372 | |||
| 368 | /* PCI Express capability registers */ | 373 | /* PCI Express capability registers */ |
| 369 | 374 | ||
| 370 | #define PCI_EXP_FLAGS 2 /* Capabilities register */ | 375 | #define PCI_EXP_FLAGS 2 /* Capabilities register */ |
| @@ -502,6 +507,7 @@ | |||
| 502 | #define PCI_EXT_CAP_ID_VC 2 | 507 | #define PCI_EXT_CAP_ID_VC 2 |
| 503 | #define PCI_EXT_CAP_ID_DSN 3 | 508 | #define PCI_EXT_CAP_ID_DSN 3 |
| 504 | #define PCI_EXT_CAP_ID_PWR 4 | 509 | #define PCI_EXT_CAP_ID_PWR 4 |
| 510 | #define PCI_EXT_CAP_ID_ACS 13 | ||
| 505 | #define PCI_EXT_CAP_ID_ARI 14 | 511 | #define PCI_EXT_CAP_ID_ARI 14 |
| 506 | #define PCI_EXT_CAP_ID_ATS 15 | 512 | #define PCI_EXT_CAP_ID_ATS 15 |
| 507 | #define PCI_EXT_CAP_ID_SRIOV 16 | 513 | #define PCI_EXT_CAP_ID_SRIOV 16 |
| @@ -662,4 +668,16 @@ | |||
| 662 | #define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ | 668 | #define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ |
| 663 | #define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ | 669 | #define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ |
| 664 | 670 | ||
| 671 | /* Access Control Service */ | ||
| 672 | #define PCI_ACS_CAP 0x04 /* ACS Capability Register */ | ||
| 673 | #define PCI_ACS_SV 0x01 /* Source Validation */ | ||
| 674 | #define PCI_ACS_TB 0x02 /* Translation Blocking */ | ||
| 675 | #define PCI_ACS_RR 0x04 /* P2P Request Redirect */ | ||
| 676 | #define PCI_ACS_CR 0x08 /* P2P Completion Redirect */ | ||
| 677 | #define PCI_ACS_UF 0x10 /* Upstream Forwarding */ | ||
| 678 | #define PCI_ACS_EC 0x20 /* P2P Egress Control */ | ||
| 679 | #define PCI_ACS_DT 0x40 /* Direct Translated P2P */ | ||
| 680 | #define PCI_ACS_CTRL 0x06 /* ACS Control Register */ | ||
| 681 | #define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */ | ||
| 682 | |||
| 665 | #endif /* LINUX_PCI_REGS_H */ | 683 | #endif /* LINUX_PCI_REGS_H */ |
diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h index b4c79545330b..6775532b92a9 100644 --- a/include/linux/pcieport_if.h +++ b/include/linux/pcieport_if.h | |||
| @@ -10,10 +10,7 @@ | |||
| 10 | #define _PCIEPORT_IF_H_ | 10 | #define _PCIEPORT_IF_H_ |
| 11 | 11 | ||
| 12 | /* Port Type */ | 12 | /* Port Type */ |
| 13 | #define PCIE_RC_PORT 4 /* Root port of RC */ | 13 | #define PCIE_ANY_PORT (~0) |
| 14 | #define PCIE_SW_UPSTREAM_PORT 5 /* Upstream port of Switch */ | ||
| 15 | #define PCIE_SW_DOWNSTREAM_PORT 6 /* Downstream port of Switch */ | ||
| 16 | #define PCIE_ANY_PORT 7 | ||
| 17 | 14 | ||
| 18 | /* Service Type */ | 15 | /* Service Type */ |
| 19 | #define PCIE_PORT_SERVICE_PME_SHIFT 0 /* Power Management Event */ | 16 | #define PCIE_PORT_SERVICE_PME_SHIFT 0 /* Power Management Event */ |
| @@ -25,17 +22,6 @@ | |||
| 25 | #define PCIE_PORT_SERVICE_VC_SHIFT 3 /* Virtual Channel */ | 22 | #define PCIE_PORT_SERVICE_VC_SHIFT 3 /* Virtual Channel */ |
| 26 | #define PCIE_PORT_SERVICE_VC (1 << PCIE_PORT_SERVICE_VC_SHIFT) | 23 | #define PCIE_PORT_SERVICE_VC (1 << PCIE_PORT_SERVICE_VC_SHIFT) |
| 27 | 24 | ||
| 28 | /* Root/Upstream/Downstream Port's Interrupt Mode */ | ||
| 29 | #define PCIE_PORT_NO_IRQ (-1) | ||
| 30 | #define PCIE_PORT_INTx_MODE 0 | ||
| 31 | #define PCIE_PORT_MSI_MODE 1 | ||
| 32 | #define PCIE_PORT_MSIX_MODE 2 | ||
| 33 | |||
| 34 | struct pcie_port_data { | ||
| 35 | int port_type; /* Type of the port */ | ||
| 36 | int port_irq_mode; /* [0:INTx | 1:MSI | 2:MSI-X] */ | ||
| 37 | }; | ||
| 38 | |||
| 39 | struct pcie_device { | 25 | struct pcie_device { |
| 40 | int irq; /* Service IRQ/MSI/MSI-X Vector */ | 26 | int irq; /* Service IRQ/MSI/MSI-X Vector */ |
| 41 | struct pci_dev *port; /* Root/Upstream/Downstream Port */ | 27 | struct pci_dev *port; /* Root/Upstream/Downstream Port */ |
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 9bd03193ecd4..5a5d6ce4bd55 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
| @@ -60,6 +60,7 @@ | |||
| 60 | 60 | ||
| 61 | #define DEFINE_PER_CPU_SECTION(type, name, sec) \ | 61 | #define DEFINE_PER_CPU_SECTION(type, name, sec) \ |
| 62 | __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ | 62 | __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ |
| 63 | extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ | ||
| 63 | __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ | 64 | __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ |
| 64 | __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ | 65 | __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ |
| 65 | __typeof__(type) per_cpu__##name | 66 | __typeof__(type) per_cpu__##name |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 878836ca999c..cf5efbcf716c 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
| @@ -34,8 +34,6 @@ | |||
| 34 | 34 | ||
| 35 | #ifdef CONFIG_SMP | 35 | #ifdef CONFIG_SMP |
| 36 | 36 | ||
| 37 | #ifndef CONFIG_HAVE_LEGACY_PER_CPU_AREA | ||
| 38 | |||
| 39 | /* minimum unit size, also is the maximum supported allocation size */ | 37 | /* minimum unit size, also is the maximum supported allocation size */ |
| 40 | #define PCPU_MIN_UNIT_SIZE PFN_ALIGN(64 << 10) | 38 | #define PCPU_MIN_UNIT_SIZE PFN_ALIGN(64 << 10) |
| 41 | 39 | ||
| @@ -130,30 +128,9 @@ extern int __init pcpu_page_first_chunk(size_t reserved_size, | |||
| 130 | #define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))) | 128 | #define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))) |
| 131 | 129 | ||
| 132 | extern void *__alloc_reserved_percpu(size_t size, size_t align); | 130 | extern void *__alloc_reserved_percpu(size_t size, size_t align); |
| 133 | |||
| 134 | #else /* CONFIG_HAVE_LEGACY_PER_CPU_AREA */ | ||
| 135 | |||
| 136 | struct percpu_data { | ||
| 137 | void *ptrs[1]; | ||
| 138 | }; | ||
| 139 | |||
| 140 | /* pointer disguising messes up the kmemleak objects tracking */ | ||
| 141 | #ifndef CONFIG_DEBUG_KMEMLEAK | ||
| 142 | #define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata) | ||
| 143 | #else | ||
| 144 | #define __percpu_disguise(pdata) (struct percpu_data *)(pdata) | ||
| 145 | #endif | ||
| 146 | |||
| 147 | #define per_cpu_ptr(ptr, cpu) \ | ||
| 148 | ({ \ | ||
| 149 | struct percpu_data *__p = __percpu_disguise(ptr); \ | ||
| 150 | (__typeof__(ptr))__p->ptrs[(cpu)]; \ | ||
| 151 | }) | ||
| 152 | |||
| 153 | #endif /* CONFIG_HAVE_LEGACY_PER_CPU_AREA */ | ||
| 154 | |||
| 155 | extern void *__alloc_percpu(size_t size, size_t align); | 131 | extern void *__alloc_percpu(size_t size, size_t align); |
| 156 | extern void free_percpu(void *__pdata); | 132 | extern void free_percpu(void *__pdata); |
| 133 | extern phys_addr_t per_cpu_ptr_to_phys(void *addr); | ||
| 157 | 134 | ||
| 158 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA | 135 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA |
| 159 | extern void __init setup_per_cpu_areas(void); | 136 | extern void __init setup_per_cpu_areas(void); |
| @@ -179,6 +156,11 @@ static inline void free_percpu(void *p) | |||
| 179 | kfree(p); | 156 | kfree(p); |
| 180 | } | 157 | } |
| 181 | 158 | ||
| 159 | static inline phys_addr_t per_cpu_ptr_to_phys(void *addr) | ||
| 160 | { | ||
| 161 | return __pa(addr); | ||
| 162 | } | ||
| 163 | |||
| 182 | static inline void __init setup_per_cpu_areas(void) { } | 164 | static inline void __init setup_per_cpu_areas(void) { } |
| 183 | 165 | ||
| 184 | static inline void *pcpu_lpage_remapped(void *kaddr) | 166 | static inline void *pcpu_lpage_remapped(void *kaddr) |
| @@ -188,8 +170,8 @@ static inline void *pcpu_lpage_remapped(void *kaddr) | |||
| 188 | 170 | ||
| 189 | #endif /* CONFIG_SMP */ | 171 | #endif /* CONFIG_SMP */ |
| 190 | 172 | ||
| 191 | #define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \ | 173 | #define alloc_percpu(type) \ |
| 192 | __alignof__(type)) | 174 | (typeof(type) *)__alloc_percpu(sizeof(type), __alignof__(type)) |
| 193 | 175 | ||
| 194 | /* | 176 | /* |
| 195 | * Optional methods for optimized non-lvalue per-cpu variable access. | 177 | * Optional methods for optimized non-lvalue per-cpu variable access. |
| @@ -243,4 +225,404 @@ do { \ | |||
| 243 | # define percpu_xor(var, val) __percpu_generic_to_op(var, (val), ^=) | 225 | # define percpu_xor(var, val) __percpu_generic_to_op(var, (val), ^=) |
| 244 | #endif | 226 | #endif |
| 245 | 227 | ||
| 228 | /* | ||
| 229 | * Branching function to split up a function into a set of functions that | ||
| 230 | * are called for different scalar sizes of the objects handled. | ||
| 231 | */ | ||
| 232 | |||
| 233 | extern void __bad_size_call_parameter(void); | ||
| 234 | |||
| 235 | #define __pcpu_size_call_return(stem, variable) \ | ||
| 236 | ({ typeof(variable) pscr_ret__; \ | ||
| 237 | switch(sizeof(variable)) { \ | ||
| 238 | case 1: pscr_ret__ = stem##1(variable);break; \ | ||
| 239 | case 2: pscr_ret__ = stem##2(variable);break; \ | ||
| 240 | case 4: pscr_ret__ = stem##4(variable);break; \ | ||
| 241 | case 8: pscr_ret__ = stem##8(variable);break; \ | ||
| 242 | default: \ | ||
| 243 | __bad_size_call_parameter();break; \ | ||
| 244 | } \ | ||
| 245 | pscr_ret__; \ | ||
| 246 | }) | ||
| 247 | |||
| 248 | #define __pcpu_size_call(stem, variable, ...) \ | ||
| 249 | do { \ | ||
| 250 | switch(sizeof(variable)) { \ | ||
| 251 | case 1: stem##1(variable, __VA_ARGS__);break; \ | ||
| 252 | case 2: stem##2(variable, __VA_ARGS__);break; \ | ||
| 253 | case 4: stem##4(variable, __VA_ARGS__);break; \ | ||
| 254 | case 8: stem##8(variable, __VA_ARGS__);break; \ | ||
| 255 | default: \ | ||
| 256 | __bad_size_call_parameter();break; \ | ||
| 257 | } \ | ||
| 258 | } while (0) | ||
| 259 | |||
| 260 | /* | ||
| 261 | * Optimized manipulation for memory allocated through the per cpu | ||
| 262 | * allocator or for addresses of per cpu variables (can be determined | ||
| 263 | * using per_cpu_var(xx). | ||
| 264 | * | ||
| 265 | * These operation guarantee exclusivity of access for other operations | ||
| 266 | * on the *same* processor. The assumption is that per cpu data is only | ||
| 267 | * accessed by a single processor instance (the current one). | ||
| 268 | * | ||
| 269 | * The first group is used for accesses that must be done in a | ||
| 270 | * preemption safe way since we know that the context is not preempt | ||
| 271 | * safe. Interrupts may occur. If the interrupt modifies the variable | ||
| 272 | * too then RMW actions will not be reliable. | ||
| 273 | * | ||
| 274 | * The arch code can provide optimized functions in two ways: | ||
| 275 | * | ||
| 276 | * 1. Override the function completely. F.e. define this_cpu_add(). | ||
| 277 | * The arch must then ensure that the various scalar format passed | ||
| 278 | * are handled correctly. | ||
| 279 | * | ||
| 280 | * 2. Provide functions for certain scalar sizes. F.e. provide | ||
| 281 | * this_cpu_add_2() to provide per cpu atomic operations for 2 byte | ||
| 282 | * sized RMW actions. If arch code does not provide operations for | ||
| 283 | * a scalar size then the fallback in the generic code will be | ||
| 284 | * used. | ||
| 285 | */ | ||
| 286 | |||
| 287 | #define _this_cpu_generic_read(pcp) \ | ||
| 288 | ({ typeof(pcp) ret__; \ | ||
| 289 | preempt_disable(); \ | ||
| 290 | ret__ = *this_cpu_ptr(&(pcp)); \ | ||
| 291 | preempt_enable(); \ | ||
| 292 | ret__; \ | ||
| 293 | }) | ||
| 294 | |||
| 295 | #ifndef this_cpu_read | ||
| 296 | # ifndef this_cpu_read_1 | ||
| 297 | # define this_cpu_read_1(pcp) _this_cpu_generic_read(pcp) | ||
| 298 | # endif | ||
| 299 | # ifndef this_cpu_read_2 | ||
| 300 | # define this_cpu_read_2(pcp) _this_cpu_generic_read(pcp) | ||
| 301 | # endif | ||
| 302 | # ifndef this_cpu_read_4 | ||
| 303 | # define this_cpu_read_4(pcp) _this_cpu_generic_read(pcp) | ||
| 304 | # endif | ||
| 305 | # ifndef this_cpu_read_8 | ||
| 306 | # define this_cpu_read_8(pcp) _this_cpu_generic_read(pcp) | ||
| 307 | # endif | ||
| 308 | # define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, (pcp)) | ||
| 309 | #endif | ||
| 310 | |||
| 311 | #define _this_cpu_generic_to_op(pcp, val, op) \ | ||
| 312 | do { \ | ||
| 313 | preempt_disable(); \ | ||
| 314 | *__this_cpu_ptr(&pcp) op val; \ | ||
| 315 | preempt_enable(); \ | ||
| 316 | } while (0) | ||
| 317 | |||
| 318 | #ifndef this_cpu_write | ||
| 319 | # ifndef this_cpu_write_1 | ||
| 320 | # define this_cpu_write_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) | ||
| 321 | # endif | ||
| 322 | # ifndef this_cpu_write_2 | ||
| 323 | # define this_cpu_write_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) | ||
| 324 | # endif | ||
| 325 | # ifndef this_cpu_write_4 | ||
| 326 | # define this_cpu_write_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) | ||
| 327 | # endif | ||
| 328 | # ifndef this_cpu_write_8 | ||
| 329 | # define this_cpu_write_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) | ||
| 330 | # endif | ||
| 331 | # define this_cpu_write(pcp, val) __pcpu_size_call(this_cpu_write_, (pcp), (val)) | ||
| 332 | #endif | ||
| 333 | |||
| 334 | #ifndef this_cpu_add | ||
| 335 | # ifndef this_cpu_add_1 | ||
| 336 | # define this_cpu_add_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) | ||
| 337 | # endif | ||
| 338 | # ifndef this_cpu_add_2 | ||
| 339 | # define this_cpu_add_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) | ||
| 340 | # endif | ||
| 341 | # ifndef this_cpu_add_4 | ||
| 342 | # define this_cpu_add_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) | ||
| 343 | # endif | ||
| 344 | # ifndef this_cpu_add_8 | ||
| 345 | # define this_cpu_add_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) | ||
| 346 | # endif | ||
| 347 | # define this_cpu_add(pcp, val) __pcpu_size_call(this_cpu_add_, (pcp), (val)) | ||
| 348 | #endif | ||
| 349 | |||
| 350 | #ifndef this_cpu_sub | ||
| 351 | # define this_cpu_sub(pcp, val) this_cpu_add((pcp), -(val)) | ||
| 352 | #endif | ||
| 353 | |||
| 354 | #ifndef this_cpu_inc | ||
| 355 | # define this_cpu_inc(pcp) this_cpu_add((pcp), 1) | ||
| 356 | #endif | ||
| 357 | |||
| 358 | #ifndef this_cpu_dec | ||
| 359 | # define this_cpu_dec(pcp) this_cpu_sub((pcp), 1) | ||
| 360 | #endif | ||
| 361 | |||
| 362 | #ifndef this_cpu_and | ||
| 363 | # ifndef this_cpu_and_1 | ||
| 364 | # define this_cpu_and_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) | ||
| 365 | # endif | ||
| 366 | # ifndef this_cpu_and_2 | ||
| 367 | # define this_cpu_and_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) | ||
| 368 | # endif | ||
| 369 | # ifndef this_cpu_and_4 | ||
| 370 | # define this_cpu_and_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) | ||
| 371 | # endif | ||
| 372 | # ifndef this_cpu_and_8 | ||
| 373 | # define this_cpu_and_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) | ||
| 374 | # endif | ||
| 375 | # define this_cpu_and(pcp, val) __pcpu_size_call(this_cpu_and_, (pcp), (val)) | ||
| 376 | #endif | ||
| 377 | |||
| 378 | #ifndef this_cpu_or | ||
| 379 | # ifndef this_cpu_or_1 | ||
| 380 | # define this_cpu_or_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) | ||
| 381 | # endif | ||
| 382 | # ifndef this_cpu_or_2 | ||
| 383 | # define this_cpu_or_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) | ||
| 384 | # endif | ||
| 385 | # ifndef this_cpu_or_4 | ||
| 386 | # define this_cpu_or_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) | ||
| 387 | # endif | ||
| 388 | # ifndef this_cpu_or_8 | ||
| 389 | # define this_cpu_or_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) | ||
| 390 | # endif | ||
| 391 | # define this_cpu_or(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) | ||
| 392 | #endif | ||
| 393 | |||
| 394 | #ifndef this_cpu_xor | ||
| 395 | # ifndef this_cpu_xor_1 | ||
| 396 | # define this_cpu_xor_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 397 | # endif | ||
| 398 | # ifndef this_cpu_xor_2 | ||
| 399 | # define this_cpu_xor_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 400 | # endif | ||
| 401 | # ifndef this_cpu_xor_4 | ||
| 402 | # define this_cpu_xor_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 403 | # endif | ||
| 404 | # ifndef this_cpu_xor_8 | ||
| 405 | # define this_cpu_xor_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 406 | # endif | ||
| 407 | # define this_cpu_xor(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) | ||
| 408 | #endif | ||
| 409 | |||
| 410 | /* | ||
| 411 | * Generic percpu operations that do not require preemption handling. | ||
| 412 | * Either we do not care about races or the caller has the | ||
| 413 | * responsibility of handling preemptions issues. Arch code can still | ||
| 414 | * override these instructions since the arch per cpu code may be more | ||
| 415 | * efficient and may actually get race freeness for free (that is the | ||
| 416 | * case for x86 for example). | ||
| 417 | * | ||
| 418 | * If there is no other protection through preempt disable and/or | ||
| 419 | * disabling interupts then one of these RMW operations can show unexpected | ||
| 420 | * behavior because the execution thread was rescheduled on another processor | ||
| 421 | * or an interrupt occurred and the same percpu variable was modified from | ||
| 422 | * the interrupt context. | ||
| 423 | */ | ||
| 424 | #ifndef __this_cpu_read | ||
| 425 | # ifndef __this_cpu_read_1 | ||
| 426 | # define __this_cpu_read_1(pcp) (*__this_cpu_ptr(&(pcp))) | ||
| 427 | # endif | ||
| 428 | # ifndef __this_cpu_read_2 | ||
| 429 | # define __this_cpu_read_2(pcp) (*__this_cpu_ptr(&(pcp))) | ||
| 430 | # endif | ||
| 431 | # ifndef __this_cpu_read_4 | ||
| 432 | # define __this_cpu_read_4(pcp) (*__this_cpu_ptr(&(pcp))) | ||
| 433 | # endif | ||
| 434 | # ifndef __this_cpu_read_8 | ||
| 435 | # define __this_cpu_read_8(pcp) (*__this_cpu_ptr(&(pcp))) | ||
| 436 | # endif | ||
| 437 | # define __this_cpu_read(pcp) __pcpu_size_call_return(__this_cpu_read_, (pcp)) | ||
| 438 | #endif | ||
| 439 | |||
| 440 | #define __this_cpu_generic_to_op(pcp, val, op) \ | ||
| 441 | do { \ | ||
| 442 | *__this_cpu_ptr(&(pcp)) op val; \ | ||
| 443 | } while (0) | ||
| 444 | |||
| 445 | #ifndef __this_cpu_write | ||
| 446 | # ifndef __this_cpu_write_1 | ||
| 447 | # define __this_cpu_write_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), =) | ||
| 448 | # endif | ||
| 449 | # ifndef __this_cpu_write_2 | ||
| 450 | # define __this_cpu_write_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), =) | ||
| 451 | # endif | ||
| 452 | # ifndef __this_cpu_write_4 | ||
| 453 | # define __this_cpu_write_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), =) | ||
| 454 | # endif | ||
| 455 | # ifndef __this_cpu_write_8 | ||
| 456 | # define __this_cpu_write_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), =) | ||
| 457 | # endif | ||
| 458 | # define __this_cpu_write(pcp, val) __pcpu_size_call(__this_cpu_write_, (pcp), (val)) | ||
| 459 | #endif | ||
| 460 | |||
| 461 | #ifndef __this_cpu_add | ||
| 462 | # ifndef __this_cpu_add_1 | ||
| 463 | # define __this_cpu_add_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=) | ||
| 464 | # endif | ||
| 465 | # ifndef __this_cpu_add_2 | ||
| 466 | # define __this_cpu_add_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=) | ||
| 467 | # endif | ||
| 468 | # ifndef __this_cpu_add_4 | ||
| 469 | # define __this_cpu_add_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=) | ||
| 470 | # endif | ||
| 471 | # ifndef __this_cpu_add_8 | ||
| 472 | # define __this_cpu_add_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=) | ||
| 473 | # endif | ||
| 474 | # define __this_cpu_add(pcp, val) __pcpu_size_call(__this_cpu_add_, (pcp), (val)) | ||
| 475 | #endif | ||
| 476 | |||
| 477 | #ifndef __this_cpu_sub | ||
| 478 | # define __this_cpu_sub(pcp, val) __this_cpu_add((pcp), -(val)) | ||
| 479 | #endif | ||
| 480 | |||
| 481 | #ifndef __this_cpu_inc | ||
| 482 | # define __this_cpu_inc(pcp) __this_cpu_add((pcp), 1) | ||
| 483 | #endif | ||
| 484 | |||
| 485 | #ifndef __this_cpu_dec | ||
| 486 | # define __this_cpu_dec(pcp) __this_cpu_sub((pcp), 1) | ||
| 487 | #endif | ||
| 488 | |||
| 489 | #ifndef __this_cpu_and | ||
| 490 | # ifndef __this_cpu_and_1 | ||
| 491 | # define __this_cpu_and_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=) | ||
| 492 | # endif | ||
| 493 | # ifndef __this_cpu_and_2 | ||
| 494 | # define __this_cpu_and_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=) | ||
| 495 | # endif | ||
| 496 | # ifndef __this_cpu_and_4 | ||
| 497 | # define __this_cpu_and_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=) | ||
| 498 | # endif | ||
| 499 | # ifndef __this_cpu_and_8 | ||
| 500 | # define __this_cpu_and_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=) | ||
| 501 | # endif | ||
| 502 | # define __this_cpu_and(pcp, val) __pcpu_size_call(__this_cpu_and_, (pcp), (val)) | ||
| 503 | #endif | ||
| 504 | |||
| 505 | #ifndef __this_cpu_or | ||
| 506 | # ifndef __this_cpu_or_1 | ||
| 507 | # define __this_cpu_or_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=) | ||
| 508 | # endif | ||
| 509 | # ifndef __this_cpu_or_2 | ||
| 510 | # define __this_cpu_or_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=) | ||
| 511 | # endif | ||
| 512 | # ifndef __this_cpu_or_4 | ||
| 513 | # define __this_cpu_or_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=) | ||
| 514 | # endif | ||
| 515 | # ifndef __this_cpu_or_8 | ||
| 516 | # define __this_cpu_or_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=) | ||
| 517 | # endif | ||
| 518 | # define __this_cpu_or(pcp, val) __pcpu_size_call(__this_cpu_or_, (pcp), (val)) | ||
| 519 | #endif | ||
| 520 | |||
| 521 | #ifndef __this_cpu_xor | ||
| 522 | # ifndef __this_cpu_xor_1 | ||
| 523 | # define __this_cpu_xor_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 524 | # endif | ||
| 525 | # ifndef __this_cpu_xor_2 | ||
| 526 | # define __this_cpu_xor_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 527 | # endif | ||
| 528 | # ifndef __this_cpu_xor_4 | ||
| 529 | # define __this_cpu_xor_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 530 | # endif | ||
| 531 | # ifndef __this_cpu_xor_8 | ||
| 532 | # define __this_cpu_xor_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 533 | # endif | ||
| 534 | # define __this_cpu_xor(pcp, val) __pcpu_size_call(__this_cpu_xor_, (pcp), (val)) | ||
| 535 | #endif | ||
| 536 | |||
| 537 | /* | ||
| 538 | * IRQ safe versions of the per cpu RMW operations. Note that these operations | ||
| 539 | * are *not* safe against modification of the same variable from another | ||
| 540 | * processors (which one gets when using regular atomic operations) | ||
| 541 | . They are guaranteed to be atomic vs. local interrupts and | ||
| 542 | * preemption only. | ||
| 543 | */ | ||
| 544 | #define irqsafe_cpu_generic_to_op(pcp, val, op) \ | ||
| 545 | do { \ | ||
| 546 | unsigned long flags; \ | ||
| 547 | local_irq_save(flags); \ | ||
| 548 | *__this_cpu_ptr(&(pcp)) op val; \ | ||
| 549 | local_irq_restore(flags); \ | ||
| 550 | } while (0) | ||
| 551 | |||
| 552 | #ifndef irqsafe_cpu_add | ||
| 553 | # ifndef irqsafe_cpu_add_1 | ||
| 554 | # define irqsafe_cpu_add_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=) | ||
| 555 | # endif | ||
| 556 | # ifndef irqsafe_cpu_add_2 | ||
| 557 | # define irqsafe_cpu_add_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=) | ||
| 558 | # endif | ||
| 559 | # ifndef irqsafe_cpu_add_4 | ||
| 560 | # define irqsafe_cpu_add_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=) | ||
| 561 | # endif | ||
| 562 | # ifndef irqsafe_cpu_add_8 | ||
| 563 | # define irqsafe_cpu_add_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=) | ||
| 564 | # endif | ||
| 565 | # define irqsafe_cpu_add(pcp, val) __pcpu_size_call(irqsafe_cpu_add_, (pcp), (val)) | ||
| 566 | #endif | ||
| 567 | |||
| 568 | #ifndef irqsafe_cpu_sub | ||
| 569 | # define irqsafe_cpu_sub(pcp, val) irqsafe_cpu_add((pcp), -(val)) | ||
| 570 | #endif | ||
| 571 | |||
| 572 | #ifndef irqsafe_cpu_inc | ||
| 573 | # define irqsafe_cpu_inc(pcp) irqsafe_cpu_add((pcp), 1) | ||
| 574 | #endif | ||
| 575 | |||
| 576 | #ifndef irqsafe_cpu_dec | ||
| 577 | # define irqsafe_cpu_dec(pcp) irqsafe_cpu_sub((pcp), 1) | ||
| 578 | #endif | ||
| 579 | |||
| 580 | #ifndef irqsafe_cpu_and | ||
| 581 | # ifndef irqsafe_cpu_and_1 | ||
| 582 | # define irqsafe_cpu_and_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=) | ||
| 583 | # endif | ||
| 584 | # ifndef irqsafe_cpu_and_2 | ||
| 585 | # define irqsafe_cpu_and_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=) | ||
| 586 | # endif | ||
| 587 | # ifndef irqsafe_cpu_and_4 | ||
| 588 | # define irqsafe_cpu_and_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=) | ||
| 589 | # endif | ||
| 590 | # ifndef irqsafe_cpu_and_8 | ||
| 591 | # define irqsafe_cpu_and_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=) | ||
| 592 | # endif | ||
| 593 | # define irqsafe_cpu_and(pcp, val) __pcpu_size_call(irqsafe_cpu_and_, (val)) | ||
| 594 | #endif | ||
| 595 | |||
| 596 | #ifndef irqsafe_cpu_or | ||
| 597 | # ifndef irqsafe_cpu_or_1 | ||
| 598 | # define irqsafe_cpu_or_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=) | ||
| 599 | # endif | ||
| 600 | # ifndef irqsafe_cpu_or_2 | ||
| 601 | # define irqsafe_cpu_or_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=) | ||
| 602 | # endif | ||
| 603 | # ifndef irqsafe_cpu_or_4 | ||
| 604 | # define irqsafe_cpu_or_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=) | ||
| 605 | # endif | ||
| 606 | # ifndef irqsafe_cpu_or_8 | ||
| 607 | # define irqsafe_cpu_or_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=) | ||
| 608 | # endif | ||
| 609 | # define irqsafe_cpu_or(pcp, val) __pcpu_size_call(irqsafe_cpu_or_, (val)) | ||
| 610 | #endif | ||
| 611 | |||
| 612 | #ifndef irqsafe_cpu_xor | ||
| 613 | # ifndef irqsafe_cpu_xor_1 | ||
| 614 | # define irqsafe_cpu_xor_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=) | ||
| 615 | # endif | ||
| 616 | # ifndef irqsafe_cpu_xor_2 | ||
| 617 | # define irqsafe_cpu_xor_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=) | ||
| 618 | # endif | ||
| 619 | # ifndef irqsafe_cpu_xor_4 | ||
| 620 | # define irqsafe_cpu_xor_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=) | ||
| 621 | # endif | ||
| 622 | # ifndef irqsafe_cpu_xor_8 | ||
| 623 | # define irqsafe_cpu_xor_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=) | ||
| 624 | # endif | ||
| 625 | # define irqsafe_cpu_xor(pcp, val) __pcpu_size_call(irqsafe_cpu_xor_, (val)) | ||
| 626 | #endif | ||
| 627 | |||
| 246 | #endif /* __LINUX_PERCPU_H */ | 628 | #endif /* __LINUX_PERCPU_H */ |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 43adbd7f0010..64a53f74c9a9 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -18,10 +18,6 @@ | |||
| 18 | #include <linux/ioctl.h> | 18 | #include <linux/ioctl.h> |
| 19 | #include <asm/byteorder.h> | 19 | #include <asm/byteorder.h> |
| 20 | 20 | ||
| 21 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
| 22 | #include <asm/hw_breakpoint.h> | ||
| 23 | #endif | ||
| 24 | |||
| 25 | /* | 21 | /* |
| 26 | * User-space ABI bits: | 22 | * User-space ABI bits: |
| 27 | */ | 23 | */ |
| @@ -215,12 +211,12 @@ struct perf_event_attr { | |||
| 215 | __u32 wakeup_watermark; /* bytes before wakeup */ | 211 | __u32 wakeup_watermark; /* bytes before wakeup */ |
| 216 | }; | 212 | }; |
| 217 | 213 | ||
| 218 | union { | 214 | struct { /* Hardware breakpoint info */ |
| 219 | struct { /* Hardware breakpoint info */ | 215 | __u64 bp_addr; |
| 220 | __u64 bp_addr; | 216 | __u32 bp_type; |
| 221 | __u32 bp_type; | 217 | __u32 bp_len; |
| 222 | __u32 bp_len; | 218 | __u64 __bp_reserved_1; |
| 223 | }; | 219 | __u64 __bp_reserved_2; |
| 224 | }; | 220 | }; |
| 225 | 221 | ||
| 226 | __u32 __reserved_2; | 222 | __u32 __reserved_2; |
| @@ -451,6 +447,10 @@ enum perf_callchain_context { | |||
| 451 | # include <asm/perf_event.h> | 447 | # include <asm/perf_event.h> |
| 452 | #endif | 448 | #endif |
| 453 | 449 | ||
| 450 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
| 451 | #include <asm/hw_breakpoint.h> | ||
| 452 | #endif | ||
| 453 | |||
| 454 | #include <linux/list.h> | 454 | #include <linux/list.h> |
| 455 | #include <linux/mutex.h> | 455 | #include <linux/mutex.h> |
| 456 | #include <linux/rculist.h> | 456 | #include <linux/rculist.h> |
| @@ -565,10 +565,12 @@ struct perf_pending_entry { | |||
| 565 | void (*func)(struct perf_pending_entry *); | 565 | void (*func)(struct perf_pending_entry *); |
| 566 | }; | 566 | }; |
| 567 | 567 | ||
| 568 | typedef void (*perf_callback_t)(struct perf_event *, void *); | ||
| 569 | |||
| 570 | struct perf_sample_data; | 568 | struct perf_sample_data; |
| 571 | 569 | ||
| 570 | typedef void (*perf_overflow_handler_t)(struct perf_event *, int, | ||
| 571 | struct perf_sample_data *, | ||
| 572 | struct pt_regs *regs); | ||
| 573 | |||
| 572 | /** | 574 | /** |
| 573 | * struct perf_event - performance event kernel representation: | 575 | * struct perf_event - performance event kernel representation: |
| 574 | */ | 576 | */ |
| @@ -660,18 +662,12 @@ struct perf_event { | |||
| 660 | struct pid_namespace *ns; | 662 | struct pid_namespace *ns; |
| 661 | u64 id; | 663 | u64 id; |
| 662 | 664 | ||
| 663 | void (*overflow_handler)(struct perf_event *event, | 665 | perf_overflow_handler_t overflow_handler; |
| 664 | int nmi, struct perf_sample_data *data, | ||
| 665 | struct pt_regs *regs); | ||
| 666 | 666 | ||
| 667 | #ifdef CONFIG_EVENT_PROFILE | 667 | #ifdef CONFIG_EVENT_PROFILE |
| 668 | struct event_filter *filter; | 668 | struct event_filter *filter; |
| 669 | #endif | 669 | #endif |
| 670 | 670 | ||
| 671 | perf_callback_t callback; | ||
| 672 | |||
| 673 | perf_callback_t event_callback; | ||
| 674 | |||
| 675 | #endif /* CONFIG_PERF_EVENTS */ | 671 | #endif /* CONFIG_PERF_EVENTS */ |
| 676 | }; | 672 | }; |
| 677 | 673 | ||
| @@ -781,7 +777,7 @@ extern struct perf_event * | |||
| 781 | perf_event_create_kernel_counter(struct perf_event_attr *attr, | 777 | perf_event_create_kernel_counter(struct perf_event_attr *attr, |
| 782 | int cpu, | 778 | int cpu, |
| 783 | pid_t pid, | 779 | pid_t pid, |
| 784 | perf_callback_t callback); | 780 | perf_overflow_handler_t callback); |
| 785 | extern u64 perf_event_read_value(struct perf_event *event, | 781 | extern u64 perf_event_read_value(struct perf_event *event, |
| 786 | u64 *enabled, u64 *running); | 782 | u64 *enabled, u64 *running); |
| 787 | 783 | ||
| @@ -876,6 +872,8 @@ extern void perf_output_copy(struct perf_output_handle *handle, | |||
| 876 | const void *buf, unsigned int len); | 872 | const void *buf, unsigned int len); |
| 877 | extern int perf_swevent_get_recursion_context(void); | 873 | extern int perf_swevent_get_recursion_context(void); |
| 878 | extern void perf_swevent_put_recursion_context(int rctx); | 874 | extern void perf_swevent_put_recursion_context(int rctx); |
| 875 | extern void perf_event_enable(struct perf_event *event); | ||
| 876 | extern void perf_event_disable(struct perf_event *event); | ||
| 879 | #else | 877 | #else |
| 880 | static inline void | 878 | static inline void |
| 881 | perf_event_task_sched_in(struct task_struct *task, int cpu) { } | 879 | perf_event_task_sched_in(struct task_struct *task, int cpu) { } |
| @@ -906,7 +904,8 @@ static inline void perf_event_fork(struct task_struct *tsk) { } | |||
| 906 | static inline void perf_event_init(void) { } | 904 | static inline void perf_event_init(void) { } |
| 907 | static inline int perf_swevent_get_recursion_context(void) { return -1; } | 905 | static inline int perf_swevent_get_recursion_context(void) { return -1; } |
| 908 | static inline void perf_swevent_put_recursion_context(int rctx) { } | 906 | static inline void perf_swevent_put_recursion_context(int rctx) { } |
| 909 | 907 | static inline void perf_event_enable(struct perf_event *event) { } | |
| 908 | static inline void perf_event_disable(struct perf_event *event) { } | ||
| 910 | #endif | 909 | #endif |
| 911 | 910 | ||
| 912 | #define perf_output_put(handle, x) \ | 911 | #define perf_output_put(handle, x) \ |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 3c6675c2444b..71ff887ca44e 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -83,6 +83,8 @@ struct early_platform_driver { | |||
| 83 | struct platform_driver *pdrv; | 83 | struct platform_driver *pdrv; |
| 84 | struct list_head list; | 84 | struct list_head list; |
| 85 | int requested_id; | 85 | int requested_id; |
| 86 | char *buffer; | ||
| 87 | int bufsize; | ||
| 86 | }; | 88 | }; |
| 87 | 89 | ||
| 88 | #define EARLY_PLATFORM_ID_UNSET -2 | 90 | #define EARLY_PLATFORM_ID_UNSET -2 |
| @@ -102,21 +104,29 @@ extern int early_platform_driver_probe(char *class_str, | |||
| 102 | int nr_probe, int user_only); | 104 | int nr_probe, int user_only); |
| 103 | extern void early_platform_cleanup(void); | 105 | extern void early_platform_cleanup(void); |
| 104 | 106 | ||
| 107 | #define early_platform_init(class_string, platdrv) \ | ||
| 108 | early_platform_init_buffer(class_string, platdrv, NULL, 0) | ||
| 105 | 109 | ||
| 106 | #ifndef MODULE | 110 | #ifndef MODULE |
| 107 | #define early_platform_init(class_string, platform_driver) \ | 111 | #define early_platform_init_buffer(class_string, platdrv, buf, bufsiz) \ |
| 108 | static __initdata struct early_platform_driver early_driver = { \ | 112 | static __initdata struct early_platform_driver early_driver = { \ |
| 109 | .class_str = class_string, \ | 113 | .class_str = class_string, \ |
| 110 | .pdrv = platform_driver, \ | 114 | .buffer = buf, \ |
| 115 | .bufsize = bufsiz, \ | ||
| 116 | .pdrv = platdrv, \ | ||
| 111 | .requested_id = EARLY_PLATFORM_ID_UNSET, \ | 117 | .requested_id = EARLY_PLATFORM_ID_UNSET, \ |
| 112 | }; \ | 118 | }; \ |
| 113 | static int __init early_platform_driver_setup_func(char *buf) \ | 119 | static int __init early_platform_driver_setup_func(char *buffer) \ |
| 114 | { \ | 120 | { \ |
| 115 | return early_platform_driver_register(&early_driver, buf); \ | 121 | return early_platform_driver_register(&early_driver, buffer); \ |
| 116 | } \ | 122 | } \ |
| 117 | early_param(class_string, early_platform_driver_setup_func) | 123 | early_param(class_string, early_platform_driver_setup_func) |
| 118 | #else /* MODULE */ | 124 | #else /* MODULE */ |
| 119 | #define early_platform_init(class_string, platform_driver) | 125 | #define early_platform_init_buffer(class_string, platdrv, buf, bufsiz) \ |
| 126 | static inline char *early_platform_driver_setup_func(void) \ | ||
| 127 | { \ | ||
| 128 | return bufsiz ? buf : NULL; \ | ||
| 129 | } | ||
| 120 | #endif /* MODULE */ | 130 | #endif /* MODULE */ |
| 121 | 131 | ||
| 122 | #endif /* _PLATFORM_DEVICE_H_ */ | 132 | #endif /* _PLATFORM_DEVICE_H_ */ |
diff --git a/include/linux/quota.h b/include/linux/quota.h index ce9a9b2e5cd4..e70e62194243 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
| @@ -73,6 +73,8 @@ | |||
| 73 | /* Quota format type IDs */ | 73 | /* Quota format type IDs */ |
| 74 | #define QFMT_VFS_OLD 1 | 74 | #define QFMT_VFS_OLD 1 |
| 75 | #define QFMT_VFS_V0 2 | 75 | #define QFMT_VFS_V0 2 |
| 76 | #define QFMT_OCFS2 3 | ||
| 77 | #define QFMT_VFS_V1 4 | ||
| 76 | 78 | ||
| 77 | /* Size of block in which space limits are passed through the quota | 79 | /* Size of block in which space limits are passed through the quota |
| 78 | * interface */ | 80 | * interface */ |
| @@ -334,7 +336,7 @@ struct quotactl_ops { | |||
| 334 | 336 | ||
| 335 | struct quota_format_type { | 337 | struct quota_format_type { |
| 336 | int qf_fmt_id; /* Quota format id */ | 338 | int qf_fmt_id; /* Quota format id */ |
| 337 | struct quota_format_ops *qf_ops; /* Operations of format */ | 339 | const struct quota_format_ops *qf_ops; /* Operations of format */ |
| 338 | struct module *qf_owner; /* Module implementing quota format */ | 340 | struct module *qf_owner; /* Module implementing quota format */ |
| 339 | struct quota_format_type *qf_next; | 341 | struct quota_format_type *qf_next; |
| 340 | }; | 342 | }; |
| @@ -394,7 +396,7 @@ struct quota_info { | |||
| 394 | struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */ | 396 | struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */ |
| 395 | struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */ | 397 | struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */ |
| 396 | struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ | 398 | struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ |
| 397 | struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ | 399 | const struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ |
| 398 | }; | 400 | }; |
| 399 | 401 | ||
| 400 | int register_quota_format(struct quota_format_type *fmt); | 402 | int register_quota_format(struct quota_format_type *fmt); |
diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h index d92480f8285c..1cbbd2c11aa9 100644 --- a/include/linux/raid/pq.h +++ b/include/linux/raid/pq.h | |||
| @@ -78,6 +78,25 @@ struct raid6_calls { | |||
| 78 | /* Selected algorithm */ | 78 | /* Selected algorithm */ |
| 79 | extern struct raid6_calls raid6_call; | 79 | extern struct raid6_calls raid6_call; |
| 80 | 80 | ||
| 81 | /* Various routine sets */ | ||
| 82 | extern const struct raid6_calls raid6_intx1; | ||
| 83 | extern const struct raid6_calls raid6_intx2; | ||
| 84 | extern const struct raid6_calls raid6_intx4; | ||
| 85 | extern const struct raid6_calls raid6_intx8; | ||
| 86 | extern const struct raid6_calls raid6_intx16; | ||
| 87 | extern const struct raid6_calls raid6_intx32; | ||
| 88 | extern const struct raid6_calls raid6_mmxx1; | ||
| 89 | extern const struct raid6_calls raid6_mmxx2; | ||
| 90 | extern const struct raid6_calls raid6_sse1x1; | ||
| 91 | extern const struct raid6_calls raid6_sse1x2; | ||
| 92 | extern const struct raid6_calls raid6_sse2x1; | ||
| 93 | extern const struct raid6_calls raid6_sse2x2; | ||
| 94 | extern const struct raid6_calls raid6_sse2x4; | ||
| 95 | extern const struct raid6_calls raid6_altivec1; | ||
| 96 | extern const struct raid6_calls raid6_altivec2; | ||
| 97 | extern const struct raid6_calls raid6_altivec4; | ||
| 98 | extern const struct raid6_calls raid6_altivec8; | ||
| 99 | |||
| 81 | /* Algorithm list */ | 100 | /* Algorithm list */ |
| 82 | extern const struct raid6_calls * const raid6_algos[]; | 101 | extern const struct raid6_calls * const raid6_algos[]; |
| 83 | int raid6_select_algo(void); | 102 | int raid6_select_algo(void); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 89115ec7d43f..294eb2f80144 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1102,7 +1102,7 @@ struct sched_class { | |||
| 1102 | 1102 | ||
| 1103 | void (*set_curr_task) (struct rq *rq); | 1103 | void (*set_curr_task) (struct rq *rq); |
| 1104 | void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); | 1104 | void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); |
| 1105 | void (*task_new) (struct rq *rq, struct task_struct *p); | 1105 | void (*task_fork) (struct task_struct *p); |
| 1106 | 1106 | ||
| 1107 | void (*switched_from) (struct rq *this_rq, struct task_struct *task, | 1107 | void (*switched_from) (struct rq *this_rq, struct task_struct *task, |
| 1108 | int running); | 1108 | int running); |
| @@ -1111,7 +1111,8 @@ struct sched_class { | |||
| 1111 | void (*prio_changed) (struct rq *this_rq, struct task_struct *task, | 1111 | void (*prio_changed) (struct rq *this_rq, struct task_struct *task, |
| 1112 | int oldprio, int running); | 1112 | int oldprio, int running); |
| 1113 | 1113 | ||
| 1114 | unsigned int (*get_rr_interval) (struct task_struct *task); | 1114 | unsigned int (*get_rr_interval) (struct rq *rq, |
| 1115 | struct task_struct *task); | ||
| 1115 | 1116 | ||
| 1116 | #ifdef CONFIG_FAIR_GROUP_SCHED | 1117 | #ifdef CONFIG_FAIR_GROUP_SCHED |
| 1117 | void (*moved_group) (struct task_struct *p); | 1118 | void (*moved_group) (struct task_struct *p); |
| @@ -1151,8 +1152,6 @@ struct sched_entity { | |||
| 1151 | u64 start_runtime; | 1152 | u64 start_runtime; |
| 1152 | u64 avg_wakeup; | 1153 | u64 avg_wakeup; |
| 1153 | 1154 | ||
| 1154 | u64 avg_running; | ||
| 1155 | |||
| 1156 | #ifdef CONFIG_SCHEDSTATS | 1155 | #ifdef CONFIG_SCHEDSTATS |
| 1157 | u64 wait_start; | 1156 | u64 wait_start; |
| 1158 | u64 wait_max; | 1157 | u64 wait_max; |
| @@ -1175,7 +1174,6 @@ struct sched_entity { | |||
| 1175 | u64 nr_failed_migrations_running; | 1174 | u64 nr_failed_migrations_running; |
| 1176 | u64 nr_failed_migrations_hot; | 1175 | u64 nr_failed_migrations_hot; |
| 1177 | u64 nr_forced_migrations; | 1176 | u64 nr_forced_migrations; |
| 1178 | u64 nr_forced2_migrations; | ||
| 1179 | 1177 | ||
| 1180 | u64 nr_wakeups; | 1178 | u64 nr_wakeups; |
| 1181 | u64 nr_wakeups_sync; | 1179 | u64 nr_wakeups_sync; |
| @@ -1840,7 +1838,8 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) | |||
| 1840 | extern int sched_clock_stable; | 1838 | extern int sched_clock_stable; |
| 1841 | #endif | 1839 | #endif |
| 1842 | 1840 | ||
| 1843 | extern unsigned long long sched_clock(void); | 1841 | /* ftrace calls sched_clock() directly */ |
| 1842 | extern unsigned long long notrace sched_clock(void); | ||
| 1844 | 1843 | ||
| 1845 | extern void sched_clock_init(void); | 1844 | extern void sched_clock_init(void); |
| 1846 | extern u64 sched_clock_cpu(int cpu); | 1845 | extern u64 sched_clock_cpu(int cpu); |
| @@ -1903,14 +1902,22 @@ extern unsigned int sysctl_sched_wakeup_granularity; | |||
| 1903 | extern unsigned int sysctl_sched_shares_ratelimit; | 1902 | extern unsigned int sysctl_sched_shares_ratelimit; |
| 1904 | extern unsigned int sysctl_sched_shares_thresh; | 1903 | extern unsigned int sysctl_sched_shares_thresh; |
| 1905 | extern unsigned int sysctl_sched_child_runs_first; | 1904 | extern unsigned int sysctl_sched_child_runs_first; |
| 1905 | |||
| 1906 | enum sched_tunable_scaling { | ||
| 1907 | SCHED_TUNABLESCALING_NONE, | ||
| 1908 | SCHED_TUNABLESCALING_LOG, | ||
| 1909 | SCHED_TUNABLESCALING_LINEAR, | ||
| 1910 | SCHED_TUNABLESCALING_END, | ||
| 1911 | }; | ||
| 1912 | extern enum sched_tunable_scaling sysctl_sched_tunable_scaling; | ||
| 1913 | |||
| 1906 | #ifdef CONFIG_SCHED_DEBUG | 1914 | #ifdef CONFIG_SCHED_DEBUG |
| 1907 | extern unsigned int sysctl_sched_features; | ||
| 1908 | extern unsigned int sysctl_sched_migration_cost; | 1915 | extern unsigned int sysctl_sched_migration_cost; |
| 1909 | extern unsigned int sysctl_sched_nr_migrate; | 1916 | extern unsigned int sysctl_sched_nr_migrate; |
| 1910 | extern unsigned int sysctl_sched_time_avg; | 1917 | extern unsigned int sysctl_sched_time_avg; |
| 1911 | extern unsigned int sysctl_timer_migration; | 1918 | extern unsigned int sysctl_timer_migration; |
| 1912 | 1919 | ||
| 1913 | int sched_nr_latency_handler(struct ctl_table *table, int write, | 1920 | int sched_proc_update_handler(struct ctl_table *table, int write, |
| 1914 | void __user *buffer, size_t *length, | 1921 | void __user *buffer, size_t *length, |
| 1915 | loff_t *ppos); | 1922 | loff_t *ppos); |
| 1916 | #endif | 1923 | #endif |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 850d057500de..ca6b2b317991 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
| @@ -110,7 +110,7 @@ extern struct cache_sizes malloc_sizes[]; | |||
| 110 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | 110 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); |
| 111 | void *__kmalloc(size_t size, gfp_t flags); | 111 | void *__kmalloc(size_t size, gfp_t flags); |
| 112 | 112 | ||
| 113 | #ifdef CONFIG_KMEMTRACE | 113 | #ifdef CONFIG_TRACING |
| 114 | extern void *kmem_cache_alloc_notrace(struct kmem_cache *cachep, gfp_t flags); | 114 | extern void *kmem_cache_alloc_notrace(struct kmem_cache *cachep, gfp_t flags); |
| 115 | extern size_t slab_buffer_size(struct kmem_cache *cachep); | 115 | extern size_t slab_buffer_size(struct kmem_cache *cachep); |
| 116 | #else | 116 | #else |
| @@ -166,7 +166,7 @@ found: | |||
| 166 | extern void *__kmalloc_node(size_t size, gfp_t flags, int node); | 166 | extern void *__kmalloc_node(size_t size, gfp_t flags, int node); |
| 167 | extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | 167 | extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); |
| 168 | 168 | ||
| 169 | #ifdef CONFIG_KMEMTRACE | 169 | #ifdef CONFIG_TRACING |
| 170 | extern void *kmem_cache_alloc_node_notrace(struct kmem_cache *cachep, | 170 | extern void *kmem_cache_alloc_node_notrace(struct kmem_cache *cachep, |
| 171 | gfp_t flags, | 171 | gfp_t flags, |
| 172 | int nodeid); | 172 | int nodeid); |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 5ad70a60fd74..1e14beb23f9b 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
| @@ -217,7 +217,7 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size) | |||
| 217 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | 217 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); |
| 218 | void *__kmalloc(size_t size, gfp_t flags); | 218 | void *__kmalloc(size_t size, gfp_t flags); |
| 219 | 219 | ||
| 220 | #ifdef CONFIG_KMEMTRACE | 220 | #ifdef CONFIG_TRACING |
| 221 | extern void *kmem_cache_alloc_notrace(struct kmem_cache *s, gfp_t gfpflags); | 221 | extern void *kmem_cache_alloc_notrace(struct kmem_cache *s, gfp_t gfpflags); |
| 222 | #else | 222 | #else |
| 223 | static __always_inline void * | 223 | static __always_inline void * |
| @@ -266,7 +266,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags) | |||
| 266 | void *__kmalloc_node(size_t size, gfp_t flags, int node); | 266 | void *__kmalloc_node(size_t size, gfp_t flags, int node); |
| 267 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | 267 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); |
| 268 | 268 | ||
| 269 | #ifdef CONFIG_KMEMTRACE | 269 | #ifdef CONFIG_TRACING |
| 270 | extern void *kmem_cache_alloc_node_notrace(struct kmem_cache *s, | 270 | extern void *kmem_cache_alloc_node_notrace(struct kmem_cache *s, |
| 271 | gfp_t gfpflags, | 271 | gfp_t gfpflags, |
| 272 | int node); | 272 | int node); |
diff --git a/include/linux/spi/sh_msiof.h b/include/linux/spi/sh_msiof.h new file mode 100644 index 000000000000..2e8db3d2d2e5 --- /dev/null +++ b/include/linux/spi/sh_msiof.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef __SPI_SH_MSIOF_H__ | ||
| 2 | #define __SPI_SH_MSIOF_H__ | ||
| 3 | |||
| 4 | struct sh_msiof_spi_info { | ||
| 5 | int tx_fifo_override; | ||
| 6 | int rx_fifo_override; | ||
| 7 | u16 num_chipselect; | ||
| 8 | }; | ||
| 9 | |||
| 10 | #endif /* __SPI_SH_MSIOF_H__ */ | ||
diff --git a/include/linux/spi/xilinx_spi.h b/include/linux/spi/xilinx_spi.h new file mode 100644 index 000000000000..6f17278810b0 --- /dev/null +++ b/include/linux/spi/xilinx_spi.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | #ifndef __LINUX_SPI_XILINX_SPI_H | ||
| 2 | #define __LINUX_SPI_XILINX_SPI_H | ||
| 3 | |||
| 4 | /** | ||
| 5 | * struct xspi_platform_data - Platform data of the Xilinx SPI driver | ||
| 6 | * @num_chipselect: Number of chip select by the IP. | ||
| 7 | * @little_endian: If registers should be accessed little endian or not. | ||
| 8 | * @bits_per_word: Number of bits per word. | ||
| 9 | * @devices: Devices to add when the driver is probed. | ||
| 10 | * @num_devices: Number of devices in the devices array. | ||
| 11 | */ | ||
| 12 | struct xspi_platform_data { | ||
| 13 | u16 num_chipselect; | ||
| 14 | bool little_endian; | ||
| 15 | u8 bits_per_word; | ||
| 16 | struct spi_board_info *devices; | ||
| 17 | u8 num_devices; | ||
| 18 | }; | ||
| 19 | |||
| 20 | #endif /* __LINUX_SPI_XILINX_SPI_H */ | ||
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 401097781fc0..1906782ec86b 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
| @@ -130,12 +130,14 @@ struct rpc_task_setup { | |||
| 130 | #define RPC_TASK_DYNAMIC 0x0080 /* task was kmalloc'ed */ | 130 | #define RPC_TASK_DYNAMIC 0x0080 /* task was kmalloc'ed */ |
| 131 | #define RPC_TASK_KILLED 0x0100 /* task was killed */ | 131 | #define RPC_TASK_KILLED 0x0100 /* task was killed */ |
| 132 | #define RPC_TASK_SOFT 0x0200 /* Use soft timeouts */ | 132 | #define RPC_TASK_SOFT 0x0200 /* Use soft timeouts */ |
| 133 | #define RPC_TASK_SOFTCONN 0x0400 /* Fail if can't connect */ | ||
| 133 | 134 | ||
| 134 | #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) | 135 | #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) |
| 135 | #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) | 136 | #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) |
| 136 | #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) | 137 | #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) |
| 137 | #define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) | 138 | #define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) |
| 138 | #define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT) | 139 | #define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT) |
| 140 | #define RPC_IS_SOFTCONN(t) ((t)->tk_flags & RPC_TASK_SOFTCONN) | ||
| 139 | 141 | ||
| 140 | #define RPC_TASK_RUNNING 0 | 142 | #define RPC_TASK_RUNNING 0 |
| 141 | #define RPC_TASK_QUEUED 1 | 143 | #define RPC_TASK_QUEUED 1 |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index bc70c5810fec..939a61507ac5 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -834,4 +834,8 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | |||
| 834 | asmlinkage long sys_perf_event_open( | 834 | asmlinkage long sys_perf_event_open( |
| 835 | struct perf_event_attr __user *attr_uptr, | 835 | struct perf_event_attr __user *attr_uptr, |
| 836 | pid_t pid, int cpu, int group_fd, unsigned long flags); | 836 | pid_t pid, int cpu, int group_fd, unsigned long flags); |
| 837 | |||
| 838 | asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len, | ||
| 839 | unsigned long prot, unsigned long flags, | ||
| 840 | unsigned long fd, unsigned long pgoff); | ||
| 837 | #endif | 841 | #endif |
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h index 09077f6ed128..5cf397ceb726 100644 --- a/include/linux/trace_seq.h +++ b/include/linux/trace_seq.h | |||
| @@ -14,6 +14,7 @@ struct trace_seq { | |||
| 14 | unsigned char buffer[PAGE_SIZE]; | 14 | unsigned char buffer[PAGE_SIZE]; |
| 15 | unsigned int len; | 15 | unsigned int len; |
| 16 | unsigned int readpos; | 16 | unsigned int readpos; |
| 17 | int full; | ||
| 17 | }; | 18 | }; |
| 18 | 19 | ||
| 19 | static inline void | 20 | static inline void |
| @@ -21,6 +22,7 @@ trace_seq_init(struct trace_seq *s) | |||
| 21 | { | 22 | { |
| 22 | s->len = 0; | 23 | s->len = 0; |
| 23 | s->readpos = 0; | 24 | s->readpos = 0; |
| 25 | s->full = 0; | ||
| 24 | } | 26 | } |
| 25 | 27 | ||
| 26 | /* | 28 | /* |
| @@ -33,7 +35,7 @@ extern int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args) | |||
| 33 | __attribute__ ((format (printf, 2, 0))); | 35 | __attribute__ ((format (printf, 2, 0))); |
| 34 | extern int | 36 | extern int |
| 35 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); | 37 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); |
| 36 | extern void trace_print_seq(struct seq_file *m, struct trace_seq *s); | 38 | extern int trace_print_seq(struct seq_file *m, struct trace_seq *s); |
| 37 | extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, | 39 | extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, |
| 38 | size_t cnt); | 40 | size_t cnt); |
| 39 | extern int trace_seq_puts(struct trace_seq *s, const char *str); | 41 | extern int trace_seq_puts(struct trace_seq *s, const char *str); |
| @@ -55,8 +57,9 @@ trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary) | |||
| 55 | return 0; | 57 | return 0; |
| 56 | } | 58 | } |
| 57 | 59 | ||
| 58 | static inline void trace_print_seq(struct seq_file *m, struct trace_seq *s) | 60 | static inline int trace_print_seq(struct seq_file *m, struct trace_seq *s) |
| 59 | { | 61 | { |
| 62 | return 0; | ||
| 60 | } | 63 | } |
| 61 | static inline ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, | 64 | static inline ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, |
| 62 | size_t cnt) | 65 | size_t cnt) |
diff --git a/include/linux/tty.h b/include/linux/tty.h index f0f43d08d8b8..405a9035fe40 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -190,9 +190,17 @@ struct tty_port_operations { | |||
| 190 | /* Control the DTR line */ | 190 | /* Control the DTR line */ |
| 191 | void (*dtr_rts)(struct tty_port *port, int raise); | 191 | void (*dtr_rts)(struct tty_port *port, int raise); |
| 192 | /* Called when the last close completes or a hangup finishes | 192 | /* Called when the last close completes or a hangup finishes |
| 193 | IFF the port was initialized. Do not use to free resources */ | 193 | IFF the port was initialized. Do not use to free resources. Called |
| 194 | under the port mutex to serialize against activate/shutdowns */ | ||
| 194 | void (*shutdown)(struct tty_port *port); | 195 | void (*shutdown)(struct tty_port *port); |
| 195 | void (*drop)(struct tty_port *port); | 196 | void (*drop)(struct tty_port *port); |
| 197 | /* Called under the port mutex from tty_port_open, serialized using | ||
| 198 | the port mutex */ | ||
| 199 | /* FIXME: long term getting the tty argument *out* of this would be | ||
| 200 | good for consoles */ | ||
| 201 | int (*activate)(struct tty_port *port, struct tty_struct *tty); | ||
| 202 | /* Called on the final put of a port */ | ||
| 203 | void (*destruct)(struct tty_port *port); | ||
| 196 | }; | 204 | }; |
| 197 | 205 | ||
| 198 | struct tty_port { | 206 | struct tty_port { |
| @@ -206,12 +214,14 @@ struct tty_port { | |||
| 206 | wait_queue_head_t delta_msr_wait; /* Modem status change */ | 214 | wait_queue_head_t delta_msr_wait; /* Modem status change */ |
| 207 | unsigned long flags; /* TTY flags ASY_*/ | 215 | unsigned long flags; /* TTY flags ASY_*/ |
| 208 | struct mutex mutex; /* Locking */ | 216 | struct mutex mutex; /* Locking */ |
| 217 | struct mutex buf_mutex; /* Buffer alloc lock */ | ||
| 209 | unsigned char *xmit_buf; /* Optional buffer */ | 218 | unsigned char *xmit_buf; /* Optional buffer */ |
| 210 | unsigned int close_delay; /* Close port delay */ | 219 | unsigned int close_delay; /* Close port delay */ |
| 211 | unsigned int closing_wait; /* Delay for output */ | 220 | unsigned int closing_wait; /* Delay for output */ |
| 212 | int drain_delay; /* Set to zero if no pure time | 221 | int drain_delay; /* Set to zero if no pure time |
| 213 | based drain is needed else | 222 | based drain is needed else |
| 214 | set to size of fifo */ | 223 | set to size of fifo */ |
| 224 | struct kref kref; /* Ref counter */ | ||
| 215 | }; | 225 | }; |
| 216 | 226 | ||
| 217 | /* | 227 | /* |
| @@ -439,7 +449,7 @@ extern void initialize_tty_struct(struct tty_struct *tty, | |||
| 439 | struct tty_driver *driver, int idx); | 449 | struct tty_driver *driver, int idx); |
| 440 | extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx, | 450 | extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx, |
| 441 | int first_ok); | 451 | int first_ok); |
| 442 | extern void tty_release_dev(struct file *filp); | 452 | extern int tty_release(struct inode *inode, struct file *filp); |
| 443 | extern int tty_init_termios(struct tty_struct *tty); | 453 | extern int tty_init_termios(struct tty_struct *tty); |
| 444 | 454 | ||
| 445 | extern struct tty_struct *tty_pair_get_tty(struct tty_struct *tty); | 455 | extern struct tty_struct *tty_pair_get_tty(struct tty_struct *tty); |
| @@ -454,6 +464,15 @@ extern int tty_write_lock(struct tty_struct *tty, int ndelay); | |||
| 454 | extern void tty_port_init(struct tty_port *port); | 464 | extern void tty_port_init(struct tty_port *port); |
| 455 | extern int tty_port_alloc_xmit_buf(struct tty_port *port); | 465 | extern int tty_port_alloc_xmit_buf(struct tty_port *port); |
| 456 | extern void tty_port_free_xmit_buf(struct tty_port *port); | 466 | extern void tty_port_free_xmit_buf(struct tty_port *port); |
| 467 | extern void tty_port_put(struct tty_port *port); | ||
| 468 | |||
| 469 | extern inline struct tty_port *tty_port_get(struct tty_port *port) | ||
| 470 | { | ||
| 471 | if (port) | ||
| 472 | kref_get(&port->kref); | ||
| 473 | return port; | ||
| 474 | } | ||
| 475 | |||
| 457 | extern struct tty_struct *tty_port_tty_get(struct tty_port *port); | 476 | extern struct tty_struct *tty_port_tty_get(struct tty_port *port); |
| 458 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); | 477 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); |
| 459 | extern int tty_port_carrier_raised(struct tty_port *port); | 478 | extern int tty_port_carrier_raised(struct tty_port *port); |
| @@ -467,6 +486,8 @@ extern int tty_port_close_start(struct tty_port *port, | |||
| 467 | extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); | 486 | extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); |
| 468 | extern void tty_port_close(struct tty_port *port, | 487 | extern void tty_port_close(struct tty_port *port, |
| 469 | struct tty_struct *tty, struct file *filp); | 488 | struct tty_struct *tty, struct file *filp); |
| 489 | extern int tty_port_open(struct tty_port *port, | ||
| 490 | struct tty_struct *tty, struct file *filp); | ||
| 470 | extern inline int tty_port_users(struct tty_port *port) | 491 | extern inline int tty_port_users(struct tty_port *port) |
| 471 | { | 492 | { |
| 472 | return port->count + port->blocked_open; | 493 | return port->count + port->blocked_open; |
diff --git a/include/linux/usb.h b/include/linux/usb.h index a34fa89f1474..e101a2d04d75 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -331,6 +331,7 @@ struct usb_bus { | |||
| 331 | u8 otg_port; /* 0, or number of OTG/HNP port */ | 331 | u8 otg_port; /* 0, or number of OTG/HNP port */ |
| 332 | unsigned is_b_host:1; /* true during some HNP roleswitches */ | 332 | unsigned is_b_host:1; /* true during some HNP roleswitches */ |
| 333 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ | 333 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ |
| 334 | unsigned sg_tablesize; /* 0 or largest number of sg list entries */ | ||
| 334 | 335 | ||
| 335 | int devnum_next; /* Next open device number in | 336 | int devnum_next; /* Next open device number in |
| 336 | * round-robin allocation */ | 337 | * round-robin allocation */ |
| @@ -428,11 +429,9 @@ struct usb_tt; | |||
| 428 | * @last_busy: time of last use | 429 | * @last_busy: time of last use |
| 429 | * @autosuspend_delay: in jiffies | 430 | * @autosuspend_delay: in jiffies |
| 430 | * @connect_time: time device was first connected | 431 | * @connect_time: time device was first connected |
| 431 | * @auto_pm: autosuspend/resume in progress | ||
| 432 | * @do_remote_wakeup: remote wakeup should be enabled | 432 | * @do_remote_wakeup: remote wakeup should be enabled |
| 433 | * @reset_resume: needs reset instead of resume | 433 | * @reset_resume: needs reset instead of resume |
| 434 | * @autosuspend_disabled: autosuspend disabled by the user | 434 | * @autosuspend_disabled: autosuspend disabled by the user |
| 435 | * @autoresume_disabled: autoresume disabled by the user | ||
| 436 | * @skip_sys_resume: skip the next system resume | 435 | * @skip_sys_resume: skip the next system resume |
| 437 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB | 436 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB |
| 438 | * specific data for the device. | 437 | * specific data for the device. |
| @@ -513,11 +512,9 @@ struct usb_device { | |||
| 513 | int autosuspend_delay; | 512 | int autosuspend_delay; |
| 514 | unsigned long connect_time; | 513 | unsigned long connect_time; |
| 515 | 514 | ||
| 516 | unsigned auto_pm:1; | ||
| 517 | unsigned do_remote_wakeup:1; | 515 | unsigned do_remote_wakeup:1; |
| 518 | unsigned reset_resume:1; | 516 | unsigned reset_resume:1; |
| 519 | unsigned autosuspend_disabled:1; | 517 | unsigned autosuspend_disabled:1; |
| 520 | unsigned autoresume_disabled:1; | ||
| 521 | unsigned skip_sys_resume:1; | 518 | unsigned skip_sys_resume:1; |
| 522 | #endif | 519 | #endif |
| 523 | struct wusb_dev *wusb_dev; | 520 | struct wusb_dev *wusb_dev; |
| @@ -543,22 +540,20 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | |||
| 543 | 540 | ||
| 544 | /* USB autosuspend and autoresume */ | 541 | /* USB autosuspend and autoresume */ |
| 545 | #ifdef CONFIG_USB_SUSPEND | 542 | #ifdef CONFIG_USB_SUSPEND |
| 546 | extern int usb_autopm_set_interface(struct usb_interface *intf); | ||
| 547 | extern int usb_autopm_get_interface(struct usb_interface *intf); | 543 | extern int usb_autopm_get_interface(struct usb_interface *intf); |
| 548 | extern void usb_autopm_put_interface(struct usb_interface *intf); | 544 | extern void usb_autopm_put_interface(struct usb_interface *intf); |
| 549 | extern int usb_autopm_get_interface_async(struct usb_interface *intf); | 545 | extern int usb_autopm_get_interface_async(struct usb_interface *intf); |
| 550 | extern void usb_autopm_put_interface_async(struct usb_interface *intf); | 546 | extern void usb_autopm_put_interface_async(struct usb_interface *intf); |
| 551 | 547 | ||
| 552 | static inline void usb_autopm_enable(struct usb_interface *intf) | 548 | static inline void usb_autopm_get_interface_no_resume( |
| 549 | struct usb_interface *intf) | ||
| 553 | { | 550 | { |
| 554 | atomic_set(&intf->pm_usage_cnt, 0); | 551 | atomic_inc(&intf->pm_usage_cnt); |
| 555 | usb_autopm_set_interface(intf); | ||
| 556 | } | 552 | } |
| 557 | 553 | static inline void usb_autopm_put_interface_no_suspend( | |
| 558 | static inline void usb_autopm_disable(struct usb_interface *intf) | 554 | struct usb_interface *intf) |
| 559 | { | 555 | { |
| 560 | atomic_set(&intf->pm_usage_cnt, 1); | 556 | atomic_dec(&intf->pm_usage_cnt); |
| 561 | usb_autopm_set_interface(intf); | ||
| 562 | } | 557 | } |
| 563 | 558 | ||
| 564 | static inline void usb_mark_last_busy(struct usb_device *udev) | 559 | static inline void usb_mark_last_busy(struct usb_device *udev) |
| @@ -568,12 +563,8 @@ static inline void usb_mark_last_busy(struct usb_device *udev) | |||
| 568 | 563 | ||
| 569 | #else | 564 | #else |
| 570 | 565 | ||
| 571 | static inline int usb_autopm_set_interface(struct usb_interface *intf) | ||
| 572 | { return 0; } | ||
| 573 | |||
| 574 | static inline int usb_autopm_get_interface(struct usb_interface *intf) | 566 | static inline int usb_autopm_get_interface(struct usb_interface *intf) |
| 575 | { return 0; } | 567 | { return 0; } |
| 576 | |||
| 577 | static inline int usb_autopm_get_interface_async(struct usb_interface *intf) | 568 | static inline int usb_autopm_get_interface_async(struct usb_interface *intf) |
| 578 | { return 0; } | 569 | { return 0; } |
| 579 | 570 | ||
| @@ -581,9 +572,11 @@ static inline void usb_autopm_put_interface(struct usb_interface *intf) | |||
| 581 | { } | 572 | { } |
| 582 | static inline void usb_autopm_put_interface_async(struct usb_interface *intf) | 573 | static inline void usb_autopm_put_interface_async(struct usb_interface *intf) |
| 583 | { } | 574 | { } |
| 584 | static inline void usb_autopm_enable(struct usb_interface *intf) | 575 | static inline void usb_autopm_get_interface_no_resume( |
| 576 | struct usb_interface *intf) | ||
| 585 | { } | 577 | { } |
| 586 | static inline void usb_autopm_disable(struct usb_interface *intf) | 578 | static inline void usb_autopm_put_interface_no_suspend( |
| 579 | struct usb_interface *intf) | ||
| 587 | { } | 580 | { } |
| 588 | static inline void usb_mark_last_busy(struct usb_device *udev) | 581 | static inline void usb_mark_last_busy(struct usb_device *udev) |
| 589 | { } | 582 | { } |
| @@ -626,6 +619,10 @@ extern struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev, | |||
| 626 | unsigned ifnum); | 619 | unsigned ifnum); |
| 627 | extern struct usb_host_interface *usb_altnum_to_altsetting( | 620 | extern struct usb_host_interface *usb_altnum_to_altsetting( |
| 628 | const struct usb_interface *intf, unsigned int altnum); | 621 | const struct usb_interface *intf, unsigned int altnum); |
| 622 | extern struct usb_host_interface *usb_find_alt_setting( | ||
| 623 | struct usb_host_config *config, | ||
| 624 | unsigned int iface_num, | ||
| 625 | unsigned int alt_num); | ||
| 629 | 626 | ||
| 630 | 627 | ||
| 631 | /** | 628 | /** |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 4f6bb3d2160e..738ea1a691cb 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
| @@ -127,6 +127,7 @@ struct usb_function { | |||
| 127 | /* private: */ | 127 | /* private: */ |
| 128 | /* internals */ | 128 | /* internals */ |
| 129 | struct list_head list; | 129 | struct list_head list; |
| 130 | DECLARE_BITMAP(endpoints, 32); | ||
| 130 | }; | 131 | }; |
| 131 | 132 | ||
| 132 | int usb_add_function(struct usb_configuration *, struct usb_function *); | 133 | int usb_add_function(struct usb_configuration *, struct usb_function *); |
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 2443c0e7a80c..52bb917641f0 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
| @@ -33,6 +33,23 @@ enum usb_otg_state { | |||
| 33 | OTG_STATE_A_VBUS_ERR, | 33 | OTG_STATE_A_VBUS_ERR, |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | #define USB_OTG_PULLUP_ID (1 << 0) | ||
| 37 | #define USB_OTG_PULLDOWN_DP (1 << 1) | ||
| 38 | #define USB_OTG_PULLDOWN_DM (1 << 2) | ||
| 39 | #define USB_OTG_EXT_VBUS_INDICATOR (1 << 3) | ||
| 40 | #define USB_OTG_DRV_VBUS (1 << 4) | ||
| 41 | #define USB_OTG_DRV_VBUS_EXT (1 << 5) | ||
| 42 | |||
| 43 | struct otg_transceiver; | ||
| 44 | |||
| 45 | /* for transceivers connected thru an ULPI interface, the user must | ||
| 46 | * provide access ops | ||
| 47 | */ | ||
| 48 | struct otg_io_access_ops { | ||
| 49 | int (*read)(struct otg_transceiver *otg, u32 reg); | ||
| 50 | int (*write)(struct otg_transceiver *otg, u32 val, u32 reg); | ||
| 51 | }; | ||
| 52 | |||
| 36 | /* | 53 | /* |
| 37 | * the otg driver needs to interact with both device side and host side | 54 | * the otg driver needs to interact with both device side and host side |
| 38 | * usb controllers. it decides which controller is active at a given | 55 | * usb controllers. it decides which controller is active at a given |
| @@ -42,6 +59,7 @@ enum usb_otg_state { | |||
| 42 | struct otg_transceiver { | 59 | struct otg_transceiver { |
| 43 | struct device *dev; | 60 | struct device *dev; |
| 44 | const char *label; | 61 | const char *label; |
| 62 | unsigned int flags; | ||
| 45 | 63 | ||
| 46 | u8 default_a; | 64 | u8 default_a; |
| 47 | enum usb_otg_state state; | 65 | enum usb_otg_state state; |
| @@ -49,10 +67,17 @@ struct otg_transceiver { | |||
| 49 | struct usb_bus *host; | 67 | struct usb_bus *host; |
| 50 | struct usb_gadget *gadget; | 68 | struct usb_gadget *gadget; |
| 51 | 69 | ||
| 70 | struct otg_io_access_ops *io_ops; | ||
| 71 | void __iomem *io_priv; | ||
| 72 | |||
| 52 | /* to pass extra port status to the root hub */ | 73 | /* to pass extra port status to the root hub */ |
| 53 | u16 port_status; | 74 | u16 port_status; |
| 54 | u16 port_change; | 75 | u16 port_change; |
| 55 | 76 | ||
| 77 | /* initialize/shutdown the OTG controller */ | ||
| 78 | int (*init)(struct otg_transceiver *otg); | ||
| 79 | void (*shutdown)(struct otg_transceiver *otg); | ||
| 80 | |||
| 56 | /* bind/unbind the host controller */ | 81 | /* bind/unbind the host controller */ |
| 57 | int (*set_host)(struct otg_transceiver *otg, | 82 | int (*set_host)(struct otg_transceiver *otg, |
| 58 | struct usb_bus *host); | 83 | struct usb_bus *host); |
| @@ -65,6 +90,10 @@ struct otg_transceiver { | |||
| 65 | int (*set_power)(struct otg_transceiver *otg, | 90 | int (*set_power)(struct otg_transceiver *otg, |
| 66 | unsigned mA); | 91 | unsigned mA); |
| 67 | 92 | ||
| 93 | /* effective for A-peripheral, ignored for B devices */ | ||
| 94 | int (*set_vbus)(struct otg_transceiver *otg, | ||
| 95 | bool enabled); | ||
| 96 | |||
| 68 | /* for non-OTG B devices: set transceiver into suspend mode */ | 97 | /* for non-OTG B devices: set transceiver into suspend mode */ |
| 69 | int (*set_suspend)(struct otg_transceiver *otg, | 98 | int (*set_suspend)(struct otg_transceiver *otg, |
| 70 | int suspend); | 99 | int suspend); |
| @@ -85,6 +114,38 @@ extern int otg_set_transceiver(struct otg_transceiver *); | |||
| 85 | extern void usb_nop_xceiv_register(void); | 114 | extern void usb_nop_xceiv_register(void); |
| 86 | extern void usb_nop_xceiv_unregister(void); | 115 | extern void usb_nop_xceiv_unregister(void); |
| 87 | 116 | ||
| 117 | /* helpers for direct access thru low-level io interface */ | ||
| 118 | static inline int otg_io_read(struct otg_transceiver *otg, u32 reg) | ||
| 119 | { | ||
| 120 | if (otg->io_ops && otg->io_ops->read) | ||
| 121 | return otg->io_ops->read(otg, reg); | ||
| 122 | |||
| 123 | return -EINVAL; | ||
| 124 | } | ||
| 125 | |||
| 126 | static inline int otg_io_write(struct otg_transceiver *otg, u32 reg, u32 val) | ||
| 127 | { | ||
| 128 | if (otg->io_ops && otg->io_ops->write) | ||
| 129 | return otg->io_ops->write(otg, reg, val); | ||
| 130 | |||
| 131 | return -EINVAL; | ||
| 132 | } | ||
| 133 | |||
| 134 | static inline int | ||
| 135 | otg_init(struct otg_transceiver *otg) | ||
| 136 | { | ||
| 137 | if (otg->init) | ||
| 138 | return otg->init(otg); | ||
| 139 | |||
| 140 | return 0; | ||
| 141 | } | ||
| 142 | |||
| 143 | static inline void | ||
| 144 | otg_shutdown(struct otg_transceiver *otg) | ||
| 145 | { | ||
| 146 | if (otg->shutdown) | ||
| 147 | otg->shutdown(otg); | ||
| 148 | } | ||
| 88 | 149 | ||
| 89 | /* for usb host and peripheral controller drivers */ | 150 | /* for usb host and peripheral controller drivers */ |
| 90 | extern struct otg_transceiver *otg_get_transceiver(void); | 151 | extern struct otg_transceiver *otg_get_transceiver(void); |
| @@ -97,6 +158,12 @@ otg_start_hnp(struct otg_transceiver *otg) | |||
| 97 | return otg->start_hnp(otg); | 158 | return otg->start_hnp(otg); |
| 98 | } | 159 | } |
| 99 | 160 | ||
| 161 | /* Context: can sleep */ | ||
| 162 | static inline int | ||
| 163 | otg_set_vbus(struct otg_transceiver *otg, bool enabled) | ||
| 164 | { | ||
| 165 | return otg->set_vbus(otg, enabled); | ||
| 166 | } | ||
| 100 | 167 | ||
| 101 | /* for HCDs */ | 168 | /* for HCDs */ |
| 102 | static inline int | 169 | static inline int |
| @@ -105,7 +172,6 @@ otg_set_host(struct otg_transceiver *otg, struct usb_bus *host) | |||
| 105 | return otg->set_host(otg, host); | 172 | return otg->set_host(otg, host); |
| 106 | } | 173 | } |
| 107 | 174 | ||
| 108 | |||
| 109 | /* for usb peripheral controller drivers */ | 175 | /* for usb peripheral controller drivers */ |
| 110 | 176 | ||
| 111 | /* Context: can sleep */ | 177 | /* Context: can sleep */ |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index ce911ebf91e8..acf6e457c04b 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
| @@ -39,8 +39,6 @@ enum port_dev_state { | |||
| 39 | * @serial: pointer back to the struct usb_serial owner of this port. | 39 | * @serial: pointer back to the struct usb_serial owner of this port. |
| 40 | * @port: pointer to the corresponding tty_port for this port. | 40 | * @port: pointer to the corresponding tty_port for this port. |
| 41 | * @lock: spinlock to grab when updating portions of this structure. | 41 | * @lock: spinlock to grab when updating portions of this structure. |
| 42 | * @mutex: mutex used to synchronize serial_open() and serial_close() | ||
| 43 | * access for this port. | ||
| 44 | * @number: the number of the port (the minor number). | 42 | * @number: the number of the port (the minor number). |
| 45 | * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. | 43 | * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. |
| 46 | * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. | 44 | * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. |
| @@ -77,7 +75,6 @@ struct usb_serial_port { | |||
| 77 | struct usb_serial *serial; | 75 | struct usb_serial *serial; |
| 78 | struct tty_port port; | 76 | struct tty_port port; |
| 79 | spinlock_t lock; | 77 | spinlock_t lock; |
| 80 | struct mutex mutex; | ||
| 81 | unsigned char number; | 78 | unsigned char number; |
| 82 | 79 | ||
| 83 | unsigned char *interrupt_in_buffer; | 80 | unsigned char *interrupt_in_buffer; |
diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h new file mode 100644 index 000000000000..20675c6ebc4d --- /dev/null +++ b/include/linux/usb/ulpi.h | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #ifndef __LINUX_USB_ULPI_H | ||
| 2 | #define __LINUX_USB_ULPI_H | ||
| 3 | |||
| 4 | struct otg_transceiver *otg_ulpi_create(struct otg_io_access_ops *ops, | ||
| 5 | unsigned int flags); | ||
| 6 | |||
| 7 | #endif /* __LINUX_USB_ULPI_H */ | ||
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index 3d15fb9bc116..a4b947e470a5 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
| @@ -56,7 +56,9 @@ | |||
| 56 | US_FLAG(SANE_SENSE, 0x00008000) \ | 56 | US_FLAG(SANE_SENSE, 0x00008000) \ |
| 57 | /* Sane Sense (> 18 bytes) */ \ | 57 | /* Sane Sense (> 18 bytes) */ \ |
| 58 | US_FLAG(CAPACITY_OK, 0x00010000) \ | 58 | US_FLAG(CAPACITY_OK, 0x00010000) \ |
| 59 | /* READ CAPACITY response is correct */ | 59 | /* READ CAPACITY response is correct */ \ |
| 60 | US_FLAG(BAD_SENSE, 0x00020000) \ | ||
| 61 | /* Bad Sense (never more than 18 bytes) */ | ||
| 60 | 62 | ||
| 61 | #define US_FLAG(name, value) US_FL_##name = value , | 63 | #define US_FLAG(name, value) US_FL_##name = value , |
| 62 | enum { US_DO_ALL_FLAGS }; | 64 | enum { US_DO_ALL_FLAGS }; |
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index b2a7d8ba6ee3..15591d2ea400 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h | |||
| @@ -128,6 +128,29 @@ struct usbdevfs_hub_portinfo { | |||
| 128 | #ifdef __KERNEL__ | 128 | #ifdef __KERNEL__ |
| 129 | #ifdef CONFIG_COMPAT | 129 | #ifdef CONFIG_COMPAT |
| 130 | #include <linux/compat.h> | 130 | #include <linux/compat.h> |
| 131 | |||
| 132 | struct usbdevfs_ctrltransfer32 { | ||
| 133 | u8 bRequestType; | ||
| 134 | u8 bRequest; | ||
| 135 | u16 wValue; | ||
| 136 | u16 wIndex; | ||
| 137 | u16 wLength; | ||
| 138 | u32 timeout; /* in milliseconds */ | ||
| 139 | compat_caddr_t data; | ||
| 140 | }; | ||
| 141 | |||
| 142 | struct usbdevfs_bulktransfer32 { | ||
| 143 | compat_uint_t ep; | ||
| 144 | compat_uint_t len; | ||
| 145 | compat_uint_t timeout; /* in milliseconds */ | ||
| 146 | compat_caddr_t data; | ||
| 147 | }; | ||
| 148 | |||
| 149 | struct usbdevfs_disconnectsignal32 { | ||
| 150 | compat_int_t signr; | ||
| 151 | compat_caddr_t context; | ||
| 152 | }; | ||
| 153 | |||
| 131 | struct usbdevfs_urb32 { | 154 | struct usbdevfs_urb32 { |
| 132 | unsigned char type; | 155 | unsigned char type; |
| 133 | unsigned char endpoint; | 156 | unsigned char endpoint; |
| @@ -153,7 +176,9 @@ struct usbdevfs_ioctl32 { | |||
| 153 | #endif /* __KERNEL__ */ | 176 | #endif /* __KERNEL__ */ |
| 154 | 177 | ||
| 155 | #define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) | 178 | #define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) |
| 179 | #define USBDEVFS_CONTROL32 _IOWR('U', 0, struct usbdevfs_ctrltransfer32) | ||
| 156 | #define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer) | 180 | #define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer) |
| 181 | #define USBDEVFS_BULK32 _IOWR('U', 2, struct usbdevfs_bulktransfer32) | ||
| 157 | #define USBDEVFS_RESETEP _IOR('U', 3, unsigned int) | 182 | #define USBDEVFS_RESETEP _IOR('U', 3, unsigned int) |
| 158 | #define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface) | 183 | #define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface) |
| 159 | #define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int) | 184 | #define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int) |
| @@ -166,6 +191,7 @@ struct usbdevfs_ioctl32 { | |||
| 166 | #define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *) | 191 | #define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *) |
| 167 | #define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32) | 192 | #define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32) |
| 168 | #define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal) | 193 | #define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal) |
| 194 | #define USBDEVFS_DISCSIGNAL32 _IOR('U', 14, struct usbdevfs_disconnectsignal32) | ||
| 169 | #define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int) | 195 | #define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int) |
| 170 | #define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) | 196 | #define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) |
| 171 | #define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo) | 197 | #define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo) |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 2d0f222388a8..d85889710f9b 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
| @@ -76,24 +76,22 @@ DECLARE_PER_CPU(struct vm_event_state, vm_event_states); | |||
| 76 | 76 | ||
| 77 | static inline void __count_vm_event(enum vm_event_item item) | 77 | static inline void __count_vm_event(enum vm_event_item item) |
| 78 | { | 78 | { |
| 79 | __get_cpu_var(vm_event_states).event[item]++; | 79 | __this_cpu_inc(per_cpu_var(vm_event_states).event[item]); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | static inline void count_vm_event(enum vm_event_item item) | 82 | static inline void count_vm_event(enum vm_event_item item) |
| 83 | { | 83 | { |
| 84 | get_cpu_var(vm_event_states).event[item]++; | 84 | this_cpu_inc(per_cpu_var(vm_event_states).event[item]); |
| 85 | put_cpu(); | ||
| 86 | } | 85 | } |
| 87 | 86 | ||
| 88 | static inline void __count_vm_events(enum vm_event_item item, long delta) | 87 | static inline void __count_vm_events(enum vm_event_item item, long delta) |
| 89 | { | 88 | { |
| 90 | __get_cpu_var(vm_event_states).event[item] += delta; | 89 | __this_cpu_add(per_cpu_var(vm_event_states).event[item], delta); |
| 91 | } | 90 | } |
| 92 | 91 | ||
| 93 | static inline void count_vm_events(enum vm_event_item item, long delta) | 92 | static inline void count_vm_events(enum vm_event_item item, long delta) |
| 94 | { | 93 | { |
| 95 | get_cpu_var(vm_event_states).event[item] += delta; | 94 | this_cpu_add(per_cpu_var(vm_event_states).event[item], delta); |
| 96 | put_cpu(); | ||
| 97 | } | 95 | } |
| 98 | 96 | ||
| 99 | extern void all_vm_events(unsigned long *); | 97 | extern void all_vm_events(unsigned long *); |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index cf24c20de9e4..9466e860d8c2 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -25,6 +25,7 @@ typedef void (*work_func_t)(struct work_struct *work); | |||
| 25 | struct work_struct { | 25 | struct work_struct { |
| 26 | atomic_long_t data; | 26 | atomic_long_t data; |
| 27 | #define WORK_STRUCT_PENDING 0 /* T if work item pending execution */ | 27 | #define WORK_STRUCT_PENDING 0 /* T if work item pending execution */ |
| 28 | #define WORK_STRUCT_STATIC 1 /* static initializer (debugobjects) */ | ||
| 28 | #define WORK_STRUCT_FLAG_MASK (3UL) | 29 | #define WORK_STRUCT_FLAG_MASK (3UL) |
| 29 | #define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK) | 30 | #define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK) |
| 30 | struct list_head entry; | 31 | struct list_head entry; |
| @@ -35,6 +36,7 @@ struct work_struct { | |||
| 35 | }; | 36 | }; |
| 36 | 37 | ||
| 37 | #define WORK_DATA_INIT() ATOMIC_LONG_INIT(0) | 38 | #define WORK_DATA_INIT() ATOMIC_LONG_INIT(0) |
| 39 | #define WORK_DATA_STATIC_INIT() ATOMIC_LONG_INIT(2) | ||
| 38 | 40 | ||
| 39 | struct delayed_work { | 41 | struct delayed_work { |
| 40 | struct work_struct work; | 42 | struct work_struct work; |
| @@ -63,7 +65,7 @@ struct execute_work { | |||
| 63 | #endif | 65 | #endif |
| 64 | 66 | ||
| 65 | #define __WORK_INITIALIZER(n, f) { \ | 67 | #define __WORK_INITIALIZER(n, f) { \ |
| 66 | .data = WORK_DATA_INIT(), \ | 68 | .data = WORK_DATA_STATIC_INIT(), \ |
| 67 | .entry = { &(n).entry, &(n).entry }, \ | 69 | .entry = { &(n).entry, &(n).entry }, \ |
| 68 | .func = (f), \ | 70 | .func = (f), \ |
| 69 | __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \ | 71 | __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \ |
| @@ -91,6 +93,14 @@ struct execute_work { | |||
| 91 | #define PREPARE_DELAYED_WORK(_work, _func) \ | 93 | #define PREPARE_DELAYED_WORK(_work, _func) \ |
| 92 | PREPARE_WORK(&(_work)->work, (_func)) | 94 | PREPARE_WORK(&(_work)->work, (_func)) |
| 93 | 95 | ||
| 96 | #ifdef CONFIG_DEBUG_OBJECTS_WORK | ||
| 97 | extern void __init_work(struct work_struct *work, int onstack); | ||
| 98 | extern void destroy_work_on_stack(struct work_struct *work); | ||
| 99 | #else | ||
| 100 | static inline void __init_work(struct work_struct *work, int onstack) { } | ||
| 101 | static inline void destroy_work_on_stack(struct work_struct *work) { } | ||
| 102 | #endif | ||
| 103 | |||
| 94 | /* | 104 | /* |
| 95 | * initialize all of a work item in one go | 105 | * initialize all of a work item in one go |
| 96 | * | 106 | * |
| @@ -99,24 +109,36 @@ struct execute_work { | |||
| 99 | * to generate better code. | 109 | * to generate better code. |
| 100 | */ | 110 | */ |
| 101 | #ifdef CONFIG_LOCKDEP | 111 | #ifdef CONFIG_LOCKDEP |
| 102 | #define INIT_WORK(_work, _func) \ | 112 | #define __INIT_WORK(_work, _func, _onstack) \ |
| 103 | do { \ | 113 | do { \ |
| 104 | static struct lock_class_key __key; \ | 114 | static struct lock_class_key __key; \ |
| 105 | \ | 115 | \ |
| 116 | __init_work((_work), _onstack); \ | ||
| 106 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ | 117 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ |
| 107 | lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0);\ | 118 | lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0);\ |
| 108 | INIT_LIST_HEAD(&(_work)->entry); \ | 119 | INIT_LIST_HEAD(&(_work)->entry); \ |
| 109 | PREPARE_WORK((_work), (_func)); \ | 120 | PREPARE_WORK((_work), (_func)); \ |
| 110 | } while (0) | 121 | } while (0) |
| 111 | #else | 122 | #else |
| 112 | #define INIT_WORK(_work, _func) \ | 123 | #define __INIT_WORK(_work, _func, _onstack) \ |
| 113 | do { \ | 124 | do { \ |
| 125 | __init_work((_work), _onstack); \ | ||
| 114 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ | 126 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ |
| 115 | INIT_LIST_HEAD(&(_work)->entry); \ | 127 | INIT_LIST_HEAD(&(_work)->entry); \ |
| 116 | PREPARE_WORK((_work), (_func)); \ | 128 | PREPARE_WORK((_work), (_func)); \ |
| 117 | } while (0) | 129 | } while (0) |
| 118 | #endif | 130 | #endif |
| 119 | 131 | ||
| 132 | #define INIT_WORK(_work, _func) \ | ||
| 133 | do { \ | ||
| 134 | __INIT_WORK((_work), (_func), 0); \ | ||
| 135 | } while (0) | ||
| 136 | |||
| 137 | #define INIT_WORK_ON_STACK(_work, _func) \ | ||
| 138 | do { \ | ||
| 139 | __INIT_WORK((_work), (_func), 1); \ | ||
| 140 | } while (0) | ||
| 141 | |||
| 120 | #define INIT_DELAYED_WORK(_work, _func) \ | 142 | #define INIT_DELAYED_WORK(_work, _func) \ |
| 121 | do { \ | 143 | do { \ |
| 122 | INIT_WORK(&(_work)->work, (_func)); \ | 144 | INIT_WORK(&(_work)->work, (_func)); \ |
| @@ -125,22 +147,16 @@ struct execute_work { | |||
| 125 | 147 | ||
| 126 | #define INIT_DELAYED_WORK_ON_STACK(_work, _func) \ | 148 | #define INIT_DELAYED_WORK_ON_STACK(_work, _func) \ |
| 127 | do { \ | 149 | do { \ |
| 128 | INIT_WORK(&(_work)->work, (_func)); \ | 150 | INIT_WORK_ON_STACK(&(_work)->work, (_func)); \ |
| 129 | init_timer_on_stack(&(_work)->timer); \ | 151 | init_timer_on_stack(&(_work)->timer); \ |
| 130 | } while (0) | 152 | } while (0) |
| 131 | 153 | ||
| 132 | #define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \ | 154 | #define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \ |
| 133 | do { \ | 155 | do { \ |
| 134 | INIT_WORK(&(_work)->work, (_func)); \ | 156 | INIT_WORK(&(_work)->work, (_func)); \ |
| 135 | init_timer_deferrable(&(_work)->timer); \ | 157 | init_timer_deferrable(&(_work)->timer); \ |
| 136 | } while (0) | 158 | } while (0) |
| 137 | 159 | ||
| 138 | #define INIT_DELAYED_WORK_ON_STACK(_work, _func) \ | ||
| 139 | do { \ | ||
| 140 | INIT_WORK(&(_work)->work, (_func)); \ | ||
| 141 | init_timer_on_stack(&(_work)->timer); \ | ||
| 142 | } while (0) | ||
| 143 | |||
| 144 | /** | 160 | /** |
| 145 | * work_pending - Find out whether a work item is currently pending | 161 | * work_pending - Find out whether a work item is currently pending |
| 146 | * @work: The work item in question | 162 | * @work: The work item in question |
