diff options
Diffstat (limited to 'include')
171 files changed, 3678 insertions, 2744 deletions
diff --git a/include/asm-generic/bitops/builtin-__ffs.h b/include/asm-generic/bitops/builtin-__ffs.h new file mode 100644 index 000000000000..90041e3a41f0 --- /dev/null +++ b/include/asm-generic/bitops/builtin-__ffs.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #ifndef _ASM_GENERIC_BITOPS_BUILTIN___FFS_H_ | ||
| 2 | #define _ASM_GENERIC_BITOPS_BUILTIN___FFS_H_ | ||
| 3 | |||
| 4 | /** | ||
| 5 | * __ffs - find first bit in word. | ||
| 6 | * @word: The word to search | ||
| 7 | * | ||
| 8 | * Undefined if no bit exists, so code should check against 0 first. | ||
| 9 | */ | ||
| 10 | static __always_inline unsigned long __ffs(unsigned long word) | ||
| 11 | { | ||
| 12 | return __builtin_ctzl(word); | ||
| 13 | } | ||
| 14 | |||
| 15 | #endif | ||
diff --git a/include/asm-generic/bitops/builtin-__fls.h b/include/asm-generic/bitops/builtin-__fls.h new file mode 100644 index 000000000000..0248f386635f --- /dev/null +++ b/include/asm-generic/bitops/builtin-__fls.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #ifndef _ASM_GENERIC_BITOPS_BUILTIN___FLS_H_ | ||
| 2 | #define _ASM_GENERIC_BITOPS_BUILTIN___FLS_H_ | ||
| 3 | |||
| 4 | /** | ||
| 5 | * __fls - find last (most-significant) set bit in a long word | ||
| 6 | * @word: the word to search | ||
| 7 | * | ||
| 8 | * Undefined if no set bit exists, so code should check against 0 first. | ||
| 9 | */ | ||
| 10 | static __always_inline unsigned long __fls(unsigned long word) | ||
| 11 | { | ||
| 12 | return (sizeof(word) * 8) - 1 - __builtin_clzl(word); | ||
| 13 | } | ||
| 14 | |||
| 15 | #endif | ||
diff --git a/include/asm-generic/bitops/builtin-ffs.h b/include/asm-generic/bitops/builtin-ffs.h new file mode 100644 index 000000000000..064825829e1c --- /dev/null +++ b/include/asm-generic/bitops/builtin-ffs.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | #ifndef _ASM_GENERIC_BITOPS_BUILTIN_FFS_H_ | ||
| 2 | #define _ASM_GENERIC_BITOPS_BUILTIN_FFS_H_ | ||
| 3 | |||
| 4 | /** | ||
| 5 | * ffs - find first bit set | ||
| 6 | * @x: the word to search | ||
| 7 | * | ||
| 8 | * This is defined the same way as | ||
| 9 | * the libc and compiler builtin ffs routines, therefore | ||
| 10 | * differs in spirit from the above ffz (man ffs). | ||
| 11 | */ | ||
| 12 | static __always_inline int ffs(int x) | ||
| 13 | { | ||
| 14 | return __builtin_ffs(x); | ||
| 15 | } | ||
| 16 | |||
| 17 | #endif | ||
diff --git a/include/asm-generic/bitops/builtin-fls.h b/include/asm-generic/bitops/builtin-fls.h new file mode 100644 index 000000000000..eda652d0ac7f --- /dev/null +++ b/include/asm-generic/bitops/builtin-fls.h | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #ifndef _ASM_GENERIC_BITOPS_BUILTIN_FLS_H_ | ||
| 2 | #define _ASM_GENERIC_BITOPS_BUILTIN_FLS_H_ | ||
| 3 | |||
| 4 | /** | ||
| 5 | * fls - find last (most-significant) bit set | ||
| 6 | * @x: the word to search | ||
| 7 | * | ||
| 8 | * This is defined the same way as ffs. | ||
| 9 | * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. | ||
| 10 | */ | ||
| 11 | static __always_inline int fls(int x) | ||
| 12 | { | ||
| 13 | return x ? sizeof(x) * 8 - __builtin_clz(x) : 0; | ||
| 14 | } | ||
| 15 | |||
| 16 | #endif | ||
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index 991ef01cd77e..3748ec92dcbc 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h | |||
| @@ -691,9 +691,11 @@ __SC_COMP(__NR_process_vm_readv, sys_process_vm_readv, \ | |||
| 691 | #define __NR_process_vm_writev 271 | 691 | #define __NR_process_vm_writev 271 |
| 692 | __SC_COMP(__NR_process_vm_writev, sys_process_vm_writev, \ | 692 | __SC_COMP(__NR_process_vm_writev, sys_process_vm_writev, \ |
| 693 | compat_sys_process_vm_writev) | 693 | compat_sys_process_vm_writev) |
| 694 | #define __NR_kcmp 272 | ||
| 695 | __SYSCALL(__NR_kcmp, sys_kcmp) | ||
| 694 | 696 | ||
| 695 | #undef __NR_syscalls | 697 | #undef __NR_syscalls |
| 696 | #define __NR_syscalls 272 | 698 | #define __NR_syscalls 273 |
| 697 | 699 | ||
| 698 | /* | 700 | /* |
| 699 | * All syscalls below here should go away really, | 701 | * All syscalls below here should go away really, |
diff --git a/include/clocksource/arm_generic.h b/include/clocksource/arm_generic.h new file mode 100644 index 000000000000..5b41b0d27f0f --- /dev/null +++ b/include/clocksource/arm_generic.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2012 ARM Ltd. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 as | ||
| 6 | * published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | #ifndef __CLKSOURCE_ARM_GENERIC_H | ||
| 17 | #define __CLKSOURCE_ARM_GENERIC_H | ||
| 18 | |||
| 19 | extern int arm_generic_timer_init(void); | ||
| 20 | |||
| 21 | #endif | ||
diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h index bdf0152cbbe9..f4621184a9b4 100644 --- a/include/drm/drm_fourcc.h +++ b/include/drm/drm_fourcc.h | |||
| @@ -107,8 +107,7 @@ | |||
| 107 | #define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ | 107 | #define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ |
| 108 | #define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ | 108 | #define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ |
| 109 | 109 | ||
| 110 | /* 2 non contiguous plane YCbCr */ | 110 | /* special NV12 tiled format */ |
| 111 | #define DRM_FORMAT_NV12M fourcc_code('N', 'M', '1', '2') /* 2x2 subsampled Cr:Cb plane */ | ||
| 112 | #define DRM_FORMAT_NV12MT fourcc_code('T', 'M', '1', '2') /* 2x2 subsampled Cr:Cb plane 64x32 macroblocks */ | 111 | #define DRM_FORMAT_NV12MT fourcc_code('T', 'M', '1', '2') /* 2x2 subsampled Cr:Cb plane 64x32 macroblocks */ |
| 113 | 112 | ||
| 114 | /* | 113 | /* |
| @@ -131,7 +130,4 @@ | |||
| 131 | #define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ | 130 | #define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ |
| 132 | #define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ | 131 | #define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ |
| 133 | 132 | ||
| 134 | /* 3 non contiguous plane YCbCr */ | ||
| 135 | #define DRM_FORMAT_YUV420M fourcc_code('Y', 'M', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */ | ||
| 136 | |||
| 137 | #endif /* DRM_FOURCC_H */ | 133 | #endif /* DRM_FOURCC_H */ |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index fa217607c582..c57e064666e4 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -84,7 +84,6 @@ header-y += capability.h | |||
| 84 | header-y += capi.h | 84 | header-y += capi.h |
| 85 | header-y += cciss_defs.h | 85 | header-y += cciss_defs.h |
| 86 | header-y += cciss_ioctl.h | 86 | header-y += cciss_ioctl.h |
| 87 | header-y += cdk.h | ||
| 88 | header-y += cdrom.h | 87 | header-y += cdrom.h |
| 89 | header-y += cgroupstats.h | 88 | header-y += cgroupstats.h |
| 90 | header-y += chio.h | 89 | header-y += chio.h |
| @@ -93,7 +92,6 @@ header-y += cn_proc.h | |||
| 93 | header-y += coda.h | 92 | header-y += coda.h |
| 94 | header-y += coda_psdev.h | 93 | header-y += coda_psdev.h |
| 95 | header-y += coff.h | 94 | header-y += coff.h |
| 96 | header-y += comstats.h | ||
| 97 | header-y += connector.h | 95 | header-y += connector.h |
| 98 | header-y += const.h | 96 | header-y += const.h |
| 99 | header-y += cramfs_fs.h | 97 | header-y += cramfs_fs.h |
| @@ -140,7 +138,6 @@ header-y += fuse.h | |||
| 140 | header-y += futex.h | 138 | header-y += futex.h |
| 141 | header-y += gameport.h | 139 | header-y += gameport.h |
| 142 | header-y += gen_stats.h | 140 | header-y += gen_stats.h |
| 143 | header-y += generic_serial.h | ||
| 144 | header-y += genetlink.h | 141 | header-y += genetlink.h |
| 145 | header-y += gfs2_ondisk.h | 142 | header-y += gfs2_ondisk.h |
| 146 | header-y += gigaset_dev.h | 143 | header-y += gigaset_dev.h |
| @@ -372,6 +369,7 @@ header-y += tipc.h | |||
| 372 | header-y += tipc_config.h | 369 | header-y += tipc_config.h |
| 373 | header-y += toshiba.h | 370 | header-y += toshiba.h |
| 374 | header-y += tty.h | 371 | header-y += tty.h |
| 372 | header-y += tty_flags.h | ||
| 375 | header-y += types.h | 373 | header-y += types.h |
| 376 | header-y += udf_fs_i.h | 374 | header-y += udf_fs_i.h |
| 377 | header-y += udp.h | 375 | header-y += udp.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 4f2a76224509..90be98981102 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -138,9 +138,9 @@ void acpi_penalize_isa_irq(int irq, int active); | |||
| 138 | void acpi_pci_irq_disable (struct pci_dev *dev); | 138 | void acpi_pci_irq_disable (struct pci_dev *dev); |
| 139 | 139 | ||
| 140 | struct acpi_pci_driver { | 140 | struct acpi_pci_driver { |
| 141 | struct acpi_pci_driver *next; | 141 | struct list_head node; |
| 142 | int (*add)(acpi_handle handle); | 142 | int (*add)(struct acpi_pci_root *root); |
| 143 | void (*remove)(acpi_handle handle); | 143 | void (*remove)(struct acpi_pci_root *root); |
| 144 | }; | 144 | }; |
| 145 | 145 | ||
| 146 | int acpi_pci_register_driver(struct acpi_pci_driver *driver); | 146 | int acpi_pci_register_driver(struct acpi_pci_driver *driver); |
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h index d117b29d1062..f612c783170f 100644 --- a/include/linux/amba/serial.h +++ b/include/linux/amba/serial.h | |||
| @@ -205,7 +205,6 @@ struct amba_pl011_data { | |||
| 205 | void *dma_tx_param; | 205 | void *dma_tx_param; |
| 206 | void (*init) (void); | 206 | void (*init) (void); |
| 207 | void (*exit) (void); | 207 | void (*exit) (void); |
| 208 | void (*reset) (void); | ||
| 209 | }; | 208 | }; |
| 210 | #endif | 209 | #endif |
| 211 | 210 | ||
diff --git a/include/linux/atmel-ssc.h b/include/linux/atmel-ssc.h index 06023393fba9..4eb31752e2b7 100644 --- a/include/linux/atmel-ssc.h +++ b/include/linux/atmel-ssc.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/platform_device.h> | 4 | #include <linux/platform_device.h> |
| 5 | #include <linux/list.h> | 5 | #include <linux/list.h> |
| 6 | #include <linux/io.h> | ||
| 6 | 7 | ||
| 7 | struct ssc_device { | 8 | struct ssc_device { |
| 8 | struct list_head list; | 9 | struct list_head list; |
diff --git a/include/linux/atmel_tc.h b/include/linux/atmel_tc.h index 1d14b1dc1aee..89a931babecf 100644 --- a/include/linux/atmel_tc.h +++ b/include/linux/atmel_tc.h | |||
| @@ -63,7 +63,7 @@ struct atmel_tc { | |||
| 63 | struct platform_device *pdev; | 63 | struct platform_device *pdev; |
| 64 | struct resource *iomem; | 64 | struct resource *iomem; |
| 65 | void __iomem *regs; | 65 | void __iomem *regs; |
| 66 | struct atmel_tcb_config *tcb_config; | 66 | const struct atmel_tcb_config *tcb_config; |
| 67 | int irq[3]; | 67 | int irq[3]; |
| 68 | struct clk *clk[3]; | 68 | struct clk *clk[3]; |
| 69 | struct list_head node; | 69 | struct list_head node; |
diff --git a/include/linux/bcd.h b/include/linux/bcd.h index 22ea563ba3eb..18fff11fb3ea 100644 --- a/include/linux/bcd.h +++ b/include/linux/bcd.h | |||
| @@ -3,7 +3,20 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
| 5 | 5 | ||
| 6 | unsigned bcd2bin(unsigned char val) __attribute_const__; | 6 | #define bcd2bin(x) \ |
| 7 | unsigned char bin2bcd(unsigned val) __attribute_const__; | 7 | (__builtin_constant_p((u8 )(x)) ? \ |
| 8 | const_bcd2bin(x) : \ | ||
| 9 | _bcd2bin(x)) | ||
| 10 | |||
| 11 | #define bin2bcd(x) \ | ||
| 12 | (__builtin_constant_p((u8 )(x)) ? \ | ||
| 13 | const_bin2bcd(x) : \ | ||
| 14 | _bin2bcd(x)) | ||
| 15 | |||
| 16 | #define const_bcd2bin(x) (((x) & 0x0f) + ((x) >> 4) * 10) | ||
| 17 | #define const_bin2bcd(x) ((((x) / 10) << 4) + (x) % 10) | ||
| 18 | |||
| 19 | unsigned _bcd2bin(unsigned char val) __attribute_const__; | ||
| 20 | unsigned char _bin2bcd(unsigned val) __attribute_const__; | ||
| 8 | 21 | ||
| 9 | #endif /* _BCD_H */ | 22 | #endif /* _BCD_H */ |
diff --git a/include/linux/cd1400.h b/include/linux/cd1400.h deleted file mode 100644 index 1dc3ab0523fd..000000000000 --- a/include/linux/cd1400.h +++ /dev/null | |||
| @@ -1,292 +0,0 @@ | |||
| 1 | /*****************************************************************************/ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * cd1400.h -- cd1400 UART hardware info. | ||
| 5 | * | ||
| 6 | * Copyright (C) 1996-1998 Stallion Technologies | ||
| 7 | * Copyright (C) 1994-1996 Greg Ungerer. | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | * GNU General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 22 | */ | ||
| 23 | |||
| 24 | /*****************************************************************************/ | ||
| 25 | #ifndef _CD1400_H | ||
| 26 | #define _CD1400_H | ||
| 27 | /*****************************************************************************/ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Define the number of async ports per cd1400 uart chip. | ||
| 31 | */ | ||
| 32 | #define CD1400_PORTS 4 | ||
| 33 | |||
| 34 | /* | ||
| 35 | * Define the cd1400 uarts internal FIFO sizes. | ||
| 36 | */ | ||
| 37 | #define CD1400_TXFIFOSIZE 12 | ||
| 38 | #define CD1400_RXFIFOSIZE 12 | ||
| 39 | |||
| 40 | /* | ||
| 41 | * Local RX FIFO thresh hold level. Also define the RTS thresh hold | ||
| 42 | * based on the RX thresh hold. | ||
| 43 | */ | ||
| 44 | #define FIFO_RXTHRESHOLD 6 | ||
| 45 | #define FIFO_RTSTHRESHOLD 7 | ||
| 46 | |||
| 47 | /*****************************************************************************/ | ||
| 48 | |||
| 49 | /* | ||
| 50 | * Define the cd1400 register addresses. These are all the valid | ||
| 51 | * registers with the cd1400. Some are global, some virtual, some | ||
| 52 | * per port. | ||
| 53 | */ | ||
| 54 | #define GFRCR 0x40 | ||
| 55 | #define CAR 0x68 | ||
| 56 | #define GCR 0x4b | ||
| 57 | #define SVRR 0x67 | ||
| 58 | #define RICR 0x44 | ||
| 59 | #define TICR 0x45 | ||
| 60 | #define MICR 0x46 | ||
| 61 | #define RIR 0x6b | ||
| 62 | #define TIR 0x6a | ||
| 63 | #define MIR 0x69 | ||
| 64 | #define PPR 0x7e | ||
| 65 | |||
| 66 | #define RIVR 0x43 | ||
| 67 | #define TIVR 0x42 | ||
| 68 | #define MIVR 0x41 | ||
| 69 | #define TDR 0x63 | ||
| 70 | #define RDSR 0x62 | ||
| 71 | #define MISR 0x4c | ||
| 72 | #define EOSRR 0x60 | ||
| 73 | |||
| 74 | #define LIVR 0x18 | ||
| 75 | #define CCR 0x05 | ||
| 76 | #define SRER 0x06 | ||
| 77 | #define COR1 0x08 | ||
| 78 | #define COR2 0x09 | ||
| 79 | #define COR3 0x0a | ||
| 80 | #define COR4 0x1e | ||
| 81 | #define COR5 0x1f | ||
| 82 | #define CCSR 0x0b | ||
| 83 | #define RDCR 0x0e | ||
| 84 | #define SCHR1 0x1a | ||
| 85 | #define SCHR2 0x1b | ||
| 86 | #define SCHR3 0x1c | ||
| 87 | #define SCHR4 0x1d | ||
| 88 | #define SCRL 0x22 | ||
| 89 | #define SCRH 0x23 | ||
| 90 | #define LNC 0x24 | ||
| 91 | #define MCOR1 0x15 | ||
| 92 | #define MCOR2 0x16 | ||
| 93 | #define RTPR 0x21 | ||
| 94 | #define MSVR1 0x6c | ||
| 95 | #define MSVR2 0x6d | ||
| 96 | #define PSVR 0x6f | ||
| 97 | #define RBPR 0x78 | ||
| 98 | #define RCOR 0x7c | ||
| 99 | #define TBPR 0x72 | ||
| 100 | #define TCOR 0x76 | ||
| 101 | |||
| 102 | /*****************************************************************************/ | ||
| 103 | |||
| 104 | /* | ||
| 105 | * Define the set of baud rate clock divisors. | ||
| 106 | */ | ||
| 107 | #define CD1400_CLK0 8 | ||
| 108 | #define CD1400_CLK1 32 | ||
| 109 | #define CD1400_CLK2 128 | ||
| 110 | #define CD1400_CLK3 512 | ||
| 111 | #define CD1400_CLK4 2048 | ||
| 112 | |||
| 113 | #define CD1400_NUMCLKS 5 | ||
| 114 | |||
| 115 | /*****************************************************************************/ | ||
| 116 | |||
| 117 | /* | ||
| 118 | * Define the clock pre-scalar value to be a 5 ms clock. This should be | ||
| 119 | * OK for now. It would probably be better to make it 10 ms, but we | ||
| 120 | * can't fit that divisor into 8 bits! | ||
| 121 | */ | ||
| 122 | #define PPR_SCALAR 244 | ||
| 123 | |||
| 124 | /*****************************************************************************/ | ||
| 125 | |||
| 126 | /* | ||
| 127 | * Define values used to set character size options. | ||
| 128 | */ | ||
| 129 | #define COR1_CHL5 0x00 | ||
| 130 | #define COR1_CHL6 0x01 | ||
| 131 | #define COR1_CHL7 0x02 | ||
| 132 | #define COR1_CHL8 0x03 | ||
| 133 | |||
| 134 | /* | ||
| 135 | * Define values used to set the number of stop bits. | ||
| 136 | */ | ||
| 137 | #define COR1_STOP1 0x00 | ||
| 138 | #define COR1_STOP15 0x04 | ||
| 139 | #define COR1_STOP2 0x08 | ||
| 140 | |||
| 141 | /* | ||
| 142 | * Define values used to set the parity scheme in use. | ||
| 143 | */ | ||
| 144 | #define COR1_PARNONE 0x00 | ||
| 145 | #define COR1_PARFORCE 0x20 | ||
| 146 | #define COR1_PARENB 0x40 | ||
| 147 | #define COR1_PARIGNORE 0x10 | ||
| 148 | |||
| 149 | #define COR1_PARODD 0x80 | ||
| 150 | #define COR1_PAREVEN 0x00 | ||
| 151 | |||
| 152 | #define COR2_IXM 0x80 | ||
| 153 | #define COR2_TXIBE 0x40 | ||
| 154 | #define COR2_ETC 0x20 | ||
| 155 | #define COR2_LLM 0x10 | ||
| 156 | #define COR2_RLM 0x08 | ||
| 157 | #define COR2_RTSAO 0x04 | ||
| 158 | #define COR2_CTSAE 0x02 | ||
| 159 | |||
| 160 | #define COR3_SCDRNG 0x80 | ||
| 161 | #define COR3_SCD34 0x40 | ||
| 162 | #define COR3_FCT 0x20 | ||
| 163 | #define COR3_SCD12 0x10 | ||
| 164 | |||
| 165 | /* | ||
| 166 | * Define values used by COR4. | ||
| 167 | */ | ||
| 168 | #define COR4_BRKINT 0x08 | ||
| 169 | #define COR4_IGNBRK 0x18 | ||
| 170 | |||
| 171 | /*****************************************************************************/ | ||
| 172 | |||
| 173 | /* | ||
| 174 | * Define the modem control register values. | ||
| 175 | * Note that the actual hardware is a little different to the conventional | ||
| 176 | * pin names on the cd1400. | ||
| 177 | */ | ||
| 178 | #define MSVR1_DTR 0x01 | ||
| 179 | #define MSVR1_DSR 0x10 | ||
| 180 | #define MSVR1_RI 0x20 | ||
| 181 | #define MSVR1_CTS 0x40 | ||
| 182 | #define MSVR1_DCD 0x80 | ||
| 183 | |||
| 184 | #define MSVR2_RTS 0x02 | ||
| 185 | #define MSVR2_DSR 0x10 | ||
| 186 | #define MSVR2_RI 0x20 | ||
| 187 | #define MSVR2_CTS 0x40 | ||
| 188 | #define MSVR2_DCD 0x80 | ||
| 189 | |||
| 190 | #define MCOR1_DCD 0x80 | ||
| 191 | #define MCOR1_CTS 0x40 | ||
| 192 | #define MCOR1_RI 0x20 | ||
| 193 | #define MCOR1_DSR 0x10 | ||
| 194 | |||
| 195 | #define MCOR2_DCD 0x80 | ||
| 196 | #define MCOR2_CTS 0x40 | ||
| 197 | #define MCOR2_RI 0x20 | ||
| 198 | #define MCOR2_DSR 0x10 | ||
| 199 | |||
| 200 | /*****************************************************************************/ | ||
| 201 | |||
| 202 | /* | ||
| 203 | * Define the bits used with the service (interrupt) enable register. | ||
| 204 | */ | ||
| 205 | #define SRER_NNDT 0x01 | ||
| 206 | #define SRER_TXEMPTY 0x02 | ||
| 207 | #define SRER_TXDATA 0x04 | ||
| 208 | #define SRER_RXDATA 0x10 | ||
| 209 | #define SRER_MODEM 0x80 | ||
| 210 | |||
| 211 | /*****************************************************************************/ | ||
| 212 | |||
| 213 | /* | ||
| 214 | * Define operational commands for the command register. | ||
| 215 | */ | ||
| 216 | #define CCR_RESET 0x80 | ||
| 217 | #define CCR_CORCHANGE 0x4e | ||
| 218 | #define CCR_SENDCH 0x20 | ||
| 219 | #define CCR_CHANCTRL 0x10 | ||
| 220 | |||
| 221 | #define CCR_TXENABLE (CCR_CHANCTRL | 0x08) | ||
| 222 | #define CCR_TXDISABLE (CCR_CHANCTRL | 0x04) | ||
| 223 | #define CCR_RXENABLE (CCR_CHANCTRL | 0x02) | ||
| 224 | #define CCR_RXDISABLE (CCR_CHANCTRL | 0x01) | ||
| 225 | |||
| 226 | #define CCR_SENDSCHR1 (CCR_SENDCH | 0x01) | ||
| 227 | #define CCR_SENDSCHR2 (CCR_SENDCH | 0x02) | ||
| 228 | #define CCR_SENDSCHR3 (CCR_SENDCH | 0x03) | ||
| 229 | #define CCR_SENDSCHR4 (CCR_SENDCH | 0x04) | ||
| 230 | |||
| 231 | #define CCR_RESETCHAN (CCR_RESET | 0x00) | ||
| 232 | #define CCR_RESETFULL (CCR_RESET | 0x01) | ||
| 233 | #define CCR_TXFLUSHFIFO (CCR_RESET | 0x02) | ||
| 234 | |||
| 235 | #define CCR_MAXWAIT 10000 | ||
| 236 | |||
| 237 | /*****************************************************************************/ | ||
| 238 | |||
| 239 | /* | ||
| 240 | * Define the valid acknowledgement types (for hw ack cycle). | ||
| 241 | */ | ||
| 242 | #define ACK_TYPMASK 0x07 | ||
| 243 | #define ACK_TYPTX 0x02 | ||
| 244 | #define ACK_TYPMDM 0x01 | ||
| 245 | #define ACK_TYPRXGOOD 0x03 | ||
| 246 | #define ACK_TYPRXBAD 0x07 | ||
| 247 | |||
| 248 | #define SVRR_RX 0x01 | ||
| 249 | #define SVRR_TX 0x02 | ||
| 250 | #define SVRR_MDM 0x04 | ||
| 251 | |||
| 252 | #define ST_OVERRUN 0x01 | ||
| 253 | #define ST_FRAMING 0x02 | ||
| 254 | #define ST_PARITY 0x04 | ||
| 255 | #define ST_BREAK 0x08 | ||
| 256 | #define ST_SCHAR1 0x10 | ||
| 257 | #define ST_SCHAR2 0x20 | ||
| 258 | #define ST_SCHAR3 0x30 | ||
| 259 | #define ST_SCHAR4 0x40 | ||
| 260 | #define ST_RANGE 0x70 | ||
| 261 | #define ST_SCHARMASK 0x70 | ||
| 262 | #define ST_TIMEOUT 0x80 | ||
| 263 | |||
| 264 | #define MISR_DCD 0x80 | ||
| 265 | #define MISR_CTS 0x40 | ||
| 266 | #define MISR_RI 0x20 | ||
| 267 | #define MISR_DSR 0x10 | ||
| 268 | |||
| 269 | /*****************************************************************************/ | ||
| 270 | |||
| 271 | /* | ||
| 272 | * Defines for the CCSR status register. | ||
| 273 | */ | ||
| 274 | #define CCSR_RXENABLED 0x80 | ||
| 275 | #define CCSR_RXFLOWON 0x40 | ||
| 276 | #define CCSR_RXFLOWOFF 0x20 | ||
| 277 | #define CCSR_TXENABLED 0x08 | ||
| 278 | #define CCSR_TXFLOWON 0x04 | ||
| 279 | #define CCSR_TXFLOWOFF 0x02 | ||
| 280 | |||
| 281 | /*****************************************************************************/ | ||
| 282 | |||
| 283 | /* | ||
| 284 | * Define the embedded commands. | ||
| 285 | */ | ||
| 286 | #define ETC_CMD 0x00 | ||
| 287 | #define ETC_STARTBREAK 0x81 | ||
| 288 | #define ETC_DELAY 0x82 | ||
| 289 | #define ETC_STOPBREAK 0x83 | ||
| 290 | |||
| 291 | /*****************************************************************************/ | ||
| 292 | #endif | ||
diff --git a/include/linux/cdk.h b/include/linux/cdk.h deleted file mode 100644 index 80093a8d4f64..000000000000 --- a/include/linux/cdk.h +++ /dev/null | |||
| @@ -1,486 +0,0 @@ | |||
| 1 | /*****************************************************************************/ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * cdk.h -- CDK interface definitions. | ||
| 5 | * | ||
| 6 | * Copyright (C) 1996-1998 Stallion Technologies | ||
| 7 | * Copyright (C) 1994-1996 Greg Ungerer. | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | * GNU General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 22 | */ | ||
| 23 | |||
| 24 | /*****************************************************************************/ | ||
| 25 | #ifndef _CDK_H | ||
| 26 | #define _CDK_H | ||
| 27 | /*****************************************************************************/ | ||
| 28 | |||
| 29 | #pragma pack(2) | ||
| 30 | |||
| 31 | /* | ||
| 32 | * The following set of definitions is used to communicate with the | ||
| 33 | * shared memory interface of the Stallion intelligent multiport serial | ||
| 34 | * boards. The definitions in this file are taken directly from the | ||
| 35 | * document titled "Generic Stackable Interface, Downloader and | ||
| 36 | * Communications Development Kit". | ||
| 37 | */ | ||
| 38 | |||
| 39 | /* | ||
| 40 | * Define the set of important shared memory addresses. These are | ||
| 41 | * required to initialize the board and get things started. All of these | ||
| 42 | * addresses are relative to the start of the shared memory. | ||
| 43 | */ | ||
| 44 | #define CDK_SIGADDR 0x200 | ||
| 45 | #define CDK_FEATADDR 0x280 | ||
| 46 | #define CDK_CDKADDR 0x300 | ||
| 47 | #define CDK_RDYADDR 0x262 | ||
| 48 | |||
| 49 | #define CDK_ALIVEMARKER 13 | ||
| 50 | |||
| 51 | /* | ||
| 52 | * On hardware power up the ROMs located on the EasyConnection 8/64 will | ||
| 53 | * fill out the following signature information into shared memory. This | ||
| 54 | * way the host system can quickly determine that the board is present | ||
| 55 | * and is operational. | ||
| 56 | */ | ||
| 57 | typedef struct cdkecpsig { | ||
| 58 | unsigned long magic; | ||
| 59 | unsigned short romver; | ||
| 60 | unsigned short cputype; | ||
| 61 | unsigned char panelid[8]; | ||
| 62 | } cdkecpsig_t; | ||
| 63 | |||
| 64 | #define ECP_MAGIC 0x21504345 | ||
| 65 | |||
| 66 | /* | ||
| 67 | * On hardware power up the ROMs located on the ONboard, Stallion and | ||
| 68 | * Brumbys will fill out the following signature information into shared | ||
| 69 | * memory. This way the host system can quickly determine that the board | ||
| 70 | * is present and is operational. | ||
| 71 | */ | ||
| 72 | typedef struct cdkonbsig { | ||
| 73 | unsigned short magic0; | ||
| 74 | unsigned short magic1; | ||
| 75 | unsigned short magic2; | ||
| 76 | unsigned short magic3; | ||
| 77 | unsigned short romver; | ||
| 78 | unsigned short memoff; | ||
| 79 | unsigned short memseg; | ||
| 80 | unsigned short amask0; | ||
| 81 | unsigned short pic; | ||
| 82 | unsigned short status; | ||
| 83 | unsigned short btype; | ||
| 84 | unsigned short clkticks; | ||
| 85 | unsigned short clkspeed; | ||
| 86 | unsigned short amask1; | ||
| 87 | unsigned short amask2; | ||
| 88 | } cdkonbsig_t; | ||
| 89 | |||
| 90 | #define ONB_MAGIC0 0xf2a7 | ||
| 91 | #define ONB_MAGIC1 0xa149 | ||
| 92 | #define ONB_MAGIC2 0x6352 | ||
| 93 | #define ONB_MAGIC3 0xf121 | ||
| 94 | |||
| 95 | /* | ||
| 96 | * Define the feature area structure. The feature area is the set of | ||
| 97 | * startup parameters used by the slave image when it starts executing. | ||
| 98 | * They allow for the specification of buffer sizes, debug trace, etc. | ||
| 99 | */ | ||
| 100 | typedef struct cdkfeature { | ||
| 101 | unsigned long debug; | ||
| 102 | unsigned long banner; | ||
| 103 | unsigned long etype; | ||
| 104 | unsigned long nrdevs; | ||
| 105 | unsigned long brdspec; | ||
| 106 | unsigned long txrqsize; | ||
| 107 | unsigned long rxrqsize; | ||
| 108 | unsigned long flags; | ||
| 109 | } cdkfeature_t; | ||
| 110 | |||
| 111 | #define ETYP_DDK 0 | ||
| 112 | #define ETYP_CDK 1 | ||
| 113 | |||
| 114 | /* | ||
| 115 | * Define the CDK header structure. This is the info that the slave | ||
| 116 | * environment sets up after it has been downloaded and started. It | ||
| 117 | * essentially provides a memory map for the shared memory interface. | ||
| 118 | */ | ||
| 119 | typedef struct cdkhdr { | ||
| 120 | unsigned short command; | ||
| 121 | unsigned short status; | ||
| 122 | unsigned short port; | ||
| 123 | unsigned short mode; | ||
| 124 | unsigned long cmd_buf[14]; | ||
| 125 | unsigned short alive_cnt; | ||
| 126 | unsigned short intrpt_mode; | ||
| 127 | unsigned char intrpt_id[8]; | ||
| 128 | unsigned char ver_release; | ||
| 129 | unsigned char ver_modification; | ||
| 130 | unsigned char ver_fix; | ||
| 131 | unsigned char deadman_restart; | ||
| 132 | unsigned short deadman; | ||
| 133 | unsigned short nrdevs; | ||
| 134 | unsigned long memp; | ||
| 135 | unsigned long hostp; | ||
| 136 | unsigned long slavep; | ||
| 137 | unsigned char hostreq; | ||
| 138 | unsigned char slavereq; | ||
| 139 | unsigned char cmd_reserved[30]; | ||
| 140 | } cdkhdr_t; | ||
| 141 | |||
| 142 | #define MODE_DDK 0 | ||
| 143 | #define MODE_CDK 1 | ||
| 144 | |||
| 145 | #define IMD_INTR 0x0 | ||
| 146 | #define IMD_PPINTR 0x1 | ||
| 147 | #define IMD_POLL 0xff | ||
| 148 | |||
| 149 | /* | ||
| 150 | * Define the memory mapping structure. This structure is pointed to by | ||
| 151 | * the memp field in the stlcdkhdr struct. As many as these structures | ||
| 152 | * as required are laid out in shared memory to define how the rest of | ||
| 153 | * shared memory is divided up. There will be one for each port. | ||
| 154 | */ | ||
| 155 | typedef struct cdkmem { | ||
| 156 | unsigned short dtype; | ||
| 157 | unsigned long offset; | ||
| 158 | } cdkmem_t; | ||
| 159 | |||
| 160 | #define TYP_UNDEFINED 0x0 | ||
| 161 | #define TYP_ASYNCTRL 0x1 | ||
| 162 | #define TYP_ASYNC 0x20 | ||
| 163 | #define TYP_PARALLEL 0x40 | ||
| 164 | #define TYP_SYNCX21 0x60 | ||
| 165 | |||
| 166 | /*****************************************************************************/ | ||
| 167 | |||
| 168 | /* | ||
| 169 | * Following is a set of defines and structures used to actually deal | ||
| 170 | * with the serial ports on the board. Firstly is the set of commands | ||
| 171 | * that can be applied to ports. | ||
| 172 | */ | ||
| 173 | #define ASYCMD (((unsigned long) 'a') << 8) | ||
| 174 | |||
| 175 | #define A_NULL (ASYCMD | 0) | ||
| 176 | #define A_FLUSH (ASYCMD | 1) | ||
| 177 | #define A_BREAK (ASYCMD | 2) | ||
| 178 | #define A_GETPORT (ASYCMD | 3) | ||
| 179 | #define A_SETPORT (ASYCMD | 4) | ||
| 180 | #define A_SETPORTF (ASYCMD | 5) | ||
| 181 | #define A_SETPORTFTX (ASYCMD | 6) | ||
| 182 | #define A_SETPORTFRX (ASYCMD | 7) | ||
| 183 | #define A_GETSIGNALS (ASYCMD | 8) | ||
| 184 | #define A_SETSIGNALS (ASYCMD | 9) | ||
| 185 | #define A_SETSIGNALSF (ASYCMD | 10) | ||
| 186 | #define A_SETSIGNALSFTX (ASYCMD | 11) | ||
| 187 | #define A_SETSIGNALSFRX (ASYCMD | 12) | ||
| 188 | #define A_GETNOTIFY (ASYCMD | 13) | ||
| 189 | #define A_SETNOTIFY (ASYCMD | 14) | ||
| 190 | #define A_NOTIFY (ASYCMD | 15) | ||
| 191 | #define A_PORTCTRL (ASYCMD | 16) | ||
| 192 | #define A_GETSTATS (ASYCMD | 17) | ||
| 193 | #define A_RQSTATE (ASYCMD | 18) | ||
| 194 | #define A_FLOWSTATE (ASYCMD | 19) | ||
| 195 | #define A_CLEARSTATS (ASYCMD | 20) | ||
| 196 | |||
| 197 | /* | ||
| 198 | * Define those arguments used for simple commands. | ||
| 199 | */ | ||
| 200 | #define FLUSHRX 0x1 | ||
| 201 | #define FLUSHTX 0x2 | ||
| 202 | |||
| 203 | #define BREAKON -1 | ||
| 204 | #define BREAKOFF -2 | ||
| 205 | |||
| 206 | /* | ||
| 207 | * Define the port setting structure, and all those defines that go along | ||
| 208 | * with it. Basically this structure defines the characteristics of this | ||
| 209 | * port: baud rate, chars, parity, input/output char cooking etc. | ||
| 210 | */ | ||
| 211 | typedef struct asyport { | ||
| 212 | unsigned long baudout; | ||
| 213 | unsigned long baudin; | ||
| 214 | unsigned long iflag; | ||
| 215 | unsigned long oflag; | ||
| 216 | unsigned long lflag; | ||
| 217 | unsigned long pflag; | ||
| 218 | unsigned long flow; | ||
| 219 | unsigned long spare1; | ||
| 220 | unsigned short vtime; | ||
| 221 | unsigned short vmin; | ||
| 222 | unsigned short txlo; | ||
| 223 | unsigned short txhi; | ||
| 224 | unsigned short rxlo; | ||
| 225 | unsigned short rxhi; | ||
| 226 | unsigned short rxhog; | ||
| 227 | unsigned short spare2; | ||
| 228 | unsigned char csize; | ||
| 229 | unsigned char stopbs; | ||
| 230 | unsigned char parity; | ||
| 231 | unsigned char stopin; | ||
| 232 | unsigned char startin; | ||
| 233 | unsigned char stopout; | ||
| 234 | unsigned char startout; | ||
| 235 | unsigned char parmark; | ||
| 236 | unsigned char brkmark; | ||
| 237 | unsigned char cc[11]; | ||
| 238 | } asyport_t; | ||
| 239 | |||
| 240 | #define PT_STOP1 0x0 | ||
| 241 | #define PT_STOP15 0x1 | ||
| 242 | #define PT_STOP2 0x2 | ||
| 243 | |||
| 244 | #define PT_NOPARITY 0x0 | ||
| 245 | #define PT_ODDPARITY 0x1 | ||
| 246 | #define PT_EVENPARITY 0x2 | ||
| 247 | #define PT_MARKPARITY 0x3 | ||
| 248 | #define PT_SPACEPARITY 0x4 | ||
| 249 | |||
| 250 | #define F_NONE 0x0 | ||
| 251 | #define F_IXON 0x1 | ||
| 252 | #define F_IXOFF 0x2 | ||
| 253 | #define F_IXANY 0x4 | ||
| 254 | #define F_IOXANY 0x8 | ||
| 255 | #define F_RTSFLOW 0x10 | ||
| 256 | #define F_CTSFLOW 0x20 | ||
| 257 | #define F_DTRFLOW 0x40 | ||
| 258 | #define F_DCDFLOW 0x80 | ||
| 259 | #define F_DSROFLOW 0x100 | ||
| 260 | #define F_DSRIFLOW 0x200 | ||
| 261 | |||
| 262 | #define FI_NORX 0x1 | ||
| 263 | #define FI_RAW 0x2 | ||
| 264 | #define FI_ISTRIP 0x4 | ||
| 265 | #define FI_UCLC 0x8 | ||
| 266 | #define FI_INLCR 0x10 | ||
| 267 | #define FI_ICRNL 0x20 | ||
| 268 | #define FI_IGNCR 0x40 | ||
| 269 | #define FI_IGNBREAK 0x80 | ||
| 270 | #define FI_DSCRDBREAK 0x100 | ||
| 271 | #define FI_1MARKBREAK 0x200 | ||
| 272 | #define FI_2MARKBREAK 0x400 | ||
| 273 | #define FI_XCHNGBREAK 0x800 | ||
| 274 | #define FI_IGNRXERRS 0x1000 | ||
| 275 | #define FI_DSCDRXERRS 0x2000 | ||
| 276 | #define FI_1MARKRXERRS 0x4000 | ||
| 277 | #define FI_2MARKRXERRS 0x8000 | ||
| 278 | #define FI_XCHNGRXERRS 0x10000 | ||
| 279 | #define FI_DSCRDNULL 0x20000 | ||
| 280 | |||
| 281 | #define FO_OLCUC 0x1 | ||
| 282 | #define FO_ONLCR 0x2 | ||
| 283 | #define FO_OOCRNL 0x4 | ||
| 284 | #define FO_ONOCR 0x8 | ||
| 285 | #define FO_ONLRET 0x10 | ||
| 286 | #define FO_ONL 0x20 | ||
| 287 | #define FO_OBS 0x40 | ||
| 288 | #define FO_OVT 0x80 | ||
| 289 | #define FO_OFF 0x100 | ||
| 290 | #define FO_OTAB1 0x200 | ||
| 291 | #define FO_OTAB2 0x400 | ||
| 292 | #define FO_OTAB3 0x800 | ||
| 293 | #define FO_OCR1 0x1000 | ||
| 294 | #define FO_OCR2 0x2000 | ||
| 295 | #define FO_OCR3 0x4000 | ||
| 296 | #define FO_OFILL 0x8000 | ||
| 297 | #define FO_ODELL 0x10000 | ||
| 298 | |||
| 299 | #define P_RTSLOCK 0x1 | ||
| 300 | #define P_CTSLOCK 0x2 | ||
| 301 | #define P_MAPRTS 0x4 | ||
| 302 | #define P_MAPCTS 0x8 | ||
| 303 | #define P_LOOPBACK 0x10 | ||
| 304 | #define P_DTRFOLLOW 0x20 | ||
| 305 | #define P_FAKEDCD 0x40 | ||
| 306 | |||
| 307 | #define P_RXIMIN 0x10000 | ||
| 308 | #define P_RXITIME 0x20000 | ||
| 309 | #define P_RXTHOLD 0x40000 | ||
| 310 | |||
| 311 | /* | ||
| 312 | * Define a structure to communicate serial port signal and data state | ||
| 313 | * information. | ||
| 314 | */ | ||
| 315 | typedef struct asysigs { | ||
| 316 | unsigned long data; | ||
| 317 | unsigned long signal; | ||
| 318 | unsigned long sigvalue; | ||
| 319 | } asysigs_t; | ||
| 320 | |||
| 321 | #define DT_TXBUSY 0x1 | ||
| 322 | #define DT_TXEMPTY 0x2 | ||
| 323 | #define DT_TXLOW 0x4 | ||
| 324 | #define DT_TXHIGH 0x8 | ||
| 325 | #define DT_TXFULL 0x10 | ||
| 326 | #define DT_TXHOG 0x20 | ||
| 327 | #define DT_TXFLOWED 0x40 | ||
| 328 | #define DT_TXBREAK 0x80 | ||
| 329 | |||
| 330 | #define DT_RXBUSY 0x100 | ||
| 331 | #define DT_RXEMPTY 0x200 | ||
| 332 | #define DT_RXLOW 0x400 | ||
| 333 | #define DT_RXHIGH 0x800 | ||
| 334 | #define DT_RXFULL 0x1000 | ||
| 335 | #define DT_RXHOG 0x2000 | ||
| 336 | #define DT_RXFLOWED 0x4000 | ||
| 337 | #define DT_RXBREAK 0x8000 | ||
| 338 | |||
| 339 | #define SG_DTR 0x1 | ||
| 340 | #define SG_DCD 0x2 | ||
| 341 | #define SG_RTS 0x4 | ||
| 342 | #define SG_CTS 0x8 | ||
| 343 | #define SG_DSR 0x10 | ||
| 344 | #define SG_RI 0x20 | ||
| 345 | |||
| 346 | /* | ||
| 347 | * Define the notification setting structure. This is used to tell the | ||
| 348 | * port what events we want to be informed about. Fields here use the | ||
| 349 | * same defines as for the asysigs structure above. | ||
| 350 | */ | ||
| 351 | typedef struct asynotify { | ||
| 352 | unsigned long ctrl; | ||
| 353 | unsigned long data; | ||
| 354 | unsigned long signal; | ||
| 355 | unsigned long sigvalue; | ||
| 356 | } asynotify_t; | ||
| 357 | |||
| 358 | /* | ||
| 359 | * Define the port control structure. It is used to do fine grain | ||
| 360 | * control operations on the port. | ||
| 361 | */ | ||
| 362 | typedef struct { | ||
| 363 | unsigned long rxctrl; | ||
| 364 | unsigned long txctrl; | ||
| 365 | char rximdch; | ||
| 366 | char tximdch; | ||
| 367 | char spare1; | ||
| 368 | char spare2; | ||
| 369 | } asyctrl_t; | ||
| 370 | |||
| 371 | #define CT_ENABLE 0x1 | ||
| 372 | #define CT_DISABLE 0x2 | ||
| 373 | #define CT_STOP 0x4 | ||
| 374 | #define CT_START 0x8 | ||
| 375 | #define CT_STARTFLOW 0x10 | ||
| 376 | #define CT_STOPFLOW 0x20 | ||
| 377 | #define CT_SENDCHR 0x40 | ||
| 378 | |||
| 379 | /* | ||
| 380 | * Define the stats structure kept for each port. This is a useful set | ||
| 381 | * of data collected for each port on the slave. The A_GETSTATS command | ||
| 382 | * is used to retrieve this data from the slave. | ||
| 383 | */ | ||
| 384 | typedef struct asystats { | ||
| 385 | unsigned long opens; | ||
| 386 | unsigned long txchars; | ||
| 387 | unsigned long rxchars; | ||
| 388 | unsigned long txringq; | ||
| 389 | unsigned long rxringq; | ||
| 390 | unsigned long txmsgs; | ||
| 391 | unsigned long rxmsgs; | ||
| 392 | unsigned long txflushes; | ||
| 393 | unsigned long rxflushes; | ||
| 394 | unsigned long overruns; | ||
| 395 | unsigned long framing; | ||
| 396 | unsigned long parity; | ||
| 397 | unsigned long ringover; | ||
| 398 | unsigned long lost; | ||
| 399 | unsigned long rxstart; | ||
| 400 | unsigned long rxstop; | ||
| 401 | unsigned long txstart; | ||
| 402 | unsigned long txstop; | ||
| 403 | unsigned long dcdcnt; | ||
| 404 | unsigned long dtrcnt; | ||
| 405 | unsigned long ctscnt; | ||
| 406 | unsigned long rtscnt; | ||
| 407 | unsigned long dsrcnt; | ||
| 408 | unsigned long ricnt; | ||
| 409 | unsigned long txbreaks; | ||
| 410 | unsigned long rxbreaks; | ||
| 411 | unsigned long signals; | ||
| 412 | unsigned long state; | ||
| 413 | unsigned long hwid; | ||
| 414 | } asystats_t; | ||
| 415 | |||
| 416 | /*****************************************************************************/ | ||
| 417 | |||
| 418 | /* | ||
| 419 | * All command and control communication with a device on the slave is | ||
| 420 | * via a control block in shared memory. Each device has its own control | ||
| 421 | * block, defined by the following structure. The control block allows | ||
| 422 | * the host to open, close and control the device on the slave. | ||
| 423 | */ | ||
| 424 | typedef struct cdkctrl { | ||
| 425 | unsigned char open; | ||
| 426 | unsigned char close; | ||
| 427 | unsigned long openarg; | ||
| 428 | unsigned long closearg; | ||
| 429 | unsigned long cmd; | ||
| 430 | unsigned long status; | ||
| 431 | unsigned long args[32]; | ||
| 432 | } cdkctrl_t; | ||
| 433 | |||
| 434 | /* | ||
| 435 | * Each device on the slave passes data to and from the host via a ring | ||
| 436 | * queue in shared memory. Define a ring queue structure to hold the | ||
| 437 | * vital information about each ring queue. Two ring queues will be | ||
| 438 | * allocated for each port, one for receive data and one for transmit | ||
| 439 | * data. | ||
| 440 | */ | ||
| 441 | typedef struct cdkasyrq { | ||
| 442 | unsigned long offset; | ||
| 443 | unsigned short size; | ||
| 444 | unsigned short head; | ||
| 445 | unsigned short tail; | ||
| 446 | } cdkasyrq_t; | ||
| 447 | |||
| 448 | /* | ||
| 449 | * Each asynchronous port is defined in shared memory by the following | ||
| 450 | * structure. It contains a control block to command a device, and also | ||
| 451 | * the necessary data channel information as well. | ||
| 452 | */ | ||
| 453 | typedef struct cdkasy { | ||
| 454 | cdkctrl_t ctrl; | ||
| 455 | unsigned short notify; | ||
| 456 | asynotify_t changed; | ||
| 457 | unsigned short receive; | ||
| 458 | cdkasyrq_t rxq; | ||
| 459 | unsigned short transmit; | ||
| 460 | cdkasyrq_t txq; | ||
| 461 | } cdkasy_t; | ||
| 462 | |||
| 463 | #pragma pack() | ||
| 464 | |||
| 465 | /*****************************************************************************/ | ||
| 466 | |||
| 467 | /* | ||
| 468 | * Define the set of ioctls used by the driver to do special things | ||
| 469 | * to the board. These include interrupting it, and initializing | ||
| 470 | * the driver after board startup and shutdown. | ||
| 471 | */ | ||
| 472 | #include <linux/ioctl.h> | ||
| 473 | |||
| 474 | #define STL_BINTR _IO('s',20) | ||
| 475 | #define STL_BSTART _IO('s',21) | ||
| 476 | #define STL_BSTOP _IO('s',22) | ||
| 477 | #define STL_BRESET _IO('s',23) | ||
| 478 | |||
| 479 | /* | ||
| 480 | * Define a set of ioctl extensions, used to get at special stuff. | ||
| 481 | */ | ||
| 482 | #define STL_GETPFLAG _IO('s',80) | ||
| 483 | #define STL_SETPFLAG _IO('s',81) | ||
| 484 | |||
| 485 | /*****************************************************************************/ | ||
| 486 | #endif | ||
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 77335fac943e..c12731582920 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */ | 26 | #define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */ |
| 27 | #define CLK_IS_ROOT BIT(4) /* root clk, has no parent */ | 27 | #define CLK_IS_ROOT BIT(4) /* root clk, has no parent */ |
| 28 | #define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */ | 28 | #define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */ |
| 29 | #define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */ | ||
| 29 | 30 | ||
| 30 | struct clk_hw; | 31 | struct clk_hw; |
| 31 | 32 | ||
| @@ -360,6 +361,11 @@ int of_clk_add_provider(struct device_node *np, | |||
| 360 | void of_clk_del_provider(struct device_node *np); | 361 | void of_clk_del_provider(struct device_node *np); |
| 361 | struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, | 362 | struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, |
| 362 | void *data); | 363 | void *data); |
| 364 | struct clk_onecell_data { | ||
| 365 | struct clk **clks; | ||
| 366 | unsigned int clk_num; | ||
| 367 | }; | ||
| 368 | struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); | ||
| 363 | const char *of_clk_get_parent_name(struct device_node *np, int index); | 369 | const char *of_clk_get_parent_name(struct device_node *np, int index); |
| 364 | void of_clk_init(const struct of_device_id *matches); | 370 | void of_clk_init(const struct of_device_id *matches); |
| 365 | 371 | ||
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 2f4079175afb..934bc34d5f99 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
| @@ -49,6 +49,13 @@ | |||
| 49 | #endif | 49 | #endif |
| 50 | #endif | 50 | #endif |
| 51 | 51 | ||
| 52 | #if __GNUC_MINOR__ >= 6 | ||
| 53 | /* | ||
| 54 | * Tell the optimizer that something else uses this function or variable. | ||
| 55 | */ | ||
| 56 | #define __visible __attribute__((externally_visible)) | ||
| 57 | #endif | ||
| 58 | |||
| 52 | #if __GNUC_MINOR__ > 0 | 59 | #if __GNUC_MINOR__ > 0 |
| 53 | #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | 60 | #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) |
| 54 | #endif | 61 | #endif |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 923d093c9cea..f430e4162f41 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -278,6 +278,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 278 | # define __section(S) __attribute__ ((__section__(#S))) | 278 | # define __section(S) __attribute__ ((__section__(#S))) |
| 279 | #endif | 279 | #endif |
| 280 | 280 | ||
| 281 | #ifndef __visible | ||
| 282 | #define __visible | ||
| 283 | #endif | ||
| 284 | |||
| 281 | /* Are two types/vars the same type (ignoring qualifiers)? */ | 285 | /* Are two types/vars the same type (ignoring qualifiers)? */ |
| 282 | #ifndef __same_type | 286 | #ifndef __same_type |
| 283 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) | 287 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) |
diff --git a/include/linux/comstats.h b/include/linux/comstats.h deleted file mode 100644 index 3f5ea8e8026d..000000000000 --- a/include/linux/comstats.h +++ /dev/null | |||
| @@ -1,119 +0,0 @@ | |||
| 1 | /*****************************************************************************/ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * comstats.h -- Serial Port Stats. | ||
| 5 | * | ||
| 6 | * Copyright (C) 1996-1998 Stallion Technologies | ||
| 7 | * Copyright (C) 1994-1996 Greg Ungerer. | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | * GNU General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 22 | */ | ||
| 23 | |||
| 24 | /*****************************************************************************/ | ||
| 25 | #ifndef _COMSTATS_H | ||
| 26 | #define _COMSTATS_H | ||
| 27 | /*****************************************************************************/ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Serial port stats structure. The structure itself is UART | ||
| 31 | * independent, but some fields may be UART/driver specific (for | ||
| 32 | * example state). | ||
| 33 | */ | ||
| 34 | |||
| 35 | typedef struct { | ||
| 36 | unsigned long brd; | ||
| 37 | unsigned long panel; | ||
| 38 | unsigned long port; | ||
| 39 | unsigned long hwid; | ||
| 40 | unsigned long type; | ||
| 41 | unsigned long txtotal; | ||
| 42 | unsigned long rxtotal; | ||
| 43 | unsigned long txbuffered; | ||
| 44 | unsigned long rxbuffered; | ||
| 45 | unsigned long rxoverrun; | ||
| 46 | unsigned long rxparity; | ||
| 47 | unsigned long rxframing; | ||
| 48 | unsigned long rxlost; | ||
| 49 | unsigned long txbreaks; | ||
| 50 | unsigned long rxbreaks; | ||
| 51 | unsigned long txxon; | ||
| 52 | unsigned long txxoff; | ||
| 53 | unsigned long rxxon; | ||
| 54 | unsigned long rxxoff; | ||
| 55 | unsigned long txctson; | ||
| 56 | unsigned long txctsoff; | ||
| 57 | unsigned long rxrtson; | ||
| 58 | unsigned long rxrtsoff; | ||
| 59 | unsigned long modem; | ||
| 60 | unsigned long state; | ||
| 61 | unsigned long flags; | ||
| 62 | unsigned long ttystate; | ||
| 63 | unsigned long cflags; | ||
| 64 | unsigned long iflags; | ||
| 65 | unsigned long oflags; | ||
| 66 | unsigned long lflags; | ||
| 67 | unsigned long signals; | ||
| 68 | } comstats_t; | ||
| 69 | |||
| 70 | |||
| 71 | /* | ||
| 72 | * Board stats structure. Returns useful info about the board. | ||
| 73 | */ | ||
| 74 | |||
| 75 | #define COM_MAXPANELS 8 | ||
| 76 | |||
| 77 | typedef struct { | ||
| 78 | unsigned long panel; | ||
| 79 | unsigned long type; | ||
| 80 | unsigned long hwid; | ||
| 81 | unsigned long nrports; | ||
| 82 | } companel_t; | ||
| 83 | |||
| 84 | typedef struct { | ||
| 85 | unsigned long brd; | ||
| 86 | unsigned long type; | ||
| 87 | unsigned long hwid; | ||
| 88 | unsigned long state; | ||
| 89 | unsigned long ioaddr; | ||
| 90 | unsigned long ioaddr2; | ||
| 91 | unsigned long memaddr; | ||
| 92 | unsigned long irq; | ||
| 93 | unsigned long nrpanels; | ||
| 94 | unsigned long nrports; | ||
| 95 | companel_t panels[COM_MAXPANELS]; | ||
| 96 | } combrd_t; | ||
| 97 | |||
| 98 | |||
| 99 | /* | ||
| 100 | * Define the ioctl operations for stats stuff. | ||
| 101 | */ | ||
| 102 | #include <linux/ioctl.h> | ||
| 103 | |||
| 104 | #define COM_GETPORTSTATS _IO('c',30) | ||
| 105 | #define COM_CLRPORTSTATS _IO('c',31) | ||
| 106 | #define COM_GETBRDSTATS _IO('c',32) | ||
| 107 | |||
| 108 | |||
| 109 | /* | ||
| 110 | * Define the set of ioctls that give user level access to the | ||
| 111 | * private port, panel and board structures. The argument required | ||
| 112 | * will be driver dependent! | ||
| 113 | */ | ||
| 114 | #define COM_READPORT _IO('c',40) | ||
| 115 | #define COM_READBOARD _IO('c',41) | ||
| 116 | #define COM_READPANEL _IO('c',42) | ||
| 117 | |||
| 118 | /*****************************************************************************/ | ||
| 119 | #endif | ||
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index caa34e50537e..59200795482e 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -206,6 +206,8 @@ struct dentry_operations { | |||
| 206 | #define DCACHE_MANAGED_DENTRY \ | 206 | #define DCACHE_MANAGED_DENTRY \ |
| 207 | (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) | 207 | (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) |
| 208 | 208 | ||
| 209 | #define DCACHE_DENTRY_KILLED 0x100000 | ||
| 210 | |||
| 209 | extern seqlock_t rename_lock; | 211 | extern seqlock_t rename_lock; |
| 210 | 212 | ||
| 211 | static inline int dname_external(struct dentry *dentry) | 213 | static inline int dname_external(struct dentry *dentry) |
diff --git a/include/linux/device.h b/include/linux/device.h index 52a5f15a2223..af92883bb4a6 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -536,6 +536,10 @@ extern void *__devres_alloc(dr_release_t release, size_t size, gfp_t gfp, | |||
| 536 | #else | 536 | #else |
| 537 | extern void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp); | 537 | extern void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp); |
| 538 | #endif | 538 | #endif |
| 539 | extern void devres_for_each_res(struct device *dev, dr_release_t release, | ||
| 540 | dr_match_t match, void *match_data, | ||
| 541 | void (*fn)(struct device *, void *, void *), | ||
| 542 | void *data); | ||
| 539 | extern void devres_free(void *res); | 543 | extern void devres_free(void *res); |
| 540 | extern void devres_add(struct device *dev, void *res); | 544 | extern void devres_add(struct device *dev, void *res); |
| 541 | extern void *devres_find(struct device *dev, dr_release_t release, | 545 | extern void *devres_find(struct device *dev, dr_release_t release, |
| @@ -891,12 +895,15 @@ extern const char *dev_driver_string(const struct device *dev); | |||
| 891 | 895 | ||
| 892 | #ifdef CONFIG_PRINTK | 896 | #ifdef CONFIG_PRINTK |
| 893 | 897 | ||
| 894 | extern int __dev_printk(const char *level, const struct device *dev, | 898 | extern __printf(3, 0) |
| 895 | struct va_format *vaf); | 899 | int dev_vprintk_emit(int level, const struct device *dev, |
| 900 | const char *fmt, va_list args); | ||
| 901 | extern __printf(3, 4) | ||
| 902 | int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...); | ||
| 903 | |||
| 896 | extern __printf(3, 4) | 904 | extern __printf(3, 4) |
| 897 | int dev_printk(const char *level, const struct device *dev, | 905 | int dev_printk(const char *level, const struct device *dev, |
| 898 | const char *fmt, ...) | 906 | const char *fmt, ...); |
| 899 | ; | ||
| 900 | extern __printf(2, 3) | 907 | extern __printf(2, 3) |
| 901 | int dev_emerg(const struct device *dev, const char *fmt, ...); | 908 | int dev_emerg(const struct device *dev, const char *fmt, ...); |
| 902 | extern __printf(2, 3) | 909 | extern __printf(2, 3) |
| @@ -914,6 +921,14 @@ int _dev_info(const struct device *dev, const char *fmt, ...); | |||
| 914 | 921 | ||
| 915 | #else | 922 | #else |
| 916 | 923 | ||
| 924 | static inline __printf(3, 0) | ||
| 925 | int dev_vprintk_emit(int level, const struct device *dev, | ||
| 926 | const char *fmt, va_list args) | ||
| 927 | { return 0; } | ||
| 928 | static inline __printf(3, 4) | ||
| 929 | int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...) | ||
| 930 | { return 0; } | ||
| 931 | |||
| 917 | static inline int __dev_printk(const char *level, const struct device *dev, | 932 | static inline int __dev_printk(const char *level, const struct device *dev, |
| 918 | struct va_format *vaf) | 933 | struct va_format *vaf) |
| 919 | { return 0; } | 934 | { return 0; } |
| @@ -946,6 +961,32 @@ int _dev_info(const struct device *dev, const char *fmt, ...) | |||
| 946 | 961 | ||
| 947 | #endif | 962 | #endif |
| 948 | 963 | ||
| 964 | /* | ||
| 965 | * Stupid hackaround for existing uses of non-printk uses dev_info | ||
| 966 | * | ||
| 967 | * Note that the definition of dev_info below is actually _dev_info | ||
| 968 | * and a macro is used to avoid redefining dev_info | ||
| 969 | */ | ||
| 970 | |||
| 971 | #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg) | ||
| 972 | |||
| 973 | #if defined(CONFIG_DYNAMIC_DEBUG) | ||
| 974 | #define dev_dbg(dev, format, ...) \ | ||
| 975 | do { \ | ||
| 976 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ | ||
| 977 | } while (0) | ||
| 978 | #elif defined(DEBUG) | ||
| 979 | #define dev_dbg(dev, format, arg...) \ | ||
| 980 | dev_printk(KERN_DEBUG, dev, format, ##arg) | ||
| 981 | #else | ||
| 982 | #define dev_dbg(dev, format, arg...) \ | ||
| 983 | ({ \ | ||
| 984 | if (0) \ | ||
| 985 | dev_printk(KERN_DEBUG, dev, format, ##arg); \ | ||
| 986 | 0; \ | ||
| 987 | }) | ||
| 988 | #endif | ||
| 989 | |||
| 949 | #define dev_level_ratelimited(dev_level, dev, fmt, ...) \ | 990 | #define dev_level_ratelimited(dev_level, dev, fmt, ...) \ |
| 950 | do { \ | 991 | do { \ |
| 951 | static DEFINE_RATELIMIT_STATE(_rs, \ | 992 | static DEFINE_RATELIMIT_STATE(_rs, \ |
| @@ -969,33 +1010,21 @@ do { \ | |||
| 969 | dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__) | 1010 | dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__) |
| 970 | #define dev_info_ratelimited(dev, fmt, ...) \ | 1011 | #define dev_info_ratelimited(dev, fmt, ...) \ |
| 971 | dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__) | 1012 | dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__) |
| 1013 | #if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG) | ||
| 972 | #define dev_dbg_ratelimited(dev, fmt, ...) \ | 1014 | #define dev_dbg_ratelimited(dev, fmt, ...) \ |
| 973 | dev_level_ratelimited(dev_dbg, dev, fmt, ##__VA_ARGS__) | 1015 | do { \ |
| 974 | 1016 | static DEFINE_RATELIMIT_STATE(_rs, \ | |
| 975 | /* | 1017 | DEFAULT_RATELIMIT_INTERVAL, \ |
| 976 | * Stupid hackaround for existing uses of non-printk uses dev_info | 1018 | DEFAULT_RATELIMIT_BURST); \ |
| 977 | * | 1019 | DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ |
| 978 | * Note that the definition of dev_info below is actually _dev_info | 1020 | if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \ |
| 979 | * and a macro is used to avoid redefining dev_info | 1021 | __ratelimit(&_rs)) \ |
| 980 | */ | 1022 | __dynamic_pr_debug(&descriptor, pr_fmt(fmt), \ |
| 981 | 1023 | ##__VA_ARGS__); \ | |
| 982 | #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg) | ||
| 983 | |||
| 984 | #if defined(CONFIG_DYNAMIC_DEBUG) | ||
| 985 | #define dev_dbg(dev, format, ...) \ | ||
| 986 | do { \ | ||
| 987 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ | ||
| 988 | } while (0) | 1024 | } while (0) |
| 989 | #elif defined(DEBUG) | ||
| 990 | #define dev_dbg(dev, format, arg...) \ | ||
| 991 | dev_printk(KERN_DEBUG, dev, format, ##arg) | ||
| 992 | #else | 1025 | #else |
| 993 | #define dev_dbg(dev, format, arg...) \ | 1026 | #define dev_dbg_ratelimited(dev, fmt, ...) \ |
| 994 | ({ \ | 1027 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
| 995 | if (0) \ | ||
| 996 | dev_printk(KERN_DEBUG, dev, format, ##arg); \ | ||
| 997 | 0; \ | ||
| 998 | }) | ||
| 999 | #endif | 1028 | #endif |
| 1000 | 1029 | ||
| 1001 | #ifdef VERBOSE_DEBUG | 1030 | #ifdef VERBOSE_DEBUG |
diff --git a/include/linux/efi-bgrt.h b/include/linux/efi-bgrt.h new file mode 100644 index 000000000000..051b21fedf68 --- /dev/null +++ b/include/linux/efi-bgrt.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #ifndef _LINUX_EFI_BGRT_H | ||
| 2 | #define _LINUX_EFI_BGRT_H | ||
| 3 | |||
| 4 | #ifdef CONFIG_ACPI_BGRT | ||
| 5 | |||
| 6 | #include <linux/acpi.h> | ||
| 7 | |||
| 8 | void efi_bgrt_init(void); | ||
| 9 | |||
| 10 | /* The BGRT data itself; only valid if bgrt_image != NULL. */ | ||
| 11 | extern void *bgrt_image; | ||
| 12 | extern size_t bgrt_image_size; | ||
| 13 | extern struct acpi_table_bgrt *bgrt_tab; | ||
| 14 | |||
| 15 | #else /* !CONFIG_ACPI_BGRT */ | ||
| 16 | |||
| 17 | static inline void efi_bgrt_init(void) {} | ||
| 18 | |||
| 19 | #endif /* !CONFIG_ACPI_BGRT */ | ||
| 20 | |||
| 21 | #endif /* _LINUX_EFI_BGRT_H */ | ||
diff --git a/include/linux/efi.h b/include/linux/efi.h index ec45ccd8708a..8670eb1eb8cd 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
| @@ -496,6 +496,14 @@ extern void efi_map_pal_code (void); | |||
| 496 | extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg); | 496 | extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg); |
| 497 | extern void efi_gettimeofday (struct timespec *ts); | 497 | extern void efi_gettimeofday (struct timespec *ts); |
| 498 | extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */ | 498 | extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */ |
| 499 | #ifdef CONFIG_X86 | ||
| 500 | extern void efi_late_init(void); | ||
| 501 | extern void efi_free_boot_services(void); | ||
| 502 | #else | ||
| 503 | static inline void efi_late_init(void) {} | ||
| 504 | static inline void efi_free_boot_services(void) {} | ||
| 505 | #endif | ||
| 506 | extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr); | ||
| 499 | extern u64 efi_get_iobase (void); | 507 | extern u64 efi_get_iobase (void); |
| 500 | extern u32 efi_mem_type (unsigned long phys_addr); | 508 | extern u32 efi_mem_type (unsigned long phys_addr); |
| 501 | extern u64 efi_mem_attributes (unsigned long phys_addr); | 509 | extern u64 efi_mem_attributes (unsigned long phys_addr); |
diff --git a/include/linux/elf.h b/include/linux/elf.h index 999b4f52e8e5..0a05051a8924 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
| @@ -387,7 +387,11 @@ typedef struct elf64_shdr { | |||
| 387 | #define NT_S390_PREFIX 0x305 /* s390 prefix register */ | 387 | #define NT_S390_PREFIX 0x305 /* s390 prefix register */ |
| 388 | #define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ | 388 | #define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ |
| 389 | #define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */ | 389 | #define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */ |
| 390 | #define NT_S390_TDB 0x308 /* s390 transaction diagnostic block */ | ||
| 390 | #define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */ | 391 | #define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */ |
| 392 | #define NT_ARM_TLS 0x401 /* ARM TLS register */ | ||
| 393 | #define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */ | ||
| 394 | #define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */ | ||
| 391 | 395 | ||
| 392 | 396 | ||
| 393 | /* Note header in a PT_NOTE section */ | 397 | /* Note header in a PT_NOTE section */ |
diff --git a/include/linux/extcon.h b/include/linux/extcon.h index cdd401477656..7443a560c9d0 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h | |||
| @@ -30,19 +30,19 @@ | |||
| 30 | 30 | ||
| 31 | /* | 31 | /* |
| 32 | * The standard cable name is to help support general notifier | 32 | * The standard cable name is to help support general notifier |
| 33 | * and notifee device drivers to share the common names. | 33 | * and notifiee device drivers to share the common names. |
| 34 | * Please use standard cable names unless your notifier device has | 34 | * Please use standard cable names unless your notifier device has |
| 35 | * a very unique and abnormal cable or | 35 | * a very unique and abnormal cable or |
| 36 | * the cable type is supposed to be used with only one unique | 36 | * the cable type is supposed to be used with only one unique |
| 37 | * pair of notifier/notifee devices. | 37 | * pair of notifier/notifiee devices. |
| 38 | * | 38 | * |
| 39 | * Please add any other "standard" cables used with extcon dev. | 39 | * Please add any other "standard" cables used with extcon dev. |
| 40 | * | 40 | * |
| 41 | * You may add a dot and number to specify version or specification | 41 | * You may add a dot and number to specify version or specification |
| 42 | * of the specific cable if it is required. (e.g., "Fast-charger.18" | 42 | * of the specific cable if it is required. (e.g., "Fast-charger.18" |
| 43 | * and "Fast-charger.10" for 1.8A and 1.0A chargers) | 43 | * and "Fast-charger.10" for 1.8A and 1.0A chargers) |
| 44 | * However, the notifee and notifier should be able to handle such | 44 | * However, the notifiee and notifier should be able to handle such |
| 45 | * string and if the notifee can negotiate the protocol or idenify, | 45 | * string and if the notifiee can negotiate the protocol or identify, |
| 46 | * you don't need such convention. This convention is helpful when | 46 | * you don't need such convention. This convention is helpful when |
| 47 | * notifier can distinguish but notifiee cannot. | 47 | * notifier can distinguish but notifiee cannot. |
| 48 | */ | 48 | */ |
| @@ -76,7 +76,7 @@ struct extcon_cable; | |||
| 76 | * struct extcon_dev - An extcon device represents one external connector. | 76 | * struct extcon_dev - An extcon device represents one external connector. |
| 77 | * @name The name of this extcon device. Parent device name is used | 77 | * @name The name of this extcon device. Parent device name is used |
| 78 | * if NULL. | 78 | * if NULL. |
| 79 | * @supported_cable Array of supported cable name ending with NULL. | 79 | * @supported_cable Array of supported cable names ending with NULL. |
| 80 | * If supported_cable is NULL, cable name related APIs | 80 | * If supported_cable is NULL, cable name related APIs |
| 81 | * are disabled. | 81 | * are disabled. |
| 82 | * @mutually_exclusive Array of mutually exclusive set of cables that cannot | 82 | * @mutually_exclusive Array of mutually exclusive set of cables that cannot |
| @@ -95,7 +95,7 @@ struct extcon_cable; | |||
| 95 | * @state Attach/detach state of this extcon. Do not provide at | 95 | * @state Attach/detach state of this extcon. Do not provide at |
| 96 | * register-time | 96 | * register-time |
| 97 | * @nh Notifier for the state change events from this extcon | 97 | * @nh Notifier for the state change events from this extcon |
| 98 | * @entry To support list of extcon devices so that uses can search | 98 | * @entry To support list of extcon devices so that users can search |
| 99 | * for extcon devices based on the extcon name. | 99 | * for extcon devices based on the extcon name. |
| 100 | * @lock | 100 | * @lock |
| 101 | * @max_supported Internal value to store the number of cables. | 101 | * @max_supported Internal value to store the number of cables. |
| @@ -199,7 +199,7 @@ extern int extcon_update_state(struct extcon_dev *edev, u32 mask, u32 state); | |||
| 199 | /* | 199 | /* |
| 200 | * get/set_cable_state access each bit of the 32b encoded state value. | 200 | * get/set_cable_state access each bit of the 32b encoded state value. |
| 201 | * They are used to access the status of each cable based on the cable_name | 201 | * They are used to access the status of each cable based on the cable_name |
| 202 | * or cable_index, which is retrived by extcon_find_cable_index | 202 | * or cable_index, which is retrieved by extcon_find_cable_index |
| 203 | */ | 203 | */ |
| 204 | extern int extcon_find_cable_index(struct extcon_dev *sdev, | 204 | extern int extcon_find_cable_index(struct extcon_dev *sdev, |
| 205 | const char *cable_name); | 205 | const char *cable_name); |
| @@ -226,9 +226,9 @@ extern int extcon_unregister_interest(struct extcon_specific_cable_nb *nb); | |||
| 226 | 226 | ||
| 227 | /* | 227 | /* |
| 228 | * Following APIs are to monitor every action of a notifier. | 228 | * Following APIs are to monitor every action of a notifier. |
| 229 | * Registerer gets notified for every external port of a connection device. | 229 | * Registrar gets notified for every external port of a connection device. |
| 230 | * Probably this could be used to debug an action of notifier; however, | 230 | * Probably this could be used to debug an action of notifier; however, |
| 231 | * we do not recommend to use this at normal 'notifiee' device drivers who | 231 | * we do not recommend to use this for normal 'notifiee' device drivers who |
| 232 | * want to be notified by a specific external port of the notifier. | 232 | * want to be notified by a specific external port of the notifier. |
| 233 | */ | 233 | */ |
| 234 | extern int extcon_register_notifier(struct extcon_dev *edev, | 234 | extern int extcon_register_notifier(struct extcon_dev *edev, |
diff --git a/include/linux/extcon/extcon-adc-jack.h b/include/linux/extcon/extcon-adc-jack.h new file mode 100644 index 000000000000..20e9eef25d4c --- /dev/null +++ b/include/linux/extcon/extcon-adc-jack.h | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/extcon/extcon-adc-jack.h | ||
| 3 | * | ||
| 4 | * Analog Jack extcon driver with ADC-based detection capability. | ||
| 5 | * | ||
| 6 | * Copyright (C) 2012 Samsung Electronics | ||
| 7 | * MyungJoo Ham <myungjoo.ham@samsung.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License version 2 as | ||
| 11 | * published by the Free Software Foundation. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _EXTCON_ADC_JACK_H_ | ||
| 16 | #define _EXTCON_ADC_JACK_H_ __FILE__ | ||
| 17 | |||
| 18 | #include <linux/module.h> | ||
| 19 | #include <linux/extcon.h> | ||
| 20 | |||
| 21 | /** | ||
| 22 | * struct adc_jack_cond - condition to use an extcon state | ||
| 23 | * @state - the corresponding extcon state (if 0, this struct denotes | ||
| 24 | * the last adc_jack_cond element among the array) | ||
| 25 | * @min_adc - min adc value for this condition | ||
| 26 | * @max_adc - max adc value for this condition | ||
| 27 | * | ||
| 28 | * For example, if { .state = 0x3, .min_adc = 100, .max_adc = 200}, it means | ||
| 29 | * that if ADC value is between (inclusive) 100 and 200, than the cable 0 and | ||
| 30 | * 1 are attached (1<<0 | 1<<1 == 0x3) | ||
| 31 | * | ||
| 32 | * Note that you don't need to describe condition for "no cable attached" | ||
| 33 | * because when no adc_jack_cond is met, state = 0 is automatically chosen. | ||
| 34 | */ | ||
| 35 | struct adc_jack_cond { | ||
| 36 | u32 state; /* extcon state value. 0 if invalid */ | ||
| 37 | u32 min_adc; | ||
| 38 | u32 max_adc; | ||
| 39 | }; | ||
| 40 | |||
| 41 | /** | ||
| 42 | * struct adc_jack_pdata - platform data for adc jack device. | ||
| 43 | * @name - name of the extcon device. If null, "adc-jack" is used. | ||
| 44 | * @consumer_channel - Unique name to identify the channel on the consumer | ||
| 45 | * side. This typically describes the channels used within | ||
| 46 | * the consumer. E.g. 'battery_voltage' | ||
| 47 | * @cable_names - array of cable names ending with null. | ||
| 48 | * @adc_contitions - array of struct adc_jack_cond conditions ending | ||
| 49 | * with .state = 0 entry. This describes how to decode | ||
| 50 | * adc values into extcon state. | ||
| 51 | * @irq_flags - irq flags used for the @irq | ||
| 52 | * @handling_delay_ms - in some devices, we need to read ADC value some | ||
| 53 | * milli-seconds after the interrupt occurs. You may | ||
| 54 | * describe such delays with @handling_delay_ms, which | ||
| 55 | * is rounded-off by jiffies. | ||
| 56 | */ | ||
| 57 | struct adc_jack_pdata { | ||
| 58 | const char *name; | ||
| 59 | const char *consumer_channel; | ||
| 60 | /* | ||
| 61 | * The last entry should be NULL | ||
| 62 | */ | ||
| 63 | const char **cable_names; | ||
| 64 | /* The last entry's state should be 0 */ | ||
| 65 | struct adc_jack_cond *adc_conditions; | ||
| 66 | |||
| 67 | unsigned long irq_flags; | ||
| 68 | unsigned long handling_delay_ms; /* in ms */ | ||
| 69 | }; | ||
| 70 | |||
| 71 | #endif /* _EXTCON_ADC_JACK_H */ | ||
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 1e7c01189fa6..e4279fedb93a 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
| @@ -12,6 +12,9 @@ struct firmware { | |||
| 12 | size_t size; | 12 | size_t size; |
| 13 | const u8 *data; | 13 | const u8 *data; |
| 14 | struct page **pages; | 14 | struct page **pages; |
| 15 | |||
| 16 | /* firmware loader private fields */ | ||
| 17 | void *priv; | ||
| 15 | }; | 18 | }; |
| 16 | 19 | ||
| 17 | struct module; | 20 | struct module; |
| @@ -44,6 +47,8 @@ int request_firmware_nowait( | |||
| 44 | void (*cont)(const struct firmware *fw, void *context)); | 47 | void (*cont)(const struct firmware *fw, void *context)); |
| 45 | 48 | ||
| 46 | void release_firmware(const struct firmware *fw); | 49 | void release_firmware(const struct firmware *fw); |
| 50 | int cache_firmware(const char *name); | ||
| 51 | int uncache_firmware(const char *name); | ||
| 47 | #else | 52 | #else |
| 48 | static inline int request_firmware(const struct firmware **fw, | 53 | static inline int request_firmware(const struct firmware **fw, |
| 49 | const char *name, | 54 | const char *name, |
| @@ -62,6 +67,16 @@ static inline int request_firmware_nowait( | |||
| 62 | static inline void release_firmware(const struct firmware *fw) | 67 | static inline void release_firmware(const struct firmware *fw) |
| 63 | { | 68 | { |
| 64 | } | 69 | } |
| 70 | |||
| 71 | static inline int cache_firmware(const char *name) | ||
| 72 | { | ||
| 73 | return -ENOENT; | ||
| 74 | } | ||
| 75 | |||
| 76 | static inline int uncache_firmware(const char *name) | ||
| 77 | { | ||
| 78 | return -EINVAL; | ||
| 79 | } | ||
| 65 | #endif | 80 | #endif |
| 66 | 81 | ||
| 67 | #endif | 82 | #endif |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 15be561e7397..a82296af413f 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
| @@ -19,9 +19,11 @@ | |||
| 19 | 19 | ||
| 20 | #define FSL_UTMI_PHY_DLY 10 /*As per P1010RM, delay for UTMI | 20 | #define FSL_UTMI_PHY_DLY 10 /*As per P1010RM, delay for UTMI |
| 21 | PHY CLK to become stable - 10ms*/ | 21 | PHY CLK to become stable - 10ms*/ |
| 22 | #define FSL_USB_PHY_CLK_TIMEOUT 10000 /* uSec */ | ||
| 22 | #define FSL_USB_VER_OLD 0 | 23 | #define FSL_USB_VER_OLD 0 |
| 23 | #define FSL_USB_VER_1_6 1 | 24 | #define FSL_USB_VER_1_6 1 |
| 24 | #define FSL_USB_VER_2_2 2 | 25 | #define FSL_USB_VER_2_2 2 |
| 26 | #define FSL_USB_VER_2_4 3 | ||
| 25 | 27 | ||
| 26 | #include <linux/types.h> | 28 | #include <linux/types.h> |
| 27 | 29 | ||
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 55e6d63d46d0..a52f2f4fe030 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/kallsyms.h> | 10 | #include <linux/kallsyms.h> |
| 11 | #include <linux/linkage.h> | 11 | #include <linux/linkage.h> |
| 12 | #include <linux/bitops.h> | 12 | #include <linux/bitops.h> |
| 13 | #include <linux/ptrace.h> | ||
| 13 | #include <linux/ktime.h> | 14 | #include <linux/ktime.h> |
| 14 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
| 15 | #include <linux/types.h> | 16 | #include <linux/types.h> |
| @@ -18,6 +19,28 @@ | |||
| 18 | 19 | ||
| 19 | #include <asm/ftrace.h> | 20 | #include <asm/ftrace.h> |
| 20 | 21 | ||
| 22 | /* | ||
| 23 | * If the arch supports passing the variable contents of | ||
| 24 | * function_trace_op as the third parameter back from the | ||
| 25 | * mcount call, then the arch should define this as 1. | ||
| 26 | */ | ||
| 27 | #ifndef ARCH_SUPPORTS_FTRACE_OPS | ||
| 28 | #define ARCH_SUPPORTS_FTRACE_OPS 0 | ||
| 29 | #endif | ||
| 30 | |||
| 31 | /* | ||
| 32 | * If the arch's mcount caller does not support all of ftrace's | ||
| 33 | * features, then it must call an indirect function that | ||
| 34 | * does. Or at least does enough to prevent any unwelcomed side effects. | ||
| 35 | */ | ||
| 36 | #if !defined(CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST) || \ | ||
| 37 | !ARCH_SUPPORTS_FTRACE_OPS | ||
| 38 | # define FTRACE_FORCE_LIST_FUNC 1 | ||
| 39 | #else | ||
| 40 | # define FTRACE_FORCE_LIST_FUNC 0 | ||
| 41 | #endif | ||
| 42 | |||
| 43 | |||
| 21 | struct module; | 44 | struct module; |
| 22 | struct ftrace_hash; | 45 | struct ftrace_hash; |
| 23 | 46 | ||
| @@ -29,7 +52,10 @@ ftrace_enable_sysctl(struct ctl_table *table, int write, | |||
| 29 | void __user *buffer, size_t *lenp, | 52 | void __user *buffer, size_t *lenp, |
| 30 | loff_t *ppos); | 53 | loff_t *ppos); |
| 31 | 54 | ||
| 32 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); | 55 | struct ftrace_ops; |
| 56 | |||
| 57 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip, | ||
| 58 | struct ftrace_ops *op, struct pt_regs *regs); | ||
| 33 | 59 | ||
| 34 | /* | 60 | /* |
| 35 | * FTRACE_OPS_FL_* bits denote the state of ftrace_ops struct and are | 61 | * FTRACE_OPS_FL_* bits denote the state of ftrace_ops struct and are |
| @@ -45,12 +71,33 @@ typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); | |||
| 45 | * could be controled by following calls: | 71 | * could be controled by following calls: |
| 46 | * ftrace_function_local_enable | 72 | * ftrace_function_local_enable |
| 47 | * ftrace_function_local_disable | 73 | * ftrace_function_local_disable |
| 74 | * SAVE_REGS - The ftrace_ops wants regs saved at each function called | ||
| 75 | * and passed to the callback. If this flag is set, but the | ||
| 76 | * architecture does not support passing regs | ||
| 77 | * (ARCH_SUPPORTS_FTRACE_SAVE_REGS is not defined), then the | ||
| 78 | * ftrace_ops will fail to register, unless the next flag | ||
| 79 | * is set. | ||
| 80 | * SAVE_REGS_IF_SUPPORTED - This is the same as SAVE_REGS, but if the | ||
| 81 | * handler can handle an arch that does not save regs | ||
| 82 | * (the handler tests if regs == NULL), then it can set | ||
| 83 | * this flag instead. It will not fail registering the ftrace_ops | ||
| 84 | * but, the regs field will be NULL if the arch does not support | ||
| 85 | * passing regs to the handler. | ||
| 86 | * Note, if this flag is set, the SAVE_REGS flag will automatically | ||
| 87 | * get set upon registering the ftrace_ops, if the arch supports it. | ||
| 88 | * RECURSION_SAFE - The ftrace_ops can set this to tell the ftrace infrastructure | ||
| 89 | * that the call back has its own recursion protection. If it does | ||
| 90 | * not set this, then the ftrace infrastructure will add recursion | ||
| 91 | * protection for the caller. | ||
| 48 | */ | 92 | */ |
| 49 | enum { | 93 | enum { |
| 50 | FTRACE_OPS_FL_ENABLED = 1 << 0, | 94 | FTRACE_OPS_FL_ENABLED = 1 << 0, |
| 51 | FTRACE_OPS_FL_GLOBAL = 1 << 1, | 95 | FTRACE_OPS_FL_GLOBAL = 1 << 1, |
| 52 | FTRACE_OPS_FL_DYNAMIC = 1 << 2, | 96 | FTRACE_OPS_FL_DYNAMIC = 1 << 2, |
| 53 | FTRACE_OPS_FL_CONTROL = 1 << 3, | 97 | FTRACE_OPS_FL_CONTROL = 1 << 3, |
| 98 | FTRACE_OPS_FL_SAVE_REGS = 1 << 4, | ||
| 99 | FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED = 1 << 5, | ||
| 100 | FTRACE_OPS_FL_RECURSION_SAFE = 1 << 6, | ||
| 54 | }; | 101 | }; |
| 55 | 102 | ||
| 56 | struct ftrace_ops { | 103 | struct ftrace_ops { |
| @@ -163,7 +210,8 @@ static inline int ftrace_function_local_disabled(struct ftrace_ops *ops) | |||
| 163 | return *this_cpu_ptr(ops->disabled); | 210 | return *this_cpu_ptr(ops->disabled); |
| 164 | } | 211 | } |
| 165 | 212 | ||
| 166 | extern void ftrace_stub(unsigned long a0, unsigned long a1); | 213 | extern void ftrace_stub(unsigned long a0, unsigned long a1, |
| 214 | struct ftrace_ops *op, struct pt_regs *regs); | ||
| 167 | 215 | ||
| 168 | #else /* !CONFIG_FUNCTION_TRACER */ | 216 | #else /* !CONFIG_FUNCTION_TRACER */ |
| 169 | /* | 217 | /* |
| @@ -172,6 +220,10 @@ extern void ftrace_stub(unsigned long a0, unsigned long a1); | |||
| 172 | */ | 220 | */ |
| 173 | #define register_ftrace_function(ops) ({ 0; }) | 221 | #define register_ftrace_function(ops) ({ 0; }) |
| 174 | #define unregister_ftrace_function(ops) ({ 0; }) | 222 | #define unregister_ftrace_function(ops) ({ 0; }) |
| 223 | static inline int ftrace_nr_registered_ops(void) | ||
| 224 | { | ||
| 225 | return 0; | ||
| 226 | } | ||
| 175 | static inline void clear_ftrace_function(void) { } | 227 | static inline void clear_ftrace_function(void) { } |
| 176 | static inline void ftrace_kill(void) { } | 228 | static inline void ftrace_kill(void) { } |
| 177 | static inline void ftrace_stop(void) { } | 229 | static inline void ftrace_stop(void) { } |
| @@ -227,12 +279,33 @@ extern void unregister_ftrace_function_probe_all(char *glob); | |||
| 227 | 279 | ||
| 228 | extern int ftrace_text_reserved(void *start, void *end); | 280 | extern int ftrace_text_reserved(void *start, void *end); |
| 229 | 281 | ||
| 282 | extern int ftrace_nr_registered_ops(void); | ||
| 283 | |||
| 284 | /* | ||
| 285 | * The dyn_ftrace record's flags field is split into two parts. | ||
| 286 | * the first part which is '0-FTRACE_REF_MAX' is a counter of | ||
| 287 | * the number of callbacks that have registered the function that | ||
| 288 | * the dyn_ftrace descriptor represents. | ||
| 289 | * | ||
| 290 | * The second part is a mask: | ||
| 291 | * ENABLED - the function is being traced | ||
| 292 | * REGS - the record wants the function to save regs | ||
| 293 | * REGS_EN - the function is set up to save regs. | ||
| 294 | * | ||
| 295 | * When a new ftrace_ops is registered and wants a function to save | ||
| 296 | * pt_regs, the rec->flag REGS is set. When the function has been | ||
| 297 | * set up to save regs, the REG_EN flag is set. Once a function | ||
| 298 | * starts saving regs it will do so until all ftrace_ops are removed | ||
| 299 | * from tracing that function. | ||
| 300 | */ | ||
| 230 | enum { | 301 | enum { |
| 231 | FTRACE_FL_ENABLED = (1 << 30), | 302 | FTRACE_FL_ENABLED = (1UL << 29), |
| 303 | FTRACE_FL_REGS = (1UL << 30), | ||
| 304 | FTRACE_FL_REGS_EN = (1UL << 31) | ||
| 232 | }; | 305 | }; |
| 233 | 306 | ||
| 234 | #define FTRACE_FL_MASK (0x3UL << 30) | 307 | #define FTRACE_FL_MASK (0x7UL << 29) |
| 235 | #define FTRACE_REF_MAX ((1 << 30) - 1) | 308 | #define FTRACE_REF_MAX ((1UL << 29) - 1) |
| 236 | 309 | ||
| 237 | struct dyn_ftrace { | 310 | struct dyn_ftrace { |
| 238 | union { | 311 | union { |
| @@ -244,6 +317,8 @@ struct dyn_ftrace { | |||
| 244 | }; | 317 | }; |
| 245 | 318 | ||
| 246 | int ftrace_force_update(void); | 319 | int ftrace_force_update(void); |
| 320 | int ftrace_set_filter_ip(struct ftrace_ops *ops, unsigned long ip, | ||
| 321 | int remove, int reset); | ||
| 247 | int ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf, | 322 | int ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf, |
| 248 | int len, int reset); | 323 | int len, int reset); |
| 249 | int ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf, | 324 | int ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf, |
| @@ -263,9 +338,23 @@ enum { | |||
| 263 | FTRACE_STOP_FUNC_RET = (1 << 4), | 338 | FTRACE_STOP_FUNC_RET = (1 << 4), |
| 264 | }; | 339 | }; |
| 265 | 340 | ||
| 341 | /* | ||
| 342 | * The FTRACE_UPDATE_* enum is used to pass information back | ||
| 343 | * from the ftrace_update_record() and ftrace_test_record() | ||
| 344 | * functions. These are called by the code update routines | ||
| 345 | * to find out what is to be done for a given function. | ||
| 346 | * | ||
| 347 | * IGNORE - The function is already what we want it to be | ||
| 348 | * MAKE_CALL - Start tracing the function | ||
| 349 | * MODIFY_CALL - Stop saving regs for the function | ||
| 350 | * MODIFY_CALL_REGS - Start saving regs for the function | ||
| 351 | * MAKE_NOP - Stop tracing the function | ||
| 352 | */ | ||
| 266 | enum { | 353 | enum { |
| 267 | FTRACE_UPDATE_IGNORE, | 354 | FTRACE_UPDATE_IGNORE, |
| 268 | FTRACE_UPDATE_MAKE_CALL, | 355 | FTRACE_UPDATE_MAKE_CALL, |
| 356 | FTRACE_UPDATE_MODIFY_CALL, | ||
| 357 | FTRACE_UPDATE_MODIFY_CALL_REGS, | ||
| 269 | FTRACE_UPDATE_MAKE_NOP, | 358 | FTRACE_UPDATE_MAKE_NOP, |
| 270 | }; | 359 | }; |
| 271 | 360 | ||
| @@ -317,7 +406,9 @@ extern int ftrace_dyn_arch_init(void *data); | |||
| 317 | extern void ftrace_replace_code(int enable); | 406 | extern void ftrace_replace_code(int enable); |
| 318 | extern int ftrace_update_ftrace_func(ftrace_func_t func); | 407 | extern int ftrace_update_ftrace_func(ftrace_func_t func); |
| 319 | extern void ftrace_caller(void); | 408 | extern void ftrace_caller(void); |
| 409 | extern void ftrace_regs_caller(void); | ||
| 320 | extern void ftrace_call(void); | 410 | extern void ftrace_call(void); |
| 411 | extern void ftrace_regs_call(void); | ||
| 321 | extern void mcount_call(void); | 412 | extern void mcount_call(void); |
| 322 | 413 | ||
| 323 | void ftrace_modify_all_code(int command); | 414 | void ftrace_modify_all_code(int command); |
| @@ -325,6 +416,15 @@ void ftrace_modify_all_code(int command); | |||
| 325 | #ifndef FTRACE_ADDR | 416 | #ifndef FTRACE_ADDR |
| 326 | #define FTRACE_ADDR ((unsigned long)ftrace_caller) | 417 | #define FTRACE_ADDR ((unsigned long)ftrace_caller) |
| 327 | #endif | 418 | #endif |
| 419 | |||
| 420 | #ifndef FTRACE_REGS_ADDR | ||
| 421 | #ifdef ARCH_SUPPORTS_FTRACE_SAVE_REGS | ||
| 422 | # define FTRACE_REGS_ADDR ((unsigned long)ftrace_regs_caller) | ||
| 423 | #else | ||
| 424 | # define FTRACE_REGS_ADDR FTRACE_ADDR | ||
| 425 | #endif | ||
| 426 | #endif | ||
| 427 | |||
| 328 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 428 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
| 329 | extern void ftrace_graph_caller(void); | 429 | extern void ftrace_graph_caller(void); |
| 330 | extern int ftrace_enable_ftrace_graph_caller(void); | 430 | extern int ftrace_enable_ftrace_graph_caller(void); |
| @@ -380,6 +480,39 @@ extern int ftrace_make_nop(struct module *mod, | |||
| 380 | */ | 480 | */ |
| 381 | extern int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr); | 481 | extern int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr); |
| 382 | 482 | ||
| 483 | #ifdef ARCH_SUPPORTS_FTRACE_SAVE_REGS | ||
| 484 | /** | ||
| 485 | * ftrace_modify_call - convert from one addr to another (no nop) | ||
| 486 | * @rec: the mcount call site record | ||
| 487 | * @old_addr: the address expected to be currently called to | ||
| 488 | * @addr: the address to change to | ||
| 489 | * | ||
| 490 | * This is a very sensitive operation and great care needs | ||
| 491 | * to be taken by the arch. The operation should carefully | ||
| 492 | * read the location, check to see if what is read is indeed | ||
| 493 | * what we expect it to be, and then on success of the compare, | ||
| 494 | * it should write to the location. | ||
| 495 | * | ||
| 496 | * The code segment at @rec->ip should be a caller to @old_addr | ||
| 497 | * | ||
| 498 | * Return must be: | ||
| 499 | * 0 on success | ||
| 500 | * -EFAULT on error reading the location | ||
| 501 | * -EINVAL on a failed compare of the contents | ||
| 502 | * -EPERM on error writing to the location | ||
| 503 | * Any other value will be considered a failure. | ||
| 504 | */ | ||
| 505 | extern int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr, | ||
| 506 | unsigned long addr); | ||
| 507 | #else | ||
| 508 | /* Should never be called */ | ||
| 509 | static inline int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr, | ||
| 510 | unsigned long addr) | ||
| 511 | { | ||
| 512 | return -EINVAL; | ||
| 513 | } | ||
| 514 | #endif | ||
| 515 | |||
| 383 | /* May be defined in arch */ | 516 | /* May be defined in arch */ |
| 384 | extern int ftrace_arch_read_dyn_info(char *buf, int size); | 517 | extern int ftrace_arch_read_dyn_info(char *buf, int size); |
| 385 | 518 | ||
| @@ -387,7 +520,7 @@ extern int skip_trace(unsigned long ip); | |||
| 387 | 520 | ||
| 388 | extern void ftrace_disable_daemon(void); | 521 | extern void ftrace_disable_daemon(void); |
| 389 | extern void ftrace_enable_daemon(void); | 522 | extern void ftrace_enable_daemon(void); |
| 390 | #else | 523 | #else /* CONFIG_DYNAMIC_FTRACE */ |
| 391 | static inline int skip_trace(unsigned long ip) { return 0; } | 524 | static inline int skip_trace(unsigned long ip) { return 0; } |
| 392 | static inline int ftrace_force_update(void) { return 0; } | 525 | static inline int ftrace_force_update(void) { return 0; } |
| 393 | static inline void ftrace_disable_daemon(void) { } | 526 | static inline void ftrace_disable_daemon(void) { } |
| @@ -405,6 +538,10 @@ static inline int ftrace_text_reserved(void *start, void *end) | |||
| 405 | { | 538 | { |
| 406 | return 0; | 539 | return 0; |
| 407 | } | 540 | } |
| 541 | static inline unsigned long ftrace_location(unsigned long ip) | ||
| 542 | { | ||
| 543 | return 0; | ||
| 544 | } | ||
| 408 | 545 | ||
| 409 | /* | 546 | /* |
| 410 | * Again users of functions that have ftrace_ops may not | 547 | * Again users of functions that have ftrace_ops may not |
| @@ -413,6 +550,7 @@ static inline int ftrace_text_reserved(void *start, void *end) | |||
| 413 | */ | 550 | */ |
| 414 | #define ftrace_regex_open(ops, flag, inod, file) ({ -ENODEV; }) | 551 | #define ftrace_regex_open(ops, flag, inod, file) ({ -ENODEV; }) |
| 415 | #define ftrace_set_early_filter(ops, buf, enable) do { } while (0) | 552 | #define ftrace_set_early_filter(ops, buf, enable) do { } while (0) |
| 553 | #define ftrace_set_filter_ip(ops, ip, remove, reset) ({ -ENODEV; }) | ||
| 416 | #define ftrace_set_filter(ops, buf, len, reset) ({ -ENODEV; }) | 554 | #define ftrace_set_filter(ops, buf, len, reset) ({ -ENODEV; }) |
| 417 | #define ftrace_set_notrace(ops, buf, len, reset) ({ -ENODEV; }) | 555 | #define ftrace_set_notrace(ops, buf, len, reset) ({ -ENODEV; }) |
| 418 | #define ftrace_free_filter(ops) do { } while (0) | 556 | #define ftrace_free_filter(ops) do { } while (0) |
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h deleted file mode 100644 index 79b3eb37243a..000000000000 --- a/include/linux/generic_serial.h +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * generic_serial.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 1998 R.E.Wolff@BitWizard.nl | ||
| 5 | * | ||
| 6 | * written for the SX serial driver. | ||
| 7 | * | ||
| 8 | * Version 0.1 -- December, 1998. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef GENERIC_SERIAL_H | ||
| 12 | #define GENERIC_SERIAL_H | ||
| 13 | |||
| 14 | #warning Use of this header is deprecated. | ||
| 15 | #warning Since nobody sets the constants defined here for you, you should not, in any case, use them. Including the header is thus pointless. | ||
| 16 | |||
| 17 | /* Flags */ | ||
| 18 | /* Warning: serial.h defines some ASYNC_ flags, they say they are "only" | ||
| 19 | used in serial.c, but they are also used in all other serial drivers. | ||
| 20 | Make sure they don't clash with these here... */ | ||
| 21 | #define GS_TX_INTEN 0x00800000 | ||
| 22 | #define GS_RX_INTEN 0x00400000 | ||
| 23 | #define GS_ACTIVE 0x00200000 | ||
| 24 | |||
| 25 | #define GS_TYPE_NORMAL 1 | ||
| 26 | |||
| 27 | #define GS_DEBUG_FLUSH 0x00000001 | ||
| 28 | #define GS_DEBUG_BTR 0x00000002 | ||
| 29 | #define GS_DEBUG_TERMIOS 0x00000004 | ||
| 30 | #define GS_DEBUG_STUFF 0x00000008 | ||
| 31 | #define GS_DEBUG_CLOSE 0x00000010 | ||
| 32 | #define GS_DEBUG_FLOW 0x00000020 | ||
| 33 | #define GS_DEBUG_WRITE 0x00000040 | ||
| 34 | |||
| 35 | #endif | ||
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 305f23cd7cff..cab3da3d0949 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
| @@ -132,11 +132,11 @@ extern void synchronize_irq(unsigned int irq); | |||
| 132 | struct task_struct; | 132 | struct task_struct; |
| 133 | 133 | ||
| 134 | #if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING) | 134 | #if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING) |
| 135 | static inline void account_system_vtime(struct task_struct *tsk) | 135 | static inline void vtime_account(struct task_struct *tsk) |
| 136 | { | 136 | { |
| 137 | } | 137 | } |
| 138 | #else | 138 | #else |
| 139 | extern void account_system_vtime(struct task_struct *tsk); | 139 | extern void vtime_account(struct task_struct *tsk); |
| 140 | #endif | 140 | #endif |
| 141 | 141 | ||
| 142 | #if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) | 142 | #if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) |
| @@ -162,7 +162,7 @@ extern void rcu_nmi_exit(void); | |||
| 162 | */ | 162 | */ |
| 163 | #define __irq_enter() \ | 163 | #define __irq_enter() \ |
| 164 | do { \ | 164 | do { \ |
| 165 | account_system_vtime(current); \ | 165 | vtime_account(current); \ |
| 166 | add_preempt_count(HARDIRQ_OFFSET); \ | 166 | add_preempt_count(HARDIRQ_OFFSET); \ |
| 167 | trace_hardirq_enter(); \ | 167 | trace_hardirq_enter(); \ |
| 168 | } while (0) | 168 | } while (0) |
| @@ -178,7 +178,7 @@ extern void irq_enter(void); | |||
| 178 | #define __irq_exit() \ | 178 | #define __irq_exit() \ |
| 179 | do { \ | 179 | do { \ |
| 180 | trace_hardirq_exit(); \ | 180 | trace_hardirq_exit(); \ |
| 181 | account_system_vtime(current); \ | 181 | vtime_account(current); \ |
| 182 | sub_preempt_count(HARDIRQ_OFFSET); \ | 182 | sub_preempt_count(HARDIRQ_OFFSET); \ |
| 183 | } while (0) | 183 | } while (0) |
| 184 | 184 | ||
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h new file mode 100644 index 000000000000..0aa5f4c42ae6 --- /dev/null +++ b/include/linux/hid-sensor-hub.h | |||
| @@ -0,0 +1,160 @@ | |||
| 1 | /* | ||
| 2 | * HID Sensors Driver | ||
| 3 | * Copyright (c) 2012, Intel Corporation. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms and conditions of the GNU General Public License, | ||
| 7 | * version 2, as published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along with | ||
| 15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
| 16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 17 | * | ||
| 18 | */ | ||
| 19 | #ifndef _HID_SENSORS_HUB_H | ||
| 20 | #define _HID_SENSORS_HUB_H | ||
| 21 | |||
| 22 | #include <linux/hid.h> | ||
| 23 | #include <linux/hid-sensor-ids.h> | ||
| 24 | |||
| 25 | /** | ||
| 26 | * struct hid_sensor_hub_attribute_info - Attribute info | ||
| 27 | * @usage_id: Parent usage id of a physical device. | ||
| 28 | * @attrib_id: Attribute id for this attribute. | ||
| 29 | * @report_id: Report id in which this information resides. | ||
| 30 | * @index: Field index in the report. | ||
| 31 | * @units: Measurment unit for this attribute. | ||
| 32 | * @unit_expo: Exponent used in the data. | ||
| 33 | * @size: Size in bytes for data size. | ||
| 34 | */ | ||
| 35 | struct hid_sensor_hub_attribute_info { | ||
| 36 | u32 usage_id; | ||
| 37 | u32 attrib_id; | ||
| 38 | s32 report_id; | ||
| 39 | s32 index; | ||
| 40 | s32 units; | ||
| 41 | s32 unit_expo; | ||
| 42 | s32 size; | ||
| 43 | }; | ||
| 44 | |||
| 45 | /** | ||
| 46 | * struct hid_sensor_hub_device - Stores the hub instance data | ||
| 47 | * @hdev: Stores the hid instance. | ||
| 48 | * @vendor_id: Vendor id of hub device. | ||
| 49 | * @product_id: Product id of hub device. | ||
| 50 | */ | ||
| 51 | struct hid_sensor_hub_device { | ||
| 52 | struct hid_device *hdev; | ||
| 53 | u32 vendor_id; | ||
| 54 | u32 product_id; | ||
| 55 | }; | ||
| 56 | |||
| 57 | /** | ||
| 58 | * struct hid_sensor_hub_callbacks - Client callback functions | ||
| 59 | * @pdev: Platform device instance of the client driver. | ||
| 60 | * @suspend: Suspend callback. | ||
| 61 | * @resume: Resume callback. | ||
| 62 | * @capture_sample: Callback to get a sample. | ||
| 63 | * @send_event: Send notification to indicate all samples are | ||
| 64 | * captured, process and send event | ||
| 65 | */ | ||
| 66 | struct hid_sensor_hub_callbacks { | ||
| 67 | struct platform_device *pdev; | ||
| 68 | int (*suspend)(struct hid_sensor_hub_device *hsdev, void *priv); | ||
| 69 | int (*resume)(struct hid_sensor_hub_device *hsdev, void *priv); | ||
| 70 | int (*capture_sample)(struct hid_sensor_hub_device *hsdev, | ||
| 71 | u32 usage_id, size_t raw_len, char *raw_data, | ||
| 72 | void *priv); | ||
| 73 | int (*send_event)(struct hid_sensor_hub_device *hsdev, u32 usage_id, | ||
| 74 | void *priv); | ||
| 75 | }; | ||
| 76 | |||
| 77 | /* Registration functions */ | ||
| 78 | |||
| 79 | /** | ||
| 80 | * sensor_hub_register_callback() - Register client callbacks | ||
| 81 | * @hsdev: Hub device instance. | ||
| 82 | * @usage_id: Usage id of the client (E.g. 0x200076 for Gyro). | ||
| 83 | * @usage_callback: Callback function storage | ||
| 84 | * | ||
| 85 | * Used to register callbacks by client processing drivers. Sensor | ||
| 86 | * hub core driver will call these callbacks to offload processing | ||
| 87 | * of data streams and notifications. | ||
| 88 | */ | ||
| 89 | int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev, | ||
| 90 | u32 usage_id, | ||
| 91 | struct hid_sensor_hub_callbacks *usage_callback); | ||
| 92 | |||
| 93 | /** | ||
| 94 | * sensor_hub_remove_callback() - Remove client callbacks | ||
| 95 | * @hsdev: Hub device instance. | ||
| 96 | * @usage_id: Usage id of the client (E.g. 0x200076 for Gyro). | ||
| 97 | * | ||
| 98 | * If there is a callback registred, this call will remove that | ||
| 99 | * callbacks, so that it will stop data and event notifications. | ||
| 100 | */ | ||
| 101 | int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev, | ||
| 102 | u32 usage_id); | ||
| 103 | |||
| 104 | |||
| 105 | /* Hid sensor hub core interfaces */ | ||
| 106 | |||
| 107 | /** | ||
| 108 | * sensor_hub_input_get_attribute_info() - Get an attribute information | ||
| 109 | * @hsdev: Hub device instance. | ||
| 110 | * @type: Type of this attribute, input/output/feature | ||
| 111 | * @usage_id: Attribute usage id of parent physical device as per spec | ||
| 112 | * @attr_usage_id: Attribute usage id as per spec | ||
| 113 | * @info: return information about attribute after parsing report | ||
| 114 | * | ||
| 115 | * Parses report and returns the attribute information such as report id, | ||
| 116 | * field index, units and exponet etc. | ||
| 117 | */ | ||
| 118 | int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev, | ||
| 119 | u8 type, | ||
| 120 | u32 usage_id, u32 attr_usage_id, | ||
| 121 | struct hid_sensor_hub_attribute_info *info); | ||
| 122 | |||
| 123 | /** | ||
| 124 | * sensor_hub_input_attr_get_raw_value() - Synchronous read request | ||
| 125 | * @usage_id: Attribute usage id of parent physical device as per spec | ||
| 126 | * @attr_usage_id: Attribute usage id as per spec | ||
| 127 | * @report_id: Report id to look for | ||
| 128 | * | ||
| 129 | * Issues a synchronous read request for an input attribute. Returns | ||
| 130 | * data upto 32 bits. Since client can get events, so this call should | ||
| 131 | * not be used for data paths, this will impact performance. | ||
| 132 | */ | ||
| 133 | |||
| 134 | int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev, | ||
| 135 | u32 usage_id, | ||
| 136 | u32 attr_usage_id, u32 report_id); | ||
| 137 | /** | ||
| 138 | * sensor_hub_set_feature() - Feature set request | ||
| 139 | * @report_id: Report id to look for | ||
| 140 | * @field_index: Field index inside a report | ||
| 141 | * @value: Value to set | ||
| 142 | * | ||
| 143 | * Used to set a field in feature report. For example this can set polling | ||
| 144 | * interval, sensitivity, activate/deactivate state. | ||
| 145 | */ | ||
| 146 | int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, | ||
| 147 | u32 field_index, s32 value); | ||
| 148 | |||
| 149 | /** | ||
| 150 | * sensor_hub_get_feature() - Feature get request | ||
| 151 | * @report_id: Report id to look for | ||
| 152 | * @field_index: Field index inside a report | ||
| 153 | * @value: Place holder for return value | ||
| 154 | * | ||
| 155 | * Used to get a field in feature report. For example this can get polling | ||
| 156 | * interval, sensitivity, activate/deactivate state. | ||
| 157 | */ | ||
| 158 | int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, | ||
| 159 | u32 field_index, s32 *value); | ||
| 160 | #endif | ||
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h new file mode 100644 index 000000000000..ca8d7e94eb3c --- /dev/null +++ b/include/linux/hid-sensor-ids.h | |||
| @@ -0,0 +1,112 @@ | |||
| 1 | /* | ||
| 2 | * HID Sensors Driver | ||
| 3 | * Copyright (c) 2012, Intel Corporation. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms and conditions of the GNU General Public License, | ||
| 7 | * version 2, as published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along with | ||
| 15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
| 16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 17 | * | ||
| 18 | */ | ||
| 19 | #ifndef _HID_SENSORS_IDS_H | ||
| 20 | #define _HID_SENSORS_IDS_H | ||
| 21 | |||
| 22 | #define HID_UP_SENSOR 0x00200000 | ||
| 23 | #define HID_MAX_PHY_DEVICES 0xFF | ||
| 24 | |||
| 25 | /* Accel 3D (200073) */ | ||
| 26 | #define HID_USAGE_SENSOR_ACCEL_3D 0x200073 | ||
| 27 | #define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453 | ||
| 28 | #define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454 | ||
| 29 | #define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455 | ||
| 30 | |||
| 31 | /* ALS (200041) */ | ||
| 32 | #define HID_USAGE_SENSOR_ALS 0x200041 | ||
| 33 | #define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1 | ||
| 34 | |||
| 35 | /* Gyro 3D: (200076) */ | ||
| 36 | #define HID_USAGE_SENSOR_GYRO_3D 0x200076 | ||
| 37 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457 | ||
| 38 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458 | ||
| 39 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459 | ||
| 40 | |||
| 41 | /*ORIENTATION: Compass 3D: (200083) */ | ||
| 42 | #define HID_USAGE_SENSOR_COMPASS_3D 0x200083 | ||
| 43 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471 | ||
| 44 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472 | ||
| 45 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473 | ||
| 46 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Z 0x200474 | ||
| 47 | |||
| 48 | #define HID_USAGE_SENSOR_ORIENT_COMP_MAGN_NORTH 0x200475 | ||
| 49 | #define HID_USAGE_SENSOR_ORIENT_COMP_TRUE_NORTH 0x200476 | ||
| 50 | #define HID_USAGE_SENSOR_ORIENT_MAGN_NORTH 0x200477 | ||
| 51 | #define HID_USAGE_SENSOR_ORIENT_TRUE_NORTH 0x200478 | ||
| 52 | |||
| 53 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE 0x200479 | ||
| 54 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_X 0x20047A | ||
| 55 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Y 0x20047B | ||
| 56 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Z 0x20047C | ||
| 57 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_OUT_OF_RANGE 0x20047D | ||
| 58 | #define HID_USAGE_SENSOR_ORIENT_TILT 0x20047E | ||
| 59 | #define HID_USAGE_SENSOR_ORIENT_TILT_X 0x20047F | ||
| 60 | #define HID_USAGE_SENSOR_ORIENT_TILT_Y 0x200480 | ||
| 61 | #define HID_USAGE_SENSOR_ORIENT_TILT_Z 0x200481 | ||
| 62 | #define HID_USAGE_SENSOR_ORIENT_ROTATION_MATRIX 0x200482 | ||
| 63 | #define HID_USAGE_SENSOR_ORIENT_QUATERNION 0x200483 | ||
| 64 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX 0x200484 | ||
| 65 | |||
| 66 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_X_AXIS 0x200485 | ||
| 67 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_Y_AXIS 0x200486 | ||
| 68 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_Z_AXIS 0x200487 | ||
| 69 | |||
| 70 | /* Units */ | ||
| 71 | #define HID_USAGE_SENSOR_UNITS_NOT_SPECIFIED 0x00 | ||
| 72 | #define HID_USAGE_SENSOR_UNITS_LUX 0x01 | ||
| 73 | #define HID_USAGE_SENSOR_UNITS_KELVIN 0x01000100 | ||
| 74 | #define HID_USAGE_SENSOR_UNITS_FAHRENHEIT 0x03000100 | ||
| 75 | #define HID_USAGE_SENSOR_UNITS_PASCAL 0xF1E1 | ||
| 76 | #define HID_USAGE_SENSOR_UNITS_NEWTON 0x11E1 | ||
| 77 | #define HID_USAGE_SENSOR_UNITS_METERS_PER_SECOND 0x11F0 | ||
| 78 | #define HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD 0x11E0 | ||
| 79 | #define HID_USAGE_SENSOR_UNITS_FARAD 0xE14F2000 | ||
| 80 | #define HID_USAGE_SENSOR_UNITS_AMPERE 0x01001000 | ||
| 81 | #define HID_USAGE_SENSOR_UNITS_WATT 0x21d1 | ||
| 82 | #define HID_USAGE_SENSOR_UNITS_HENRY 0x21E1E000 | ||
| 83 | #define HID_USAGE_SENSOR_UNITS_OHM 0x21D1E000 | ||
| 84 | #define HID_USAGE_SENSOR_UNITS_VOLT 0x21D1F000 | ||
| 85 | #define HID_USAGE_SENSOR_UNITS_HERTZ 0x01F0 | ||
| 86 | #define HID_USAGE_SENSOR_UNITS_DEGREES_PER_SEC_SQRD 0x14E0 | ||
| 87 | #define HID_USAGE_SENSOR_UNITS_RADIANS 0x12 | ||
| 88 | #define HID_USAGE_SENSOR_UNITS_RADIANS_PER_SECOND 0x12F0 | ||
| 89 | #define HID_USAGE_SENSOR_UNITS_RADIANS_PER_SEC_SQRD 0x12E0 | ||
| 90 | #define HID_USAGE_SENSOR_UNITS_SECOND 0x0110 | ||
| 91 | #define HID_USAGE_SENSOR_UNITS_GAUSS 0x01E1F000 | ||
| 92 | #define HID_USAGE_SENSOR_UNITS_GRAM 0x0101 | ||
| 93 | #define HID_USAGE_SENSOR_UNITS_CENTIMETER 0x11 | ||
| 94 | #define HID_USAGE_SENSOR_UNITS_G 0x1A | ||
| 95 | #define HID_USAGE_SENSOR_UNITS_MILLISECOND 0x19 | ||
| 96 | #define HID_USAGE_SENSOR_UNITS_PERCENT 0x17 | ||
| 97 | #define HID_USAGE_SENSOR_UNITS_DEGREES 0x14 | ||
| 98 | #define HID_USAGE_SENSOR_UNITS_DEGREES_PER_SECOND 0x15 | ||
| 99 | |||
| 100 | /* Common selectors */ | ||
| 101 | #define HID_USAGE_SENSOR_PROP_REPORT_INTERVAL 0x20030E | ||
| 102 | #define HID_USAGE_SENSOR_PROP_SENSITIVITY_ABS 0x20030F | ||
| 103 | #define HID_USAGE_SENSOR_PROP_SENSITIVITY_RANGE_PCT 0x200310 | ||
| 104 | #define HID_USAGE_SENSOR_PROP_SENSITIVITY_REL_PCT 0x200311 | ||
| 105 | #define HID_USAGE_SENSOR_PROP_ACCURACY 0x200312 | ||
| 106 | #define HID_USAGE_SENSOR_PROP_RESOLUTION 0x200313 | ||
| 107 | #define HID_USAGE_SENSOR_PROP_RANGE_MAXIMUM 0x200314 | ||
| 108 | #define HID_USAGE_SENSOR_PROP_RANGE_MINIMUM 0x200315 | ||
| 109 | #define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 | ||
| 110 | #define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 | ||
| 111 | |||
| 112 | #endif | ||
diff --git a/include/linux/hid.h b/include/linux/hid.h index 42970de1b40c..7e1f37db7582 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -414,7 +414,7 @@ struct hid_field { | |||
| 414 | __u16 dpad; /* dpad input code */ | 414 | __u16 dpad; /* dpad input code */ |
| 415 | }; | 415 | }; |
| 416 | 416 | ||
| 417 | #define HID_MAX_FIELDS 128 | 417 | #define HID_MAX_FIELDS 256 |
| 418 | 418 | ||
| 419 | struct hid_report { | 419 | struct hid_report { |
| 420 | struct list_head list; | 420 | struct list_head list; |
| @@ -626,6 +626,7 @@ struct hid_usage_id { | |||
| 626 | * @report_fixup: called before report descriptor parsing (NULL means nop) | 626 | * @report_fixup: called before report descriptor parsing (NULL means nop) |
| 627 | * @input_mapping: invoked on input registering before mapping an usage | 627 | * @input_mapping: invoked on input registering before mapping an usage |
| 628 | * @input_mapped: invoked on input registering after mapping an usage | 628 | * @input_mapped: invoked on input registering after mapping an usage |
| 629 | * @input_configured: invoked just before the device is registered | ||
| 629 | * @feature_mapping: invoked on feature registering | 630 | * @feature_mapping: invoked on feature registering |
| 630 | * @suspend: invoked on suspend (NULL means nop) | 631 | * @suspend: invoked on suspend (NULL means nop) |
| 631 | * @resume: invoked on resume if device was not reset (NULL means nop) | 632 | * @resume: invoked on resume if device was not reset (NULL means nop) |
| @@ -670,6 +671,8 @@ struct hid_driver { | |||
| 670 | int (*input_mapped)(struct hid_device *hdev, | 671 | int (*input_mapped)(struct hid_device *hdev, |
| 671 | struct hid_input *hidinput, struct hid_field *field, | 672 | struct hid_input *hidinput, struct hid_field *field, |
| 672 | struct hid_usage *usage, unsigned long **bit, int *max); | 673 | struct hid_usage *usage, unsigned long **bit, int *max); |
| 674 | void (*input_configured)(struct hid_device *hdev, | ||
| 675 | struct hid_input *hidinput); | ||
| 673 | void (*feature_mapping)(struct hid_device *hdev, | 676 | void (*feature_mapping)(struct hid_device *hdev, |
| 674 | struct hid_field *field, | 677 | struct hid_field *field, |
| 675 | struct hid_usage *usage); | 678 | struct hid_usage *usage); |
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 68ed7f7e1fc9..e73b852156b1 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h | |||
| @@ -122,12 +122,53 @@ | |||
| 122 | #define REG_U32 4 | 122 | #define REG_U32 4 |
| 123 | #define REG_U64 8 | 123 | #define REG_U64 8 |
| 124 | 124 | ||
| 125 | /* | ||
| 126 | * As we look at expanding the KVP functionality to include | ||
| 127 | * IP injection functionality, we need to maintain binary | ||
| 128 | * compatibility with older daemons. | ||
| 129 | * | ||
| 130 | * The KVP opcodes are defined by the host and it was unfortunate | ||
| 131 | * that I chose to treat the registration operation as part of the | ||
| 132 | * KVP operations defined by the host. | ||
| 133 | * Here is the level of compatibility | ||
| 134 | * (between the user level daemon and the kernel KVP driver) that we | ||
| 135 | * will implement: | ||
| 136 | * | ||
| 137 | * An older daemon will always be supported on a newer driver. | ||
| 138 | * A given user level daemon will require a minimal version of the | ||
| 139 | * kernel driver. | ||
| 140 | * If we cannot handle the version differences, we will fail gracefully | ||
| 141 | * (this can happen when we have a user level daemon that is more | ||
| 142 | * advanced than the KVP driver. | ||
| 143 | * | ||
| 144 | * We will use values used in this handshake for determining if we have | ||
| 145 | * workable user level daemon and the kernel driver. We begin by taking the | ||
| 146 | * registration opcode out of the KVP opcode namespace. We will however, | ||
| 147 | * maintain compatibility with the existing user-level daemon code. | ||
| 148 | */ | ||
| 149 | |||
| 150 | /* | ||
| 151 | * Daemon code not supporting IP injection (legacy daemon). | ||
| 152 | */ | ||
| 153 | |||
| 154 | #define KVP_OP_REGISTER 4 | ||
| 155 | |||
| 156 | /* | ||
| 157 | * Daemon code supporting IP injection. | ||
| 158 | * The KVP opcode field is used to communicate the | ||
| 159 | * registration information; so define a namespace that | ||
| 160 | * will be distinct from the host defined KVP opcode. | ||
| 161 | */ | ||
| 162 | |||
| 163 | #define KVP_OP_REGISTER1 100 | ||
| 164 | |||
| 125 | enum hv_kvp_exchg_op { | 165 | enum hv_kvp_exchg_op { |
| 126 | KVP_OP_GET = 0, | 166 | KVP_OP_GET = 0, |
| 127 | KVP_OP_SET, | 167 | KVP_OP_SET, |
| 128 | KVP_OP_DELETE, | 168 | KVP_OP_DELETE, |
| 129 | KVP_OP_ENUMERATE, | 169 | KVP_OP_ENUMERATE, |
| 130 | KVP_OP_REGISTER, | 170 | KVP_OP_GET_IP_INFO, |
| 171 | KVP_OP_SET_IP_INFO, | ||
| 131 | KVP_OP_COUNT /* Number of operations, must be last. */ | 172 | KVP_OP_COUNT /* Number of operations, must be last. */ |
| 132 | }; | 173 | }; |
| 133 | 174 | ||
| @@ -140,6 +181,39 @@ enum hv_kvp_exchg_pool { | |||
| 140 | KVP_POOL_COUNT /* Number of pools, must be last. */ | 181 | KVP_POOL_COUNT /* Number of pools, must be last. */ |
| 141 | }; | 182 | }; |
| 142 | 183 | ||
| 184 | /* | ||
| 185 | * Some Hyper-V status codes. | ||
| 186 | */ | ||
| 187 | |||
| 188 | #define HV_S_OK 0x00000000 | ||
| 189 | #define HV_E_FAIL 0x80004005 | ||
| 190 | #define HV_S_CONT 0x80070103 | ||
| 191 | #define HV_ERROR_NOT_SUPPORTED 0x80070032 | ||
| 192 | #define HV_ERROR_MACHINE_LOCKED 0x800704F7 | ||
| 193 | #define HV_ERROR_DEVICE_NOT_CONNECTED 0x8007048F | ||
| 194 | #define HV_INVALIDARG 0x80070057 | ||
| 195 | #define HV_GUID_NOTFOUND 0x80041002 | ||
| 196 | |||
| 197 | #define ADDR_FAMILY_NONE 0x00 | ||
| 198 | #define ADDR_FAMILY_IPV4 0x01 | ||
| 199 | #define ADDR_FAMILY_IPV6 0x02 | ||
| 200 | |||
| 201 | #define MAX_ADAPTER_ID_SIZE 128 | ||
| 202 | #define MAX_IP_ADDR_SIZE 1024 | ||
| 203 | #define MAX_GATEWAY_SIZE 512 | ||
| 204 | |||
| 205 | |||
| 206 | struct hv_kvp_ipaddr_value { | ||
| 207 | __u16 adapter_id[MAX_ADAPTER_ID_SIZE]; | ||
| 208 | __u8 addr_family; | ||
| 209 | __u8 dhcp_enabled; | ||
| 210 | __u16 ip_addr[MAX_IP_ADDR_SIZE]; | ||
| 211 | __u16 sub_net[MAX_IP_ADDR_SIZE]; | ||
| 212 | __u16 gate_way[MAX_GATEWAY_SIZE]; | ||
| 213 | __u16 dns_addr[MAX_IP_ADDR_SIZE]; | ||
| 214 | } __attribute__((packed)); | ||
| 215 | |||
| 216 | |||
| 143 | struct hv_kvp_hdr { | 217 | struct hv_kvp_hdr { |
| 144 | __u8 operation; | 218 | __u8 operation; |
| 145 | __u8 pool; | 219 | __u8 pool; |
| @@ -181,16 +255,26 @@ struct hv_kvp_register { | |||
| 181 | }; | 255 | }; |
| 182 | 256 | ||
| 183 | struct hv_kvp_msg { | 257 | struct hv_kvp_msg { |
| 184 | struct hv_kvp_hdr kvp_hdr; | 258 | union { |
| 259 | struct hv_kvp_hdr kvp_hdr; | ||
| 260 | int error; | ||
| 261 | }; | ||
| 185 | union { | 262 | union { |
| 186 | struct hv_kvp_msg_get kvp_get; | 263 | struct hv_kvp_msg_get kvp_get; |
| 187 | struct hv_kvp_msg_set kvp_set; | 264 | struct hv_kvp_msg_set kvp_set; |
| 188 | struct hv_kvp_msg_delete kvp_delete; | 265 | struct hv_kvp_msg_delete kvp_delete; |
| 189 | struct hv_kvp_msg_enumerate kvp_enum_data; | 266 | struct hv_kvp_msg_enumerate kvp_enum_data; |
| 267 | struct hv_kvp_ipaddr_value kvp_ip_val; | ||
| 190 | struct hv_kvp_register kvp_register; | 268 | struct hv_kvp_register kvp_register; |
| 191 | } body; | 269 | } body; |
| 192 | } __attribute__((packed)); | 270 | } __attribute__((packed)); |
| 193 | 271 | ||
| 272 | struct hv_kvp_ip_msg { | ||
| 273 | __u8 operation; | ||
| 274 | __u8 pool; | ||
| 275 | struct hv_kvp_ipaddr_value kvp_ip_val; | ||
| 276 | } __attribute__((packed)); | ||
| 277 | |||
| 194 | #ifdef __KERNEL__ | 278 | #ifdef __KERNEL__ |
| 195 | #include <linux/scatterlist.h> | 279 | #include <linux/scatterlist.h> |
| 196 | #include <linux/list.h> | 280 | #include <linux/list.h> |
| @@ -405,7 +489,7 @@ struct vmtransfer_page_range { | |||
| 405 | struct vmtransfer_page_packet_header { | 489 | struct vmtransfer_page_packet_header { |
| 406 | struct vmpacket_descriptor d; | 490 | struct vmpacket_descriptor d; |
| 407 | u16 xfer_pageset_id; | 491 | u16 xfer_pageset_id; |
| 408 | bool sender_owns_set; | 492 | u8 sender_owns_set; |
| 409 | u8 reserved; | 493 | u8 reserved; |
| 410 | u32 range_cnt; | 494 | u32 range_cnt; |
| 411 | struct vmtransfer_page_range ranges[1]; | 495 | struct vmtransfer_page_range ranges[1]; |
| @@ -559,7 +643,7 @@ struct vmbus_channel_query_vmbus_version { | |||
| 559 | /* VMBus Version Supported parameters */ | 643 | /* VMBus Version Supported parameters */ |
| 560 | struct vmbus_channel_version_supported { | 644 | struct vmbus_channel_version_supported { |
| 561 | struct vmbus_channel_message_header header; | 645 | struct vmbus_channel_message_header header; |
| 562 | bool version_supported; | 646 | u8 version_supported; |
| 563 | } __packed; | 647 | } __packed; |
| 564 | 648 | ||
| 565 | /* Offer Channel parameters */ | 649 | /* Offer Channel parameters */ |
| @@ -568,7 +652,7 @@ struct vmbus_channel_offer_channel { | |||
| 568 | struct vmbus_channel_offer offer; | 652 | struct vmbus_channel_offer offer; |
| 569 | u32 child_relid; | 653 | u32 child_relid; |
| 570 | u8 monitorid; | 654 | u8 monitorid; |
| 571 | bool monitor_allocated; | 655 | u8 monitor_allocated; |
| 572 | } __packed; | 656 | } __packed; |
| 573 | 657 | ||
| 574 | /* Rescind Offer parameters */ | 658 | /* Rescind Offer parameters */ |
| @@ -704,7 +788,7 @@ struct vmbus_channel_initiate_contact { | |||
| 704 | 788 | ||
| 705 | struct vmbus_channel_version_response { | 789 | struct vmbus_channel_version_response { |
| 706 | struct vmbus_channel_message_header header; | 790 | struct vmbus_channel_message_header header; |
| 707 | bool version_supported; | 791 | u8 version_supported; |
| 708 | } __packed; | 792 | } __packed; |
| 709 | 793 | ||
| 710 | enum vmbus_channel_state { | 794 | enum vmbus_channel_state { |
| @@ -977,11 +1061,6 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver); | |||
| 977 | #define ICMSGHDRFLAG_REQUEST 2 | 1061 | #define ICMSGHDRFLAG_REQUEST 2 |
| 978 | #define ICMSGHDRFLAG_RESPONSE 4 | 1062 | #define ICMSGHDRFLAG_RESPONSE 4 |
| 979 | 1063 | ||
| 980 | #define HV_S_OK 0x00000000 | ||
| 981 | #define HV_E_FAIL 0x80004005 | ||
| 982 | #define HV_S_CONT 0x80070103 | ||
| 983 | #define HV_ERROR_NOT_SUPPORTED 0x80070032 | ||
| 984 | #define HV_ERROR_MACHINE_LOCKED 0x800704F7 | ||
| 985 | 1064 | ||
| 986 | /* | 1065 | /* |
| 987 | * While we want to handle util services as regular devices, | 1066 | * While we want to handle util services as regular devices, |
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h index 1bc74afe7a35..49ed17fdf055 100644 --- a/include/linux/i2c-pnx.h +++ b/include/linux/i2c-pnx.h | |||
| @@ -22,6 +22,7 @@ struct i2c_pnx_mif { | |||
| 22 | struct timer_list timer; /* Timeout */ | 22 | struct timer_list timer; /* Timeout */ |
| 23 | u8 * buf; /* Data buffer */ | 23 | u8 * buf; /* Data buffer */ |
| 24 | int len; /* Length of data buffer */ | 24 | int len; /* Length of data buffer */ |
| 25 | int order; /* RX Bytes to order via TX */ | ||
| 25 | }; | 26 | }; |
| 26 | 27 | ||
| 27 | struct i2c_pnx_algo_data { | 28 | struct i2c_pnx_algo_data { |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 7ea898c55a60..a12a38107c1a 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
| @@ -561,9 +561,6 @@ struct twl4030_bci_platform_data { | |||
| 561 | 561 | ||
| 562 | /* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */ | 562 | /* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */ |
| 563 | struct twl4030_gpio_platform_data { | 563 | struct twl4030_gpio_platform_data { |
| 564 | int gpio_base; | ||
| 565 | unsigned irq_base, irq_end; | ||
| 566 | |||
| 567 | /* package the two LED signals as output-only GPIOs? */ | 564 | /* package the two LED signals as output-only GPIOs? */ |
| 568 | bool use_leds; | 565 | bool use_leds; |
| 569 | 566 | ||
diff --git a/include/linux/iio/adc/ad_sigma_delta.h b/include/linux/iio/adc/ad_sigma_delta.h new file mode 100644 index 000000000000..2e4eab9868a3 --- /dev/null +++ b/include/linux/iio/adc/ad_sigma_delta.h | |||
| @@ -0,0 +1,173 @@ | |||
| 1 | /* | ||
| 2 | * Support code for Analog Devices Sigma-Delta ADCs | ||
| 3 | * | ||
| 4 | * Copyright 2012 Analog Devices Inc. | ||
| 5 | * Author: Lars-Peter Clausen <lars@metafoo.de> | ||
| 6 | * | ||
| 7 | * Licensed under the GPL-2. | ||
| 8 | */ | ||
| 9 | #ifndef __AD_SIGMA_DELTA_H__ | ||
| 10 | #define __AD_SIGMA_DELTA_H__ | ||
| 11 | |||
| 12 | enum ad_sigma_delta_mode { | ||
| 13 | AD_SD_MODE_CONTINUOUS = 0, | ||
| 14 | AD_SD_MODE_SINGLE = 1, | ||
| 15 | AD_SD_MODE_IDLE = 2, | ||
| 16 | AD_SD_MODE_POWERDOWN = 3, | ||
| 17 | }; | ||
| 18 | |||
| 19 | /** | ||
| 20 | * struct ad_sigma_delta_calib_data - Calibration data for Sigma Delta devices | ||
| 21 | * @mode: Calibration mode. | ||
| 22 | * @channel: Calibration channel. | ||
| 23 | */ | ||
| 24 | struct ad_sd_calib_data { | ||
| 25 | unsigned int mode; | ||
| 26 | unsigned int channel; | ||
| 27 | }; | ||
| 28 | |||
| 29 | struct ad_sigma_delta; | ||
| 30 | struct iio_dev; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * struct ad_sigma_delta_info - Sigma Delta driver specific callbacks and options | ||
| 34 | * @set_channel: Will be called to select the current channel, may be NULL. | ||
| 35 | * @set_mode: Will be called to select the current mode, may be NULL. | ||
| 36 | * @postprocess_sample: Is called for each sampled data word, can be used to | ||
| 37 | * modify or drop the sample data, it, may be NULL. | ||
| 38 | * @has_registers: true if the device has writable and readable registers, false | ||
| 39 | * if there is just one read-only sample data shift register. | ||
| 40 | * @addr_shift: Shift of the register address in the communications register. | ||
| 41 | * @read_mask: Mask for the communications register having the read bit set. | ||
| 42 | */ | ||
| 43 | struct ad_sigma_delta_info { | ||
| 44 | int (*set_channel)(struct ad_sigma_delta *, unsigned int channel); | ||
| 45 | int (*set_mode)(struct ad_sigma_delta *, enum ad_sigma_delta_mode mode); | ||
| 46 | int (*postprocess_sample)(struct ad_sigma_delta *, unsigned int raw_sample); | ||
| 47 | bool has_registers; | ||
| 48 | unsigned int addr_shift; | ||
| 49 | unsigned int read_mask; | ||
| 50 | }; | ||
| 51 | |||
| 52 | /** | ||
| 53 | * struct ad_sigma_delta - Sigma Delta device struct | ||
| 54 | * @spi: The spi device associated with the Sigma Delta device. | ||
| 55 | * @trig: The IIO trigger associated with the Sigma Delta device. | ||
| 56 | * | ||
| 57 | * Most of the fields are private to the sigma delta library code and should not | ||
| 58 | * be accessed by individual drivers. | ||
| 59 | */ | ||
| 60 | struct ad_sigma_delta { | ||
| 61 | struct spi_device *spi; | ||
| 62 | struct iio_trigger *trig; | ||
| 63 | |||
| 64 | /* private: */ | ||
| 65 | struct completion completion; | ||
| 66 | bool irq_dis; | ||
| 67 | |||
| 68 | bool bus_locked; | ||
| 69 | |||
| 70 | uint8_t comm; | ||
| 71 | |||
| 72 | const struct ad_sigma_delta_info *info; | ||
| 73 | |||
| 74 | /* | ||
| 75 | * DMA (thus cache coherency maintenance) requires the | ||
| 76 | * transfer buffers to live in their own cache lines. | ||
| 77 | */ | ||
| 78 | uint8_t data[4] ____cacheline_aligned; | ||
| 79 | }; | ||
| 80 | |||
| 81 | static inline int ad_sigma_delta_set_channel(struct ad_sigma_delta *sd, | ||
| 82 | unsigned int channel) | ||
| 83 | { | ||
| 84 | if (sd->info->set_channel) | ||
| 85 | return sd->info->set_channel(sd, channel); | ||
| 86 | |||
| 87 | return 0; | ||
| 88 | } | ||
| 89 | |||
| 90 | static inline int ad_sigma_delta_set_mode(struct ad_sigma_delta *sd, | ||
| 91 | unsigned int mode) | ||
| 92 | { | ||
| 93 | if (sd->info->set_mode) | ||
| 94 | return sd->info->set_mode(sd, mode); | ||
| 95 | |||
| 96 | return 0; | ||
| 97 | } | ||
| 98 | |||
| 99 | static inline int ad_sigma_delta_postprocess_sample(struct ad_sigma_delta *sd, | ||
| 100 | unsigned int raw_sample) | ||
| 101 | { | ||
| 102 | if (sd->info->postprocess_sample) | ||
| 103 | return sd->info->postprocess_sample(sd, raw_sample); | ||
| 104 | |||
| 105 | return 0; | ||
| 106 | } | ||
| 107 | |||
| 108 | void ad_sd_set_comm(struct ad_sigma_delta *sigma_delta, uint8_t comm); | ||
| 109 | int ad_sd_write_reg(struct ad_sigma_delta *sigma_delta, unsigned int reg, | ||
| 110 | unsigned int size, unsigned int val); | ||
| 111 | int ad_sd_read_reg(struct ad_sigma_delta *sigma_delta, unsigned int reg, | ||
| 112 | unsigned int size, unsigned int *val); | ||
| 113 | |||
| 114 | int ad_sigma_delta_single_conversion(struct iio_dev *indio_dev, | ||
| 115 | const struct iio_chan_spec *chan, int *val); | ||
| 116 | int ad_sd_calibrate_all(struct ad_sigma_delta *sigma_delta, | ||
| 117 | const struct ad_sd_calib_data *cd, unsigned int n); | ||
| 118 | int ad_sd_init(struct ad_sigma_delta *sigma_delta, struct iio_dev *indio_dev, | ||
| 119 | struct spi_device *spi, const struct ad_sigma_delta_info *info); | ||
| 120 | |||
| 121 | int ad_sd_setup_buffer_and_trigger(struct iio_dev *indio_dev); | ||
| 122 | void ad_sd_cleanup_buffer_and_trigger(struct iio_dev *indio_dev); | ||
| 123 | |||
| 124 | int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig); | ||
| 125 | |||
| 126 | #define __AD_SD_CHANNEL(_si, _channel1, _channel2, _address, _bits, \ | ||
| 127 | _storagebits, _shift, _extend_name, _type) \ | ||
| 128 | { \ | ||
| 129 | .type = (_type), \ | ||
| 130 | .differential = (_channel2 == -1 ? 0 : 1), \ | ||
| 131 | .indexed = 1, \ | ||
| 132 | .channel = (_channel1), \ | ||
| 133 | .channel2 = (_channel2), \ | ||
| 134 | .address = (_address), \ | ||
| 135 | .extend_name = (_extend_name), \ | ||
| 136 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | ||
| 137 | IIO_CHAN_INFO_SCALE_SHARED_BIT | \ | ||
| 138 | IIO_CHAN_INFO_OFFSET_SEPARATE_BIT, \ | ||
| 139 | .scan_index = (_si), \ | ||
| 140 | .scan_type = { \ | ||
| 141 | .sign = 'u', \ | ||
| 142 | .realbits = (_bits), \ | ||
| 143 | .storagebits = (_storagebits), \ | ||
| 144 | .shift = (_shift), \ | ||
| 145 | .endianness = IIO_BE, \ | ||
| 146 | }, \ | ||
| 147 | } | ||
| 148 | |||
| 149 | #define AD_SD_DIFF_CHANNEL(_si, _channel1, _channel2, _address, _bits, \ | ||
| 150 | _storagebits, _shift) \ | ||
| 151 | __AD_SD_CHANNEL(_si, _channel1, _channel2, _address, _bits, \ | ||
| 152 | _storagebits, _shift, NULL, IIO_VOLTAGE) | ||
| 153 | |||
| 154 | #define AD_SD_SHORTED_CHANNEL(_si, _channel, _address, _bits, \ | ||
| 155 | _storagebits, _shift) \ | ||
| 156 | __AD_SD_CHANNEL(_si, _channel, _channel, _address, _bits, \ | ||
| 157 | _storagebits, _shift, "shorted", IIO_VOLTAGE) | ||
| 158 | |||
| 159 | #define AD_SD_CHANNEL(_si, _channel, _address, _bits, \ | ||
| 160 | _storagebits, _shift) \ | ||
| 161 | __AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \ | ||
| 162 | _storagebits, _shift, NULL, IIO_VOLTAGE) | ||
| 163 | |||
| 164 | #define AD_SD_TEMP_CHANNEL(_si, _address, _bits, _storagebits, _shift) \ | ||
| 165 | __AD_SD_CHANNEL(_si, 0, -1, _address, _bits, \ | ||
| 166 | _storagebits, _shift, NULL, IIO_TEMP) | ||
| 167 | |||
| 168 | #define AD_SD_SUPPLY_CHANNEL(_si, _channel, _address, _bits, _storagebits, \ | ||
| 169 | _shift) \ | ||
| 170 | __AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \ | ||
| 171 | _storagebits, _shift, "supply", IIO_VOLTAGE) | ||
| 172 | |||
| 173 | #endif | ||
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h index 8ba516fc2ec6..c629b3a1d9a9 100644 --- a/include/linux/iio/buffer.h +++ b/include/linux/iio/buffer.h | |||
| @@ -36,7 +36,7 @@ struct iio_buffer; | |||
| 36 | * any of them not existing. | 36 | * any of them not existing. |
| 37 | **/ | 37 | **/ |
| 38 | struct iio_buffer_access_funcs { | 38 | struct iio_buffer_access_funcs { |
| 39 | int (*store_to)(struct iio_buffer *buffer, u8 *data, s64 timestamp); | 39 | int (*store_to)(struct iio_buffer *buffer, u8 *data); |
| 40 | int (*read_first_n)(struct iio_buffer *buffer, | 40 | int (*read_first_n)(struct iio_buffer *buffer, |
| 41 | size_t n, | 41 | size_t n, |
| 42 | char __user *buf); | 42 | char __user *buf); |
| @@ -118,10 +118,8 @@ int iio_scan_mask_set(struct iio_dev *indio_dev, | |||
| 118 | * iio_push_to_buffer() - push to a registered buffer. | 118 | * iio_push_to_buffer() - push to a registered buffer. |
| 119 | * @buffer: IIO buffer structure for device | 119 | * @buffer: IIO buffer structure for device |
| 120 | * @data: the data to push to the buffer | 120 | * @data: the data to push to the buffer |
| 121 | * @timestamp: timestamp to associate with the data | ||
| 122 | */ | 121 | */ |
| 123 | int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data, | 122 | int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data); |
| 124 | s64 timestamp); | ||
| 125 | 123 | ||
| 126 | int iio_update_demux(struct iio_dev *indio_dev); | 124 | int iio_update_demux(struct iio_dev *indio_dev); |
| 127 | 125 | ||
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h index e2657e6d4d26..e875bcf0478f 100644 --- a/include/linux/iio/consumer.h +++ b/include/linux/iio/consumer.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | * the Free Software Foundation. | 8 | * the Free Software Foundation. |
| 9 | */ | 9 | */ |
| 10 | #ifndef _IIO_INKERN_CONSUMER_H_ | 10 | #ifndef _IIO_INKERN_CONSUMER_H_ |
| 11 | #define _IIO_INKERN_CONSUMER_H | 11 | #define _IIO_INKERN_CONSUMER_H_ |
| 12 | #include <linux/iio/types.h> | 12 | #include <linux/iio/types.h> |
| 13 | 13 | ||
| 14 | struct iio_dev; | 14 | struct iio_dev; |
| @@ -61,7 +61,7 @@ void iio_channel_release_all(struct iio_channel *chan); | |||
| 61 | 61 | ||
| 62 | /** | 62 | /** |
| 63 | * iio_read_channel_raw() - read from a given channel | 63 | * iio_read_channel_raw() - read from a given channel |
| 64 | * @channel: The channel being queried. | 64 | * @chan: The channel being queried. |
| 65 | * @val: Value read back. | 65 | * @val: Value read back. |
| 66 | * | 66 | * |
| 67 | * Note raw reads from iio channels are in adc counts and hence | 67 | * Note raw reads from iio channels are in adc counts and hence |
| @@ -71,6 +71,21 @@ int iio_read_channel_raw(struct iio_channel *chan, | |||
| 71 | int *val); | 71 | int *val); |
| 72 | 72 | ||
| 73 | /** | 73 | /** |
| 74 | * iio_read_channel_processed() - read processed value from a given channel | ||
| 75 | * @chan: The channel being queried. | ||
| 76 | * @val: Value read back. | ||
| 77 | * | ||
| 78 | * Returns an error code or 0. | ||
| 79 | * | ||
| 80 | * This function will read a processed value from a channel. A processed value | ||
| 81 | * means that this value will have the correct unit and not some device internal | ||
| 82 | * representation. If the device does not support reporting a processed value | ||
| 83 | * the function will query the raw value and the channels scale and offset and | ||
| 84 | * do the appropriate transformation. | ||
| 85 | */ | ||
| 86 | int iio_read_channel_processed(struct iio_channel *chan, int *val); | ||
| 87 | |||
| 88 | /** | ||
| 74 | * iio_get_channel_type() - get the type of a channel | 89 | * iio_get_channel_type() - get the type of a channel |
| 75 | * @channel: The channel being queried. | 90 | * @channel: The channel being queried. |
| 76 | * @type: The type of the channel. | 91 | * @type: The type of the channel. |
| @@ -82,7 +97,7 @@ int iio_get_channel_type(struct iio_channel *channel, | |||
| 82 | 97 | ||
| 83 | /** | 98 | /** |
| 84 | * iio_read_channel_scale() - read the scale value for a channel | 99 | * iio_read_channel_scale() - read the scale value for a channel |
| 85 | * @channel: The channel being queried. | 100 | * @chan: The channel being queried. |
| 86 | * @val: First part of value read back. | 101 | * @val: First part of value read back. |
| 87 | * @val2: Second part of value read back. | 102 | * @val2: Second part of value read back. |
| 88 | * | 103 | * |
| @@ -93,4 +108,27 @@ int iio_get_channel_type(struct iio_channel *channel, | |||
| 93 | int iio_read_channel_scale(struct iio_channel *chan, int *val, | 108 | int iio_read_channel_scale(struct iio_channel *chan, int *val, |
| 94 | int *val2); | 109 | int *val2); |
| 95 | 110 | ||
| 111 | /** | ||
| 112 | * iio_convert_raw_to_processed() - Converts a raw value to a processed value | ||
| 113 | * @chan: The channel being queried | ||
| 114 | * @raw: The raw IIO to convert | ||
| 115 | * @processed: The result of the conversion | ||
| 116 | * @scale: Scale factor to apply during the conversion | ||
| 117 | * | ||
| 118 | * Returns an error code or 0. | ||
| 119 | * | ||
| 120 | * This function converts a raw value to processed value for a specific channel. | ||
| 121 | * A raw value is the device internal representation of a sample and the value | ||
| 122 | * returned by iio_read_channel_raw, so the unit of that value is device | ||
| 123 | * depended. A processed value on the other hand is value has a normed unit | ||
| 124 | * according with the IIO specification. | ||
| 125 | * | ||
| 126 | * The scale factor allows to increase the precession of the returned value. For | ||
| 127 | * a scale factor of 1 the function will return the result in the normal IIO | ||
| 128 | * unit for the channel type. E.g. millivolt for voltage channels, if you want | ||
| 129 | * nanovolts instead pass 1000 as the scale factor. | ||
| 130 | */ | ||
| 131 | int iio_convert_raw_to_processed(struct iio_channel *chan, int raw, | ||
| 132 | int *processed, unsigned int scale); | ||
| 133 | |||
| 96 | #endif | 134 | #endif |
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index be82936c4089..c0ae76ac4e0b 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
| @@ -35,10 +35,13 @@ enum iio_chan_info_enum { | |||
| 35 | IIO_CHAN_INFO_FREQUENCY, | 35 | IIO_CHAN_INFO_FREQUENCY, |
| 36 | IIO_CHAN_INFO_PHASE, | 36 | IIO_CHAN_INFO_PHASE, |
| 37 | IIO_CHAN_INFO_HARDWAREGAIN, | 37 | IIO_CHAN_INFO_HARDWAREGAIN, |
| 38 | IIO_CHAN_INFO_HYSTERESIS, | ||
| 38 | }; | 39 | }; |
| 39 | 40 | ||
| 40 | #define IIO_CHAN_INFO_SHARED_BIT(type) BIT(type*2) | 41 | #define IIO_CHAN_INFO_SHARED_BIT(type) BIT(type*2) |
| 41 | #define IIO_CHAN_INFO_SEPARATE_BIT(type) BIT(type*2 + 1) | 42 | #define IIO_CHAN_INFO_SEPARATE_BIT(type) BIT(type*2 + 1) |
| 43 | #define IIO_CHAN_INFO_BITS(type) (IIO_CHAN_INFO_SHARED_BIT(type) | \ | ||
| 44 | IIO_CHAN_INFO_SEPARATE_BIT(type)) | ||
| 42 | 45 | ||
| 43 | #define IIO_CHAN_INFO_RAW_SEPARATE_BIT \ | 46 | #define IIO_CHAN_INFO_RAW_SEPARATE_BIT \ |
| 44 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_RAW) | 47 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_RAW) |
| @@ -100,6 +103,10 @@ enum iio_chan_info_enum { | |||
| 100 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HARDWAREGAIN) | 103 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HARDWAREGAIN) |
| 101 | #define IIO_CHAN_INFO_HARDWAREGAIN_SHARED_BIT \ | 104 | #define IIO_CHAN_INFO_HARDWAREGAIN_SHARED_BIT \ |
| 102 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HARDWAREGAIN) | 105 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HARDWAREGAIN) |
| 106 | #define IIO_CHAN_INFO_HYSTERESIS_SEPARATE_BIT \ | ||
| 107 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HYSTERESIS) | ||
| 108 | #define IIO_CHAN_INFO_HYSTERESIS_SHARED_BIT \ | ||
| 109 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HYSTERESIS) | ||
| 103 | 110 | ||
| 104 | enum iio_endian { | 111 | enum iio_endian { |
| 105 | IIO_CPU, | 112 | IIO_CPU, |
| @@ -164,7 +171,7 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev, | |||
| 164 | * IIO_ENUM() - Initialize enum extended channel attribute | 171 | * IIO_ENUM() - Initialize enum extended channel attribute |
| 165 | * @_name: Attribute name | 172 | * @_name: Attribute name |
| 166 | * @_shared: Whether the attribute is shared between all channels | 173 | * @_shared: Whether the attribute is shared between all channels |
| 167 | * @_e: Pointer to a iio_enum struct | 174 | * @_e: Pointer to an iio_enum struct |
| 168 | * | 175 | * |
| 169 | * This should usually be used together with IIO_ENUM_AVAILABLE() | 176 | * This should usually be used together with IIO_ENUM_AVAILABLE() |
| 170 | */ | 177 | */ |
| @@ -180,9 +187,9 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev, | |||
| 180 | /** | 187 | /** |
| 181 | * IIO_ENUM_AVAILABLE() - Initialize enum available extended channel attribute | 188 | * IIO_ENUM_AVAILABLE() - Initialize enum available extended channel attribute |
| 182 | * @_name: Attribute name ("_available" will be appended to the name) | 189 | * @_name: Attribute name ("_available" will be appended to the name) |
| 183 | * @_e: Pointer to a iio_enum struct | 190 | * @_e: Pointer to an iio_enum struct |
| 184 | * | 191 | * |
| 185 | * Creates a read only attribute which list all the available enum items in a | 192 | * Creates a read only attribute which lists all the available enum items in a |
| 186 | * space separated list. This should usually be used together with IIO_ENUM() | 193 | * space separated list. This should usually be used together with IIO_ENUM() |
| 187 | */ | 194 | */ |
| 188 | #define IIO_ENUM_AVAILABLE(_name, _e) \ | 195 | #define IIO_ENUM_AVAILABLE(_name, _e) \ |
| @@ -229,6 +236,7 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev, | |||
| 229 | * @indexed: Specify the channel has a numerical index. If not, | 236 | * @indexed: Specify the channel has a numerical index. If not, |
| 230 | * the channel index number will be suppressed for sysfs | 237 | * the channel index number will be suppressed for sysfs |
| 231 | * attributes but not for event codes. | 238 | * attributes but not for event codes. |
| 239 | * @output: Channel is output. | ||
| 232 | * @differential: Channel is differential. | 240 | * @differential: Channel is differential. |
| 233 | */ | 241 | */ |
| 234 | struct iio_chan_spec { | 242 | struct iio_chan_spec { |
| @@ -255,6 +263,21 @@ struct iio_chan_spec { | |||
| 255 | unsigned differential:1; | 263 | unsigned differential:1; |
| 256 | }; | 264 | }; |
| 257 | 265 | ||
| 266 | |||
| 267 | /** | ||
| 268 | * iio_channel_has_info() - Checks whether a channel supports a info attribute | ||
| 269 | * @chan: The channel to be queried | ||
| 270 | * @type: Type of the info attribute to be checked | ||
| 271 | * | ||
| 272 | * Returns true if the channels supports reporting values for the given info | ||
| 273 | * attribute type, false otherwise. | ||
| 274 | */ | ||
| 275 | static inline bool iio_channel_has_info(const struct iio_chan_spec *chan, | ||
| 276 | enum iio_chan_info_enum type) | ||
| 277 | { | ||
| 278 | return chan->info_mask & IIO_CHAN_INFO_BITS(type); | ||
| 279 | } | ||
| 280 | |||
| 258 | #define IIO_ST(si, rb, sb, sh) \ | 281 | #define IIO_ST(si, rb, sb, sh) \ |
| 259 | { .sign = si, .realbits = rb, .storagebits = sb, .shift = sh } | 282 | { .sign = si, .realbits = rb, .storagebits = sb, .shift = sh } |
| 260 | 283 | ||
| @@ -312,6 +335,9 @@ struct iio_dev; | |||
| 312 | * Meaning is event dependent. | 335 | * Meaning is event dependent. |
| 313 | * @validate_trigger: function to validate the trigger when the | 336 | * @validate_trigger: function to validate the trigger when the |
| 314 | * current trigger gets changed. | 337 | * current trigger gets changed. |
| 338 | * @update_scan_mode: function to configure device and scan buffer when | ||
| 339 | * channels have changed | ||
| 340 | * @debugfs_reg_access: function to read or write register value of device | ||
| 315 | **/ | 341 | **/ |
| 316 | struct iio_info { | 342 | struct iio_info { |
| 317 | struct module *driver_module; | 343 | struct module *driver_module; |
| @@ -367,10 +393,10 @@ struct iio_info { | |||
| 367 | * scan mask is valid for the device. | 393 | * scan mask is valid for the device. |
| 368 | */ | 394 | */ |
| 369 | struct iio_buffer_setup_ops { | 395 | struct iio_buffer_setup_ops { |
| 370 | int (*preenable)(struct iio_dev *); | 396 | int (*preenable)(struct iio_dev *); |
| 371 | int (*postenable)(struct iio_dev *); | 397 | int (*postenable)(struct iio_dev *); |
| 372 | int (*predisable)(struct iio_dev *); | 398 | int (*predisable)(struct iio_dev *); |
| 373 | int (*postdisable)(struct iio_dev *); | 399 | int (*postdisable)(struct iio_dev *); |
| 374 | bool (*validate_scan_mask)(struct iio_dev *indio_dev, | 400 | bool (*validate_scan_mask)(struct iio_dev *indio_dev, |
| 375 | const unsigned long *scan_mask); | 401 | const unsigned long *scan_mask); |
| 376 | }; | 402 | }; |
| @@ -516,6 +542,31 @@ static inline struct iio_dev *iio_device_get(struct iio_dev *indio_dev) | |||
| 516 | return indio_dev ? dev_to_iio_dev(get_device(&indio_dev->dev)) : NULL; | 542 | return indio_dev ? dev_to_iio_dev(get_device(&indio_dev->dev)) : NULL; |
| 517 | } | 543 | } |
| 518 | 544 | ||
| 545 | |||
| 546 | /** | ||
| 547 | * iio_device_set_drvdata() - Set device driver data | ||
| 548 | * @indio_dev: IIO device structure | ||
| 549 | * @data: Driver specific data | ||
| 550 | * | ||
| 551 | * Allows to attach an arbitrary pointer to an IIO device, which can later be | ||
| 552 | * retrieved by iio_device_get_drvdata(). | ||
| 553 | */ | ||
| 554 | static inline void iio_device_set_drvdata(struct iio_dev *indio_dev, void *data) | ||
| 555 | { | ||
| 556 | dev_set_drvdata(&indio_dev->dev, data); | ||
| 557 | } | ||
| 558 | |||
| 559 | /** | ||
| 560 | * iio_device_get_drvdata() - Get device driver data | ||
| 561 | * @indio_dev: IIO device structure | ||
| 562 | * | ||
| 563 | * Returns the data previously set with iio_device_set_drvdata() | ||
| 564 | */ | ||
| 565 | static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev) | ||
| 566 | { | ||
| 567 | return dev_get_drvdata(&indio_dev->dev); | ||
| 568 | } | ||
| 569 | |||
| 519 | /* Can we make this smaller? */ | 570 | /* Can we make this smaller? */ |
| 520 | #define IIO_ALIGN L1_CACHE_BYTES | 571 | #define IIO_ALIGN L1_CACHE_BYTES |
| 521 | /** | 572 | /** |
diff --git a/include/linux/iio/kfifo_buf.h b/include/linux/iio/kfifo_buf.h index 014d5a13b32b..25eeac762e84 100644 --- a/include/linux/iio/kfifo_buf.h +++ b/include/linux/iio/kfifo_buf.h | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | #ifndef __LINUX_IIO_KFIFO_BUF_H__ | ||
| 2 | #define __LINUX_IIO_KFIFO_BUF_H__ | ||
| 1 | 3 | ||
| 2 | #include <linux/kfifo.h> | 4 | #include <linux/kfifo.h> |
| 3 | #include <linux/iio/iio.h> | 5 | #include <linux/iio/iio.h> |
| @@ -6,3 +8,4 @@ | |||
| 6 | struct iio_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev); | 8 | struct iio_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev); |
| 7 | void iio_kfifo_free(struct iio_buffer *r); | 9 | void iio_kfifo_free(struct iio_buffer *r); |
| 8 | 10 | ||
| 11 | #endif | ||
diff --git a/include/linux/iio/machine.h b/include/linux/iio/machine.h index 400a453ff67b..809a3f08d5a5 100644 --- a/include/linux/iio/machine.h +++ b/include/linux/iio/machine.h | |||
| @@ -8,6 +8,9 @@ | |||
| 8 | * the Free Software Foundation. | 8 | * the Free Software Foundation. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #ifndef __LINUX_IIO_MACHINE_H__ | ||
| 12 | #define __LINUX_IIO_MACHINE_H__ | ||
| 13 | |||
| 11 | /** | 14 | /** |
| 12 | * struct iio_map - description of link between consumer and device channels | 15 | * struct iio_map - description of link between consumer and device channels |
| 13 | * @adc_channel_label: Label used to identify the channel on the provider. | 16 | * @adc_channel_label: Label used to identify the channel on the provider. |
| @@ -22,3 +25,5 @@ struct iio_map { | |||
| 22 | const char *consumer_dev_name; | 25 | const char *consumer_dev_name; |
| 23 | const char *consumer_channel; | 26 | const char *consumer_channel; |
| 24 | }; | 27 | }; |
| 28 | |||
| 29 | #endif | ||
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h index a9819940a84c..20239da1d0f7 100644 --- a/include/linux/iio/trigger.h +++ b/include/linux/iio/trigger.h | |||
| @@ -29,7 +29,7 @@ struct iio_subirq { | |||
| 29 | * instances of a given device. | 29 | * instances of a given device. |
| 30 | **/ | 30 | **/ |
| 31 | struct iio_trigger_ops { | 31 | struct iio_trigger_ops { |
| 32 | struct module *owner; | 32 | struct module *owner; |
| 33 | int (*set_trigger_state)(struct iio_trigger *trig, bool state); | 33 | int (*set_trigger_state)(struct iio_trigger *trig, bool state); |
| 34 | int (*try_reenable)(struct iio_trigger *trig); | 34 | int (*try_reenable)(struct iio_trigger *trig); |
| 35 | int (*validate_device)(struct iio_trigger *trig, | 35 | int (*validate_device)(struct iio_trigger *trig, |
| @@ -39,7 +39,7 @@ struct iio_trigger_ops { | |||
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| 41 | * struct iio_trigger - industrial I/O trigger device | 41 | * struct iio_trigger - industrial I/O trigger device |
| 42 | * | 42 | * @ops: [DRIVER] operations structure |
| 43 | * @id: [INTERN] unique id number | 43 | * @id: [INTERN] unique id number |
| 44 | * @name: [DRIVER] unique name | 44 | * @name: [DRIVER] unique name |
| 45 | * @dev: [DRIVER] associated device (if relevant) | 45 | * @dev: [DRIVER] associated device (if relevant) |
| @@ -76,19 +76,19 @@ struct iio_trigger { | |||
| 76 | static inline struct iio_trigger *to_iio_trigger(struct device *d) | 76 | static inline struct iio_trigger *to_iio_trigger(struct device *d) |
| 77 | { | 77 | { |
| 78 | return container_of(d, struct iio_trigger, dev); | 78 | return container_of(d, struct iio_trigger, dev); |
| 79 | }; | 79 | } |
| 80 | 80 | ||
| 81 | static inline void iio_trigger_put(struct iio_trigger *trig) | 81 | static inline void iio_trigger_put(struct iio_trigger *trig) |
| 82 | { | 82 | { |
| 83 | module_put(trig->ops->owner); | 83 | module_put(trig->ops->owner); |
| 84 | put_device(&trig->dev); | 84 | put_device(&trig->dev); |
| 85 | }; | 85 | } |
| 86 | 86 | ||
| 87 | static inline void iio_trigger_get(struct iio_trigger *trig) | 87 | static inline void iio_trigger_get(struct iio_trigger *trig) |
| 88 | { | 88 | { |
| 89 | get_device(&trig->dev); | 89 | get_device(&trig->dev); |
| 90 | __module_get(trig->ops->owner); | 90 | __module_get(trig->ops->owner); |
| 91 | }; | 91 | } |
| 92 | 92 | ||
| 93 | /** | 93 | /** |
| 94 | * iio_trigger_register() - register a trigger with the IIO core | 94 | * iio_trigger_register() - register a trigger with the IIO core |
| @@ -104,7 +104,8 @@ void iio_trigger_unregister(struct iio_trigger *trig_info); | |||
| 104 | 104 | ||
| 105 | /** | 105 | /** |
| 106 | * iio_trigger_poll() - called on a trigger occurring | 106 | * iio_trigger_poll() - called on a trigger occurring |
| 107 | * @trig: trigger which occurred | 107 | * @trig: trigger which occurred |
| 108 | * @time: timestamp when trigger occurred | ||
| 108 | * | 109 | * |
| 109 | * Typically called in relevant hardware interrupt handler. | 110 | * Typically called in relevant hardware interrupt handler. |
| 110 | **/ | 111 | **/ |
diff --git a/include/linux/iio/trigger_consumer.h b/include/linux/iio/trigger_consumer.h index 60d64b356945..c4f8c7409666 100644 --- a/include/linux/iio/trigger_consumer.h +++ b/include/linux/iio/trigger_consumer.h | |||
| @@ -7,6 +7,15 @@ | |||
| 7 | * the Free Software Foundation. | 7 | * the Free Software Foundation. |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #ifndef __LINUX_IIO_TRIGGER_CONSUMER_H__ | ||
| 11 | #define __LINUX_IIO_TRIGGER_CONSUMER_H__ | ||
| 12 | |||
| 13 | #include <linux/interrupt.h> | ||
| 14 | #include <linux/types.h> | ||
| 15 | |||
| 16 | struct iio_dev; | ||
| 17 | struct iio_trigger; | ||
| 18 | |||
| 10 | /** | 19 | /** |
| 11 | * struct iio_poll_func - poll function pair | 20 | * struct iio_poll_func - poll function pair |
| 12 | * | 21 | * |
| @@ -50,3 +59,5 @@ void iio_trigger_notify_done(struct iio_trigger *trig); | |||
| 50 | */ | 59 | */ |
| 51 | int iio_triggered_buffer_postenable(struct iio_dev *indio_dev); | 60 | int iio_triggered_buffer_postenable(struct iio_dev *indio_dev); |
| 52 | int iio_triggered_buffer_predisable(struct iio_dev *indio_dev); | 61 | int iio_triggered_buffer_predisable(struct iio_dev *indio_dev); |
| 62 | |||
| 63 | #endif | ||
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 44e397705d7f..5c647ecfd5ba 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h | |||
| @@ -57,5 +57,6 @@ enum iio_modifier { | |||
| 57 | #define IIO_VAL_INT_PLUS_MICRO 2 | 57 | #define IIO_VAL_INT_PLUS_MICRO 2 |
| 58 | #define IIO_VAL_INT_PLUS_NANO 3 | 58 | #define IIO_VAL_INT_PLUS_NANO 3 |
| 59 | #define IIO_VAL_INT_PLUS_MICRO_DB 4 | 59 | #define IIO_VAL_INT_PLUS_MICRO_DB 4 |
| 60 | #define IIO_VAL_FRACTIONAL 10 | ||
| 60 | 61 | ||
| 61 | #endif /* _IIO_TYPES_H_ */ | 62 | #endif /* _IIO_TYPES_H_ */ |
diff --git a/include/linux/input.h b/include/linux/input.h index 725dcd0f63a4..ba4874302939 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
| @@ -1169,6 +1169,18 @@ struct ff_effect { | |||
| 1169 | #include <linux/mod_devicetable.h> | 1169 | #include <linux/mod_devicetable.h> |
| 1170 | 1170 | ||
| 1171 | /** | 1171 | /** |
| 1172 | * struct input_value - input value representation | ||
| 1173 | * @type: type of value (EV_KEY, EV_ABS, etc) | ||
| 1174 | * @code: the value code | ||
| 1175 | * @value: the value | ||
| 1176 | */ | ||
| 1177 | struct input_value { | ||
| 1178 | __u16 type; | ||
| 1179 | __u16 code; | ||
| 1180 | __s32 value; | ||
| 1181 | }; | ||
| 1182 | |||
| 1183 | /** | ||
| 1172 | * struct input_dev - represents an input device | 1184 | * struct input_dev - represents an input device |
| 1173 | * @name: name of the device | 1185 | * @name: name of the device |
| 1174 | * @phys: physical path to the device in the system hierarchy | 1186 | * @phys: physical path to the device in the system hierarchy |
| @@ -1203,11 +1215,7 @@ struct ff_effect { | |||
| 1203 | * software autorepeat | 1215 | * software autorepeat |
| 1204 | * @timer: timer for software autorepeat | 1216 | * @timer: timer for software autorepeat |
| 1205 | * @rep: current values for autorepeat parameters (delay, rate) | 1217 | * @rep: current values for autorepeat parameters (delay, rate) |
| 1206 | * @mt: pointer to array of struct input_mt_slot holding current values | 1218 | * @mt: pointer to multitouch state |
| 1207 | * of tracked contacts | ||
| 1208 | * @mtsize: number of MT slots the device uses | ||
| 1209 | * @slot: MT slot currently being transmitted | ||
| 1210 | * @trkid: stores MT tracking ID for the current contact | ||
| 1211 | * @absinfo: array of &struct input_absinfo elements holding information | 1219 | * @absinfo: array of &struct input_absinfo elements holding information |
| 1212 | * about absolute axes (current value, min, max, flat, fuzz, | 1220 | * about absolute axes (current value, min, max, flat, fuzz, |
| 1213 | * resolution) | 1221 | * resolution) |
| @@ -1244,7 +1252,6 @@ struct ff_effect { | |||
| 1244 | * last user closes the device | 1252 | * last user closes the device |
| 1245 | * @going_away: marks devices that are in a middle of unregistering and | 1253 | * @going_away: marks devices that are in a middle of unregistering and |
| 1246 | * causes input_open_device*() fail with -ENODEV. | 1254 | * causes input_open_device*() fail with -ENODEV. |
| 1247 | * @sync: set to %true when there were no new events since last EV_SYN | ||
| 1248 | * @dev: driver model's view of this device | 1255 | * @dev: driver model's view of this device |
| 1249 | * @h_list: list of input handles associated with the device. When | 1256 | * @h_list: list of input handles associated with the device. When |
| 1250 | * accessing the list dev->mutex must be held | 1257 | * accessing the list dev->mutex must be held |
| @@ -1287,10 +1294,7 @@ struct input_dev { | |||
| 1287 | 1294 | ||
| 1288 | int rep[REP_CNT]; | 1295 | int rep[REP_CNT]; |
| 1289 | 1296 | ||
| 1290 | struct input_mt_slot *mt; | 1297 | struct input_mt *mt; |
| 1291 | int mtsize; | ||
| 1292 | int slot; | ||
| 1293 | int trkid; | ||
| 1294 | 1298 | ||
| 1295 | struct input_absinfo *absinfo; | 1299 | struct input_absinfo *absinfo; |
| 1296 | 1300 | ||
| @@ -1312,12 +1316,14 @@ struct input_dev { | |||
| 1312 | unsigned int users; | 1316 | unsigned int users; |
| 1313 | bool going_away; | 1317 | bool going_away; |
| 1314 | 1318 | ||
| 1315 | bool sync; | ||
| 1316 | |||
| 1317 | struct device dev; | 1319 | struct device dev; |
| 1318 | 1320 | ||
| 1319 | struct list_head h_list; | 1321 | struct list_head h_list; |
| 1320 | struct list_head node; | 1322 | struct list_head node; |
| 1323 | |||
| 1324 | unsigned int num_vals; | ||
| 1325 | unsigned int max_vals; | ||
| 1326 | struct input_value *vals; | ||
| 1321 | }; | 1327 | }; |
| 1322 | #define to_input_dev(d) container_of(d, struct input_dev, dev) | 1328 | #define to_input_dev(d) container_of(d, struct input_dev, dev) |
| 1323 | 1329 | ||
| @@ -1378,6 +1384,9 @@ struct input_handle; | |||
| 1378 | * @event: event handler. This method is being called by input core with | 1384 | * @event: event handler. This method is being called by input core with |
| 1379 | * interrupts disabled and dev->event_lock spinlock held and so | 1385 | * interrupts disabled and dev->event_lock spinlock held and so |
| 1380 | * it may not sleep | 1386 | * it may not sleep |
| 1387 | * @events: event sequence handler. This method is being called by | ||
| 1388 | * input core with interrupts disabled and dev->event_lock | ||
| 1389 | * spinlock held and so it may not sleep | ||
| 1381 | * @filter: similar to @event; separates normal event handlers from | 1390 | * @filter: similar to @event; separates normal event handlers from |
| 1382 | * "filters". | 1391 | * "filters". |
| 1383 | * @match: called after comparing device's id with handler's id_table | 1392 | * @match: called after comparing device's id with handler's id_table |
| @@ -1414,6 +1423,8 @@ struct input_handler { | |||
| 1414 | void *private; | 1423 | void *private; |
| 1415 | 1424 | ||
| 1416 | void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); | 1425 | void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); |
| 1426 | void (*events)(struct input_handle *handle, | ||
| 1427 | const struct input_value *vals, unsigned int count); | ||
| 1417 | bool (*filter)(struct input_handle *handle, unsigned int type, unsigned int code, int value); | 1428 | bool (*filter)(struct input_handle *handle, unsigned int type, unsigned int code, int value); |
| 1418 | bool (*match)(struct input_handler *handler, struct input_dev *dev); | 1429 | bool (*match)(struct input_handler *handler, struct input_dev *dev); |
| 1419 | int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); | 1430 | int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); |
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h index f86737586e19..cc5cca774bab 100644 --- a/include/linux/input/mt.h +++ b/include/linux/input/mt.h | |||
| @@ -15,12 +15,41 @@ | |||
| 15 | 15 | ||
| 16 | #define TRKID_MAX 0xffff | 16 | #define TRKID_MAX 0xffff |
| 17 | 17 | ||
| 18 | #define INPUT_MT_POINTER 0x0001 /* pointer device, e.g. trackpad */ | ||
| 19 | #define INPUT_MT_DIRECT 0x0002 /* direct device, e.g. touchscreen */ | ||
| 20 | #define INPUT_MT_DROP_UNUSED 0x0004 /* drop contacts not seen in frame */ | ||
| 21 | #define INPUT_MT_TRACK 0x0008 /* use in-kernel tracking */ | ||
| 22 | |||
| 18 | /** | 23 | /** |
| 19 | * struct input_mt_slot - represents the state of an input MT slot | 24 | * struct input_mt_slot - represents the state of an input MT slot |
| 20 | * @abs: holds current values of ABS_MT axes for this slot | 25 | * @abs: holds current values of ABS_MT axes for this slot |
| 26 | * @frame: last frame at which input_mt_report_slot_state() was called | ||
| 27 | * @key: optional driver designation of this slot | ||
| 21 | */ | 28 | */ |
| 22 | struct input_mt_slot { | 29 | struct input_mt_slot { |
| 23 | int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; | 30 | int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; |
| 31 | unsigned int frame; | ||
| 32 | unsigned int key; | ||
| 33 | }; | ||
| 34 | |||
| 35 | /** | ||
| 36 | * struct input_mt - state of tracked contacts | ||
| 37 | * @trkid: stores MT tracking ID for the next contact | ||
| 38 | * @num_slots: number of MT slots the device uses | ||
| 39 | * @slot: MT slot currently being transmitted | ||
| 40 | * @flags: input_mt operation flags | ||
| 41 | * @frame: increases every time input_mt_sync_frame() is called | ||
| 42 | * @red: reduced cost matrix for in-kernel tracking | ||
| 43 | * @slots: array of slots holding current values of tracked contacts | ||
| 44 | */ | ||
| 45 | struct input_mt { | ||
| 46 | int trkid; | ||
| 47 | int num_slots; | ||
| 48 | int slot; | ||
| 49 | unsigned int flags; | ||
| 50 | unsigned int frame; | ||
| 51 | int *red; | ||
| 52 | struct input_mt_slot slots[]; | ||
| 24 | }; | 53 | }; |
| 25 | 54 | ||
| 26 | static inline void input_mt_set_value(struct input_mt_slot *slot, | 55 | static inline void input_mt_set_value(struct input_mt_slot *slot, |
| @@ -35,12 +64,18 @@ static inline int input_mt_get_value(const struct input_mt_slot *slot, | |||
| 35 | return slot->abs[code - ABS_MT_FIRST]; | 64 | return slot->abs[code - ABS_MT_FIRST]; |
| 36 | } | 65 | } |
| 37 | 66 | ||
| 38 | int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots); | 67 | static inline bool input_mt_is_active(const struct input_mt_slot *slot) |
| 68 | { | ||
| 69 | return input_mt_get_value(slot, ABS_MT_TRACKING_ID) >= 0; | ||
| 70 | } | ||
| 71 | |||
| 72 | int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots, | ||
| 73 | unsigned int flags); | ||
| 39 | void input_mt_destroy_slots(struct input_dev *dev); | 74 | void input_mt_destroy_slots(struct input_dev *dev); |
| 40 | 75 | ||
| 41 | static inline int input_mt_new_trkid(struct input_dev *dev) | 76 | static inline int input_mt_new_trkid(struct input_mt *mt) |
| 42 | { | 77 | { |
| 43 | return dev->trkid++ & TRKID_MAX; | 78 | return mt->trkid++ & TRKID_MAX; |
| 44 | } | 79 | } |
| 45 | 80 | ||
| 46 | static inline void input_mt_slot(struct input_dev *dev, int slot) | 81 | static inline void input_mt_slot(struct input_dev *dev, int slot) |
| @@ -64,4 +99,20 @@ void input_mt_report_slot_state(struct input_dev *dev, | |||
| 64 | void input_mt_report_finger_count(struct input_dev *dev, int count); | 99 | void input_mt_report_finger_count(struct input_dev *dev, int count); |
| 65 | void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count); | 100 | void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count); |
| 66 | 101 | ||
| 102 | void input_mt_sync_frame(struct input_dev *dev); | ||
| 103 | |||
| 104 | /** | ||
| 105 | * struct input_mt_pos - contact position | ||
| 106 | * @x: horizontal coordinate | ||
| 107 | * @y: vertical coordinate | ||
| 108 | */ | ||
| 109 | struct input_mt_pos { | ||
| 110 | s16 x, y; | ||
| 111 | }; | ||
| 112 | |||
| 113 | int input_mt_assign_slots(struct input_dev *dev, int *slots, | ||
| 114 | const struct input_mt_pos *pos, int num_pos); | ||
| 115 | |||
| 116 | int input_mt_get_slot_by_key(struct input_dev *dev, int key); | ||
| 117 | |||
| 67 | #endif | 118 | #endif |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index c5f856a040b9..5e4e6170f43a 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
| @@ -430,6 +430,8 @@ enum | |||
| 430 | NR_SOFTIRQS | 430 | NR_SOFTIRQS |
| 431 | }; | 431 | }; |
| 432 | 432 | ||
| 433 | #define SOFTIRQ_STOP_IDLE_MASK (~(1 << RCU_SOFTIRQ)) | ||
| 434 | |||
| 433 | /* map softirq index to softirq name. update 'softirq_to_name' in | 435 | /* map softirq index to softirq name. update 'softirq_to_name' in |
| 434 | * kernel/softirq.c when adding a new softirq. | 436 | * kernel/softirq.c when adding a new softirq. |
| 435 | */ | 437 | */ |
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 7e83370e6fd2..f3b99e1c1042 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
| @@ -256,72 +256,78 @@ static inline void iommu_set_fault_handler(struct iommu_domain *domain, | |||
| 256 | { | 256 | { |
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | int iommu_attach_group(struct iommu_domain *domain, struct iommu_group *group) | 259 | static inline int iommu_attach_group(struct iommu_domain *domain, |
| 260 | struct iommu_group *group) | ||
| 260 | { | 261 | { |
| 261 | return -ENODEV; | 262 | return -ENODEV; |
| 262 | } | 263 | } |
| 263 | 264 | ||
| 264 | void iommu_detach_group(struct iommu_domain *domain, struct iommu_group *group) | 265 | static inline void iommu_detach_group(struct iommu_domain *domain, |
| 266 | struct iommu_group *group) | ||
| 265 | { | 267 | { |
| 266 | } | 268 | } |
| 267 | 269 | ||
| 268 | struct iommu_group *iommu_group_alloc(void) | 270 | static inline struct iommu_group *iommu_group_alloc(void) |
| 269 | { | 271 | { |
| 270 | return ERR_PTR(-ENODEV); | 272 | return ERR_PTR(-ENODEV); |
| 271 | } | 273 | } |
| 272 | 274 | ||
| 273 | void *iommu_group_get_iommudata(struct iommu_group *group) | 275 | static inline void *iommu_group_get_iommudata(struct iommu_group *group) |
| 274 | { | 276 | { |
| 275 | return NULL; | 277 | return NULL; |
| 276 | } | 278 | } |
| 277 | 279 | ||
| 278 | void iommu_group_set_iommudata(struct iommu_group *group, void *iommu_data, | 280 | static inline void iommu_group_set_iommudata(struct iommu_group *group, |
| 279 | void (*release)(void *iommu_data)) | 281 | void *iommu_data, |
| 282 | void (*release)(void *iommu_data)) | ||
| 280 | { | 283 | { |
| 281 | } | 284 | } |
| 282 | 285 | ||
| 283 | int iommu_group_set_name(struct iommu_group *group, const char *name) | 286 | static inline int iommu_group_set_name(struct iommu_group *group, |
| 287 | const char *name) | ||
| 284 | { | 288 | { |
| 285 | return -ENODEV; | 289 | return -ENODEV; |
| 286 | } | 290 | } |
| 287 | 291 | ||
| 288 | int iommu_group_add_device(struct iommu_group *group, struct device *dev) | 292 | static inline int iommu_group_add_device(struct iommu_group *group, |
| 293 | struct device *dev) | ||
| 289 | { | 294 | { |
| 290 | return -ENODEV; | 295 | return -ENODEV; |
| 291 | } | 296 | } |
| 292 | 297 | ||
| 293 | void iommu_group_remove_device(struct device *dev) | 298 | static inline void iommu_group_remove_device(struct device *dev) |
| 294 | { | 299 | { |
| 295 | } | 300 | } |
| 296 | 301 | ||
| 297 | int iommu_group_for_each_dev(struct iommu_group *group, void *data, | 302 | static inline int iommu_group_for_each_dev(struct iommu_group *group, |
| 298 | int (*fn)(struct device *, void *)) | 303 | void *data, |
| 304 | int (*fn)(struct device *, void *)) | ||
| 299 | { | 305 | { |
| 300 | return -ENODEV; | 306 | return -ENODEV; |
| 301 | } | 307 | } |
| 302 | 308 | ||
| 303 | struct iommu_group *iommu_group_get(struct device *dev) | 309 | static inline struct iommu_group *iommu_group_get(struct device *dev) |
| 304 | { | 310 | { |
| 305 | return NULL; | 311 | return NULL; |
| 306 | } | 312 | } |
| 307 | 313 | ||
| 308 | void iommu_group_put(struct iommu_group *group) | 314 | static inline void iommu_group_put(struct iommu_group *group) |
| 309 | { | 315 | { |
| 310 | } | 316 | } |
| 311 | 317 | ||
| 312 | int iommu_group_register_notifier(struct iommu_group *group, | 318 | static inline int iommu_group_register_notifier(struct iommu_group *group, |
| 313 | struct notifier_block *nb) | 319 | struct notifier_block *nb) |
| 314 | { | 320 | { |
| 315 | return -ENODEV; | 321 | return -ENODEV; |
| 316 | } | 322 | } |
| 317 | 323 | ||
| 318 | int iommu_group_unregister_notifier(struct iommu_group *group, | 324 | static inline int iommu_group_unregister_notifier(struct iommu_group *group, |
| 319 | struct notifier_block *nb) | 325 | struct notifier_block *nb) |
| 320 | { | 326 | { |
| 321 | return 0; | 327 | return 0; |
| 322 | } | 328 | } |
| 323 | 329 | ||
| 324 | int iommu_group_id(struct iommu_group *group) | 330 | static inline int iommu_group_id(struct iommu_group *group) |
| 325 | { | 331 | { |
| 326 | return -ENODEV; | 332 | return -ENODEV; |
| 327 | } | 333 | } |
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index 9a323d12de1c..0ba014c55056 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h | |||
| @@ -10,12 +10,10 @@ | |||
| 10 | 10 | ||
| 11 | struct irq_affinity_notify; | 11 | struct irq_affinity_notify; |
| 12 | struct proc_dir_entry; | 12 | struct proc_dir_entry; |
| 13 | struct timer_rand_state; | ||
| 14 | struct module; | 13 | struct module; |
| 15 | /** | 14 | /** |
| 16 | * struct irq_desc - interrupt descriptor | 15 | * struct irq_desc - interrupt descriptor |
| 17 | * @irq_data: per irq and chip data passed down to chip functions | 16 | * @irq_data: per irq and chip data passed down to chip functions |
| 18 | * @timer_rand_state: pointer to timer rand state struct | ||
| 19 | * @kstat_irqs: irq stats per cpu | 17 | * @kstat_irqs: irq stats per cpu |
| 20 | * @handle_irq: highlevel irq-events handler | 18 | * @handle_irq: highlevel irq-events handler |
| 21 | * @preflow_handler: handler called before the flow handler (currently used by sparc) | 19 | * @preflow_handler: handler called before the flow handler (currently used by sparc) |
diff --git a/include/linux/istallion.h b/include/linux/istallion.h deleted file mode 100644 index ad700a60c158..000000000000 --- a/include/linux/istallion.h +++ /dev/null | |||
| @@ -1,123 +0,0 @@ | |||
| 1 | /*****************************************************************************/ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * istallion.h -- stallion intelligent multiport serial driver. | ||
| 5 | * | ||
| 6 | * Copyright (C) 1996-1998 Stallion Technologies | ||
| 7 | * Copyright (C) 1994-1996 Greg Ungerer. | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | * GNU General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 22 | */ | ||
| 23 | |||
| 24 | /*****************************************************************************/ | ||
| 25 | #ifndef _ISTALLION_H | ||
| 26 | #define _ISTALLION_H | ||
| 27 | /*****************************************************************************/ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Define important driver constants here. | ||
| 31 | */ | ||
| 32 | #define STL_MAXBRDS 4 | ||
| 33 | #define STL_MAXPANELS 4 | ||
| 34 | #define STL_MAXPORTS 64 | ||
| 35 | #define STL_MAXCHANS (STL_MAXPORTS + 1) | ||
| 36 | #define STL_MAXDEVS (STL_MAXBRDS * STL_MAXPORTS) | ||
| 37 | |||
| 38 | |||
| 39 | /* | ||
| 40 | * Define a set of structures to hold all the board/panel/port info | ||
| 41 | * for our ports. These will be dynamically allocated as required at | ||
| 42 | * driver initialization time. | ||
| 43 | */ | ||
| 44 | |||
| 45 | /* | ||
| 46 | * Port and board structures to hold status info about each object. | ||
| 47 | * The board structure contains pointers to structures for each port | ||
| 48 | * connected to it. Panels are not distinguished here, since | ||
| 49 | * communication with the slave board will always be on a per port | ||
| 50 | * basis. | ||
| 51 | */ | ||
| 52 | struct stliport { | ||
| 53 | unsigned long magic; | ||
| 54 | struct tty_port port; | ||
| 55 | unsigned int portnr; | ||
| 56 | unsigned int panelnr; | ||
| 57 | unsigned int brdnr; | ||
| 58 | unsigned long state; | ||
| 59 | unsigned int devnr; | ||
| 60 | int baud_base; | ||
| 61 | int custom_divisor; | ||
| 62 | int closing_wait; | ||
| 63 | int rc; | ||
| 64 | int argsize; | ||
| 65 | void *argp; | ||
| 66 | unsigned int rxmarkmsk; | ||
| 67 | wait_queue_head_t raw_wait; | ||
| 68 | struct asysigs asig; | ||
| 69 | unsigned long addr; | ||
| 70 | unsigned long rxoffset; | ||
| 71 | unsigned long txoffset; | ||
| 72 | unsigned long sigs; | ||
| 73 | unsigned long pflag; | ||
| 74 | unsigned int rxsize; | ||
| 75 | unsigned int txsize; | ||
| 76 | unsigned char reqbit; | ||
| 77 | unsigned char portidx; | ||
| 78 | unsigned char portbit; | ||
| 79 | }; | ||
| 80 | |||
| 81 | /* | ||
| 82 | * Use a structure of function pointers to do board level operations. | ||
| 83 | * These include, enable/disable, paging shared memory, interrupting, etc. | ||
| 84 | */ | ||
| 85 | struct stlibrd { | ||
| 86 | unsigned long magic; | ||
| 87 | unsigned int brdnr; | ||
| 88 | unsigned int brdtype; | ||
| 89 | unsigned long state; | ||
| 90 | unsigned int nrpanels; | ||
| 91 | unsigned int nrports; | ||
| 92 | unsigned int nrdevs; | ||
| 93 | unsigned int iobase; | ||
| 94 | int iosize; | ||
| 95 | unsigned long memaddr; | ||
| 96 | void __iomem *membase; | ||
| 97 | unsigned long memsize; | ||
| 98 | int pagesize; | ||
| 99 | int hostoffset; | ||
| 100 | int slaveoffset; | ||
| 101 | int bitsize; | ||
| 102 | int enabval; | ||
| 103 | unsigned int panels[STL_MAXPANELS]; | ||
| 104 | int panelids[STL_MAXPANELS]; | ||
| 105 | void (*init)(struct stlibrd *brdp); | ||
| 106 | void (*enable)(struct stlibrd *brdp); | ||
| 107 | void (*reenable)(struct stlibrd *brdp); | ||
| 108 | void (*disable)(struct stlibrd *brdp); | ||
| 109 | void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line); | ||
| 110 | void (*intr)(struct stlibrd *brdp); | ||
| 111 | void (*reset)(struct stlibrd *brdp); | ||
| 112 | struct stliport *ports[STL_MAXPORTS]; | ||
| 113 | }; | ||
| 114 | |||
| 115 | |||
| 116 | /* | ||
| 117 | * Define MAGIC numbers used for above structures. | ||
| 118 | */ | ||
| 119 | #define STLI_PORTMAGIC 0xe671c7a1 | ||
| 120 | #define STLI_BOARDMAGIC 0x4bc6c825 | ||
| 121 | |||
| 122 | /*****************************************************************************/ | ||
| 123 | #endif | ||
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index daf4a3a40ee0..b7c8cdc1d422 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h | |||
| @@ -65,7 +65,6 @@ struct kbd_struct { | |||
| 65 | 65 | ||
| 66 | extern int kbd_init(void); | 66 | extern int kbd_init(void); |
| 67 | 67 | ||
| 68 | extern unsigned char getledstate(void); | ||
| 69 | extern void setledstate(struct kbd_struct *kbd, unsigned int led); | 68 | extern void setledstate(struct kbd_struct *kbd, unsigned int led); |
| 70 | 69 | ||
| 71 | extern int do_poke_blanked_console; | 70 | extern int do_poke_blanked_console; |
| @@ -145,16 +144,4 @@ void compute_shiftstate(void); | |||
| 145 | 144 | ||
| 146 | extern unsigned int keymap_count; | 145 | extern unsigned int keymap_count; |
| 147 | 146 | ||
| 148 | /* console.c */ | ||
| 149 | |||
| 150 | static inline void con_schedule_flip(struct tty_struct *t) | ||
| 151 | { | ||
| 152 | unsigned long flags; | ||
| 153 | spin_lock_irqsave(&t->buf.lock, flags); | ||
| 154 | if (t->buf.tail != NULL) | ||
| 155 | t->buf.tail->commit = t->buf.tail->used; | ||
| 156 | spin_unlock_irqrestore(&t->buf.lock, flags); | ||
| 157 | schedule_work(&t->buf.work); | ||
| 158 | } | ||
| 159 | |||
| 160 | #endif | 147 | #endif |
diff --git a/include/linux/kdb.h b/include/linux/kdb.h index 42d9e863a313..7f6fe6e015bc 100644 --- a/include/linux/kdb.h +++ b/include/linux/kdb.h | |||
| @@ -13,6 +13,14 @@ | |||
| 13 | * Copyright (C) 2009 Jason Wessel <jason.wessel@windriver.com> | 13 | * Copyright (C) 2009 Jason Wessel <jason.wessel@windriver.com> |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | typedef enum { | ||
| 17 | KDB_REPEAT_NONE = 0, /* Do not repeat this command */ | ||
| 18 | KDB_REPEAT_NO_ARGS, /* Repeat the command without arguments */ | ||
| 19 | KDB_REPEAT_WITH_ARGS, /* Repeat the command including its arguments */ | ||
| 20 | } kdb_repeat_t; | ||
| 21 | |||
| 22 | typedef int (*kdb_func_t)(int, const char **); | ||
| 23 | |||
| 16 | #ifdef CONFIG_KGDB_KDB | 24 | #ifdef CONFIG_KGDB_KDB |
| 17 | #include <linux/init.h> | 25 | #include <linux/init.h> |
| 18 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
| @@ -32,14 +40,6 @@ extern atomic_t kdb_event; | |||
| 32 | 40 | ||
| 33 | #define KDB_MAXARGS 16 /* Maximum number of arguments to a function */ | 41 | #define KDB_MAXARGS 16 /* Maximum number of arguments to a function */ |
| 34 | 42 | ||
| 35 | typedef enum { | ||
| 36 | KDB_REPEAT_NONE = 0, /* Do not repeat this command */ | ||
| 37 | KDB_REPEAT_NO_ARGS, /* Repeat the command without arguments */ | ||
| 38 | KDB_REPEAT_WITH_ARGS, /* Repeat the command including its arguments */ | ||
| 39 | } kdb_repeat_t; | ||
| 40 | |||
| 41 | typedef int (*kdb_func_t)(int, const char **); | ||
| 42 | |||
| 43 | /* KDB return codes from a command or internal kdb function */ | 43 | /* KDB return codes from a command or internal kdb function */ |
| 44 | #define KDB_NOTFOUND (-1) | 44 | #define KDB_NOTFOUND (-1) |
| 45 | #define KDB_ARGCOUNT (-2) | 45 | #define KDB_ARGCOUNT (-2) |
| @@ -149,11 +149,14 @@ extern int kdb_register_repeat(char *, kdb_func_t, char *, char *, | |||
| 149 | short, kdb_repeat_t); | 149 | short, kdb_repeat_t); |
| 150 | extern int kdb_unregister(char *); | 150 | extern int kdb_unregister(char *); |
| 151 | #else /* ! CONFIG_KGDB_KDB */ | 151 | #else /* ! CONFIG_KGDB_KDB */ |
| 152 | #define kdb_printf(...) | 152 | static inline __printf(1, 2) int kdb_printf(const char *fmt, ...) { return 0; } |
| 153 | #define kdb_init(x) | 153 | static inline void kdb_init(int level) {} |
| 154 | #define kdb_register(...) | 154 | static inline int kdb_register(char *cmd, kdb_func_t func, char *usage, |
| 155 | #define kdb_register_repeat(...) | 155 | char *help, short minlen) { return 0; } |
| 156 | #define kdb_uregister(x) | 156 | static inline int kdb_register_repeat(char *cmd, kdb_func_t func, char *usage, |
| 157 | char *help, short minlen, | ||
| 158 | kdb_repeat_t repeat) { return 0; } | ||
| 159 | static inline int kdb_unregister(char *cmd) { return 0; } | ||
| 157 | #endif /* CONFIG_KGDB_KDB */ | 160 | #endif /* CONFIG_KGDB_KDB */ |
| 158 | enum { | 161 | enum { |
| 159 | KDB_NOT_INITIALIZED, | 162 | KDB_NOT_INITIALIZED, |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 604382143bcf..2451f1f7a1d9 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -82,10 +82,18 @@ | |||
| 82 | __x - (__x % (y)); \ | 82 | __x - (__x % (y)); \ |
| 83 | } \ | 83 | } \ |
| 84 | ) | 84 | ) |
| 85 | |||
| 86 | /* | ||
| 87 | * Divide positive or negative dividend by positive divisor and round | ||
| 88 | * to closest integer. Result is undefined for negative divisors. | ||
| 89 | */ | ||
| 85 | #define DIV_ROUND_CLOSEST(x, divisor)( \ | 90 | #define DIV_ROUND_CLOSEST(x, divisor)( \ |
| 86 | { \ | 91 | { \ |
| 87 | typeof(divisor) __divisor = divisor; \ | 92 | typeof(x) __x = x; \ |
| 88 | (((x) + ((__divisor) / 2)) / (__divisor)); \ | 93 | typeof(divisor) __d = divisor; \ |
| 94 | (((typeof(x))-1) > 0 || (__x) > 0) ? \ | ||
| 95 | (((__x) + ((__d) / 2)) / (__d)) : \ | ||
| 96 | (((__x) - ((__d) / 2)) / (__d)); \ | ||
| 89 | } \ | 97 | } \ |
| 90 | ) | 98 | ) |
| 91 | 99 | ||
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 2fbd9053c2df..36d12f0884c3 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
| @@ -130,4 +130,12 @@ extern void account_process_tick(struct task_struct *, int user); | |||
| 130 | extern void account_steal_ticks(unsigned long ticks); | 130 | extern void account_steal_ticks(unsigned long ticks); |
| 131 | extern void account_idle_ticks(unsigned long ticks); | 131 | extern void account_idle_ticks(unsigned long ticks); |
| 132 | 132 | ||
| 133 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
| 134 | extern void vtime_task_switch(struct task_struct *prev); | ||
| 135 | extern void vtime_account_system(struct task_struct *tsk); | ||
| 136 | extern void vtime_account_idle(struct task_struct *tsk); | ||
| 137 | #else | ||
| 138 | static inline void vtime_task_switch(struct task_struct *prev) { } | ||
| 139 | #endif | ||
| 140 | |||
| 133 | #endif /* _LINUX_KERNEL_STAT_H */ | 141 | #endif /* _LINUX_KERNEL_STAT_H */ |
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index c4d2fc194ede..4dff0c6ed58f 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
| @@ -240,6 +240,7 @@ extern void kgdb_arch_late(void); | |||
| 240 | * hardware breakpoints. | 240 | * hardware breakpoints. |
| 241 | * @correct_hw_break: Allow an architecture to specify how to correct the | 241 | * @correct_hw_break: Allow an architecture to specify how to correct the |
| 242 | * hardware debug registers. | 242 | * hardware debug registers. |
| 243 | * @enable_nmi: Manage NMI-triggered entry to KGDB | ||
| 243 | */ | 244 | */ |
| 244 | struct kgdb_arch { | 245 | struct kgdb_arch { |
| 245 | unsigned char gdb_bpt_instr[BREAK_INSTR_SIZE]; | 246 | unsigned char gdb_bpt_instr[BREAK_INSTR_SIZE]; |
| @@ -252,6 +253,8 @@ struct kgdb_arch { | |||
| 252 | void (*disable_hw_break)(struct pt_regs *regs); | 253 | void (*disable_hw_break)(struct pt_regs *regs); |
| 253 | void (*remove_all_hw_break)(void); | 254 | void (*remove_all_hw_break)(void); |
| 254 | void (*correct_hw_break)(void); | 255 | void (*correct_hw_break)(void); |
| 256 | |||
| 257 | void (*enable_nmi)(bool on); | ||
| 255 | }; | 258 | }; |
| 256 | 259 | ||
| 257 | /** | 260 | /** |
| @@ -283,6 +286,16 @@ extern struct kgdb_arch arch_kgdb_ops; | |||
| 283 | 286 | ||
| 284 | extern unsigned long __weak kgdb_arch_pc(int exception, struct pt_regs *regs); | 287 | extern unsigned long __weak kgdb_arch_pc(int exception, struct pt_regs *regs); |
| 285 | 288 | ||
| 289 | #ifdef CONFIG_SERIAL_KGDB_NMI | ||
| 290 | extern int kgdb_register_nmi_console(void); | ||
| 291 | extern int kgdb_unregister_nmi_console(void); | ||
| 292 | extern bool kgdb_nmi_poll_knock(void); | ||
| 293 | #else | ||
| 294 | static inline int kgdb_register_nmi_console(void) { return 0; } | ||
| 295 | static inline int kgdb_unregister_nmi_console(void) { return 0; } | ||
| 296 | static inline bool kgdb_nmi_poll_knock(void) { return 1; } | ||
| 297 | #endif | ||
| 298 | |||
| 286 | extern int kgdb_register_io_module(struct kgdb_io *local_kgdb_io_ops); | 299 | extern int kgdb_register_io_module(struct kgdb_io *local_kgdb_io_ops); |
| 287 | extern void kgdb_unregister_io_module(struct kgdb_io *local_kgdb_io_ops); | 300 | extern void kgdb_unregister_io_module(struct kgdb_io *local_kgdb_io_ops); |
| 288 | extern struct kgdb_io *dbg_io_ops; | 301 | extern struct kgdb_io *dbg_io_ops; |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index fc615a97e2d3..1e57449395b1 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
| @@ -224,7 +224,7 @@ static inline int kobject_uevent_env(struct kobject *kobj, | |||
| 224 | 224 | ||
| 225 | static inline __printf(2, 3) | 225 | static inline __printf(2, 3) |
| 226 | int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) | 226 | int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) |
| 227 | { return 0; } | 227 | { return -ENOMEM; } |
| 228 | 228 | ||
| 229 | static inline int kobject_action_type(const char *buf, size_t count, | 229 | static inline int kobject_action_type(const char *buf, size_t count, |
| 230 | enum kobject_action *type) | 230 | enum kobject_action *type) |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index b6e1f8c00577..23755ba42abc 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | #include <linux/spinlock.h> | 38 | #include <linux/spinlock.h> |
| 39 | #include <linux/rcupdate.h> | 39 | #include <linux/rcupdate.h> |
| 40 | #include <linux/mutex.h> | 40 | #include <linux/mutex.h> |
| 41 | #include <linux/ftrace.h> | ||
| 41 | 42 | ||
| 42 | #ifdef CONFIG_KPROBES | 43 | #ifdef CONFIG_KPROBES |
| 43 | #include <asm/kprobes.h> | 44 | #include <asm/kprobes.h> |
| @@ -48,14 +49,26 @@ | |||
| 48 | #define KPROBE_REENTER 0x00000004 | 49 | #define KPROBE_REENTER 0x00000004 |
| 49 | #define KPROBE_HIT_SSDONE 0x00000008 | 50 | #define KPROBE_HIT_SSDONE 0x00000008 |
| 50 | 51 | ||
| 52 | /* | ||
| 53 | * If function tracer is enabled and the arch supports full | ||
| 54 | * passing of pt_regs to function tracing, then kprobes can | ||
| 55 | * optimize on top of function tracing. | ||
| 56 | */ | ||
| 57 | #if defined(CONFIG_FUNCTION_TRACER) && defined(ARCH_SUPPORTS_FTRACE_SAVE_REGS) \ | ||
| 58 | && defined(ARCH_SUPPORTS_KPROBES_ON_FTRACE) | ||
| 59 | # define KPROBES_CAN_USE_FTRACE | ||
| 60 | #endif | ||
| 61 | |||
| 51 | /* Attach to insert probes on any functions which should be ignored*/ | 62 | /* Attach to insert probes on any functions which should be ignored*/ |
| 52 | #define __kprobes __attribute__((__section__(".kprobes.text"))) | 63 | #define __kprobes __attribute__((__section__(".kprobes.text"))) |
| 64 | |||
| 53 | #else /* CONFIG_KPROBES */ | 65 | #else /* CONFIG_KPROBES */ |
| 54 | typedef int kprobe_opcode_t; | 66 | typedef int kprobe_opcode_t; |
| 55 | struct arch_specific_insn { | 67 | struct arch_specific_insn { |
| 56 | int dummy; | 68 | int dummy; |
| 57 | }; | 69 | }; |
| 58 | #define __kprobes | 70 | #define __kprobes |
| 71 | |||
| 59 | #endif /* CONFIG_KPROBES */ | 72 | #endif /* CONFIG_KPROBES */ |
| 60 | 73 | ||
| 61 | struct kprobe; | 74 | struct kprobe; |
| @@ -128,6 +141,7 @@ struct kprobe { | |||
| 128 | * NOTE: | 141 | * NOTE: |
| 129 | * this flag is only for optimized_kprobe. | 142 | * this flag is only for optimized_kprobe. |
| 130 | */ | 143 | */ |
| 144 | #define KPROBE_FLAG_FTRACE 8 /* probe is using ftrace */ | ||
| 131 | 145 | ||
| 132 | /* Has this kprobe gone ? */ | 146 | /* Has this kprobe gone ? */ |
| 133 | static inline int kprobe_gone(struct kprobe *p) | 147 | static inline int kprobe_gone(struct kprobe *p) |
| @@ -146,6 +160,13 @@ static inline int kprobe_optimized(struct kprobe *p) | |||
| 146 | { | 160 | { |
| 147 | return p->flags & KPROBE_FLAG_OPTIMIZED; | 161 | return p->flags & KPROBE_FLAG_OPTIMIZED; |
| 148 | } | 162 | } |
| 163 | |||
| 164 | /* Is this kprobe uses ftrace ? */ | ||
| 165 | static inline int kprobe_ftrace(struct kprobe *p) | ||
| 166 | { | ||
| 167 | return p->flags & KPROBE_FLAG_FTRACE; | ||
| 168 | } | ||
| 169 | |||
| 149 | /* | 170 | /* |
| 150 | * Special probe type that uses setjmp-longjmp type tricks to resume | 171 | * Special probe type that uses setjmp-longjmp type tricks to resume |
| 151 | * execution at a specified entry with a matching prototype corresponding | 172 | * execution at a specified entry with a matching prototype corresponding |
| @@ -295,6 +316,12 @@ extern int proc_kprobes_optimization_handler(struct ctl_table *table, | |||
| 295 | #endif | 316 | #endif |
| 296 | 317 | ||
| 297 | #endif /* CONFIG_OPTPROBES */ | 318 | #endif /* CONFIG_OPTPROBES */ |
| 319 | #ifdef KPROBES_CAN_USE_FTRACE | ||
| 320 | extern void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, | ||
| 321 | struct ftrace_ops *ops, struct pt_regs *regs); | ||
| 322 | extern int arch_prepare_kprobe_ftrace(struct kprobe *p); | ||
| 323 | #endif | ||
| 324 | |||
| 298 | 325 | ||
| 299 | /* Get the kprobe at this addr (if any) - called with preemption disabled */ | 326 | /* Get the kprobe at this addr (if any) - called with preemption disabled */ |
| 300 | struct kprobe *get_kprobe(void *addr); | 327 | struct kprobe *get_kprobe(void *addr); |
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index 22ccf9dee177..8d816646f766 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
| @@ -14,6 +14,11 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), | |||
| 14 | kthread_create_on_node(threadfn, data, -1, namefmt, ##arg) | 14 | kthread_create_on_node(threadfn, data, -1, namefmt, ##arg) |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | struct task_struct *kthread_create_on_cpu(int (*threadfn)(void *data), | ||
| 18 | void *data, | ||
| 19 | unsigned int cpu, | ||
| 20 | const char *namefmt); | ||
| 21 | |||
| 17 | /** | 22 | /** |
| 18 | * kthread_run - create and wake a thread. | 23 | * kthread_run - create and wake a thread. |
| 19 | * @threadfn: the function to run until signal_pending(current). | 24 | * @threadfn: the function to run until signal_pending(current). |
| @@ -34,9 +39,13 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), | |||
| 34 | 39 | ||
| 35 | void kthread_bind(struct task_struct *k, unsigned int cpu); | 40 | void kthread_bind(struct task_struct *k, unsigned int cpu); |
| 36 | int kthread_stop(struct task_struct *k); | 41 | int kthread_stop(struct task_struct *k); |
| 37 | int kthread_should_stop(void); | 42 | bool kthread_should_stop(void); |
| 43 | bool kthread_should_park(void); | ||
| 38 | bool kthread_freezable_should_stop(bool *was_frozen); | 44 | bool kthread_freezable_should_stop(bool *was_frozen); |
| 39 | void *kthread_data(struct task_struct *k); | 45 | void *kthread_data(struct task_struct *k); |
| 46 | int kthread_park(struct task_struct *k); | ||
| 47 | void kthread_unpark(struct task_struct *k); | ||
| 48 | void kthread_parkme(void); | ||
| 40 | 49 | ||
| 41 | int kthreadd(void *unused); | 50 | int kthreadd(void *unused); |
| 42 | extern struct task_struct *kthreadd_task; | 51 | extern struct task_struct *kthreadd_task; |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index b70b48b01098..8a59e0abe5fa 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -685,7 +685,7 @@ static inline int kvm_deassign_device(struct kvm *kvm, | |||
| 685 | static inline void kvm_guest_enter(void) | 685 | static inline void kvm_guest_enter(void) |
| 686 | { | 686 | { |
| 687 | BUG_ON(preemptible()); | 687 | BUG_ON(preemptible()); |
| 688 | account_system_vtime(current); | 688 | vtime_account(current); |
| 689 | current->flags |= PF_VCPU; | 689 | current->flags |= PF_VCPU; |
| 690 | /* KVM does not hold any references to rcu protected data when it | 690 | /* KVM does not hold any references to rcu protected data when it |
| 691 | * switches CPU into a guest mode. In fact switching to a guest mode | 691 | * switches CPU into a guest mode. In fact switching to a guest mode |
| @@ -699,7 +699,7 @@ static inline void kvm_guest_enter(void) | |||
| 699 | 699 | ||
| 700 | static inline void kvm_guest_exit(void) | 700 | static inline void kvm_guest_exit(void) |
| 701 | { | 701 | { |
| 702 | account_system_vtime(current); | 702 | vtime_account(current); |
| 703 | current->flags &= ~PF_VCPU; | 703 | current->flags &= ~PF_VCPU; |
| 704 | } | 704 | } |
| 705 | 705 | ||
diff --git a/include/linux/mISDNhw.h b/include/linux/mISDNhw.h index d0752eca9b44..9d96d5d4dfed 100644 --- a/include/linux/mISDNhw.h +++ b/include/linux/mISDNhw.h | |||
| @@ -183,7 +183,7 @@ extern int mISDN_initbchannel(struct bchannel *, unsigned short, | |||
| 183 | unsigned short); | 183 | unsigned short); |
| 184 | extern int mISDN_freedchannel(struct dchannel *); | 184 | extern int mISDN_freedchannel(struct dchannel *); |
| 185 | extern void mISDN_clear_bchannel(struct bchannel *); | 185 | extern void mISDN_clear_bchannel(struct bchannel *); |
| 186 | extern int mISDN_freebchannel(struct bchannel *); | 186 | extern void mISDN_freebchannel(struct bchannel *); |
| 187 | extern int mISDN_ctrl_bchannel(struct bchannel *, struct mISDN_ctrl_req *); | 187 | extern int mISDN_ctrl_bchannel(struct bchannel *, struct mISDN_ctrl_req *); |
| 188 | extern void queue_ch_frame(struct mISDNchannel *, u_int, | 188 | extern void queue_ch_frame(struct mISDNchannel *, u_int, |
| 189 | int, struct sk_buff *); | 189 | int, struct sk_buff *); |
diff --git a/include/linux/memory.h b/include/linux/memory.h index 1ac7f6e405f9..ff9a9f8e0ed9 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | #include <linux/compiler.h> | 19 | #include <linux/compiler.h> |
| 20 | #include <linux/mutex.h> | 20 | #include <linux/mutex.h> |
| 21 | 21 | ||
| 22 | #define MIN_MEMORY_BLOCK_SIZE (1 << SECTION_SIZE_BITS) | 22 | #define MIN_MEMORY_BLOCK_SIZE (1UL << SECTION_SIZE_BITS) |
| 23 | 23 | ||
| 24 | struct memory_block { | 24 | struct memory_block { |
| 25 | unsigned long start_section_nr; | 25 | unsigned long start_section_nr; |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index 3a8435a8058f..cebe97ee98b8 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | 16 | ||
| 17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
| 18 | 18 | ||
| 19 | struct irq_domain; | ||
| 20 | |||
| 19 | /* | 21 | /* |
| 20 | * This struct describes the MFD part ("cell"). | 22 | * This struct describes the MFD part ("cell"). |
| 21 | * After registration the copy of this structure will become the platform data | 23 | * After registration the copy of this structure will become the platform data |
| @@ -98,7 +100,7 @@ static inline const struct mfd_cell *mfd_get_cell(struct platform_device *pdev) | |||
| 98 | extern int mfd_add_devices(struct device *parent, int id, | 100 | extern int mfd_add_devices(struct device *parent, int id, |
| 99 | struct mfd_cell *cells, int n_devs, | 101 | struct mfd_cell *cells, int n_devs, |
| 100 | struct resource *mem_base, | 102 | struct resource *mem_base, |
| 101 | int irq_base); | 103 | int irq_base, struct irq_domain *irq_domain); |
| 102 | 104 | ||
| 103 | extern void mfd_remove_devices(struct device *parent); | 105 | extern void mfd_remove_devices(struct device *parent); |
| 104 | 106 | ||
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h index 5b90e94399e1..c410d99bd667 100644 --- a/include/linux/mfd/dbx500-prcmu.h +++ b/include/linux/mfd/dbx500-prcmu.h | |||
| @@ -136,6 +136,7 @@ enum prcmu_clock { | |||
| 136 | PRCMU_TIMCLK, | 136 | PRCMU_TIMCLK, |
| 137 | PRCMU_PLLSOC0, | 137 | PRCMU_PLLSOC0, |
| 138 | PRCMU_PLLSOC1, | 138 | PRCMU_PLLSOC1, |
| 139 | PRCMU_ARMSS, | ||
| 139 | PRCMU_PLLDDR, | 140 | PRCMU_PLLDDR, |
| 140 | PRCMU_PLLDSI, | 141 | PRCMU_PLLDSI, |
| 141 | PRCMU_DSI0CLK, | 142 | PRCMU_DSI0CLK, |
diff --git a/include/linux/mfd/max77686.h b/include/linux/mfd/max77686.h index 3d7ae4d7fd36..46c0f320ed76 100644 --- a/include/linux/mfd/max77686.h +++ b/include/linux/mfd/max77686.h | |||
| @@ -74,6 +74,7 @@ enum max77686_regulators { | |||
| 74 | struct max77686_regulator_data { | 74 | struct max77686_regulator_data { |
| 75 | int id; | 75 | int id; |
| 76 | struct regulator_init_data *initdata; | 76 | struct regulator_init_data *initdata; |
| 77 | struct device_node *of_node; | ||
| 77 | }; | 78 | }; |
| 78 | 79 | ||
| 79 | enum max77686_opmode { | 80 | enum max77686_opmode { |
diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h index f4f0dfa4698a..6823548d0c0a 100644 --- a/include/linux/mfd/max8998.h +++ b/include/linux/mfd/max8998.h | |||
| @@ -67,7 +67,7 @@ struct max8998_regulator_data { | |||
| 67 | /** | 67 | /** |
| 68 | * struct max8998_board - packages regulator init data | 68 | * struct max8998_board - packages regulator init data |
| 69 | * @regulators: array of defined regulators | 69 | * @regulators: array of defined regulators |
| 70 | * @num_regulators: number of regultors used | 70 | * @num_regulators: number of regulators used |
| 71 | * @irq_base: base IRQ number for max8998, required for IRQs | 71 | * @irq_base: base IRQ number for max8998, required for IRQs |
| 72 | * @ono: power onoff IRQ number for max8998 | 72 | * @ono: power onoff IRQ number for max8998 |
| 73 | * @buck_voltage_lock: Do NOT change the values of the following six | 73 | * @buck_voltage_lock: Do NOT change the values of the following six |
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h index 12c06870829a..7cd83d826ed8 100644 --- a/include/linux/mfd/tps65217.h +++ b/include/linux/mfd/tps65217.h | |||
| @@ -22,6 +22,9 @@ | |||
| 22 | #include <linux/regulator/driver.h> | 22 | #include <linux/regulator/driver.h> |
| 23 | #include <linux/regulator/machine.h> | 23 | #include <linux/regulator/machine.h> |
| 24 | 24 | ||
| 25 | /* TPS chip id list */ | ||
| 26 | #define TPS65217 0xF0 | ||
| 27 | |||
| 25 | /* I2C ID for TPS65217 part */ | 28 | /* I2C ID for TPS65217 part */ |
| 26 | #define TPS65217_I2C_ID 0x24 | 29 | #define TPS65217_I2C_ID 0x24 |
| 27 | 30 | ||
| @@ -248,13 +251,11 @@ struct tps_info { | |||
| 248 | struct tps65217 { | 251 | struct tps65217 { |
| 249 | struct device *dev; | 252 | struct device *dev; |
| 250 | struct tps65217_board *pdata; | 253 | struct tps65217_board *pdata; |
| 254 | unsigned int id; | ||
| 251 | struct regulator_desc desc[TPS65217_NUM_REGULATOR]; | 255 | struct regulator_desc desc[TPS65217_NUM_REGULATOR]; |
| 252 | struct regulator_dev *rdev[TPS65217_NUM_REGULATOR]; | 256 | struct regulator_dev *rdev[TPS65217_NUM_REGULATOR]; |
| 253 | struct tps_info *info[TPS65217_NUM_REGULATOR]; | 257 | struct tps_info *info[TPS65217_NUM_REGULATOR]; |
| 254 | struct regmap *regmap; | 258 | struct regmap *regmap; |
| 255 | |||
| 256 | /* Client devices */ | ||
| 257 | struct platform_device *regulator_pdev[TPS65217_NUM_REGULATOR]; | ||
| 258 | }; | 259 | }; |
| 259 | 260 | ||
| 260 | static inline struct tps65217 *dev_to_tps65217(struct device *dev) | 261 | static inline struct tps65217 *dev_to_tps65217(struct device *dev) |
| @@ -262,6 +263,11 @@ static inline struct tps65217 *dev_to_tps65217(struct device *dev) | |||
| 262 | return dev_get_drvdata(dev); | 263 | return dev_get_drvdata(dev); |
| 263 | } | 264 | } |
| 264 | 265 | ||
| 266 | static inline int tps65217_chip_id(struct tps65217 *tps65217) | ||
| 267 | { | ||
| 268 | return tps65217->id; | ||
| 269 | } | ||
| 270 | |||
| 265 | int tps65217_reg_read(struct tps65217 *tps, unsigned int reg, | 271 | int tps65217_reg_read(struct tps65217 *tps, unsigned int reg, |
| 266 | unsigned int *val); | 272 | unsigned int *val); |
| 267 | int tps65217_reg_write(struct tps65217 *tps, unsigned int reg, | 273 | int tps65217_reg_write(struct tps65217 *tps, unsigned int reg, |
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h index f350fd0ba1df..94514710a03f 100644 --- a/include/linux/mfd/tps6586x.h +++ b/include/linux/mfd/tps6586x.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #define TPS6586X_SLEW_RATE_MASK 0x07 | 14 | #define TPS6586X_SLEW_RATE_MASK 0x07 |
| 15 | 15 | ||
| 16 | enum { | 16 | enum { |
| 17 | TPS6586X_ID_SYS, | ||
| 17 | TPS6586X_ID_SM_0, | 18 | TPS6586X_ID_SM_0, |
| 18 | TPS6586X_ID_SM_1, | 19 | TPS6586X_ID_SM_1, |
| 19 | TPS6586X_ID_SM_2, | 20 | TPS6586X_ID_SM_2, |
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h index eaad49f7c130..ba43d4806b83 100644 --- a/include/linux/mfd/twl6040.h +++ b/include/linux/mfd/twl6040.h | |||
| @@ -194,7 +194,6 @@ struct twl6040_vibra_data { | |||
| 194 | 194 | ||
| 195 | struct twl6040_platform_data { | 195 | struct twl6040_platform_data { |
| 196 | int audpwron_gpio; /* audio power-on gpio */ | 196 | int audpwron_gpio; /* audio power-on gpio */ |
| 197 | unsigned int irq_base; | ||
| 198 | 197 | ||
| 199 | struct twl6040_codec_data *codec; | 198 | struct twl6040_codec_data *codec; |
| 200 | struct twl6040_vibra_data *vibra; | 199 | struct twl6040_vibra_data *vibra; |
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h index 61f0905bdc48..de201203bc7c 100644 --- a/include/linux/micrel_phy.h +++ b/include/linux/micrel_phy.h | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/micrel_phy.h | ||
| 3 | * | ||
| 4 | * Micrel PHY IDs | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms of the GNU General Public License as published by the | ||
| 8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 9 | * option) any later version. | ||
| 10 | * | ||
| 11 | */ | ||
| 12 | |||
| 1 | #ifndef _MICREL_PHY_H | 13 | #ifndef _MICREL_PHY_H |
| 2 | #define _MICREL_PHY_H | 14 | #define _MICREL_PHY_H |
| 3 | 15 | ||
| @@ -5,10 +17,11 @@ | |||
| 5 | 17 | ||
| 6 | #define PHY_ID_KSZ9021 0x00221610 | 18 | #define PHY_ID_KSZ9021 0x00221610 |
| 7 | #define PHY_ID_KS8737 0x00221720 | 19 | #define PHY_ID_KS8737 0x00221720 |
| 8 | #define PHY_ID_KS8041 0x00221510 | 20 | #define PHY_ID_KSZ8021 0x00221555 |
| 9 | #define PHY_ID_KS8051 0x00221550 | 21 | #define PHY_ID_KSZ8041 0x00221510 |
| 22 | #define PHY_ID_KSZ8051 0x00221550 | ||
| 10 | /* both for ks8001 Rev. A/B, and for ks8721 Rev 3. */ | 23 | /* both for ks8001 Rev. A/B, and for ks8721 Rev 3. */ |
| 11 | #define PHY_ID_KS8001 0x0022161A | 24 | #define PHY_ID_KSZ8001 0x0022161A |
| 12 | 25 | ||
| 13 | /* struct phy_device dev_flags definitions */ | 26 | /* struct phy_device dev_flags definitions */ |
| 14 | #define MICREL_PHY_50MHZ_CLK 0x00000001 | 27 | #define MICREL_PHY_50MHZ_CLK 0x00000001 |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index bd6c9fcdf2dd..6e1b0f973a03 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -796,6 +796,19 @@ enum mlx4_net_trans_rule_id { | |||
| 796 | MLX4_NET_TRANS_RULE_NUM, /* should be last */ | 796 | MLX4_NET_TRANS_RULE_NUM, /* should be last */ |
| 797 | }; | 797 | }; |
| 798 | 798 | ||
| 799 | extern const u16 __sw_id_hw[]; | ||
| 800 | |||
| 801 | static inline int map_hw_to_sw_id(u16 header_id) | ||
| 802 | { | ||
| 803 | |||
| 804 | int i; | ||
| 805 | for (i = 0; i < MLX4_NET_TRANS_RULE_NUM; i++) { | ||
| 806 | if (header_id == __sw_id_hw[i]) | ||
| 807 | return i; | ||
| 808 | } | ||
| 809 | return -EINVAL; | ||
| 810 | } | ||
| 811 | |||
| 799 | enum mlx4_net_trans_promisc_mode { | 812 | enum mlx4_net_trans_promisc_mode { |
| 800 | MLX4_FS_PROMISC_NONE = 0, | 813 | MLX4_FS_PROMISC_NONE = 0, |
| 801 | MLX4_FS_PROMISC_UPLINK, | 814 | MLX4_FS_PROMISC_UPLINK, |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 111aca5e97f3..4b27f9f503e4 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -239,6 +239,7 @@ struct mmc_card { | |||
| 239 | #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ | 239 | #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ |
| 240 | #define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8) /* Avoid sending 512 bytes in */ | 240 | #define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8) /* Avoid sending 512 bytes in */ |
| 241 | #define MMC_QUIRK_LONG_READ_TIME (1<<9) /* Data read time > CSD says */ | 241 | #define MMC_QUIRK_LONG_READ_TIME (1<<9) /* Data read time > CSD says */ |
| 242 | #define MMC_QUIRK_SEC_ERASE_TRIM_BROKEN (1<<10) /* Skip secure for erase/trim */ | ||
| 242 | /* byte mode */ | 243 | /* byte mode */ |
| 243 | unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */ | 244 | unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */ |
| 244 | #define MMC_NO_POWER_NOTIFICATION 0 | 245 | #define MMC_NO_POWER_NOTIFICATION 0 |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 6955045199b0..fed3def62818 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -232,7 +232,7 @@ struct of_device_id | |||
| 232 | char type[32]; | 232 | char type[32]; |
| 233 | char compatible[128]; | 233 | char compatible[128]; |
| 234 | #ifdef __KERNEL__ | 234 | #ifdef __KERNEL__ |
| 235 | void *data; | 235 | const void *data; |
| 236 | #else | 236 | #else |
| 237 | kernel_ulong_t data; | 237 | kernel_ulong_t data; |
| 238 | #endif | 238 | #endif |
| @@ -600,4 +600,12 @@ struct x86_cpu_id { | |||
| 600 | #define X86_MODEL_ANY 0 | 600 | #define X86_MODEL_ANY 0 |
| 601 | #define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */ | 601 | #define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */ |
| 602 | 602 | ||
| 603 | #define IPACK_ANY_FORMAT 0xff | ||
| 604 | #define IPACK_ANY_ID (~0) | ||
| 605 | struct ipack_device_id { | ||
| 606 | __u8 format; /* Format version or IPACK_ANY_ID */ | ||
| 607 | __u32 vendor; /* Vendor ID or IPACK_ANY_ID */ | ||
| 608 | __u32 device; /* Device ID or IPACK_ANY_ID */ | ||
| 609 | }; | ||
| 610 | |||
| 603 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 611 | #endif /* LINUX_MOD_DEVICETABLE_H */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 59dc05f38247..5f49cc0a107e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -2720,9 +2720,6 @@ static inline const char *netdev_name(const struct net_device *dev) | |||
| 2720 | return dev->name; | 2720 | return dev->name; |
| 2721 | } | 2721 | } |
| 2722 | 2722 | ||
| 2723 | extern int __netdev_printk(const char *level, const struct net_device *dev, | ||
| 2724 | struct va_format *vaf); | ||
| 2725 | |||
| 2726 | extern __printf(3, 4) | 2723 | extern __printf(3, 4) |
| 2727 | int netdev_printk(const char *level, const struct net_device *dev, | 2724 | int netdev_printk(const char *level, const struct net_device *dev, |
| 2728 | const char *format, ...); | 2725 | const char *format, ...); |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 1f8fc7f9bcd8..4b03f56e280e 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -265,11 +265,6 @@ static inline const struct nfs_rpc_ops *NFS_PROTO(const struct inode *inode) | |||
| 265 | return NFS_SERVER(inode)->nfs_client->rpc_ops; | 265 | return NFS_SERVER(inode)->nfs_client->rpc_ops; |
| 266 | } | 266 | } |
| 267 | 267 | ||
| 268 | static inline __be32 *NFS_COOKIEVERF(const struct inode *inode) | ||
| 269 | { | ||
| 270 | return NFS_I(inode)->cookieverf; | ||
| 271 | } | ||
| 272 | |||
| 273 | static inline unsigned NFS_MINATTRTIMEO(const struct inode *inode) | 268 | static inline unsigned NFS_MINATTRTIMEO(const struct inode *inode) |
| 274 | { | 269 | { |
| 275 | struct nfs_server *nfss = NFS_SERVER(inode); | 270 | struct nfs_server *nfss = NFS_SERVER(inode); |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index ac7c8ae254f2..be9cf3c7e79e 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -652,7 +652,7 @@ struct nfs_getaclargs { | |||
| 652 | }; | 652 | }; |
| 653 | 653 | ||
| 654 | /* getxattr ACL interface flags */ | 654 | /* getxattr ACL interface flags */ |
| 655 | #define NFS4_ACL_LEN_REQUEST 0x0001 /* zero length getxattr buffer */ | 655 | #define NFS4_ACL_TRUNC 0x0001 /* ACL was truncated */ |
| 656 | struct nfs_getaclres { | 656 | struct nfs_getaclres { |
| 657 | size_t acl_len; | 657 | size_t acl_len; |
| 658 | size_t acl_data_offset; | 658 | size_t acl_data_offset; |
diff --git a/include/linux/nvme.h b/include/linux/nvme.h index 9490a00529f4..c25cccaa555a 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h | |||
| @@ -35,8 +35,10 @@ struct nvme_bar { | |||
| 35 | __u64 acq; /* Admin CQ Base Address */ | 35 | __u64 acq; /* Admin CQ Base Address */ |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | #define NVME_CAP_MQES(cap) ((cap) & 0xffff) | ||
| 38 | #define NVME_CAP_TIMEOUT(cap) (((cap) >> 24) & 0xff) | 39 | #define NVME_CAP_TIMEOUT(cap) (((cap) >> 24) & 0xff) |
| 39 | #define NVME_CAP_STRIDE(cap) (((cap) >> 32) & 0xf) | 40 | #define NVME_CAP_STRIDE(cap) (((cap) >> 32) & 0xf) |
| 41 | #define NVME_CAP_MPSMIN(cap) (((cap) >> 48) & 0xf) | ||
| 40 | 42 | ||
| 41 | enum { | 43 | enum { |
| 42 | NVME_CC_ENABLE = 1 << 0, | 44 | NVME_CC_ENABLE = 1 << 0, |
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h index 4ff57e81051d..85af8184691a 100644 --- a/include/linux/omapfb.h +++ b/include/linux/omapfb.h | |||
| @@ -220,7 +220,12 @@ struct omapfb_display_info { | |||
| 220 | 220 | ||
| 221 | #ifdef __KERNEL__ | 221 | #ifdef __KERNEL__ |
| 222 | 222 | ||
| 223 | #include <plat/board.h> | 223 | struct omap_lcd_config { |
| 224 | char panel_name[16]; | ||
| 225 | char ctrl_name[16]; | ||
| 226 | s16 nreset_gpio; | ||
| 227 | u8 data_lines; | ||
| 228 | }; | ||
| 224 | 229 | ||
| 225 | struct omapfb_platform_data { | 230 | struct omapfb_platform_data { |
| 226 | struct omap_lcd_config lcd; | 231 | struct omap_lcd_config lcd; |
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 248fba2af98a..9a22b5efb384 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
| @@ -22,19 +22,24 @@ extern phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle); | |||
| 22 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | 22 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) |
| 23 | { | 23 | { |
| 24 | struct pci_bus *pbus = pdev->bus; | 24 | struct pci_bus *pbus = pdev->bus; |
| 25 | |||
| 25 | /* Find a PCI root bus */ | 26 | /* Find a PCI root bus */ |
| 26 | while (!pci_is_root_bus(pbus)) | 27 | while (!pci_is_root_bus(pbus)) |
| 27 | pbus = pbus->parent; | 28 | pbus = pbus->parent; |
| 28 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), | 29 | |
| 29 | pbus->number); | 30 | return DEVICE_ACPI_HANDLE(pbus->bridge); |
| 30 | } | 31 | } |
| 31 | 32 | ||
| 32 | static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) | 33 | static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) |
| 33 | { | 34 | { |
| 34 | if (!pci_is_root_bus(pbus)) | 35 | struct device *dev; |
| 35 | return DEVICE_ACPI_HANDLE(&(pbus->self->dev)); | 36 | |
| 36 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), | 37 | if (pci_is_root_bus(pbus)) |
| 37 | pbus->number); | 38 | dev = pbus->bridge; |
| 39 | else | ||
| 40 | dev = &pbus->self->dev; | ||
| 41 | |||
| 42 | return DEVICE_ACPI_HANDLE(dev); | ||
| 38 | } | 43 | } |
| 39 | #endif | 44 | #endif |
| 40 | 45 | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index 5faa8310eec9..be1de01de1c4 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -254,10 +254,10 @@ struct pci_dev { | |||
| 254 | u8 revision; /* PCI revision, low byte of class word */ | 254 | u8 revision; /* PCI revision, low byte of class word */ |
| 255 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ | 255 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ |
| 256 | u8 pcie_cap; /* PCI-E capability offset */ | 256 | u8 pcie_cap; /* PCI-E capability offset */ |
| 257 | u8 pcie_type:4; /* PCI-E device/port type */ | ||
| 258 | u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */ | 257 | u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */ |
| 259 | u8 rom_base_reg; /* which config register controls the ROM */ | 258 | u8 rom_base_reg; /* which config register controls the ROM */ |
| 260 | u8 pin; /* which interrupt pin this device uses */ | 259 | u8 pin; /* which interrupt pin this device uses */ |
| 260 | u16 pcie_flags_reg; /* cached PCI-E Capabilities Register */ | ||
| 261 | 261 | ||
| 262 | struct pci_driver *driver; /* which driver has allocated this device */ | 262 | struct pci_driver *driver; /* which driver has allocated this device */ |
| 263 | u64 dma_mask; /* Mask of the bits of bus address this | 263 | u64 dma_mask; /* Mask of the bits of bus address this |
| @@ -369,7 +369,6 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev) | |||
| 369 | 369 | ||
| 370 | extern struct pci_dev *alloc_pci_dev(void); | 370 | extern struct pci_dev *alloc_pci_dev(void); |
| 371 | 371 | ||
| 372 | #define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list) | ||
| 373 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) | 372 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) |
| 374 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) | 373 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) |
| 375 | 374 | ||
| @@ -596,7 +595,7 @@ struct pci_driver { | |||
| 596 | int (*resume_early) (struct pci_dev *dev); | 595 | int (*resume_early) (struct pci_dev *dev); |
| 597 | int (*resume) (struct pci_dev *dev); /* Device woken up */ | 596 | int (*resume) (struct pci_dev *dev); /* Device woken up */ |
| 598 | void (*shutdown) (struct pci_dev *dev); | 597 | void (*shutdown) (struct pci_dev *dev); |
| 599 | struct pci_error_handlers *err_handler; | 598 | const struct pci_error_handlers *err_handler; |
| 600 | struct device_driver driver; | 599 | struct device_driver driver; |
| 601 | struct pci_dynids dynids; | 600 | struct pci_dynids dynids; |
| 602 | }; | 601 | }; |
| @@ -734,9 +733,7 @@ u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp); | |||
| 734 | extern struct pci_dev *pci_dev_get(struct pci_dev *dev); | 733 | extern struct pci_dev *pci_dev_get(struct pci_dev *dev); |
| 735 | extern void pci_dev_put(struct pci_dev *dev); | 734 | extern void pci_dev_put(struct pci_dev *dev); |
| 736 | extern void pci_remove_bus(struct pci_bus *b); | 735 | extern void pci_remove_bus(struct pci_bus *b); |
| 737 | extern void __pci_remove_bus_device(struct pci_dev *dev); | ||
| 738 | extern void pci_stop_and_remove_bus_device(struct pci_dev *dev); | 736 | extern void pci_stop_and_remove_bus_device(struct pci_dev *dev); |
| 739 | extern void pci_stop_bus_device(struct pci_dev *dev); | ||
| 740 | void pci_setup_cardbus(struct pci_bus *bus); | 737 | void pci_setup_cardbus(struct pci_bus *bus); |
| 741 | extern void pci_sort_breadthfirst(void); | 738 | extern void pci_sort_breadthfirst(void); |
| 742 | #define dev_is_pci(d) ((d)->bus == &pci_bus_type) | 739 | #define dev_is_pci(d) ((d)->bus == &pci_bus_type) |
| @@ -755,6 +752,7 @@ enum pci_lost_interrupt_reason pci_lost_interrupt(struct pci_dev *dev); | |||
| 755 | int pci_find_capability(struct pci_dev *dev, int cap); | 752 | int pci_find_capability(struct pci_dev *dev, int cap); |
| 756 | int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap); | 753 | int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap); |
| 757 | int pci_find_ext_capability(struct pci_dev *dev, int cap); | 754 | int pci_find_ext_capability(struct pci_dev *dev, int cap); |
| 755 | int pci_find_next_ext_capability(struct pci_dev *dev, int pos, int cap); | ||
| 758 | int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); | 756 | int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); |
| 759 | int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); | 757 | int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); |
| 760 | struct pci_bus *pci_find_next_bus(const struct pci_bus *from); | 758 | struct pci_bus *pci_find_next_bus(const struct pci_bus *from); |
| @@ -816,6 +814,39 @@ static inline int pci_write_config_dword(const struct pci_dev *dev, int where, | |||
| 816 | return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val); | 814 | return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val); |
| 817 | } | 815 | } |
| 818 | 816 | ||
| 817 | int pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val); | ||
| 818 | int pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *val); | ||
| 819 | int pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val); | ||
| 820 | int pcie_capability_write_dword(struct pci_dev *dev, int pos, u32 val); | ||
| 821 | int pcie_capability_clear_and_set_word(struct pci_dev *dev, int pos, | ||
| 822 | u16 clear, u16 set); | ||
| 823 | int pcie_capability_clear_and_set_dword(struct pci_dev *dev, int pos, | ||
| 824 | u32 clear, u32 set); | ||
| 825 | |||
| 826 | static inline int pcie_capability_set_word(struct pci_dev *dev, int pos, | ||
| 827 | u16 set) | ||
| 828 | { | ||
| 829 | return pcie_capability_clear_and_set_word(dev, pos, 0, set); | ||
| 830 | } | ||
| 831 | |||
| 832 | static inline int pcie_capability_set_dword(struct pci_dev *dev, int pos, | ||
| 833 | u32 set) | ||
| 834 | { | ||
| 835 | return pcie_capability_clear_and_set_dword(dev, pos, 0, set); | ||
| 836 | } | ||
| 837 | |||
| 838 | static inline int pcie_capability_clear_word(struct pci_dev *dev, int pos, | ||
| 839 | u16 clear) | ||
| 840 | { | ||
| 841 | return pcie_capability_clear_and_set_word(dev, pos, clear, 0); | ||
| 842 | } | ||
| 843 | |||
| 844 | static inline int pcie_capability_clear_dword(struct pci_dev *dev, int pos, | ||
| 845 | u32 clear) | ||
| 846 | { | ||
| 847 | return pcie_capability_clear_and_set_dword(dev, pos, clear, 0); | ||
| 848 | } | ||
| 849 | |||
| 819 | /* user-space driven config access */ | 850 | /* user-space driven config access */ |
| 820 | int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val); | 851 | int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val); |
| 821 | int pci_user_read_config_word(struct pci_dev *dev, int where, u16 *val); | 852 | int pci_user_read_config_word(struct pci_dev *dev, int where, u16 *val); |
| @@ -1013,7 +1044,6 @@ void pci_unregister_driver(struct pci_driver *dev); | |||
| 1013 | module_driver(__pci_driver, pci_register_driver, \ | 1044 | module_driver(__pci_driver, pci_register_driver, \ |
| 1014 | pci_unregister_driver) | 1045 | pci_unregister_driver) |
| 1015 | 1046 | ||
| 1016 | void pci_stop_and_remove_behind_bridge(struct pci_dev *dev); | ||
| 1017 | struct pci_driver *pci_dev_driver(const struct pci_dev *dev); | 1047 | struct pci_driver *pci_dev_driver(const struct pci_dev *dev); |
| 1018 | int pci_add_dynid(struct pci_driver *drv, | 1048 | int pci_add_dynid(struct pci_driver *drv, |
| 1019 | unsigned int vendor, unsigned int device, | 1049 | unsigned int vendor, unsigned int device, |
| @@ -1031,6 +1061,8 @@ int pci_cfg_space_size_ext(struct pci_dev *dev); | |||
| 1031 | int pci_cfg_space_size(struct pci_dev *dev); | 1061 | int pci_cfg_space_size(struct pci_dev *dev); |
| 1032 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); | 1062 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); |
| 1033 | void pci_setup_bridge(struct pci_bus *bus); | 1063 | void pci_setup_bridge(struct pci_bus *bus); |
| 1064 | resource_size_t pcibios_window_alignment(struct pci_bus *bus, | ||
| 1065 | unsigned long type); | ||
| 1034 | 1066 | ||
| 1035 | #define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0) | 1067 | #define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0) |
| 1036 | #define PCI_VGA_STATE_CHANGE_DECODES (1 << 1) | 1068 | #define PCI_VGA_STATE_CHANGE_DECODES (1 << 1) |
| @@ -1472,7 +1504,7 @@ enum pci_fixup_pass { | |||
| 1472 | /* Anonymous variables would be nice... */ | 1504 | /* Anonymous variables would be nice... */ |
| 1473 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ | 1505 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ |
| 1474 | class_shift, hook) \ | 1506 | class_shift, hook) \ |
| 1475 | static const struct pci_fixup const __pci_fixup_##name __used \ | 1507 | static const struct pci_fixup __pci_fixup_##name __used \ |
| 1476 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ | 1508 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ |
| 1477 | = { vendor, device, class, class_shift, hook }; | 1509 | = { vendor, device, class, class_shift, hook }; |
| 1478 | 1510 | ||
| @@ -1650,6 +1682,15 @@ static inline bool pci_is_pcie(struct pci_dev *dev) | |||
| 1650 | return !!pci_pcie_cap(dev); | 1682 | return !!pci_pcie_cap(dev); |
| 1651 | } | 1683 | } |
| 1652 | 1684 | ||
| 1685 | /** | ||
| 1686 | * pci_pcie_type - get the PCIe device/port type | ||
| 1687 | * @dev: PCI device | ||
| 1688 | */ | ||
| 1689 | static inline int pci_pcie_type(const struct pci_dev *dev) | ||
| 1690 | { | ||
| 1691 | return (dev->pcie_flags_reg & PCI_EXP_FLAGS_TYPE) >> 4; | ||
| 1692 | } | ||
| 1693 | |||
| 1653 | void pci_request_acs(void); | 1694 | void pci_request_acs(void); |
| 1654 | bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags); | 1695 | bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags); |
| 1655 | bool pci_acs_path_enabled(struct pci_dev *start, | 1696 | bool pci_acs_path_enabled(struct pci_dev *start, |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index fc3526077348..8d3c42719387 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -1847,7 +1847,6 @@ | |||
| 1847 | #define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081 | 1847 | #define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081 |
| 1848 | #define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082 | 1848 | #define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082 |
| 1849 | #define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 | 1849 | #define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 |
| 1850 | #define PCI_SUBDEVICE_ID_SIIG_DUAL_SERIAL 0x2530 | ||
| 1851 | 1850 | ||
| 1852 | #define PCI_VENDOR_ID_RADISYS 0x1331 | 1851 | #define PCI_VENDOR_ID_RADISYS 0x1331 |
| 1853 | 1852 | ||
| @@ -2149,7 +2148,7 @@ | |||
| 2149 | #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 | 2148 | #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 |
| 2150 | #define PCI_DEVICE_ID_NX2_57800_VF 0x16a9 | 2149 | #define PCI_DEVICE_ID_NX2_57800_VF 0x16a9 |
| 2151 | #define PCI_DEVICE_ID_NX2_5706S 0x16aa | 2150 | #define PCI_DEVICE_ID_NX2_5706S 0x16aa |
| 2152 | #define PCI_DEVICE_ID_NX2_57840_MF 0x16ab | 2151 | #define PCI_DEVICE_ID_NX2_57840_MF 0x16a4 |
| 2153 | #define PCI_DEVICE_ID_NX2_5708S 0x16ac | 2152 | #define PCI_DEVICE_ID_NX2_5708S 0x16ac |
| 2154 | #define PCI_DEVICE_ID_NX2_57840_VF 0x16ad | 2153 | #define PCI_DEVICE_ID_NX2_57840_VF 0x16ad |
| 2155 | #define PCI_DEVICE_ID_NX2_57810_MF 0x16ae | 2154 | #define PCI_DEVICE_ID_NX2_57810_MF 0x16ae |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 7fb75b143755..20ae747ddf34 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
| @@ -549,6 +549,7 @@ | |||
| 549 | #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x04 /* Current Link Speed 8.0GT/s */ | 549 | #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x04 /* Current Link Speed 8.0GT/s */ |
| 550 | #define PCI_EXP_LNKCAP2_CROSSLINK 0x100 /* Crosslink supported */ | 550 | #define PCI_EXP_LNKCAP2_CROSSLINK 0x100 /* Crosslink supported */ |
| 551 | #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ | 551 | #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ |
| 552 | #define PCI_EXP_LNKSTA2 50 /* Link Status 2 */ | ||
| 552 | #define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ | 553 | #define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ |
| 553 | 554 | ||
| 554 | /* Extended Capabilities (PCI-X 2.0 and Express) */ | 555 | /* Extended Capabilities (PCI-X 2.0 and Express) */ |
| @@ -677,6 +678,12 @@ | |||
| 677 | #define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ | 678 | #define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ |
| 678 | #define PCI_EXT_CAP_PWR_SIZEOF 16 | 679 | #define PCI_EXT_CAP_PWR_SIZEOF 16 |
| 679 | 680 | ||
| 681 | /* Vendor-Specific (VSEC, PCI_EXT_CAP_ID_VNDR) */ | ||
| 682 | #define PCI_VNDR_HEADER 4 /* Vendor-Specific Header */ | ||
| 683 | #define PCI_VNDR_HEADER_ID(x) ((x) & 0xffff) | ||
| 684 | #define PCI_VNDR_HEADER_REV(x) (((x) >> 16) & 0xf) | ||
| 685 | #define PCI_VNDR_HEADER_LEN(x) (((x) >> 20) & 0xfff) | ||
| 686 | |||
| 680 | /* | 687 | /* |
| 681 | * Hypertransport sub capability types | 688 | * Hypertransport sub capability types |
| 682 | * | 689 | * |
diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h index 6775532b92a9..e6f91b1406d8 100644 --- a/include/linux/pcieport_if.h +++ b/include/linux/pcieport_if.h | |||
| @@ -49,7 +49,7 @@ struct pcie_port_service_driver { | |||
| 49 | int (*resume) (struct pcie_device *dev); | 49 | int (*resume) (struct pcie_device *dev); |
| 50 | 50 | ||
| 51 | /* Service Error Recovery Handler */ | 51 | /* Service Error Recovery Handler */ |
| 52 | struct pci_error_handlers *err_handler; | 52 | const struct pci_error_handlers *err_handler; |
| 53 | 53 | ||
| 54 | /* Link Reset Capability - AER service driver specific */ | 54 | /* Link Reset Capability - AER service driver specific */ |
| 55 | pci_ers_result_t (*reset_link) (struct pci_dev *dev); | 55 | pci_ers_result_t (*reset_link) (struct pci_dev *dev); |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 7602ccb3f40e..599afc4bb67e 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -130,8 +130,10 @@ enum perf_event_sample_format { | |||
| 130 | PERF_SAMPLE_STREAM_ID = 1U << 9, | 130 | PERF_SAMPLE_STREAM_ID = 1U << 9, |
| 131 | PERF_SAMPLE_RAW = 1U << 10, | 131 | PERF_SAMPLE_RAW = 1U << 10, |
| 132 | PERF_SAMPLE_BRANCH_STACK = 1U << 11, | 132 | PERF_SAMPLE_BRANCH_STACK = 1U << 11, |
| 133 | PERF_SAMPLE_REGS_USER = 1U << 12, | ||
| 134 | PERF_SAMPLE_STACK_USER = 1U << 13, | ||
| 133 | 135 | ||
| 134 | PERF_SAMPLE_MAX = 1U << 12, /* non-ABI */ | 136 | PERF_SAMPLE_MAX = 1U << 14, /* non-ABI */ |
| 135 | }; | 137 | }; |
| 136 | 138 | ||
| 137 | /* | 139 | /* |
| @@ -163,6 +165,15 @@ enum perf_branch_sample_type { | |||
| 163 | PERF_SAMPLE_BRANCH_HV) | 165 | PERF_SAMPLE_BRANCH_HV) |
| 164 | 166 | ||
| 165 | /* | 167 | /* |
| 168 | * Values to determine ABI of the registers dump. | ||
| 169 | */ | ||
| 170 | enum perf_sample_regs_abi { | ||
| 171 | PERF_SAMPLE_REGS_ABI_NONE = 0, | ||
| 172 | PERF_SAMPLE_REGS_ABI_32 = 1, | ||
| 173 | PERF_SAMPLE_REGS_ABI_64 = 2, | ||
| 174 | }; | ||
| 175 | |||
| 176 | /* | ||
| 166 | * The format of the data returned by read() on a perf event fd, | 177 | * The format of the data returned by read() on a perf event fd, |
| 167 | * as specified by attr.read_format: | 178 | * as specified by attr.read_format: |
| 168 | * | 179 | * |
| @@ -194,6 +205,8 @@ enum perf_event_read_format { | |||
| 194 | #define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */ | 205 | #define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */ |
| 195 | #define PERF_ATTR_SIZE_VER1 72 /* add: config2 */ | 206 | #define PERF_ATTR_SIZE_VER1 72 /* add: config2 */ |
| 196 | #define PERF_ATTR_SIZE_VER2 80 /* add: branch_sample_type */ | 207 | #define PERF_ATTR_SIZE_VER2 80 /* add: branch_sample_type */ |
| 208 | #define PERF_ATTR_SIZE_VER3 96 /* add: sample_regs_user */ | ||
| 209 | /* add: sample_stack_user */ | ||
| 197 | 210 | ||
| 198 | /* | 211 | /* |
| 199 | * Hardware event_id to monitor via a performance monitoring event: | 212 | * Hardware event_id to monitor via a performance monitoring event: |
| @@ -255,7 +268,10 @@ struct perf_event_attr { | |||
| 255 | exclude_host : 1, /* don't count in host */ | 268 | exclude_host : 1, /* don't count in host */ |
| 256 | exclude_guest : 1, /* don't count in guest */ | 269 | exclude_guest : 1, /* don't count in guest */ |
| 257 | 270 | ||
| 258 | __reserved_1 : 43; | 271 | exclude_callchain_kernel : 1, /* exclude kernel callchains */ |
| 272 | exclude_callchain_user : 1, /* exclude user callchains */ | ||
| 273 | |||
| 274 | __reserved_1 : 41; | ||
| 259 | 275 | ||
| 260 | union { | 276 | union { |
| 261 | __u32 wakeup_events; /* wakeup every n events */ | 277 | __u32 wakeup_events; /* wakeup every n events */ |
| @@ -271,9 +287,25 @@ struct perf_event_attr { | |||
| 271 | __u64 bp_len; | 287 | __u64 bp_len; |
| 272 | __u64 config2; /* extension of config1 */ | 288 | __u64 config2; /* extension of config1 */ |
| 273 | }; | 289 | }; |
| 274 | __u64 branch_sample_type; /* enum branch_sample_type */ | 290 | __u64 branch_sample_type; /* enum perf_branch_sample_type */ |
| 291 | |||
| 292 | /* | ||
| 293 | * Defines set of user regs to dump on samples. | ||
| 294 | * See asm/perf_regs.h for details. | ||
| 295 | */ | ||
| 296 | __u64 sample_regs_user; | ||
| 297 | |||
| 298 | /* | ||
| 299 | * Defines size of the user stack to dump on samples. | ||
| 300 | */ | ||
| 301 | __u32 sample_stack_user; | ||
| 302 | |||
| 303 | /* Align to u64. */ | ||
| 304 | __u32 __reserved_2; | ||
| 275 | }; | 305 | }; |
| 276 | 306 | ||
| 307 | #define perf_flags(attr) (*(&(attr)->read_format + 1)) | ||
| 308 | |||
| 277 | /* | 309 | /* |
| 278 | * Ioctls that can be done on a perf event fd: | 310 | * Ioctls that can be done on a perf event fd: |
| 279 | */ | 311 | */ |
| @@ -548,6 +580,13 @@ enum perf_event_type { | |||
| 548 | * char data[size];}&& PERF_SAMPLE_RAW | 580 | * char data[size];}&& PERF_SAMPLE_RAW |
| 549 | * | 581 | * |
| 550 | * { u64 from, to, flags } lbr[nr];} && PERF_SAMPLE_BRANCH_STACK | 582 | * { u64 from, to, flags } lbr[nr];} && PERF_SAMPLE_BRANCH_STACK |
| 583 | * | ||
| 584 | * { u64 abi; # enum perf_sample_regs_abi | ||
| 585 | * u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_USER | ||
| 586 | * | ||
| 587 | * { u64 size; | ||
| 588 | * char data[size]; | ||
| 589 | * u64 dyn_size; } && PERF_SAMPLE_STACK_USER | ||
| 551 | * }; | 590 | * }; |
| 552 | */ | 591 | */ |
| 553 | PERF_RECORD_SAMPLE = 9, | 592 | PERF_RECORD_SAMPLE = 9, |
| @@ -609,6 +648,7 @@ struct perf_guest_info_callbacks { | |||
| 609 | #include <linux/static_key.h> | 648 | #include <linux/static_key.h> |
| 610 | #include <linux/atomic.h> | 649 | #include <linux/atomic.h> |
| 611 | #include <linux/sysfs.h> | 650 | #include <linux/sysfs.h> |
| 651 | #include <linux/perf_regs.h> | ||
| 612 | #include <asm/local.h> | 652 | #include <asm/local.h> |
| 613 | 653 | ||
| 614 | struct perf_callchain_entry { | 654 | struct perf_callchain_entry { |
| @@ -654,6 +694,11 @@ struct perf_branch_stack { | |||
| 654 | struct perf_branch_entry entries[0]; | 694 | struct perf_branch_entry entries[0]; |
| 655 | }; | 695 | }; |
| 656 | 696 | ||
| 697 | struct perf_regs_user { | ||
| 698 | __u64 abi; | ||
| 699 | struct pt_regs *regs; | ||
| 700 | }; | ||
| 701 | |||
| 657 | struct task_struct; | 702 | struct task_struct; |
| 658 | 703 | ||
| 659 | /* | 704 | /* |
| @@ -926,7 +971,7 @@ struct perf_event { | |||
| 926 | struct hw_perf_event hw; | 971 | struct hw_perf_event hw; |
| 927 | 972 | ||
| 928 | struct perf_event_context *ctx; | 973 | struct perf_event_context *ctx; |
| 929 | struct file *filp; | 974 | atomic_long_t refcount; |
| 930 | 975 | ||
| 931 | /* | 976 | /* |
| 932 | * These accumulate total time (in nanoseconds) that children | 977 | * These accumulate total time (in nanoseconds) that children |
| @@ -1133,6 +1178,8 @@ struct perf_sample_data { | |||
| 1133 | struct perf_callchain_entry *callchain; | 1178 | struct perf_callchain_entry *callchain; |
| 1134 | struct perf_raw_record *raw; | 1179 | struct perf_raw_record *raw; |
| 1135 | struct perf_branch_stack *br_stack; | 1180 | struct perf_branch_stack *br_stack; |
| 1181 | struct perf_regs_user regs_user; | ||
| 1182 | u64 stack_user_size; | ||
| 1136 | }; | 1183 | }; |
| 1137 | 1184 | ||
| 1138 | static inline void perf_sample_data_init(struct perf_sample_data *data, | 1185 | static inline void perf_sample_data_init(struct perf_sample_data *data, |
| @@ -1142,7 +1189,10 @@ static inline void perf_sample_data_init(struct perf_sample_data *data, | |||
| 1142 | data->addr = addr; | 1189 | data->addr = addr; |
| 1143 | data->raw = NULL; | 1190 | data->raw = NULL; |
| 1144 | data->br_stack = NULL; | 1191 | data->br_stack = NULL; |
| 1145 | data->period = period; | 1192 | data->period = period; |
| 1193 | data->regs_user.abi = PERF_SAMPLE_REGS_ABI_NONE; | ||
| 1194 | data->regs_user.regs = NULL; | ||
| 1195 | data->stack_user_size = 0; | ||
| 1146 | } | 1196 | } |
| 1147 | 1197 | ||
| 1148 | extern void perf_output_sample(struct perf_output_handle *handle, | 1198 | extern void perf_output_sample(struct perf_output_handle *handle, |
| @@ -1290,12 +1340,15 @@ static inline bool has_branch_stack(struct perf_event *event) | |||
| 1290 | extern int perf_output_begin(struct perf_output_handle *handle, | 1340 | extern int perf_output_begin(struct perf_output_handle *handle, |
| 1291 | struct perf_event *event, unsigned int size); | 1341 | struct perf_event *event, unsigned int size); |
| 1292 | extern void perf_output_end(struct perf_output_handle *handle); | 1342 | extern void perf_output_end(struct perf_output_handle *handle); |
| 1293 | extern void perf_output_copy(struct perf_output_handle *handle, | 1343 | extern unsigned int perf_output_copy(struct perf_output_handle *handle, |
| 1294 | const void *buf, unsigned int len); | 1344 | const void *buf, unsigned int len); |
| 1345 | extern unsigned int perf_output_skip(struct perf_output_handle *handle, | ||
| 1346 | unsigned int len); | ||
| 1295 | extern int perf_swevent_get_recursion_context(void); | 1347 | extern int perf_swevent_get_recursion_context(void); |
| 1296 | extern void perf_swevent_put_recursion_context(int rctx); | 1348 | extern void perf_swevent_put_recursion_context(int rctx); |
| 1297 | extern void perf_event_enable(struct perf_event *event); | 1349 | extern void perf_event_enable(struct perf_event *event); |
| 1298 | extern void perf_event_disable(struct perf_event *event); | 1350 | extern void perf_event_disable(struct perf_event *event); |
| 1351 | extern int __perf_event_disable(void *info); | ||
| 1299 | extern void perf_event_task_tick(void); | 1352 | extern void perf_event_task_tick(void); |
| 1300 | #else | 1353 | #else |
| 1301 | static inline void | 1354 | static inline void |
| @@ -1334,6 +1387,7 @@ static inline int perf_swevent_get_recursion_context(void) { return -1; } | |||
| 1334 | static inline void perf_swevent_put_recursion_context(int rctx) { } | 1387 | static inline void perf_swevent_put_recursion_context(int rctx) { } |
| 1335 | static inline void perf_event_enable(struct perf_event *event) { } | 1388 | static inline void perf_event_enable(struct perf_event *event) { } |
| 1336 | static inline void perf_event_disable(struct perf_event *event) { } | 1389 | static inline void perf_event_disable(struct perf_event *event) { } |
| 1390 | static inline int __perf_event_disable(void *info) { return -1; } | ||
| 1337 | static inline void perf_event_task_tick(void) { } | 1391 | static inline void perf_event_task_tick(void) { } |
| 1338 | #endif | 1392 | #endif |
| 1339 | 1393 | ||
diff --git a/include/linux/perf_regs.h b/include/linux/perf_regs.h new file mode 100644 index 000000000000..3c73d5fe18be --- /dev/null +++ b/include/linux/perf_regs.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | #ifndef _LINUX_PERF_REGS_H | ||
| 2 | #define _LINUX_PERF_REGS_H | ||
| 3 | |||
| 4 | #ifdef CONFIG_HAVE_PERF_REGS | ||
| 5 | #include <asm/perf_regs.h> | ||
| 6 | u64 perf_reg_value(struct pt_regs *regs, int idx); | ||
| 7 | int perf_reg_validate(u64 mask); | ||
| 8 | u64 perf_reg_abi(struct task_struct *task); | ||
| 9 | #else | ||
| 10 | static inline u64 perf_reg_value(struct pt_regs *regs, int idx) | ||
| 11 | { | ||
| 12 | return 0; | ||
| 13 | } | ||
| 14 | |||
| 15 | static inline int perf_reg_validate(u64 mask) | ||
| 16 | { | ||
| 17 | return mask ? -ENOSYS : 0; | ||
| 18 | } | ||
| 19 | |||
| 20 | static inline u64 perf_reg_abi(struct task_struct *task) | ||
| 21 | { | ||
| 22 | return PERF_SAMPLE_REGS_ABI_NONE; | ||
| 23 | } | ||
| 24 | #endif /* CONFIG_HAVE_PERF_REGS */ | ||
| 25 | #endif /* _LINUX_PERF_REGS_H */ | ||
diff --git a/include/linux/platform_data/ad5755.h b/include/linux/platform_data/ad5755.h new file mode 100644 index 000000000000..a5a1cb751874 --- /dev/null +++ b/include/linux/platform_data/ad5755.h | |||
| @@ -0,0 +1,103 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2012 Analog Devices Inc. | ||
| 3 | * | ||
| 4 | * Licensed under the GPL-2. | ||
| 5 | */ | ||
| 6 | #ifndef __LINUX_PLATFORM_DATA_AD5755_H__ | ||
| 7 | #define __LINUX_PLATFORM_DATA_AD5755_H__ | ||
| 8 | |||
| 9 | enum ad5755_mode { | ||
| 10 | AD5755_MODE_VOLTAGE_0V_5V = 0, | ||
| 11 | AD5755_MODE_VOLTAGE_0V_10V = 1, | ||
| 12 | AD5755_MODE_VOLTAGE_PLUSMINUS_5V = 2, | ||
| 13 | AD5755_MODE_VOLTAGE_PLUSMINUS_10V = 3, | ||
| 14 | AD5755_MODE_CURRENT_4mA_20mA = 4, | ||
| 15 | AD5755_MODE_CURRENT_0mA_20mA = 5, | ||
| 16 | AD5755_MODE_CURRENT_0mA_24mA = 6, | ||
| 17 | }; | ||
| 18 | |||
| 19 | enum ad5755_dc_dc_phase { | ||
| 20 | AD5755_DC_DC_PHASE_ALL_SAME_EDGE = 0, | ||
| 21 | AD5755_DC_DC_PHASE_A_B_SAME_EDGE_C_D_OPP_EDGE = 1, | ||
| 22 | AD5755_DC_DC_PHASE_A_C_SAME_EDGE_B_D_OPP_EDGE = 2, | ||
| 23 | AD5755_DC_DC_PHASE_90_DEGREE = 3, | ||
| 24 | }; | ||
| 25 | |||
| 26 | enum ad5755_dc_dc_freq { | ||
| 27 | AD5755_DC_DC_FREQ_250kHZ = 0, | ||
| 28 | AD5755_DC_DC_FREQ_410kHZ = 1, | ||
| 29 | AD5755_DC_DC_FREQ_650kHZ = 2, | ||
| 30 | }; | ||
| 31 | |||
| 32 | enum ad5755_dc_dc_maxv { | ||
| 33 | AD5755_DC_DC_MAXV_23V = 0, | ||
| 34 | AD5755_DC_DC_MAXV_24V5 = 1, | ||
| 35 | AD5755_DC_DC_MAXV_27V = 2, | ||
| 36 | AD5755_DC_DC_MAXV_29V5 = 3, | ||
| 37 | }; | ||
| 38 | |||
| 39 | enum ad5755_slew_rate { | ||
| 40 | AD5755_SLEW_RATE_64k = 0, | ||
| 41 | AD5755_SLEW_RATE_32k = 1, | ||
| 42 | AD5755_SLEW_RATE_16k = 2, | ||
| 43 | AD5755_SLEW_RATE_8k = 3, | ||
| 44 | AD5755_SLEW_RATE_4k = 4, | ||
| 45 | AD5755_SLEW_RATE_2k = 5, | ||
| 46 | AD5755_SLEW_RATE_1k = 6, | ||
| 47 | AD5755_SLEW_RATE_500 = 7, | ||
| 48 | AD5755_SLEW_RATE_250 = 8, | ||
| 49 | AD5755_SLEW_RATE_125 = 9, | ||
| 50 | AD5755_SLEW_RATE_64 = 10, | ||
| 51 | AD5755_SLEW_RATE_32 = 11, | ||
| 52 | AD5755_SLEW_RATE_16 = 12, | ||
| 53 | AD5755_SLEW_RATE_8 = 13, | ||
| 54 | AD5755_SLEW_RATE_4 = 14, | ||
| 55 | AD5755_SLEW_RATE_0_5 = 15, | ||
| 56 | }; | ||
| 57 | |||
| 58 | enum ad5755_slew_step_size { | ||
| 59 | AD5755_SLEW_STEP_SIZE_1 = 0, | ||
| 60 | AD5755_SLEW_STEP_SIZE_2 = 1, | ||
| 61 | AD5755_SLEW_STEP_SIZE_4 = 2, | ||
| 62 | AD5755_SLEW_STEP_SIZE_8 = 3, | ||
| 63 | AD5755_SLEW_STEP_SIZE_16 = 4, | ||
| 64 | AD5755_SLEW_STEP_SIZE_32 = 5, | ||
| 65 | AD5755_SLEW_STEP_SIZE_64 = 6, | ||
| 66 | AD5755_SLEW_STEP_SIZE_128 = 7, | ||
| 67 | AD5755_SLEW_STEP_SIZE_256 = 8, | ||
| 68 | }; | ||
| 69 | |||
| 70 | /** | ||
| 71 | * struct ad5755_platform_data - AD5755 DAC driver platform data | ||
| 72 | * @ext_dc_dc_compenstation_resistor: Whether an external DC-DC converter | ||
| 73 | * compensation register is used. | ||
| 74 | * @dc_dc_phase: DC-DC converter phase. | ||
| 75 | * @dc_dc_freq: DC-DC converter frequency. | ||
| 76 | * @dc_dc_maxv: DC-DC maximum allowed boost voltage. | ||
| 77 | * @dac.mode: The mode to be used for the DAC output. | ||
| 78 | * @dac.ext_current_sense_resistor: Whether an external current sense resistor | ||
| 79 | * is used. | ||
| 80 | * @dac.enable_voltage_overrange: Whether to enable 20% voltage output overrange. | ||
| 81 | * @dac.slew.enable: Whether to enable digital slew. | ||
| 82 | * @dac.slew.rate: Slew rate of the digital slew. | ||
| 83 | * @dac.slew.step_size: Slew step size of the digital slew. | ||
| 84 | **/ | ||
| 85 | struct ad5755_platform_data { | ||
| 86 | bool ext_dc_dc_compenstation_resistor; | ||
| 87 | enum ad5755_dc_dc_phase dc_dc_phase; | ||
| 88 | enum ad5755_dc_dc_freq dc_dc_freq; | ||
| 89 | enum ad5755_dc_dc_maxv dc_dc_maxv; | ||
| 90 | |||
| 91 | struct { | ||
| 92 | enum ad5755_mode mode; | ||
| 93 | bool ext_current_sense_resistor; | ||
| 94 | bool enable_voltage_overrange; | ||
| 95 | struct { | ||
| 96 | bool enable; | ||
| 97 | enum ad5755_slew_rate rate; | ||
| 98 | enum ad5755_slew_step_size step_size; | ||
| 99 | } slew; | ||
| 100 | } dac[4]; | ||
| 101 | }; | ||
| 102 | |||
| 103 | #endif | ||
diff --git a/include/linux/platform_data/ad7791.h b/include/linux/platform_data/ad7791.h new file mode 100644 index 000000000000..f9e4db1b82ae --- /dev/null +++ b/include/linux/platform_data/ad7791.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | #ifndef __LINUX_PLATFORM_DATA_AD7791__ | ||
| 2 | #define __LINUX_PLATFORM_DATA_AD7791__ | ||
| 3 | |||
| 4 | /** | ||
| 5 | * struct ad7791_platform_data - AD7791 device platform data | ||
| 6 | * @buffered: If set to true configure the device for buffered input mode. | ||
| 7 | * @burnout_current: If set to true the 100mA burnout current is enabled. | ||
| 8 | * @unipolar: If set to true sample in unipolar mode, if set to false sample in | ||
| 9 | * bipolar mode. | ||
| 10 | */ | ||
| 11 | struct ad7791_platform_data { | ||
| 12 | bool buffered; | ||
| 13 | bool burnout_current; | ||
| 14 | bool unipolar; | ||
| 15 | }; | ||
| 16 | |||
| 17 | #endif | ||
diff --git a/include/linux/platform_data/asoc-ti-mcbsp.h b/include/linux/platform_data/asoc-ti-mcbsp.h new file mode 100644 index 000000000000..18814127809a --- /dev/null +++ b/include/linux/platform_data/asoc-ti-mcbsp.h | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/plat-omap/include/mach/mcbsp.h | ||
| 3 | * | ||
| 4 | * Defines for Multi-Channel Buffered Serial Port | ||
| 5 | * | ||
| 6 | * Copyright (C) 2002 RidgeRun, Inc. | ||
| 7 | * Author: Steve Johnson | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | * GNU General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 22 | * | ||
| 23 | */ | ||
| 24 | #ifndef __ASM_ARCH_OMAP_MCBSP_H | ||
| 25 | #define __ASM_ARCH_OMAP_MCBSP_H | ||
| 26 | |||
| 27 | #include <linux/spinlock.h> | ||
| 28 | #include <linux/clk.h> | ||
| 29 | |||
| 30 | #define MCBSP_CONFIG_TYPE2 0x2 | ||
| 31 | #define MCBSP_CONFIG_TYPE3 0x3 | ||
| 32 | #define MCBSP_CONFIG_TYPE4 0x4 | ||
| 33 | |||
| 34 | /* Platform specific configuration */ | ||
| 35 | struct omap_mcbsp_ops { | ||
| 36 | void (*request)(unsigned int); | ||
| 37 | void (*free)(unsigned int); | ||
| 38 | }; | ||
| 39 | |||
| 40 | struct omap_mcbsp_platform_data { | ||
| 41 | struct omap_mcbsp_ops *ops; | ||
| 42 | u16 buffer_size; | ||
| 43 | u8 reg_size; | ||
| 44 | u8 reg_step; | ||
| 45 | |||
| 46 | /* McBSP platform and instance specific features */ | ||
| 47 | bool has_wakeup; /* Wakeup capability */ | ||
| 48 | bool has_ccr; /* Transceiver has configuration control registers */ | ||
| 49 | int (*enable_st_clock)(unsigned int, bool); | ||
| 50 | int (*set_clk_src)(struct device *dev, struct clk *clk, const char *src); | ||
| 51 | int (*mux_signal)(struct device *dev, const char *signal, const char *src); | ||
| 52 | }; | ||
| 53 | |||
| 54 | /** | ||
| 55 | * omap_mcbsp_dev_attr - OMAP McBSP device attributes for omap_hwmod | ||
| 56 | * @sidetone: name of the sidetone device | ||
| 57 | */ | ||
| 58 | struct omap_mcbsp_dev_attr { | ||
| 59 | const char *sidetone; | ||
| 60 | }; | ||
| 61 | |||
| 62 | #endif | ||
diff --git a/include/linux/platform_data/clk-realview.h b/include/linux/platform_data/clk-realview.h new file mode 100644 index 000000000000..2e426a7dbc51 --- /dev/null +++ b/include/linux/platform_data/clk-realview.h | |||
| @@ -0,0 +1 @@ | |||
| void realview_clk_init(void __iomem *sysbase, bool is_pb1176); | |||
diff --git a/include/linux/platform_data/clk-ux500.h b/include/linux/platform_data/clk-ux500.h new file mode 100644 index 000000000000..3af0da1f3be5 --- /dev/null +++ b/include/linux/platform_data/clk-ux500.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | /* | ||
| 2 | * Clock definitions for ux500 platforms | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 ST-Ericsson SA | ||
| 5 | * Author: Ulf Hansson <ulf.hansson@linaro.org> | ||
| 6 | * | ||
| 7 | * License terms: GNU General Public License (GPL) version 2 | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef __CLK_UX500_H | ||
| 11 | #define __CLK_UX500_H | ||
| 12 | |||
| 13 | void u8500_clk_init(void); | ||
| 14 | void u9540_clk_init(void); | ||
| 15 | void u8540_clk_init(void); | ||
| 16 | |||
| 17 | #endif /* __CLK_UX500_H */ | ||
diff --git a/include/linux/platform_data/dsp-omap.h b/include/linux/platform_data/dsp-omap.h new file mode 100644 index 000000000000..5927709b1908 --- /dev/null +++ b/include/linux/platform_data/dsp-omap.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | #ifndef __OMAP_DSP_H__ | ||
| 2 | #define __OMAP_DSP_H__ | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | struct omap_dsp_platform_data { | ||
| 7 | void (*dsp_set_min_opp) (u8 opp_id); | ||
| 8 | u8 (*dsp_get_opp) (void); | ||
| 9 | void (*cpu_set_freq) (unsigned long f); | ||
| 10 | unsigned long (*cpu_get_freq) (void); | ||
| 11 | unsigned long mpu_speed[6]; | ||
| 12 | |||
| 13 | /* functions to write and read PRCM registers */ | ||
| 14 | void (*dsp_prm_write)(u32, s16 , u16); | ||
| 15 | u32 (*dsp_prm_read)(s16 , u16); | ||
| 16 | u32 (*dsp_prm_rmw_bits)(u32, u32, s16, s16); | ||
| 17 | void (*dsp_cm_write)(u32, s16 , u16); | ||
| 18 | u32 (*dsp_cm_read)(s16 , u16); | ||
| 19 | u32 (*dsp_cm_rmw_bits)(u32, u32, s16, s16); | ||
| 20 | |||
| 21 | void (*set_bootaddr)(u32); | ||
| 22 | void (*set_bootmode)(u8); | ||
| 23 | |||
| 24 | phys_addr_t phys_mempool_base; | ||
| 25 | phys_addr_t phys_mempool_size; | ||
| 26 | }; | ||
| 27 | |||
| 28 | #if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE) | ||
| 29 | extern void omap_dsp_reserve_sdram_memblock(void); | ||
| 30 | #else | ||
| 31 | static inline void omap_dsp_reserve_sdram_memblock(void) { } | ||
| 32 | #endif | ||
| 33 | |||
| 34 | #endif | ||
diff --git a/include/linux/platform_data/gpio-omap.h b/include/linux/platform_data/gpio-omap.h new file mode 100644 index 000000000000..e8741c2678d5 --- /dev/null +++ b/include/linux/platform_data/gpio-omap.h | |||
| @@ -0,0 +1,217 @@ | |||
| 1 | /* | ||
| 2 | * OMAP GPIO handling defines and functions | ||
| 3 | * | ||
| 4 | * Copyright (C) 2003-2005 Nokia Corporation | ||
| 5 | * | ||
| 6 | * Written by Juha Yrjölä <juha.yrjola@nokia.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 21 | * | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef __ASM_ARCH_OMAP_GPIO_H | ||
| 25 | #define __ASM_ARCH_OMAP_GPIO_H | ||
| 26 | |||
| 27 | #include <linux/io.h> | ||
| 28 | #include <linux/platform_device.h> | ||
| 29 | #include <mach/irqs.h> | ||
| 30 | |||
| 31 | #define OMAP1_MPUIO_BASE 0xfffb5000 | ||
| 32 | |||
| 33 | /* | ||
| 34 | * These are the omap15xx/16xx offsets. The omap7xx offset are | ||
| 35 | * OMAP_MPUIO_ / 2 offsets below. | ||
| 36 | */ | ||
| 37 | #define OMAP_MPUIO_INPUT_LATCH 0x00 | ||
| 38 | #define OMAP_MPUIO_OUTPUT 0x04 | ||
| 39 | #define OMAP_MPUIO_IO_CNTL 0x08 | ||
| 40 | #define OMAP_MPUIO_KBR_LATCH 0x10 | ||
| 41 | #define OMAP_MPUIO_KBC 0x14 | ||
| 42 | #define OMAP_MPUIO_GPIO_EVENT_MODE 0x18 | ||
| 43 | #define OMAP_MPUIO_GPIO_INT_EDGE 0x1c | ||
| 44 | #define OMAP_MPUIO_KBD_INT 0x20 | ||
| 45 | #define OMAP_MPUIO_GPIO_INT 0x24 | ||
| 46 | #define OMAP_MPUIO_KBD_MASKIT 0x28 | ||
| 47 | #define OMAP_MPUIO_GPIO_MASKIT 0x2c | ||
| 48 | #define OMAP_MPUIO_GPIO_DEBOUNCING 0x30 | ||
| 49 | #define OMAP_MPUIO_LATCH 0x34 | ||
| 50 | |||
| 51 | #define OMAP34XX_NR_GPIOS 6 | ||
| 52 | |||
| 53 | /* | ||
| 54 | * OMAP1510 GPIO registers | ||
| 55 | */ | ||
| 56 | #define OMAP1510_GPIO_DATA_INPUT 0x00 | ||
| 57 | #define OMAP1510_GPIO_DATA_OUTPUT 0x04 | ||
| 58 | #define OMAP1510_GPIO_DIR_CONTROL 0x08 | ||
| 59 | #define OMAP1510_GPIO_INT_CONTROL 0x0c | ||
| 60 | #define OMAP1510_GPIO_INT_MASK 0x10 | ||
| 61 | #define OMAP1510_GPIO_INT_STATUS 0x14 | ||
| 62 | #define OMAP1510_GPIO_PIN_CONTROL 0x18 | ||
| 63 | |||
| 64 | #define OMAP1510_IH_GPIO_BASE 64 | ||
| 65 | |||
| 66 | /* | ||
| 67 | * OMAP1610 specific GPIO registers | ||
| 68 | */ | ||
| 69 | #define OMAP1610_GPIO_REVISION 0x0000 | ||
| 70 | #define OMAP1610_GPIO_SYSCONFIG 0x0010 | ||
| 71 | #define OMAP1610_GPIO_SYSSTATUS 0x0014 | ||
| 72 | #define OMAP1610_GPIO_IRQSTATUS1 0x0018 | ||
| 73 | #define OMAP1610_GPIO_IRQENABLE1 0x001c | ||
| 74 | #define OMAP1610_GPIO_WAKEUPENABLE 0x0028 | ||
| 75 | #define OMAP1610_GPIO_DATAIN 0x002c | ||
| 76 | #define OMAP1610_GPIO_DATAOUT 0x0030 | ||
| 77 | #define OMAP1610_GPIO_DIRECTION 0x0034 | ||
| 78 | #define OMAP1610_GPIO_EDGE_CTRL1 0x0038 | ||
| 79 | #define OMAP1610_GPIO_EDGE_CTRL2 0x003c | ||
| 80 | #define OMAP1610_GPIO_CLEAR_IRQENABLE1 0x009c | ||
| 81 | #define OMAP1610_GPIO_CLEAR_WAKEUPENA 0x00a8 | ||
| 82 | #define OMAP1610_GPIO_CLEAR_DATAOUT 0x00b0 | ||
| 83 | #define OMAP1610_GPIO_SET_IRQENABLE1 0x00dc | ||
| 84 | #define OMAP1610_GPIO_SET_WAKEUPENA 0x00e8 | ||
| 85 | #define OMAP1610_GPIO_SET_DATAOUT 0x00f0 | ||
| 86 | |||
| 87 | /* | ||
| 88 | * OMAP7XX specific GPIO registers | ||
| 89 | */ | ||
| 90 | #define OMAP7XX_GPIO_DATA_INPUT 0x00 | ||
| 91 | #define OMAP7XX_GPIO_DATA_OUTPUT 0x04 | ||
| 92 | #define OMAP7XX_GPIO_DIR_CONTROL 0x08 | ||
| 93 | #define OMAP7XX_GPIO_INT_CONTROL 0x0c | ||
| 94 | #define OMAP7XX_GPIO_INT_MASK 0x10 | ||
| 95 | #define OMAP7XX_GPIO_INT_STATUS 0x14 | ||
| 96 | |||
| 97 | /* | ||
| 98 | * omap2+ specific GPIO registers | ||
| 99 | */ | ||
| 100 | #define OMAP24XX_GPIO_REVISION 0x0000 | ||
| 101 | #define OMAP24XX_GPIO_IRQSTATUS1 0x0018 | ||
| 102 | #define OMAP24XX_GPIO_IRQSTATUS2 0x0028 | ||
| 103 | #define OMAP24XX_GPIO_IRQENABLE2 0x002c | ||
| 104 | #define OMAP24XX_GPIO_IRQENABLE1 0x001c | ||
| 105 | #define OMAP24XX_GPIO_WAKE_EN 0x0020 | ||
| 106 | #define OMAP24XX_GPIO_CTRL 0x0030 | ||
| 107 | #define OMAP24XX_GPIO_OE 0x0034 | ||
| 108 | #define OMAP24XX_GPIO_DATAIN 0x0038 | ||
| 109 | #define OMAP24XX_GPIO_DATAOUT 0x003c | ||
| 110 | #define OMAP24XX_GPIO_LEVELDETECT0 0x0040 | ||
| 111 | #define OMAP24XX_GPIO_LEVELDETECT1 0x0044 | ||
| 112 | #define OMAP24XX_GPIO_RISINGDETECT 0x0048 | ||
| 113 | #define OMAP24XX_GPIO_FALLINGDETECT 0x004c | ||
| 114 | #define OMAP24XX_GPIO_DEBOUNCE_EN 0x0050 | ||
| 115 | #define OMAP24XX_GPIO_DEBOUNCE_VAL 0x0054 | ||
| 116 | #define OMAP24XX_GPIO_CLEARIRQENABLE1 0x0060 | ||
| 117 | #define OMAP24XX_GPIO_SETIRQENABLE1 0x0064 | ||
| 118 | #define OMAP24XX_GPIO_CLEARWKUENA 0x0080 | ||
| 119 | #define OMAP24XX_GPIO_SETWKUENA 0x0084 | ||
| 120 | #define OMAP24XX_GPIO_CLEARDATAOUT 0x0090 | ||
| 121 | #define OMAP24XX_GPIO_SETDATAOUT 0x0094 | ||
| 122 | |||
| 123 | #define OMAP4_GPIO_REVISION 0x0000 | ||
| 124 | #define OMAP4_GPIO_EOI 0x0020 | ||
| 125 | #define OMAP4_GPIO_IRQSTATUSRAW0 0x0024 | ||
| 126 | #define OMAP4_GPIO_IRQSTATUSRAW1 0x0028 | ||
| 127 | #define OMAP4_GPIO_IRQSTATUS0 0x002c | ||
| 128 | #define OMAP4_GPIO_IRQSTATUS1 0x0030 | ||
| 129 | #define OMAP4_GPIO_IRQSTATUSSET0 0x0034 | ||
| 130 | #define OMAP4_GPIO_IRQSTATUSSET1 0x0038 | ||
| 131 | #define OMAP4_GPIO_IRQSTATUSCLR0 0x003c | ||
| 132 | #define OMAP4_GPIO_IRQSTATUSCLR1 0x0040 | ||
| 133 | #define OMAP4_GPIO_IRQWAKEN0 0x0044 | ||
| 134 | #define OMAP4_GPIO_IRQWAKEN1 0x0048 | ||
| 135 | #define OMAP4_GPIO_IRQENABLE1 0x011c | ||
| 136 | #define OMAP4_GPIO_WAKE_EN 0x0120 | ||
| 137 | #define OMAP4_GPIO_IRQSTATUS2 0x0128 | ||
| 138 | #define OMAP4_GPIO_IRQENABLE2 0x012c | ||
| 139 | #define OMAP4_GPIO_CTRL 0x0130 | ||
| 140 | #define OMAP4_GPIO_OE 0x0134 | ||
| 141 | #define OMAP4_GPIO_DATAIN 0x0138 | ||
| 142 | #define OMAP4_GPIO_DATAOUT 0x013c | ||
| 143 | #define OMAP4_GPIO_LEVELDETECT0 0x0140 | ||
| 144 | #define OMAP4_GPIO_LEVELDETECT1 0x0144 | ||
| 145 | #define OMAP4_GPIO_RISINGDETECT 0x0148 | ||
| 146 | #define OMAP4_GPIO_FALLINGDETECT 0x014c | ||
| 147 | #define OMAP4_GPIO_DEBOUNCENABLE 0x0150 | ||
| 148 | #define OMAP4_GPIO_DEBOUNCINGTIME 0x0154 | ||
| 149 | #define OMAP4_GPIO_CLEARIRQENABLE1 0x0160 | ||
| 150 | #define OMAP4_GPIO_SETIRQENABLE1 0x0164 | ||
| 151 | #define OMAP4_GPIO_CLEARWKUENA 0x0180 | ||
| 152 | #define OMAP4_GPIO_SETWKUENA 0x0184 | ||
| 153 | #define OMAP4_GPIO_CLEARDATAOUT 0x0190 | ||
| 154 | #define OMAP4_GPIO_SETDATAOUT 0x0194 | ||
| 155 | |||
| 156 | #define OMAP_MAX_GPIO_LINES 192 | ||
| 157 | |||
| 158 | #define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr)) | ||
| 159 | #define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES) | ||
| 160 | |||
| 161 | struct omap_gpio_dev_attr { | ||
| 162 | int bank_width; /* GPIO bank width */ | ||
| 163 | bool dbck_flag; /* dbck required or not - True for OMAP3&4 */ | ||
| 164 | }; | ||
| 165 | |||
| 166 | struct omap_gpio_reg_offs { | ||
| 167 | u16 revision; | ||
| 168 | u16 direction; | ||
| 169 | u16 datain; | ||
| 170 | u16 dataout; | ||
| 171 | u16 set_dataout; | ||
| 172 | u16 clr_dataout; | ||
| 173 | u16 irqstatus; | ||
| 174 | u16 irqstatus2; | ||
| 175 | u16 irqstatus_raw0; | ||
| 176 | u16 irqstatus_raw1; | ||
| 177 | u16 irqenable; | ||
| 178 | u16 irqenable2; | ||
| 179 | u16 set_irqenable; | ||
| 180 | u16 clr_irqenable; | ||
| 181 | u16 debounce; | ||
| 182 | u16 debounce_en; | ||
| 183 | u16 ctrl; | ||
| 184 | u16 wkup_en; | ||
| 185 | u16 leveldetect0; | ||
| 186 | u16 leveldetect1; | ||
| 187 | u16 risingdetect; | ||
| 188 | u16 fallingdetect; | ||
| 189 | u16 irqctrl; | ||
| 190 | u16 edgectrl1; | ||
| 191 | u16 edgectrl2; | ||
| 192 | u16 pinctrl; | ||
| 193 | |||
| 194 | bool irqenable_inv; | ||
| 195 | }; | ||
| 196 | |||
| 197 | struct omap_gpio_platform_data { | ||
| 198 | int bank_type; | ||
| 199 | int bank_width; /* GPIO bank width */ | ||
| 200 | int bank_stride; /* Only needed for omap1 MPUIO */ | ||
| 201 | bool dbck_flag; /* dbck required or not - True for OMAP3&4 */ | ||
| 202 | bool loses_context; /* whether the bank would ever lose context */ | ||
| 203 | bool is_mpuio; /* whether the bank is of type MPUIO */ | ||
| 204 | u32 non_wakeup_gpios; | ||
| 205 | |||
| 206 | struct omap_gpio_reg_offs *regs; | ||
| 207 | |||
| 208 | /* Return context loss count due to PM states changing */ | ||
| 209 | int (*get_context_loss_count)(struct device *dev); | ||
| 210 | }; | ||
| 211 | |||
| 212 | extern void omap2_gpio_prepare_for_idle(int off_mode); | ||
| 213 | extern void omap2_gpio_resume_after_idle(void); | ||
| 214 | extern void omap_set_gpio_debounce(int gpio, int enable); | ||
| 215 | extern void omap_set_gpio_debounce_time(int gpio, int enable); | ||
| 216 | |||
| 217 | #endif | ||
diff --git a/include/linux/platform_data/keypad-omap.h b/include/linux/platform_data/keypad-omap.h new file mode 100644 index 000000000000..a6b21eddb212 --- /dev/null +++ b/include/linux/platform_data/keypad-omap.h | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/plat-omap/include/mach/keypad.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.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 | #ifndef ASMARM_ARCH_KEYPAD_H | ||
| 11 | #define ASMARM_ARCH_KEYPAD_H | ||
| 12 | |||
| 13 | #ifndef CONFIG_ARCH_OMAP1 | ||
| 14 | #warning Please update the board to use matrix-keypad driver | ||
| 15 | #define omap_readw(reg) 0 | ||
| 16 | #define omap_writew(val, reg) do {} while (0) | ||
| 17 | #endif | ||
| 18 | #include <linux/input/matrix_keypad.h> | ||
| 19 | |||
| 20 | struct omap_kp_platform_data { | ||
| 21 | int rows; | ||
| 22 | int cols; | ||
| 23 | const struct matrix_keymap_data *keymap_data; | ||
| 24 | bool rep; | ||
| 25 | unsigned long delay; | ||
| 26 | bool dbounce; | ||
| 27 | /* specific to OMAP242x*/ | ||
| 28 | unsigned int *row_gpios; | ||
| 29 | unsigned int *col_gpios; | ||
| 30 | }; | ||
| 31 | |||
| 32 | /* Group (0..3) -- when multiple keys are pressed, only the | ||
| 33 | * keys pressed in the same group are considered as pressed. This is | ||
| 34 | * in order to workaround certain crappy HW designs that produce ghost | ||
| 35 | * keypresses. Two free bits, not used by neither row/col nor keynum, | ||
| 36 | * must be available for use as group bits. The below GROUP_SHIFT | ||
| 37 | * macro definition is based on some prior knowledge of the | ||
| 38 | * matrix_keypad defined KEY() macro internals. | ||
| 39 | */ | ||
| 40 | #define GROUP_SHIFT 14 | ||
| 41 | #define GROUP_0 (0 << GROUP_SHIFT) | ||
| 42 | #define GROUP_1 (1 << GROUP_SHIFT) | ||
| 43 | #define GROUP_2 (2 << GROUP_SHIFT) | ||
| 44 | #define GROUP_3 (3 << GROUP_SHIFT) | ||
| 45 | #define GROUP_MASK GROUP_3 | ||
| 46 | #if KEY_MAX & GROUP_MASK | ||
| 47 | #error Group bits in conflict with keynum bits | ||
| 48 | #endif | ||
| 49 | |||
| 50 | |||
| 51 | #endif | ||
| 52 | |||
diff --git a/include/linux/platform_data/lcd-mipid.h b/include/linux/platform_data/lcd-mipid.h new file mode 100644 index 000000000000..8e52c6572281 --- /dev/null +++ b/include/linux/platform_data/lcd-mipid.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | #ifndef __LCD_MIPID_H | ||
| 2 | #define __LCD_MIPID_H | ||
| 3 | |||
| 4 | enum mipid_test_num { | ||
| 5 | MIPID_TEST_RGB_LINES, | ||
| 6 | }; | ||
| 7 | |||
| 8 | enum mipid_test_result { | ||
| 9 | MIPID_TEST_SUCCESS, | ||
| 10 | MIPID_TEST_INVALID, | ||
| 11 | MIPID_TEST_FAILED, | ||
| 12 | }; | ||
| 13 | |||
| 14 | #ifdef __KERNEL__ | ||
| 15 | |||
| 16 | struct mipid_platform_data { | ||
| 17 | int nreset_gpio; | ||
| 18 | int data_lines; | ||
| 19 | |||
| 20 | void (*shutdown)(struct mipid_platform_data *pdata); | ||
| 21 | void (*set_bklight_level)(struct mipid_platform_data *pdata, | ||
| 22 | int level); | ||
| 23 | int (*get_bklight_level)(struct mipid_platform_data *pdata); | ||
| 24 | int (*get_bklight_max)(struct mipid_platform_data *pdata); | ||
| 25 | }; | ||
| 26 | |||
| 27 | #endif | ||
| 28 | |||
| 29 | #endif | ||
diff --git a/include/linux/platform_data/max310x.h b/include/linux/platform_data/max310x.h new file mode 100644 index 000000000000..91648bf5fc5c --- /dev/null +++ b/include/linux/platform_data/max310x.h | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | /* | ||
| 2 | * Maxim (Dallas) MAX3107/8 serial driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru> | ||
| 5 | * | ||
| 6 | * Based on max3100.c, by Christian Pellegrin <chripell@evolware.org> | ||
| 7 | * Based on max3110.c, by Feng Tang <feng.tang@intel.com> | ||
| 8 | * Based on max3107.c, by Aavamobile | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License as published by | ||
| 12 | * the Free Software Foundation; either version 2 of the License, or | ||
| 13 | * (at your option) any later version. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef _MAX310X_H_ | ||
| 17 | #define _MAX310X_H_ | ||
| 18 | |||
| 19 | /* | ||
| 20 | * Example board initialization data: | ||
| 21 | * | ||
| 22 | * static struct max310x_pdata max3107_pdata = { | ||
| 23 | * .driver_flags = MAX310X_EXT_CLK, | ||
| 24 | * .uart_flags[0] = MAX310X_ECHO_SUPRESS | MAX310X_AUTO_DIR_CTRL, | ||
| 25 | * .frequency = 3686400, | ||
| 26 | * .gpio_base = -1, | ||
| 27 | * }; | ||
| 28 | * | ||
| 29 | * static struct spi_board_info spi_device_max3107[] = { | ||
| 30 | * { | ||
| 31 | * .modalias = "max3107", | ||
| 32 | * .irq = IRQ_EINT3, | ||
| 33 | * .bus_num = 1, | ||
| 34 | * .chip_select = 1, | ||
| 35 | * .platform_data = &max3107_pdata, | ||
| 36 | * }, | ||
| 37 | * }; | ||
| 38 | */ | ||
| 39 | |||
| 40 | #define MAX310X_MAX_UARTS 1 | ||
| 41 | |||
| 42 | /* MAX310X platform data structure */ | ||
| 43 | struct max310x_pdata { | ||
| 44 | /* Flags global to driver */ | ||
| 45 | const u8 driver_flags:2; | ||
| 46 | #define MAX310X_EXT_CLK (0x00000001) /* External clock enable */ | ||
| 47 | #define MAX310X_AUTOSLEEP (0x00000002) /* Enable AutoSleep mode */ | ||
| 48 | /* Flags global to UART port */ | ||
| 49 | const u8 uart_flags[MAX310X_MAX_UARTS]; | ||
| 50 | #define MAX310X_LOOPBACK (0x00000001) /* Loopback mode enable */ | ||
| 51 | #define MAX310X_ECHO_SUPRESS (0x00000002) /* Enable echo supress */ | ||
| 52 | #define MAX310X_AUTO_DIR_CTRL (0x00000004) /* Enable Auto direction | ||
| 53 | * control (RS-485) | ||
| 54 | */ | ||
| 55 | /* Frequency (extrenal clock or crystal) */ | ||
| 56 | const int frequency; | ||
| 57 | /* GPIO base number (can be negative) */ | ||
| 58 | const int gpio_base; | ||
| 59 | /* Called during startup */ | ||
| 60 | void (*init)(void); | ||
| 61 | /* Called before finish */ | ||
| 62 | void (*exit)(void); | ||
| 63 | /* Suspend callback */ | ||
| 64 | void (*suspend)(int do_suspend); | ||
| 65 | }; | ||
| 66 | |||
| 67 | #endif | ||
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h new file mode 100644 index 000000000000..1a68c1e5fe53 --- /dev/null +++ b/include/linux/platform_data/mtd-nand-omap2.h | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/plat-omap/include/mach/nand.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2006 Micron Technology Inc. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #include <plat/gpmc.h> | ||
| 12 | #include <linux/mtd/partitions.h> | ||
| 13 | |||
| 14 | enum nand_io { | ||
| 15 | NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */ | ||
| 16 | NAND_OMAP_POLLED, /* polled mode, without prefetch */ | ||
| 17 | NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */ | ||
| 18 | NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */ | ||
| 19 | }; | ||
| 20 | |||
| 21 | struct omap_nand_platform_data { | ||
| 22 | int cs; | ||
| 23 | struct mtd_partition *parts; | ||
| 24 | struct gpmc_timings *gpmc_t; | ||
| 25 | int nr_parts; | ||
| 26 | bool dev_ready; | ||
| 27 | enum nand_io xfer_type; | ||
| 28 | int devsize; | ||
| 29 | enum omap_ecc ecc_opt; | ||
| 30 | struct gpmc_nand_regs reg; | ||
| 31 | }; | ||
| 32 | |||
| 33 | /* minimum size for IO mapping */ | ||
| 34 | #define NAND_IO_SIZE 4 | ||
| 35 | |||
| 36 | #if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE) | ||
| 37 | extern int gpmc_nand_init(struct omap_nand_platform_data *d); | ||
| 38 | #else | ||
| 39 | static inline int gpmc_nand_init(struct omap_nand_platform_data *d) | ||
| 40 | { | ||
| 41 | return 0; | ||
| 42 | } | ||
| 43 | #endif | ||
diff --git a/include/linux/platform_data/mtd-onenand-omap2.h b/include/linux/platform_data/mtd-onenand-omap2.h new file mode 100644 index 000000000000..2858667d2e4f --- /dev/null +++ b/include/linux/platform_data/mtd-onenand-omap2.h | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/plat-omap/include/mach/onenand.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2006 Nokia Corporation | ||
| 5 | * Author: Juha Yrjola | ||
| 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 | #include <linux/mtd/mtd.h> | ||
| 13 | #include <linux/mtd/partitions.h> | ||
| 14 | |||
| 15 | #define ONENAND_SYNC_READ (1 << 0) | ||
| 16 | #define ONENAND_SYNC_READWRITE (1 << 1) | ||
| 17 | |||
| 18 | struct onenand_freq_info { | ||
| 19 | u16 maf_id; | ||
| 20 | u16 dev_id; | ||
| 21 | u16 ver_id; | ||
| 22 | }; | ||
| 23 | |||
| 24 | struct omap_onenand_platform_data { | ||
| 25 | int cs; | ||
| 26 | int gpio_irq; | ||
| 27 | struct mtd_partition *parts; | ||
| 28 | int nr_parts; | ||
| 29 | int (*onenand_setup)(void __iomem *, int *freq_ptr); | ||
| 30 | int (*get_freq)(const struct onenand_freq_info *freq_info, | ||
| 31 | bool *clk_dep); | ||
| 32 | int dma_channel; | ||
| 33 | u8 flags; | ||
| 34 | u8 regulator_can_sleep; | ||
| 35 | u8 skip_initial_unlocking; | ||
| 36 | }; | ||
| 37 | |||
| 38 | #define ONENAND_MAX_PARTITIONS 8 | ||
| 39 | |||
| 40 | #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ | ||
| 41 | defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) | ||
| 42 | |||
| 43 | extern void gpmc_onenand_init(struct omap_onenand_platform_data *d); | ||
| 44 | |||
| 45 | #else | ||
| 46 | |||
| 47 | #define board_onenand_data NULL | ||
| 48 | |||
| 49 | static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d) | ||
| 50 | { | ||
| 51 | } | ||
| 52 | |||
| 53 | #endif | ||
diff --git a/include/linux/platform_data/omap1_bl.h b/include/linux/platform_data/omap1_bl.h new file mode 100644 index 000000000000..881a8e92d605 --- /dev/null +++ b/include/linux/platform_data/omap1_bl.h | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | #ifndef __OMAP1_BL_H__ | ||
| 2 | #define __OMAP1_BL_H__ | ||
| 3 | |||
| 4 | #include <linux/device.h> | ||
| 5 | |||
| 6 | struct omap_backlight_config { | ||
| 7 | int default_intensity; | ||
| 8 | int (*set_power)(struct device *dev, int state); | ||
| 9 | }; | ||
| 10 | |||
| 11 | #endif | ||
diff --git a/include/linux/platform_data/pinctrl-coh901.h b/include/linux/platform_data/pinctrl-coh901.h new file mode 100644 index 000000000000..30dea251b835 --- /dev/null +++ b/include/linux/platform_data/pinctrl-coh901.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2007-2012 ST-Ericsson AB | ||
| 3 | * License terms: GNU General Public License (GPL) version 2 | ||
| 4 | * GPIO block resgister definitions and inline macros for | ||
| 5 | * U300 GPIO COH 901 335 or COH 901 571/3 | ||
| 6 | * Author: Linus Walleij <linus.walleij@stericsson.com> | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __MACH_U300_GPIO_U300_H | ||
| 10 | #define __MACH_U300_GPIO_U300_H | ||
| 11 | |||
| 12 | /** | ||
| 13 | * struct u300_gpio_platform - U300 GPIO platform data | ||
| 14 | * @ports: number of GPIO block ports | ||
| 15 | * @gpio_base: first GPIO number for this block (use a free range) | ||
| 16 | * @gpio_irq_base: first GPIO IRQ number for this block (use a free range) | ||
| 17 | * @pinctrl_device: pin control device to spawn as child | ||
| 18 | */ | ||
| 19 | struct u300_gpio_platform { | ||
| 20 | u8 ports; | ||
| 21 | int gpio_base; | ||
| 22 | int gpio_irq_base; | ||
| 23 | struct platform_device *pinctrl_device; | ||
| 24 | }; | ||
| 25 | |||
| 26 | #endif /* __MACH_U300_GPIO_U300_H */ | ||
diff --git a/include/linux/platform_data/remoteproc-omap.h b/include/linux/platform_data/remoteproc-omap.h new file mode 100644 index 000000000000..b10eac89e2e9 --- /dev/null +++ b/include/linux/platform_data/remoteproc-omap.h | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | /* | ||
| 2 | * Remote Processor - omap-specific bits | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Texas Instruments, Inc. | ||
| 5 | * Copyright (C) 2011 Google, Inc. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU General Public License | ||
| 9 | * version 2 as published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef _PLAT_REMOTEPROC_H | ||
| 18 | #define _PLAT_REMOTEPROC_H | ||
| 19 | |||
| 20 | struct rproc_ops; | ||
| 21 | struct platform_device; | ||
| 22 | |||
| 23 | /* | ||
| 24 | * struct omap_rproc_pdata - omap remoteproc's platform data | ||
| 25 | * @name: the remoteproc's name | ||
| 26 | * @oh_name: omap hwmod device | ||
| 27 | * @oh_name_opt: optional, secondary omap hwmod device | ||
| 28 | * @firmware: name of firmware file to load | ||
| 29 | * @mbox_name: name of omap mailbox device to use with this rproc | ||
| 30 | * @ops: start/stop rproc handlers | ||
| 31 | * @device_enable: omap-specific handler for enabling a device | ||
| 32 | * @device_shutdown: omap-specific handler for shutting down a device | ||
| 33 | */ | ||
| 34 | struct omap_rproc_pdata { | ||
| 35 | const char *name; | ||
| 36 | const char *oh_name; | ||
| 37 | const char *oh_name_opt; | ||
| 38 | const char *firmware; | ||
| 39 | const char *mbox_name; | ||
| 40 | const struct rproc_ops *ops; | ||
| 41 | int (*device_enable) (struct platform_device *pdev); | ||
| 42 | int (*device_shutdown) (struct platform_device *pdev); | ||
| 43 | }; | ||
| 44 | |||
| 45 | #if defined(CONFIG_OMAP_REMOTEPROC) || defined(CONFIG_OMAP_REMOTEPROC_MODULE) | ||
| 46 | |||
| 47 | void __init omap_rproc_reserve_cma(void); | ||
| 48 | |||
| 49 | #else | ||
| 50 | |||
| 51 | void __init omap_rproc_reserve_cma(void) | ||
| 52 | { | ||
| 53 | } | ||
| 54 | |||
| 55 | #endif | ||
| 56 | |||
| 57 | #endif /* _PLAT_REMOTEPROC_H */ | ||
diff --git a/include/linux/platform_data/sccnxp.h b/include/linux/platform_data/sccnxp.h new file mode 100644 index 000000000000..7311ccd3217f --- /dev/null +++ b/include/linux/platform_data/sccnxp.h | |||
| @@ -0,0 +1,93 @@ | |||
| 1 | /* | ||
| 2 | * NXP (Philips) SCC+++(SCN+++) serial driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru> | ||
| 5 | * | ||
| 6 | * Based on sc26xx.c, by Thomas Bogendörfer (tsbogend@alpha.franken.de) | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __SCCNXP_H | ||
| 15 | #define __SCCNXP_H | ||
| 16 | |||
| 17 | #define SCCNXP_MAX_UARTS 2 | ||
| 18 | |||
| 19 | /* Output lines */ | ||
| 20 | #define LINE_OP0 1 | ||
| 21 | #define LINE_OP1 2 | ||
| 22 | #define LINE_OP2 3 | ||
| 23 | #define LINE_OP3 4 | ||
| 24 | #define LINE_OP4 5 | ||
| 25 | #define LINE_OP5 6 | ||
| 26 | #define LINE_OP6 7 | ||
| 27 | #define LINE_OP7 8 | ||
| 28 | |||
| 29 | /* Input lines */ | ||
| 30 | #define LINE_IP0 9 | ||
| 31 | #define LINE_IP1 10 | ||
| 32 | #define LINE_IP2 11 | ||
| 33 | #define LINE_IP3 12 | ||
| 34 | #define LINE_IP4 13 | ||
| 35 | #define LINE_IP5 14 | ||
| 36 | #define LINE_IP6 15 | ||
| 37 | |||
| 38 | /* Signals */ | ||
| 39 | #define DTR_OP 0 /* DTR */ | ||
| 40 | #define RTS_OP 4 /* RTS */ | ||
| 41 | #define DSR_IP 8 /* DSR */ | ||
| 42 | #define CTS_IP 12 /* CTS */ | ||
| 43 | #define DCD_IP 16 /* DCD */ | ||
| 44 | #define RNG_IP 20 /* RNG */ | ||
| 45 | |||
| 46 | #define DIR_OP 24 /* Special signal for control RS-485. | ||
| 47 | * Goes high when transmit, | ||
| 48 | * then goes low. | ||
| 49 | */ | ||
| 50 | |||
| 51 | /* Routing control signal 'sig' to line 'line' */ | ||
| 52 | #define MCTRL_SIG(sig, line) ((line) << (sig)) | ||
| 53 | |||
| 54 | /* | ||
| 55 | * Example board initialization data: | ||
| 56 | * | ||
| 57 | * static struct resource sc2892_resources[] = { | ||
| 58 | * DEFINE_RES_MEM(UART_PHYS_START, 0x10), | ||
| 59 | * DEFINE_RES_IRQ(IRQ_EXT2), | ||
| 60 | * }; | ||
| 61 | * | ||
| 62 | * static struct sccnxp_pdata sc2892_info = { | ||
| 63 | * .frequency = 3686400, | ||
| 64 | * .mctrl_cfg[0] = MCTRL_SIG(DIR_OP, LINE_OP0), | ||
| 65 | * .mctrl_cfg[1] = MCTRL_SIG(DIR_OP, LINE_OP1), | ||
| 66 | * }; | ||
| 67 | * | ||
| 68 | * static struct platform_device sc2892 = { | ||
| 69 | * .name = "sc2892", | ||
| 70 | * .id = -1, | ||
| 71 | * .resource = sc2892_resources, | ||
| 72 | * .num_resources = ARRAY_SIZE(sc2892_resources), | ||
| 73 | * .dev = { | ||
| 74 | * .platform_data = &sc2892_info, | ||
| 75 | * }, | ||
| 76 | * }; | ||
| 77 | */ | ||
| 78 | |||
| 79 | /* SCCNXP platform data structure */ | ||
| 80 | struct sccnxp_pdata { | ||
| 81 | /* Frequency (extrenal clock or crystal) */ | ||
| 82 | int frequency; | ||
| 83 | /* Shift for A0 line */ | ||
| 84 | const u8 reg_shift; | ||
| 85 | /* Modem control lines configuration */ | ||
| 86 | const u32 mctrl_cfg[SCCNXP_MAX_UARTS]; | ||
| 87 | /* Called during startup */ | ||
| 88 | void (*init)(void); | ||
| 89 | /* Called before finish */ | ||
| 90 | void (*exit)(void); | ||
| 91 | }; | ||
| 92 | |||
| 93 | #endif | ||
diff --git a/include/linux/platform_data/spi-omap2-mcspi.h b/include/linux/platform_data/spi-omap2-mcspi.h new file mode 100644 index 000000000000..a357eb26bd25 --- /dev/null +++ b/include/linux/platform_data/spi-omap2-mcspi.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | #ifndef _OMAP2_MCSPI_H | ||
| 2 | #define _OMAP2_MCSPI_H | ||
| 3 | |||
| 4 | #define OMAP2_MCSPI_REV 0 | ||
| 5 | #define OMAP3_MCSPI_REV 1 | ||
| 6 | #define OMAP4_MCSPI_REV 2 | ||
| 7 | |||
| 8 | #define OMAP4_MCSPI_REG_OFFSET 0x100 | ||
| 9 | |||
| 10 | struct omap2_mcspi_platform_config { | ||
| 11 | unsigned short num_cs; | ||
| 12 | unsigned int regs_offset; | ||
| 13 | }; | ||
| 14 | |||
| 15 | struct omap2_mcspi_dev_attr { | ||
| 16 | unsigned short num_chipselect; | ||
| 17 | }; | ||
| 18 | |||
| 19 | struct omap2_mcspi_device_config { | ||
| 20 | unsigned turbo_mode:1; | ||
| 21 | }; | ||
| 22 | |||
| 23 | #endif | ||
diff --git a/include/linux/platform_data/voltage-omap.h b/include/linux/platform_data/voltage-omap.h new file mode 100644 index 000000000000..5be4d5def427 --- /dev/null +++ b/include/linux/platform_data/voltage-omap.h | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | /* | ||
| 2 | * OMAP Voltage Management Routines | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011, Texas Instruments, Inc. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __ARCH_ARM_OMAP_VOLTAGE_H | ||
| 12 | #define __ARCH_ARM_OMAP_VOLTAGE_H | ||
| 13 | |||
| 14 | /** | ||
| 15 | * struct omap_volt_data - Omap voltage specific data. | ||
| 16 | * @voltage_nominal: The possible voltage value in uV | ||
| 17 | * @sr_efuse_offs: The offset of the efuse register(from system | ||
| 18 | * control module base address) from where to read | ||
| 19 | * the n-target value for the smartreflex module. | ||
| 20 | * @sr_errminlimit: Error min limit value for smartreflex. This value | ||
| 21 | * differs at differnet opp and thus is linked | ||
| 22 | * with voltage. | ||
| 23 | * @vp_errorgain: Error gain value for the voltage processor. This | ||
| 24 | * field also differs according to the voltage/opp. | ||
| 25 | */ | ||
| 26 | struct omap_volt_data { | ||
| 27 | u32 volt_nominal; | ||
| 28 | u32 sr_efuse_offs; | ||
| 29 | u8 sr_errminlimit; | ||
| 30 | u8 vp_errgain; | ||
| 31 | }; | ||
| 32 | struct voltagedomain; | ||
| 33 | |||
| 34 | struct voltagedomain *voltdm_lookup(const char *name); | ||
| 35 | int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); | ||
| 36 | unsigned long voltdm_get_voltage(struct voltagedomain *voltdm); | ||
| 37 | struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm, | ||
| 38 | unsigned long volt); | ||
| 39 | #endif | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 60e9994ef405..5711e9525a2a 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -14,11 +14,15 @@ | |||
| 14 | #include <linux/device.h> | 14 | #include <linux/device.h> |
| 15 | #include <linux/mod_devicetable.h> | 15 | #include <linux/mod_devicetable.h> |
| 16 | 16 | ||
| 17 | #define PLATFORM_DEVID_NONE (-1) | ||
| 18 | #define PLATFORM_DEVID_AUTO (-2) | ||
| 19 | |||
| 17 | struct mfd_cell; | 20 | struct mfd_cell; |
| 18 | 21 | ||
| 19 | struct platform_device { | 22 | struct platform_device { |
| 20 | const char * name; | 23 | const char * name; |
| 21 | int id; | 24 | int id; |
| 25 | bool id_auto; | ||
| 22 | struct device dev; | 26 | struct device dev; |
| 23 | u32 num_resources; | 27 | u32 num_resources; |
| 24 | struct resource * resource; | 28 | struct resource * resource; |
diff --git a/include/linux/pm.h b/include/linux/pm.h index f067e60a3832..88f034a23f2c 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -638,6 +638,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
| 638 | } while (0) | 638 | } while (0) |
| 639 | 639 | ||
| 640 | extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); | 640 | extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); |
| 641 | extern void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *)); | ||
| 641 | 642 | ||
| 642 | extern int pm_generic_prepare(struct device *dev); | 643 | extern int pm_generic_prepare(struct device *dev); |
| 643 | extern int pm_generic_suspend_late(struct device *dev); | 644 | extern int pm_generic_suspend_late(struct device *dev); |
| @@ -677,6 +678,10 @@ static inline int device_pm_wait_for_dev(struct device *a, struct device *b) | |||
| 677 | return 0; | 678 | return 0; |
| 678 | } | 679 | } |
| 679 | 680 | ||
| 681 | static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *)) | ||
| 682 | { | ||
| 683 | } | ||
| 684 | |||
| 680 | #define pm_generic_prepare NULL | 685 | #define pm_generic_prepare NULL |
| 681 | #define pm_generic_suspend NULL | 686 | #define pm_generic_suspend NULL |
| 682 | #define pm_generic_resume NULL | 687 | #define pm_generic_resume NULL |
diff --git a/include/linux/power/generic-adc-battery.h b/include/linux/power/generic-adc-battery.h new file mode 100644 index 000000000000..b1ebe08533b6 --- /dev/null +++ b/include/linux/power/generic-adc-battery.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2012, Anish Kumar <anish198519851985@gmail.com> | ||
| 3 | * This program is free software; you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License version 2 as | ||
| 5 | * published by the Free Software Foundation. | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef GENERIC_ADC_BATTERY_H | ||
| 9 | #define GENERIC_ADC_BATTERY_H | ||
| 10 | |||
| 11 | /** | ||
| 12 | * struct gab_platform_data - platform_data for generic adc iio battery driver. | ||
| 13 | * @battery_info: recommended structure to specify static power supply | ||
| 14 | * parameters | ||
| 15 | * @cal_charge: calculate charge level. | ||
| 16 | * @gpio_charge_finished: gpio for the charger. | ||
| 17 | * @gpio_inverted: Should be 1 if the GPIO is active low otherwise 0 | ||
| 18 | * @jitter_delay: delay required after the interrupt to check battery | ||
| 19 | * status.Default set is 10ms. | ||
| 20 | */ | ||
| 21 | struct gab_platform_data { | ||
| 22 | struct power_supply_info battery_info; | ||
| 23 | int (*cal_charge)(long value); | ||
| 24 | int gpio_charge_finished; | ||
| 25 | bool gpio_inverted; | ||
| 26 | int jitter_delay; | ||
| 27 | }; | ||
| 28 | |||
| 29 | #endif /* GENERIC_ADC_BATTERY_H */ | ||
diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h index 3101e62a1213..4a496ebc7d73 100644 --- a/include/linux/power/smartreflex.h +++ b/include/linux/power/smartreflex.h | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
| 24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
| 25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
| 26 | #include <plat/voltage.h> | 26 | #include <linux/platform_data/voltage-omap.h> |
| 27 | 27 | ||
| 28 | /* | 28 | /* |
| 29 | * Different Smartreflex IPs version. The v1 is the 65nm version used in | 29 | * Different Smartreflex IPs version. The v1 is the 65nm version used in |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 115ead2b5155..7c968e4f929e 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -191,6 +191,21 @@ extern void rcu_idle_enter(void); | |||
| 191 | extern void rcu_idle_exit(void); | 191 | extern void rcu_idle_exit(void); |
| 192 | extern void rcu_irq_enter(void); | 192 | extern void rcu_irq_enter(void); |
| 193 | extern void rcu_irq_exit(void); | 193 | extern void rcu_irq_exit(void); |
| 194 | |||
| 195 | #ifdef CONFIG_RCU_USER_QS | ||
| 196 | extern void rcu_user_enter(void); | ||
| 197 | extern void rcu_user_exit(void); | ||
| 198 | extern void rcu_user_enter_after_irq(void); | ||
| 199 | extern void rcu_user_exit_after_irq(void); | ||
| 200 | extern void rcu_user_hooks_switch(struct task_struct *prev, | ||
| 201 | struct task_struct *next); | ||
| 202 | #else | ||
| 203 | static inline void rcu_user_enter(void) { } | ||
| 204 | static inline void rcu_user_exit(void) { } | ||
| 205 | static inline void rcu_user_enter_after_irq(void) { } | ||
| 206 | static inline void rcu_user_exit_after_irq(void) { } | ||
| 207 | #endif /* CONFIG_RCU_USER_QS */ | ||
| 208 | |||
| 194 | extern void exit_rcu(void); | 209 | extern void exit_rcu(void); |
| 195 | 210 | ||
| 196 | /** | 211 | /** |
| @@ -210,14 +225,12 @@ extern void exit_rcu(void); | |||
| 210 | * to nest RCU_NONIDLE() wrappers, but the nesting level is currently | 225 | * to nest RCU_NONIDLE() wrappers, but the nesting level is currently |
| 211 | * quite limited. If deeper nesting is required, it will be necessary | 226 | * quite limited. If deeper nesting is required, it will be necessary |
| 212 | * to adjust DYNTICK_TASK_NESTING_VALUE accordingly. | 227 | * to adjust DYNTICK_TASK_NESTING_VALUE accordingly. |
| 213 | * | ||
| 214 | * This macro may be used from process-level code only. | ||
| 215 | */ | 228 | */ |
| 216 | #define RCU_NONIDLE(a) \ | 229 | #define RCU_NONIDLE(a) \ |
| 217 | do { \ | 230 | do { \ |
| 218 | rcu_idle_exit(); \ | 231 | rcu_irq_enter(); \ |
| 219 | do { a; } while (0); \ | 232 | do { a; } while (0); \ |
| 220 | rcu_idle_enter(); \ | 233 | rcu_irq_exit(); \ |
| 221 | } while (0) | 234 | } while (0) |
| 222 | 235 | ||
| 223 | /* | 236 | /* |
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 7f7e00df3adf..e3bcc3f4dcb8 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
| @@ -285,6 +285,7 @@ struct regmap_irq { | |||
| 285 | * @ack_base: Base ack address. If zero then the chip is clear on read. | 285 | * @ack_base: Base ack address. If zero then the chip is clear on read. |
| 286 | * @wake_base: Base address for wake enables. If zero unsupported. | 286 | * @wake_base: Base address for wake enables. If zero unsupported. |
| 287 | * @irq_reg_stride: Stride to use for chips where registers are not contiguous. | 287 | * @irq_reg_stride: Stride to use for chips where registers are not contiguous. |
| 288 | * @runtime_pm: Hold a runtime PM lock on the device when accessing it. | ||
| 288 | * | 289 | * |
| 289 | * @num_regs: Number of registers in each control bank. | 290 | * @num_regs: Number of registers in each control bank. |
| 290 | * @irqs: Descriptors for individual IRQs. Interrupt numbers are | 291 | * @irqs: Descriptors for individual IRQs. Interrupt numbers are |
| @@ -299,6 +300,8 @@ struct regmap_irq_chip { | |||
| 299 | unsigned int ack_base; | 300 | unsigned int ack_base; |
| 300 | unsigned int wake_base; | 301 | unsigned int wake_base; |
| 301 | unsigned int irq_reg_stride; | 302 | unsigned int irq_reg_stride; |
| 303 | unsigned int mask_invert; | ||
| 304 | bool runtime_pm; | ||
| 302 | 305 | ||
| 303 | int num_regs; | 306 | int num_regs; |
| 304 | 307 | ||
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index da339fd8c755..c43cd3556b1f 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
| @@ -177,6 +177,8 @@ int regulator_set_mode(struct regulator *regulator, unsigned int mode); | |||
| 177 | unsigned int regulator_get_mode(struct regulator *regulator); | 177 | unsigned int regulator_get_mode(struct regulator *regulator); |
| 178 | int regulator_set_optimum_mode(struct regulator *regulator, int load_uA); | 178 | int regulator_set_optimum_mode(struct regulator *regulator, int load_uA); |
| 179 | 179 | ||
| 180 | int regulator_allow_bypass(struct regulator *regulator, bool allow); | ||
| 181 | |||
| 180 | /* regulator notifier block */ | 182 | /* regulator notifier block */ |
| 181 | int regulator_register_notifier(struct regulator *regulator, | 183 | int regulator_register_notifier(struct regulator *regulator, |
| 182 | struct notifier_block *nb); | 184 | struct notifier_block *nb); |
| @@ -328,6 +330,12 @@ static inline int regulator_set_optimum_mode(struct regulator *regulator, | |||
| 328 | return REGULATOR_MODE_NORMAL; | 330 | return REGULATOR_MODE_NORMAL; |
| 329 | } | 331 | } |
| 330 | 332 | ||
| 333 | static inline int regulator_allow_bypass(struct regulator *regulator, | ||
| 334 | bool allow) | ||
| 335 | { | ||
| 336 | return 0; | ||
| 337 | } | ||
| 338 | |||
| 331 | static inline int regulator_register_notifier(struct regulator *regulator, | 339 | static inline int regulator_register_notifier(struct regulator *regulator, |
| 332 | struct notifier_block *nb) | 340 | struct notifier_block *nb) |
| 333 | { | 341 | { |
| @@ -352,4 +360,11 @@ static inline void regulator_set_drvdata(struct regulator *regulator, | |||
| 352 | 360 | ||
| 353 | #endif | 361 | #endif |
| 354 | 362 | ||
| 363 | static inline int regulator_set_voltage_tol(struct regulator *regulator, | ||
| 364 | int new_uV, int tol_uV) | ||
| 365 | { | ||
| 366 | return regulator_set_voltage(regulator, | ||
| 367 | new_uV - tol_uV, new_uV + tol_uV); | ||
| 368 | } | ||
| 369 | |||
| 355 | #endif | 370 | #endif |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index bac4c871f3bd..7932a3bf21bd 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
| @@ -32,6 +32,8 @@ enum regulator_status { | |||
| 32 | REGULATOR_STATUS_NORMAL, | 32 | REGULATOR_STATUS_NORMAL, |
| 33 | REGULATOR_STATUS_IDLE, | 33 | REGULATOR_STATUS_IDLE, |
| 34 | REGULATOR_STATUS_STANDBY, | 34 | REGULATOR_STATUS_STANDBY, |
| 35 | /* The regulator is enabled but not regulating */ | ||
| 36 | REGULATOR_STATUS_BYPASS, | ||
| 35 | /* in case that any other status doesn't apply */ | 37 | /* in case that any other status doesn't apply */ |
| 36 | REGULATOR_STATUS_UNDEFINED, | 38 | REGULATOR_STATUS_UNDEFINED, |
| 37 | }; | 39 | }; |
| @@ -58,6 +60,7 @@ enum regulator_status { | |||
| 58 | * regulator_desc.n_voltages. Voltages may be reported in any order. | 60 | * regulator_desc.n_voltages. Voltages may be reported in any order. |
| 59 | * | 61 | * |
| 60 | * @set_current_limit: Configure a limit for a current-limited regulator. | 62 | * @set_current_limit: Configure a limit for a current-limited regulator. |
| 63 | * The driver should select the current closest to max_uA. | ||
| 61 | * @get_current_limit: Get the configured limit for a current-limited regulator. | 64 | * @get_current_limit: Get the configured limit for a current-limited regulator. |
| 62 | * | 65 | * |
| 63 | * @set_mode: Set the configured operating mode for the regulator. | 66 | * @set_mode: Set the configured operating mode for the regulator. |
| @@ -67,6 +70,9 @@ enum regulator_status { | |||
| 67 | * @get_optimum_mode: Get the most efficient operating mode for the regulator | 70 | * @get_optimum_mode: Get the most efficient operating mode for the regulator |
| 68 | * when running with the specified parameters. | 71 | * when running with the specified parameters. |
| 69 | * | 72 | * |
| 73 | * @set_bypass: Set the regulator in bypass mode. | ||
| 74 | * @get_bypass: Get the regulator bypass mode state. | ||
| 75 | * | ||
| 70 | * @enable_time: Time taken for the regulator voltage output voltage to | 76 | * @enable_time: Time taken for the regulator voltage output voltage to |
| 71 | * stabilise after being enabled, in microseconds. | 77 | * stabilise after being enabled, in microseconds. |
| 72 | * @set_ramp_delay: Set the ramp delay for the regulator. The driver should | 78 | * @set_ramp_delay: Set the ramp delay for the regulator. The driver should |
| @@ -133,6 +139,10 @@ struct regulator_ops { | |||
| 133 | unsigned int (*get_optimum_mode) (struct regulator_dev *, int input_uV, | 139 | unsigned int (*get_optimum_mode) (struct regulator_dev *, int input_uV, |
| 134 | int output_uV, int load_uA); | 140 | int output_uV, int load_uA); |
| 135 | 141 | ||
| 142 | /* control and report on bypass mode */ | ||
| 143 | int (*set_bypass)(struct regulator_dev *dev, bool enable); | ||
| 144 | int (*get_bypass)(struct regulator_dev *dev, bool *enable); | ||
| 145 | |||
| 136 | /* the operations below are for configuration of regulator state when | 146 | /* the operations below are for configuration of regulator state when |
| 137 | * its parent PMIC enters a global STANDBY/HIBERNATE state */ | 147 | * its parent PMIC enters a global STANDBY/HIBERNATE state */ |
| 138 | 148 | ||
| @@ -205,6 +215,8 @@ struct regulator_desc { | |||
| 205 | unsigned int vsel_mask; | 215 | unsigned int vsel_mask; |
| 206 | unsigned int enable_reg; | 216 | unsigned int enable_reg; |
| 207 | unsigned int enable_mask; | 217 | unsigned int enable_mask; |
| 218 | unsigned int bypass_reg; | ||
| 219 | unsigned int bypass_mask; | ||
| 208 | 220 | ||
| 209 | unsigned int enable_time; | 221 | unsigned int enable_time; |
| 210 | }; | 222 | }; |
| @@ -221,7 +233,8 @@ struct regulator_desc { | |||
| 221 | * @driver_data: private regulator data | 233 | * @driver_data: private regulator data |
| 222 | * @of_node: OpenFirmware node to parse for device tree bindings (may be | 234 | * @of_node: OpenFirmware node to parse for device tree bindings (may be |
| 223 | * NULL). | 235 | * NULL). |
| 224 | * @regmap: regmap to use for core regmap helpers | 236 | * @regmap: regmap to use for core regmap helpers if dev_get_regulator() is |
| 237 | * insufficient. | ||
| 225 | * @ena_gpio: GPIO controlling regulator enable. | 238 | * @ena_gpio: GPIO controlling regulator enable. |
| 226 | * @ena_gpio_invert: Sense for GPIO enable control. | 239 | * @ena_gpio_invert: Sense for GPIO enable control. |
| 227 | * @ena_gpio_flags: Flags to use when calling gpio_request_one() | 240 | * @ena_gpio_flags: Flags to use when calling gpio_request_one() |
| @@ -253,6 +266,7 @@ struct regulator_dev { | |||
| 253 | int exclusive; | 266 | int exclusive; |
| 254 | u32 use_count; | 267 | u32 use_count; |
| 255 | u32 open_count; | 268 | u32 open_count; |
| 269 | u32 bypass_count; | ||
| 256 | 270 | ||
| 257 | /* lists we belong to */ | 271 | /* lists we belong to */ |
| 258 | struct list_head list; /* list of all regulators */ | 272 | struct list_head list; /* list of all regulators */ |
| @@ -310,6 +324,8 @@ int regulator_disable_regmap(struct regulator_dev *rdev); | |||
| 310 | int regulator_set_voltage_time_sel(struct regulator_dev *rdev, | 324 | int regulator_set_voltage_time_sel(struct regulator_dev *rdev, |
| 311 | unsigned int old_selector, | 325 | unsigned int old_selector, |
| 312 | unsigned int new_selector); | 326 | unsigned int new_selector); |
| 327 | int regulator_set_bypass_regmap(struct regulator_dev *rdev, bool enable); | ||
| 328 | int regulator_get_bypass_regmap(struct regulator_dev *rdev, bool *enable); | ||
| 313 | 329 | ||
| 314 | void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); | 330 | void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); |
| 315 | 331 | ||
diff --git a/include/linux/regulator/fan53555.h b/include/linux/regulator/fan53555.h new file mode 100644 index 000000000000..5c45c85d52ca --- /dev/null +++ b/include/linux/regulator/fan53555.h | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | /* | ||
| 2 | * fan53555.h - Fairchild Regulator FAN53555 Driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Marvell Technology Ltd. | ||
| 5 | * Yunfan Zhang <yfzhang@marvell.com> | ||
| 6 | * | ||
| 7 | * This package 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 | |||
| 13 | #ifndef __FAN53555_H__ | ||
| 14 | |||
| 15 | /* VSEL ID */ | ||
| 16 | enum { | ||
| 17 | FAN53555_VSEL_ID_0 = 0, | ||
| 18 | FAN53555_VSEL_ID_1, | ||
| 19 | }; | ||
| 20 | |||
| 21 | /* Transition slew rate limiting from a low to high voltage. | ||
| 22 | * ----------------------- | ||
| 23 | * Bin |Slew Rate(mV/uS) | ||
| 24 | * ------|---------------- | ||
| 25 | * 000 | 64.00 | ||
| 26 | * ------|---------------- | ||
| 27 | * 001 | 32.00 | ||
| 28 | * ------|---------------- | ||
| 29 | * 010 | 16.00 | ||
| 30 | * ------|---------------- | ||
| 31 | * 011 | 8.00 | ||
| 32 | * ------|---------------- | ||
| 33 | * 100 | 4.00 | ||
| 34 | * ------|---------------- | ||
| 35 | * 101 | 2.00 | ||
| 36 | * ------|---------------- | ||
| 37 | * 110 | 1.00 | ||
| 38 | * ------|---------------- | ||
| 39 | * 111 | 0.50 | ||
| 40 | * ----------------------- | ||
| 41 | */ | ||
| 42 | enum { | ||
| 43 | FAN53555_SLEW_RATE_64MV = 0, | ||
| 44 | FAN53555_SLEW_RATE_32MV, | ||
| 45 | FAN53555_SLEW_RATE_16MV, | ||
| 46 | FAN53555_SLEW_RATE_8MV, | ||
| 47 | FAN53555_SLEW_RATE_4MV, | ||
| 48 | FAN53555_SLEW_RATE_2MV, | ||
| 49 | FAN53555_SLEW_RATE_1MV, | ||
| 50 | FAN53555_SLEW_RATE_0_5MV, | ||
| 51 | }; | ||
| 52 | |||
| 53 | struct fan53555_platform_data { | ||
| 54 | struct regulator_init_data *regulator; | ||
| 55 | unsigned int slew_rate; | ||
| 56 | /* Sleep VSEL ID */ | ||
| 57 | unsigned int sleep_vsel_id; | ||
| 58 | }; | ||
| 59 | |||
| 60 | #endif /* __FAN53555_H__ */ | ||
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 40dd0a394cfa..36adbc82de6a 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
| @@ -32,6 +32,7 @@ struct regulator; | |||
| 32 | * board/machine. | 32 | * board/machine. |
| 33 | * STATUS: Regulator can be enabled and disabled. | 33 | * STATUS: Regulator can be enabled and disabled. |
| 34 | * DRMS: Dynamic Regulator Mode Switching is enabled for this regulator. | 34 | * DRMS: Dynamic Regulator Mode Switching is enabled for this regulator. |
| 35 | * BYPASS: Regulator can be put into bypass mode | ||
| 35 | */ | 36 | */ |
| 36 | 37 | ||
| 37 | #define REGULATOR_CHANGE_VOLTAGE 0x1 | 38 | #define REGULATOR_CHANGE_VOLTAGE 0x1 |
| @@ -39,6 +40,7 @@ struct regulator; | |||
| 39 | #define REGULATOR_CHANGE_MODE 0x4 | 40 | #define REGULATOR_CHANGE_MODE 0x4 |
| 40 | #define REGULATOR_CHANGE_STATUS 0x8 | 41 | #define REGULATOR_CHANGE_STATUS 0x8 |
| 41 | #define REGULATOR_CHANGE_DRMS 0x10 | 42 | #define REGULATOR_CHANGE_DRMS 0x10 |
| 43 | #define REGULATOR_CHANGE_BYPASS 0x20 | ||
| 42 | 44 | ||
| 43 | /** | 45 | /** |
| 44 | * struct regulator_state - regulator state during low power system states | 46 | * struct regulator_state - regulator state during low power system states |
diff --git a/include/linux/sc26198.h b/include/linux/sc26198.h deleted file mode 100644 index 7ca35abad387..000000000000 --- a/include/linux/sc26198.h +++ /dev/null | |||
| @@ -1,533 +0,0 @@ | |||
| 1 | /*****************************************************************************/ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * sc26198.h -- SC26198 UART hardware info. | ||
| 5 | * | ||
| 6 | * Copyright (C) 1995-1998 Stallion Technologies | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 21 | */ | ||
| 22 | |||
| 23 | /*****************************************************************************/ | ||
| 24 | #ifndef _SC26198_H | ||
| 25 | #define _SC26198_H | ||
| 26 | /*****************************************************************************/ | ||
| 27 | |||
| 28 | /* | ||
| 29 | * Define the number of async ports per sc26198 uart device. | ||
| 30 | */ | ||
| 31 | #define SC26198_PORTS 8 | ||
| 32 | |||
| 33 | /* | ||
| 34 | * Baud rate timing clocks. All derived from a master 14.7456 MHz clock. | ||
| 35 | */ | ||
| 36 | #define SC26198_MASTERCLOCK 14745600L | ||
| 37 | #define SC26198_DCLK (SC26198_MASTERCLOCK) | ||
| 38 | #define SC26198_CCLK (SC26198_MASTERCLOCK / 2) | ||
| 39 | #define SC26198_BCLK (SC26198_MASTERCLOCK / 4) | ||
| 40 | |||
| 41 | /* | ||
| 42 | * Define internal FIFO sizes for the 26198 ports. | ||
| 43 | */ | ||
| 44 | #define SC26198_TXFIFOSIZE 16 | ||
| 45 | #define SC26198_RXFIFOSIZE 16 | ||
| 46 | |||
| 47 | /*****************************************************************************/ | ||
| 48 | |||
| 49 | /* | ||
| 50 | * Global register definitions. These registers are global to each 26198 | ||
| 51 | * device, not specific ports on it. | ||
| 52 | */ | ||
| 53 | #define TSTR 0x0d | ||
| 54 | #define GCCR 0x0f | ||
| 55 | #define ICR 0x1b | ||
| 56 | #define WDTRCR 0x1d | ||
| 57 | #define IVR 0x1f | ||
| 58 | #define BRGTRUA 0x84 | ||
| 59 | #define GPOSR 0x87 | ||
| 60 | #define GPOC 0x8b | ||
| 61 | #define UCIR 0x8c | ||
| 62 | #define CIR 0x8c | ||
| 63 | #define BRGTRUB 0x8d | ||
| 64 | #define GRXFIFO 0x8e | ||
| 65 | #define GTXFIFO 0x8e | ||
| 66 | #define GCCR2 0x8f | ||
| 67 | #define BRGTRLA 0x94 | ||
| 68 | #define GPOR 0x97 | ||
| 69 | #define GPOD 0x9b | ||
| 70 | #define BRGTCR 0x9c | ||
| 71 | #define GICR 0x9c | ||
| 72 | #define BRGTRLB 0x9d | ||
| 73 | #define GIBCR 0x9d | ||
| 74 | #define GITR 0x9f | ||
| 75 | |||
| 76 | /* | ||
| 77 | * Per port channel registers. These are the register offsets within | ||
| 78 | * the port address space, so need to have the port address (0 to 7) | ||
| 79 | * inserted in bit positions 4:6. | ||
| 80 | */ | ||
| 81 | #define MR0 0x00 | ||
| 82 | #define MR1 0x01 | ||
| 83 | #define IOPCR 0x02 | ||
| 84 | #define BCRBRK 0x03 | ||
| 85 | #define BCRCOS 0x04 | ||
| 86 | #define BCRX 0x06 | ||
| 87 | #define BCRA 0x07 | ||
| 88 | #define XONCR 0x08 | ||
| 89 | #define XOFFCR 0x09 | ||
| 90 | #define ARCR 0x0a | ||
| 91 | #define RXCSR 0x0c | ||
| 92 | #define TXCSR 0x0e | ||
| 93 | #define MR2 0x80 | ||
| 94 | #define SR 0x81 | ||
| 95 | #define SCCR 0x81 | ||
| 96 | #define ISR 0x82 | ||
| 97 | #define IMR 0x82 | ||
| 98 | #define TXFIFO 0x83 | ||
| 99 | #define RXFIFO 0x83 | ||
| 100 | #define IPR 0x84 | ||
| 101 | #define IOPIOR 0x85 | ||
| 102 | #define XISR 0x86 | ||
| 103 | |||
| 104 | /* | ||
| 105 | * For any given port calculate the address to use to access a specified | ||
| 106 | * register. This is only used for unusual access, mostly this is done | ||
| 107 | * through the assembler access routines. | ||
| 108 | */ | ||
| 109 | #define SC26198_PORTREG(port,reg) ((((port) & 0x07) << 4) | (reg)) | ||
| 110 | |||
| 111 | /*****************************************************************************/ | ||
| 112 | |||
| 113 | /* | ||
| 114 | * Global configuration control register bit definitions. | ||
| 115 | */ | ||
| 116 | #define GCCR_NOACK 0x00 | ||
| 117 | #define GCCR_IVRACK 0x02 | ||
| 118 | #define GCCR_IVRCHANACK 0x04 | ||
| 119 | #define GCCR_IVRTYPCHANACK 0x06 | ||
| 120 | #define GCCR_ASYNCCYCLE 0x00 | ||
| 121 | #define GCCR_SYNCCYCLE 0x40 | ||
| 122 | |||
| 123 | /*****************************************************************************/ | ||
| 124 | |||
| 125 | /* | ||
| 126 | * Mode register 0 bit definitions. | ||
| 127 | */ | ||
| 128 | #define MR0_ADDRNONE 0x00 | ||
| 129 | #define MR0_AUTOWAKE 0x01 | ||
| 130 | #define MR0_AUTODOZE 0x02 | ||
| 131 | #define MR0_AUTOWAKEDOZE 0x03 | ||
| 132 | #define MR0_SWFNONE 0x00 | ||
| 133 | #define MR0_SWFTX 0x04 | ||
| 134 | #define MR0_SWFRX 0x08 | ||
| 135 | #define MR0_SWFRXTX 0x0c | ||
| 136 | #define MR0_TXMASK 0x30 | ||
| 137 | #define MR0_TXEMPTY 0x00 | ||
| 138 | #define MR0_TXHIGH 0x10 | ||
| 139 | #define MR0_TXHALF 0x20 | ||
| 140 | #define MR0_TXRDY 0x00 | ||
| 141 | #define MR0_ADDRNT 0x00 | ||
| 142 | #define MR0_ADDRT 0x40 | ||
| 143 | #define MR0_SWFNT 0x00 | ||
| 144 | #define MR0_SWFT 0x80 | ||
| 145 | |||
| 146 | /* | ||
| 147 | * Mode register 1 bit definitions. | ||
| 148 | */ | ||
| 149 | #define MR1_CS5 0x00 | ||
| 150 | #define MR1_CS6 0x01 | ||
| 151 | #define MR1_CS7 0x02 | ||
| 152 | #define MR1_CS8 0x03 | ||
| 153 | #define MR1_PAREVEN 0x00 | ||
| 154 | #define MR1_PARODD 0x04 | ||
| 155 | #define MR1_PARENB 0x00 | ||
| 156 | #define MR1_PARFORCE 0x08 | ||
| 157 | #define MR1_PARNONE 0x10 | ||
| 158 | #define MR1_PARSPECIAL 0x18 | ||
| 159 | #define MR1_ERRCHAR 0x00 | ||
| 160 | #define MR1_ERRBLOCK 0x20 | ||
| 161 | #define MR1_ISRUNMASKED 0x00 | ||
| 162 | #define MR1_ISRMASKED 0x40 | ||
| 163 | #define MR1_AUTORTS 0x80 | ||
| 164 | |||
| 165 | /* | ||
| 166 | * Mode register 2 bit definitions. | ||
| 167 | */ | ||
| 168 | #define MR2_STOP1 0x00 | ||
| 169 | #define MR2_STOP15 0x01 | ||
| 170 | #define MR2_STOP2 0x02 | ||
| 171 | #define MR2_STOP916 0x03 | ||
| 172 | #define MR2_RXFIFORDY 0x00 | ||
| 173 | #define MR2_RXFIFOHALF 0x04 | ||
| 174 | #define MR2_RXFIFOHIGH 0x08 | ||
| 175 | #define MR2_RXFIFOFULL 0x0c | ||
| 176 | #define MR2_AUTOCTS 0x10 | ||
| 177 | #define MR2_TXRTS 0x20 | ||
| 178 | #define MR2_MODENORM 0x00 | ||
| 179 | #define MR2_MODEAUTOECHO 0x40 | ||
| 180 | #define MR2_MODELOOP 0x80 | ||
| 181 | #define MR2_MODEREMECHO 0xc0 | ||
| 182 | |||
| 183 | /*****************************************************************************/ | ||
| 184 | |||
| 185 | /* | ||
| 186 | * Baud Rate Generator (BRG) selector values. | ||
| 187 | */ | ||
| 188 | #define BRG_50 0x00 | ||
| 189 | #define BRG_75 0x01 | ||
| 190 | #define BRG_150 0x02 | ||
| 191 | #define BRG_200 0x03 | ||
| 192 | #define BRG_300 0x04 | ||
| 193 | #define BRG_450 0x05 | ||
| 194 | #define BRG_600 0x06 | ||
| 195 | #define BRG_900 0x07 | ||
| 196 | #define BRG_1200 0x08 | ||
| 197 | #define BRG_1800 0x09 | ||
| 198 | #define BRG_2400 0x0a | ||
| 199 | #define BRG_3600 0x0b | ||
| 200 | #define BRG_4800 0x0c | ||
| 201 | #define BRG_7200 0x0d | ||
| 202 | #define BRG_9600 0x0e | ||
| 203 | #define BRG_14400 0x0f | ||
| 204 | #define BRG_19200 0x10 | ||
| 205 | #define BRG_28200 0x11 | ||
| 206 | #define BRG_38400 0x12 | ||
| 207 | #define BRG_57600 0x13 | ||
| 208 | #define BRG_115200 0x14 | ||
| 209 | #define BRG_230400 0x15 | ||
| 210 | #define BRG_GIN0 0x16 | ||
| 211 | #define BRG_GIN1 0x17 | ||
| 212 | #define BRG_CT0 0x18 | ||
| 213 | #define BRG_CT1 0x19 | ||
| 214 | #define BRG_RX2TX316 0x1b | ||
| 215 | #define BRG_RX2TX31 0x1c | ||
| 216 | |||
| 217 | #define SC26198_MAXBAUD 921600 | ||
| 218 | |||
| 219 | /*****************************************************************************/ | ||
| 220 | |||
| 221 | /* | ||
| 222 | * Command register command definitions. | ||
| 223 | */ | ||
| 224 | #define CR_NULL 0x04 | ||
| 225 | #define CR_ADDRNORMAL 0x0c | ||
| 226 | #define CR_RXRESET 0x14 | ||
| 227 | #define CR_TXRESET 0x1c | ||
| 228 | #define CR_CLEARRXERR 0x24 | ||
| 229 | #define CR_BREAKRESET 0x2c | ||
| 230 | #define CR_TXSTARTBREAK 0x34 | ||
| 231 | #define CR_TXSTOPBREAK 0x3c | ||
| 232 | #define CR_RTSON 0x44 | ||
| 233 | #define CR_RTSOFF 0x4c | ||
| 234 | #define CR_ADDRINIT 0x5c | ||
| 235 | #define CR_RXERRBLOCK 0x6c | ||
| 236 | #define CR_TXSENDXON 0x84 | ||
| 237 | #define CR_TXSENDXOFF 0x8c | ||
| 238 | #define CR_GANGXONSET 0x94 | ||
| 239 | #define CR_GANGXOFFSET 0x9c | ||
| 240 | #define CR_GANGXONINIT 0xa4 | ||
| 241 | #define CR_GANGXOFFINIT 0xac | ||
| 242 | #define CR_HOSTXON 0xb4 | ||
| 243 | #define CR_HOSTXOFF 0xbc | ||
| 244 | #define CR_CANCELXOFF 0xc4 | ||
| 245 | #define CR_ADDRRESET 0xdc | ||
| 246 | #define CR_RESETALLPORTS 0xf4 | ||
| 247 | #define CR_RESETALL 0xfc | ||
| 248 | |||
| 249 | #define CR_RXENABLE 0x01 | ||
| 250 | #define CR_TXENABLE 0x02 | ||
| 251 | |||
| 252 | /*****************************************************************************/ | ||
| 253 | |||
| 254 | /* | ||
| 255 | * Channel status register. | ||
| 256 | */ | ||
| 257 | #define SR_RXRDY 0x01 | ||
| 258 | #define SR_RXFULL 0x02 | ||
| 259 | #define SR_TXRDY 0x04 | ||
| 260 | #define SR_TXEMPTY 0x08 | ||
| 261 | #define SR_RXOVERRUN 0x10 | ||
| 262 | #define SR_RXPARITY 0x20 | ||
| 263 | #define SR_RXFRAMING 0x40 | ||
| 264 | #define SR_RXBREAK 0x80 | ||
| 265 | |||
| 266 | #define SR_RXERRS (SR_RXPARITY | SR_RXFRAMING | SR_RXOVERRUN) | ||
| 267 | |||
| 268 | /*****************************************************************************/ | ||
| 269 | |||
| 270 | /* | ||
| 271 | * Interrupt status register and interrupt mask register bit definitions. | ||
| 272 | */ | ||
| 273 | #define IR_TXRDY 0x01 | ||
| 274 | #define IR_RXRDY 0x02 | ||
| 275 | #define IR_RXBREAK 0x04 | ||
| 276 | #define IR_XONXOFF 0x10 | ||
| 277 | #define IR_ADDRRECOG 0x20 | ||
| 278 | #define IR_RXWATCHDOG 0x40 | ||
| 279 | #define IR_IOPORT 0x80 | ||
| 280 | |||
| 281 | /*****************************************************************************/ | ||
| 282 | |||
| 283 | /* | ||
| 284 | * Interrupt vector register field definitions. | ||
| 285 | */ | ||
| 286 | #define IVR_CHANMASK 0x07 | ||
| 287 | #define IVR_TYPEMASK 0x18 | ||
| 288 | #define IVR_CONSTMASK 0xc0 | ||
| 289 | |||
| 290 | #define IVR_RXDATA 0x10 | ||
| 291 | #define IVR_RXBADDATA 0x18 | ||
| 292 | #define IVR_TXDATA 0x08 | ||
| 293 | #define IVR_OTHER 0x00 | ||
| 294 | |||
| 295 | /*****************************************************************************/ | ||
| 296 | |||
| 297 | /* | ||
| 298 | * BRG timer control register bit definitions. | ||
| 299 | */ | ||
| 300 | #define BRGCTCR_DISABCLK0 0x00 | ||
| 301 | #define BRGCTCR_ENABCLK0 0x08 | ||
| 302 | #define BRGCTCR_DISABCLK1 0x00 | ||
| 303 | #define BRGCTCR_ENABCLK1 0x80 | ||
| 304 | |||
| 305 | #define BRGCTCR_0SCLK16 0x00 | ||
| 306 | #define BRGCTCR_0SCLK32 0x01 | ||
| 307 | #define BRGCTCR_0SCLK64 0x02 | ||
| 308 | #define BRGCTCR_0SCLK128 0x03 | ||
| 309 | #define BRGCTCR_0X1 0x04 | ||
| 310 | #define BRGCTCR_0X12 0x05 | ||
| 311 | #define BRGCTCR_0IO1A 0x06 | ||
| 312 | #define BRGCTCR_0GIN0 0x07 | ||
| 313 | |||
| 314 | #define BRGCTCR_1SCLK16 0x00 | ||
| 315 | #define BRGCTCR_1SCLK32 0x10 | ||
| 316 | #define BRGCTCR_1SCLK64 0x20 | ||
| 317 | #define BRGCTCR_1SCLK128 0x30 | ||
| 318 | #define BRGCTCR_1X1 0x40 | ||
| 319 | #define BRGCTCR_1X12 0x50 | ||
| 320 | #define BRGCTCR_1IO1B 0x60 | ||
| 321 | #define BRGCTCR_1GIN1 0x70 | ||
| 322 | |||
| 323 | /*****************************************************************************/ | ||
| 324 | |||
| 325 | /* | ||
| 326 | * Watch dog timer enable register. | ||
| 327 | */ | ||
| 328 | #define WDTRCR_ENABALL 0xff | ||
| 329 | |||
| 330 | /*****************************************************************************/ | ||
| 331 | |||
| 332 | /* | ||
| 333 | * XON/XOFF interrupt status register. | ||
| 334 | */ | ||
| 335 | #define XISR_TXCHARMASK 0x03 | ||
| 336 | #define XISR_TXCHARNORMAL 0x00 | ||
| 337 | #define XISR_TXWAIT 0x01 | ||
| 338 | #define XISR_TXXOFFPEND 0x02 | ||
| 339 | #define XISR_TXXONPEND 0x03 | ||
| 340 | |||
| 341 | #define XISR_TXFLOWMASK 0x0c | ||
| 342 | #define XISR_TXNORMAL 0x00 | ||
| 343 | #define XISR_TXSTOPPEND 0x04 | ||
| 344 | #define XISR_TXSTARTED 0x08 | ||
| 345 | #define XISR_TXSTOPPED 0x0c | ||
| 346 | |||
| 347 | #define XISR_RXFLOWMASK 0x30 | ||
| 348 | #define XISR_RXFLOWNONE 0x00 | ||
| 349 | #define XISR_RXXONSENT 0x10 | ||
| 350 | #define XISR_RXXOFFSENT 0x20 | ||
| 351 | |||
| 352 | #define XISR_RXXONGOT 0x40 | ||
| 353 | #define XISR_RXXOFFGOT 0x80 | ||
| 354 | |||
| 355 | /*****************************************************************************/ | ||
| 356 | |||
| 357 | /* | ||
| 358 | * Current interrupt register. | ||
| 359 | */ | ||
| 360 | #define CIR_TYPEMASK 0xc0 | ||
| 361 | #define CIR_TYPEOTHER 0x00 | ||
| 362 | #define CIR_TYPETX 0x40 | ||
| 363 | #define CIR_TYPERXGOOD 0x80 | ||
| 364 | #define CIR_TYPERXBAD 0xc0 | ||
| 365 | |||
| 366 | #define CIR_RXDATA 0x80 | ||
| 367 | #define CIR_RXBADDATA 0x40 | ||
| 368 | #define CIR_TXDATA 0x40 | ||
| 369 | |||
| 370 | #define CIR_CHANMASK 0x07 | ||
| 371 | #define CIR_CNTMASK 0x38 | ||
| 372 | |||
| 373 | #define CIR_SUBTYPEMASK 0x38 | ||
| 374 | #define CIR_SUBNONE 0x00 | ||
| 375 | #define CIR_SUBCOS 0x08 | ||
| 376 | #define CIR_SUBADDR 0x10 | ||
| 377 | #define CIR_SUBXONXOFF 0x18 | ||
| 378 | #define CIR_SUBBREAK 0x28 | ||
| 379 | |||
| 380 | /*****************************************************************************/ | ||
| 381 | |||
| 382 | /* | ||
| 383 | * Global interrupting channel register. | ||
| 384 | */ | ||
| 385 | #define GICR_CHANMASK 0x07 | ||
| 386 | |||
| 387 | /*****************************************************************************/ | ||
| 388 | |||
| 389 | /* | ||
| 390 | * Global interrupting byte count register. | ||
| 391 | */ | ||
| 392 | #define GICR_COUNTMASK 0x0f | ||
| 393 | |||
| 394 | /*****************************************************************************/ | ||
| 395 | |||
| 396 | /* | ||
| 397 | * Global interrupting type register. | ||
| 398 | */ | ||
| 399 | #define GITR_RXMASK 0xc0 | ||
| 400 | #define GITR_RXNONE 0x00 | ||
| 401 | #define GITR_RXBADDATA 0x80 | ||
| 402 | #define GITR_RXGOODDATA 0xc0 | ||
| 403 | #define GITR_TXDATA 0x20 | ||
| 404 | |||
| 405 | #define GITR_SUBTYPEMASK 0x07 | ||
| 406 | #define GITR_SUBNONE 0x00 | ||
| 407 | #define GITR_SUBCOS 0x01 | ||
| 408 | #define GITR_SUBADDR 0x02 | ||
| 409 | #define GITR_SUBXONXOFF 0x03 | ||
| 410 | #define GITR_SUBBREAK 0x05 | ||
| 411 | |||
| 412 | /*****************************************************************************/ | ||
| 413 | |||
| 414 | /* | ||
| 415 | * Input port change register. | ||
| 416 | */ | ||
| 417 | #define IPR_CTS 0x01 | ||
| 418 | #define IPR_DTR 0x02 | ||
| 419 | #define IPR_RTS 0x04 | ||
| 420 | #define IPR_DCD 0x08 | ||
| 421 | #define IPR_CTSCHANGE 0x10 | ||
| 422 | #define IPR_DTRCHANGE 0x20 | ||
| 423 | #define IPR_RTSCHANGE 0x40 | ||
| 424 | #define IPR_DCDCHANGE 0x80 | ||
| 425 | |||
| 426 | #define IPR_CHANGEMASK 0xf0 | ||
| 427 | |||
| 428 | /*****************************************************************************/ | ||
| 429 | |||
| 430 | /* | ||
| 431 | * IO port interrupt and output register. | ||
| 432 | */ | ||
| 433 | #define IOPR_CTS 0x01 | ||
| 434 | #define IOPR_DTR 0x02 | ||
| 435 | #define IOPR_RTS 0x04 | ||
| 436 | #define IOPR_DCD 0x08 | ||
| 437 | #define IOPR_CTSCOS 0x10 | ||
| 438 | #define IOPR_DTRCOS 0x20 | ||
| 439 | #define IOPR_RTSCOS 0x40 | ||
| 440 | #define IOPR_DCDCOS 0x80 | ||
| 441 | |||
| 442 | /*****************************************************************************/ | ||
| 443 | |||
| 444 | /* | ||
| 445 | * IO port configuration register. | ||
| 446 | */ | ||
| 447 | #define IOPCR_SETCTS 0x00 | ||
| 448 | #define IOPCR_SETDTR 0x04 | ||
| 449 | #define IOPCR_SETRTS 0x10 | ||
| 450 | #define IOPCR_SETDCD 0x00 | ||
| 451 | |||
| 452 | #define IOPCR_SETSIGS (IOPCR_SETRTS | IOPCR_SETRTS | IOPCR_SETDTR | IOPCR_SETDCD) | ||
| 453 | |||
| 454 | /*****************************************************************************/ | ||
| 455 | |||
| 456 | /* | ||
| 457 | * General purpose output select register. | ||
| 458 | */ | ||
| 459 | #define GPORS_TXC1XA 0x08 | ||
| 460 | #define GPORS_TXC16XA 0x09 | ||
| 461 | #define GPORS_RXC16XA 0x0a | ||
| 462 | #define GPORS_TXC16XB 0x0b | ||
| 463 | #define GPORS_GPOR3 0x0c | ||
| 464 | #define GPORS_GPOR2 0x0d | ||
| 465 | #define GPORS_GPOR1 0x0e | ||
| 466 | #define GPORS_GPOR0 0x0f | ||
| 467 | |||
| 468 | /*****************************************************************************/ | ||
| 469 | |||
| 470 | /* | ||
| 471 | * General purpose output register. | ||
| 472 | */ | ||
| 473 | #define GPOR_0 0x01 | ||
| 474 | #define GPOR_1 0x02 | ||
| 475 | #define GPOR_2 0x04 | ||
| 476 | #define GPOR_3 0x08 | ||
| 477 | |||
| 478 | /*****************************************************************************/ | ||
| 479 | |||
| 480 | /* | ||
| 481 | * General purpose output clock register. | ||
| 482 | */ | ||
| 483 | #define GPORC_0NONE 0x00 | ||
| 484 | #define GPORC_0GIN0 0x01 | ||
| 485 | #define GPORC_0GIN1 0x02 | ||
| 486 | #define GPORC_0IO3A 0x02 | ||
| 487 | |||
| 488 | #define GPORC_1NONE 0x00 | ||
| 489 | #define GPORC_1GIN0 0x04 | ||
| 490 | #define GPORC_1GIN1 0x08 | ||
| 491 | #define GPORC_1IO3C 0x0c | ||
| 492 | |||
| 493 | #define GPORC_2NONE 0x00 | ||
| 494 | #define GPORC_2GIN0 0x10 | ||
| 495 | #define GPORC_2GIN1 0x20 | ||
| 496 | #define GPORC_2IO3E 0x20 | ||
| 497 | |||
| 498 | #define GPORC_3NONE 0x00 | ||
| 499 | #define GPORC_3GIN0 0x40 | ||
| 500 | #define GPORC_3GIN1 0x80 | ||
| 501 | #define GPORC_3IO3G 0xc0 | ||
| 502 | |||
| 503 | /*****************************************************************************/ | ||
| 504 | |||
| 505 | /* | ||
| 506 | * General purpose output data register. | ||
| 507 | */ | ||
| 508 | #define GPOD_0MASK 0x03 | ||
| 509 | #define GPOD_0SET1 0x00 | ||
| 510 | #define GPOD_0SET0 0x01 | ||
| 511 | #define GPOD_0SETR0 0x02 | ||
| 512 | #define GPOD_0SETIO3B 0x03 | ||
| 513 | |||
| 514 | #define GPOD_1MASK 0x0c | ||
| 515 | #define GPOD_1SET1 0x00 | ||
| 516 | #define GPOD_1SET0 0x04 | ||
| 517 | #define GPOD_1SETR0 0x08 | ||
| 518 | #define GPOD_1SETIO3D 0x0c | ||
| 519 | |||
| 520 | #define GPOD_2MASK 0x30 | ||
| 521 | #define GPOD_2SET1 0x00 | ||
| 522 | #define GPOD_2SET0 0x10 | ||
| 523 | #define GPOD_2SETR0 0x20 | ||
| 524 | #define GPOD_2SETIO3F 0x30 | ||
| 525 | |||
| 526 | #define GPOD_3MASK 0xc0 | ||
| 527 | #define GPOD_3SET1 0x00 | ||
| 528 | #define GPOD_3SET0 0x40 | ||
| 529 | #define GPOD_3SETR0 0x80 | ||
| 530 | #define GPOD_3SETIO3H 0xc0 | ||
| 531 | |||
| 532 | /*****************************************************************************/ | ||
| 533 | #endif | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index b8c86648a2f9..765dffbb085e 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -273,11 +273,11 @@ extern void init_idle_bootup_task(struct task_struct *idle); | |||
| 273 | extern int runqueue_is_locked(int cpu); | 273 | extern int runqueue_is_locked(int cpu); |
| 274 | 274 | ||
| 275 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) | 275 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) |
| 276 | extern void select_nohz_load_balancer(int stop_tick); | 276 | extern void nohz_balance_enter_idle(int cpu); |
| 277 | extern void set_cpu_sd_state_idle(void); | 277 | extern void set_cpu_sd_state_idle(void); |
| 278 | extern int get_nohz_timer_target(void); | 278 | extern int get_nohz_timer_target(void); |
| 279 | #else | 279 | #else |
| 280 | static inline void select_nohz_load_balancer(int stop_tick) { } | 280 | static inline void nohz_balance_enter_idle(int cpu) { } |
| 281 | static inline void set_cpu_sd_state_idle(void) { } | 281 | static inline void set_cpu_sd_state_idle(void) { } |
| 282 | #endif | 282 | #endif |
| 283 | 283 | ||
| @@ -446,6 +446,9 @@ extern int get_dumpable(struct mm_struct *mm); | |||
| 446 | #define MMF_VM_HUGEPAGE 17 /* set when VM_HUGEPAGE is set on vma */ | 446 | #define MMF_VM_HUGEPAGE 17 /* set when VM_HUGEPAGE is set on vma */ |
| 447 | #define MMF_EXE_FILE_CHANGED 18 /* see prctl_set_mm_exe_file() */ | 447 | #define MMF_EXE_FILE_CHANGED 18 /* see prctl_set_mm_exe_file() */ |
| 448 | 448 | ||
| 449 | #define MMF_HAS_UPROBES 19 /* has uprobes */ | ||
| 450 | #define MMF_RECALC_UPROBES 20 /* MMF_HAS_UPROBES can be wrong */ | ||
| 451 | |||
| 449 | #define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK) | 452 | #define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK) |
| 450 | 453 | ||
| 451 | struct sighand_struct { | 454 | struct sighand_struct { |
| @@ -678,11 +681,6 @@ struct signal_struct { | |||
| 678 | * (notably. ptrace) */ | 681 | * (notably. ptrace) */ |
| 679 | }; | 682 | }; |
| 680 | 683 | ||
| 681 | /* Context switch must be unlocked if interrupts are to be enabled */ | ||
| 682 | #ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW | ||
| 683 | # define __ARCH_WANT_UNLOCKED_CTXSW | ||
| 684 | #endif | ||
| 685 | |||
| 686 | /* | 684 | /* |
| 687 | * Bits in flags field of signal_struct. | 685 | * Bits in flags field of signal_struct. |
| 688 | */ | 686 | */ |
| @@ -860,7 +858,6 @@ enum cpu_idle_type { | |||
| 860 | #define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ | 858 | #define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ |
| 861 | #define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */ | 859 | #define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */ |
| 862 | #define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ | 860 | #define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ |
| 863 | #define SD_PREFER_LOCAL 0x0040 /* Prefer to keep tasks local to this domain */ | ||
| 864 | #define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */ | 861 | #define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */ |
| 865 | #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ | 862 | #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ |
| 866 | #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ | 863 | #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ |
| @@ -954,7 +951,6 @@ struct sched_domain { | |||
| 954 | unsigned int smt_gain; | 951 | unsigned int smt_gain; |
| 955 | int flags; /* See SD_* */ | 952 | int flags; /* See SD_* */ |
| 956 | int level; | 953 | int level; |
| 957 | int idle_buddy; /* cpu assigned to select_idle_sibling() */ | ||
| 958 | 954 | ||
| 959 | /* Runtime fields. */ | 955 | /* Runtime fields. */ |
| 960 | unsigned long last_balance; /* init to jiffies. units in jiffies */ | 956 | unsigned long last_balance; /* init to jiffies. units in jiffies */ |
| @@ -1886,6 +1882,14 @@ static inline void rcu_copy_process(struct task_struct *p) | |||
| 1886 | 1882 | ||
| 1887 | #endif | 1883 | #endif |
| 1888 | 1884 | ||
| 1885 | static inline void rcu_switch(struct task_struct *prev, | ||
| 1886 | struct task_struct *next) | ||
| 1887 | { | ||
| 1888 | #ifdef CONFIG_RCU_USER_QS | ||
| 1889 | rcu_user_hooks_switch(prev, next); | ||
| 1890 | #endif | ||
| 1891 | } | ||
| 1892 | |||
| 1889 | static inline void tsk_restore_flags(struct task_struct *task, | 1893 | static inline void tsk_restore_flags(struct task_struct *task, |
| 1890 | unsigned long orig_flags, unsigned long flags) | 1894 | unsigned long orig_flags, unsigned long flags) |
| 1891 | { | 1895 | { |
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h index 899fbb487c94..fb3c5a8fef3d 100644 --- a/include/linux/screen_info.h +++ b/include/linux/screen_info.h | |||
| @@ -68,6 +68,8 @@ struct screen_info { | |||
| 68 | 68 | ||
| 69 | #define VIDEO_FLAGS_NOCURSOR (1 << 0) /* The video mode has no cursor set */ | 69 | #define VIDEO_FLAGS_NOCURSOR (1 << 0) /* The video mode has no cursor set */ |
| 70 | 70 | ||
| 71 | #define VIDEO_CAPABILITY_SKIP_QUIRKS (1 << 0) | ||
| 72 | |||
| 71 | #ifdef __KERNEL__ | 73 | #ifdef __KERNEL__ |
| 72 | extern struct screen_info screen_info; | 74 | extern struct screen_info screen_info; |
| 73 | 75 | ||
diff --git a/include/linux/security.h b/include/linux/security.h index 3dea6a9d568f..d143b8e01954 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -118,6 +118,7 @@ void reset_security_ops(void); | |||
| 118 | extern unsigned long mmap_min_addr; | 118 | extern unsigned long mmap_min_addr; |
| 119 | extern unsigned long dac_mmap_min_addr; | 119 | extern unsigned long dac_mmap_min_addr; |
| 120 | #else | 120 | #else |
| 121 | #define mmap_min_addr 0UL | ||
| 121 | #define dac_mmap_min_addr 0UL | 122 | #define dac_mmap_min_addr 0UL |
| 122 | #endif | 123 | #endif |
| 123 | 124 | ||
diff --git a/include/linux/serial.h b/include/linux/serial.h index 90e9f981358a..861e51de476b 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h | |||
| @@ -12,9 +12,12 @@ | |||
| 12 | 12 | ||
| 13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
| 14 | 14 | ||
| 15 | #include <linux/tty_flags.h> | ||
| 16 | |||
| 15 | #ifdef __KERNEL__ | 17 | #ifdef __KERNEL__ |
| 16 | #include <asm/page.h> | 18 | #include <asm/page.h> |
| 17 | 19 | ||
| 20 | |||
| 18 | /* | 21 | /* |
| 19 | * Counters of the input lines (CTS, DSR, RI, CD) interrupts | 22 | * Counters of the input lines (CTS, DSR, RI, CD) interrupts |
| 20 | */ | 23 | */ |
| @@ -83,89 +86,11 @@ struct serial_struct { | |||
| 83 | #define SERIAL_IO_HUB6 1 | 86 | #define SERIAL_IO_HUB6 1 |
| 84 | #define SERIAL_IO_MEM 2 | 87 | #define SERIAL_IO_MEM 2 |
| 85 | 88 | ||
| 86 | struct serial_uart_config { | ||
| 87 | char *name; | ||
| 88 | int dfl_xmit_fifo_size; | ||
| 89 | int flags; | ||
| 90 | }; | ||
| 91 | |||
| 92 | #define UART_CLEAR_FIFO 0x01 | 89 | #define UART_CLEAR_FIFO 0x01 |
| 93 | #define UART_USE_FIFO 0x02 | 90 | #define UART_USE_FIFO 0x02 |
| 94 | #define UART_STARTECH 0x04 | 91 | #define UART_STARTECH 0x04 |
| 95 | #define UART_NATSEMI 0x08 | 92 | #define UART_NATSEMI 0x08 |
| 96 | 93 | ||
| 97 | /* | ||
| 98 | * Definitions for async_struct (and serial_struct) flags field | ||
| 99 | * | ||
| 100 | * Define ASYNCB_* for convenient use with {test,set,clear}_bit. | ||
| 101 | */ | ||
| 102 | #define ASYNCB_HUP_NOTIFY 0 /* Notify getty on hangups and closes | ||
| 103 | * on the callout port */ | ||
| 104 | #define ASYNCB_FOURPORT 1 /* Set OU1, OUT2 per AST Fourport settings */ | ||
| 105 | #define ASYNCB_SAK 2 /* Secure Attention Key (Orange book) */ | ||
| 106 | #define ASYNCB_SPLIT_TERMIOS 3 /* Separate termios for dialin/callout */ | ||
| 107 | #define ASYNCB_SPD_HI 4 /* Use 56000 instead of 38400 bps */ | ||
| 108 | #define ASYNCB_SPD_VHI 5 /* Use 115200 instead of 38400 bps */ | ||
| 109 | #define ASYNCB_SKIP_TEST 6 /* Skip UART test during autoconfiguration */ | ||
| 110 | #define ASYNCB_AUTO_IRQ 7 /* Do automatic IRQ during | ||
| 111 | * autoconfiguration */ | ||
| 112 | #define ASYNCB_SESSION_LOCKOUT 8 /* Lock out cua opens based on session */ | ||
| 113 | #define ASYNCB_PGRP_LOCKOUT 9 /* Lock out cua opens based on pgrp */ | ||
| 114 | #define ASYNCB_CALLOUT_NOHUP 10 /* Don't do hangups for cua device */ | ||
| 115 | #define ASYNCB_HARDPPS_CD 11 /* Call hardpps when CD goes high */ | ||
| 116 | #define ASYNCB_SPD_SHI 12 /* Use 230400 instead of 38400 bps */ | ||
| 117 | #define ASYNCB_LOW_LATENCY 13 /* Request low latency behaviour */ | ||
| 118 | #define ASYNCB_BUGGY_UART 14 /* This is a buggy UART, skip some safety | ||
| 119 | * checks. Note: can be dangerous! */ | ||
| 120 | #define ASYNCB_AUTOPROBE 15 /* Port was autoprobed by PCI or PNP code */ | ||
| 121 | #define ASYNCB_LAST_USER 15 | ||
| 122 | |||
| 123 | /* Internal flags used only by kernel */ | ||
| 124 | #define ASYNCB_INITIALIZED 31 /* Serial port was initialized */ | ||
| 125 | #define ASYNCB_SUSPENDED 30 /* Serial port is suspended */ | ||
| 126 | #define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */ | ||
| 127 | #define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */ | ||
| 128 | #define ASYNCB_CLOSING 27 /* Serial port is closing */ | ||
| 129 | #define ASYNCB_CTS_FLOW 26 /* Do CTS flow control */ | ||
| 130 | #define ASYNCB_CHECK_CD 25 /* i.e., CLOCAL */ | ||
| 131 | #define ASYNCB_SHARE_IRQ 24 /* for multifunction cards, no longer used */ | ||
| 132 | #define ASYNCB_CONS_FLOW 23 /* flow control for console */ | ||
| 133 | #define ASYNCB_FIRST_KERNEL 22 | ||
| 134 | |||
| 135 | #define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY) | ||
| 136 | #define ASYNC_SUSPENDED (1U << ASYNCB_SUSPENDED) | ||
| 137 | #define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT) | ||
| 138 | #define ASYNC_SAK (1U << ASYNCB_SAK) | ||
| 139 | #define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS) | ||
| 140 | #define ASYNC_SPD_HI (1U << ASYNCB_SPD_HI) | ||
| 141 | #define ASYNC_SPD_VHI (1U << ASYNCB_SPD_VHI) | ||
| 142 | #define ASYNC_SKIP_TEST (1U << ASYNCB_SKIP_TEST) | ||
| 143 | #define ASYNC_AUTO_IRQ (1U << ASYNCB_AUTO_IRQ) | ||
| 144 | #define ASYNC_SESSION_LOCKOUT (1U << ASYNCB_SESSION_LOCKOUT) | ||
| 145 | #define ASYNC_PGRP_LOCKOUT (1U << ASYNCB_PGRP_LOCKOUT) | ||
| 146 | #define ASYNC_CALLOUT_NOHUP (1U << ASYNCB_CALLOUT_NOHUP) | ||
| 147 | #define ASYNC_HARDPPS_CD (1U << ASYNCB_HARDPPS_CD) | ||
| 148 | #define ASYNC_SPD_SHI (1U << ASYNCB_SPD_SHI) | ||
| 149 | #define ASYNC_LOW_LATENCY (1U << ASYNCB_LOW_LATENCY) | ||
| 150 | #define ASYNC_BUGGY_UART (1U << ASYNCB_BUGGY_UART) | ||
| 151 | #define ASYNC_AUTOPROBE (1U << ASYNCB_AUTOPROBE) | ||
| 152 | |||
| 153 | #define ASYNC_FLAGS ((1U << (ASYNCB_LAST_USER + 1)) - 1) | ||
| 154 | #define ASYNC_USR_MASK (ASYNC_SPD_MASK|ASYNC_CALLOUT_NOHUP| \ | ||
| 155 | ASYNC_LOW_LATENCY) | ||
| 156 | #define ASYNC_SPD_CUST (ASYNC_SPD_HI|ASYNC_SPD_VHI) | ||
| 157 | #define ASYNC_SPD_WARP (ASYNC_SPD_HI|ASYNC_SPD_SHI) | ||
| 158 | #define ASYNC_SPD_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI|ASYNC_SPD_SHI) | ||
| 159 | |||
| 160 | #define ASYNC_INITIALIZED (1U << ASYNCB_INITIALIZED) | ||
| 161 | #define ASYNC_NORMAL_ACTIVE (1U << ASYNCB_NORMAL_ACTIVE) | ||
| 162 | #define ASYNC_BOOT_AUTOCONF (1U << ASYNCB_BOOT_AUTOCONF) | ||
| 163 | #define ASYNC_CLOSING (1U << ASYNCB_CLOSING) | ||
| 164 | #define ASYNC_CTS_FLOW (1U << ASYNCB_CTS_FLOW) | ||
| 165 | #define ASYNC_CHECK_CD (1U << ASYNCB_CHECK_CD) | ||
| 166 | #define ASYNC_SHARE_IRQ (1U << ASYNCB_SHARE_IRQ) | ||
| 167 | #define ASYNC_CONS_FLOW (1U << ASYNCB_CONS_FLOW) | ||
| 168 | #define ASYNC_INTERNAL_FLAGS (~((1U << ASYNCB_FIRST_KERNEL) - 1)) | ||
| 169 | 94 | ||
| 170 | /* | 95 | /* |
| 171 | * Multiport serial configuration structure --- external structure | 96 | * Multiport serial configuration structure --- external structure |
diff --git a/include/linux/serial167.h b/include/linux/serial167.h deleted file mode 100644 index 59c81b708562..000000000000 --- a/include/linux/serial167.h +++ /dev/null | |||
| @@ -1,157 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * serial167.h | ||
| 3 | * | ||
| 4 | * Richard Hirst [richard@sleepie.demon.co.uk] | ||
| 5 | * | ||
| 6 | * Based on cyclades.h | ||
| 7 | */ | ||
| 8 | |||
| 9 | struct cyclades_monitor { | ||
| 10 | unsigned long int_count; | ||
| 11 | unsigned long char_count; | ||
| 12 | unsigned long char_max; | ||
| 13 | unsigned long char_last; | ||
| 14 | }; | ||
| 15 | |||
| 16 | /* | ||
| 17 | * This is our internal structure for each serial port's state. | ||
| 18 | * | ||
| 19 | * Many fields are paralleled by the structure used by the serial_struct | ||
| 20 | * structure. | ||
| 21 | * | ||
| 22 | * For definitions of the flags field, see tty.h | ||
| 23 | */ | ||
| 24 | |||
| 25 | struct cyclades_port { | ||
| 26 | int magic; | ||
| 27 | int type; | ||
| 28 | int card; | ||
| 29 | int line; | ||
| 30 | int flags; /* defined in tty.h */ | ||
| 31 | struct tty_struct *tty; | ||
| 32 | int read_status_mask; | ||
| 33 | int timeout; | ||
| 34 | int xmit_fifo_size; | ||
| 35 | int cor1,cor2,cor3,cor4,cor5,cor6,cor7; | ||
| 36 | int tbpr,tco,rbpr,rco; | ||
| 37 | int ignore_status_mask; | ||
| 38 | int close_delay; | ||
| 39 | int IER; /* Interrupt Enable Register */ | ||
| 40 | unsigned long last_active; | ||
| 41 | int count; /* # of fd on device */ | ||
| 42 | int x_char; /* to be pushed out ASAP */ | ||
| 43 | int x_break; | ||
| 44 | int blocked_open; /* # of blocked opens */ | ||
| 45 | unsigned char *xmit_buf; | ||
| 46 | int xmit_head; | ||
| 47 | int xmit_tail; | ||
| 48 | int xmit_cnt; | ||
| 49 | int default_threshold; | ||
| 50 | int default_timeout; | ||
| 51 | wait_queue_head_t open_wait; | ||
| 52 | wait_queue_head_t close_wait; | ||
| 53 | struct cyclades_monitor mon; | ||
| 54 | }; | ||
| 55 | |||
| 56 | #define CYCLADES_MAGIC 0x4359 | ||
| 57 | |||
| 58 | #define CYGETMON 0x435901 | ||
| 59 | #define CYGETTHRESH 0x435902 | ||
| 60 | #define CYSETTHRESH 0x435903 | ||
| 61 | #define CYGETDEFTHRESH 0x435904 | ||
| 62 | #define CYSETDEFTHRESH 0x435905 | ||
| 63 | #define CYGETTIMEOUT 0x435906 | ||
| 64 | #define CYSETTIMEOUT 0x435907 | ||
| 65 | #define CYGETDEFTIMEOUT 0x435908 | ||
| 66 | #define CYSETDEFTIMEOUT 0x435909 | ||
| 67 | |||
| 68 | #define CyMaxChipsPerCard 1 | ||
| 69 | |||
| 70 | /**** cd2401 registers ****/ | ||
| 71 | |||
| 72 | #define CyGFRCR (0x81) | ||
| 73 | #define CyCCR (0x13) | ||
| 74 | #define CyCLR_CHAN (0x40) | ||
| 75 | #define CyINIT_CHAN (0x20) | ||
| 76 | #define CyCHIP_RESET (0x10) | ||
| 77 | #define CyENB_XMTR (0x08) | ||
| 78 | #define CyDIS_XMTR (0x04) | ||
| 79 | #define CyENB_RCVR (0x02) | ||
| 80 | #define CyDIS_RCVR (0x01) | ||
| 81 | #define CyCAR (0xee) | ||
| 82 | #define CyIER (0x11) | ||
| 83 | #define CyMdmCh (0x80) | ||
| 84 | #define CyRxExc (0x20) | ||
| 85 | #define CyRxData (0x08) | ||
| 86 | #define CyTxMpty (0x02) | ||
| 87 | #define CyTxRdy (0x01) | ||
| 88 | #define CyLICR (0x26) | ||
| 89 | #define CyRISR (0x89) | ||
| 90 | #define CyTIMEOUT (0x80) | ||
| 91 | #define CySPECHAR (0x70) | ||
| 92 | #define CyOVERRUN (0x08) | ||
| 93 | #define CyPARITY (0x04) | ||
| 94 | #define CyFRAME (0x02) | ||
| 95 | #define CyBREAK (0x01) | ||
| 96 | #define CyREOIR (0x84) | ||
| 97 | #define CyTEOIR (0x85) | ||
| 98 | #define CyMEOIR (0x86) | ||
| 99 | #define CyNOTRANS (0x08) | ||
| 100 | #define CyRFOC (0x30) | ||
| 101 | #define CyRDR (0xf8) | ||
| 102 | #define CyTDR (0xf8) | ||
| 103 | #define CyMISR (0x8b) | ||
| 104 | #define CyRISR (0x89) | ||
| 105 | #define CyTISR (0x8a) | ||
| 106 | #define CyMSVR1 (0xde) | ||
| 107 | #define CyMSVR2 (0xdf) | ||
| 108 | #define CyDSR (0x80) | ||
| 109 | #define CyDCD (0x40) | ||
| 110 | #define CyCTS (0x20) | ||
| 111 | #define CyDTR (0x02) | ||
| 112 | #define CyRTS (0x01) | ||
| 113 | #define CyRTPRL (0x25) | ||
| 114 | #define CyRTPRH (0x24) | ||
| 115 | #define CyCOR1 (0x10) | ||
| 116 | #define CyPARITY_NONE (0x00) | ||
| 117 | #define CyPARITY_E (0x40) | ||
| 118 | #define CyPARITY_O (0xC0) | ||
| 119 | #define Cy_5_BITS (0x04) | ||
| 120 | #define Cy_6_BITS (0x05) | ||
| 121 | #define Cy_7_BITS (0x06) | ||
| 122 | #define Cy_8_BITS (0x07) | ||
| 123 | #define CyCOR2 (0x17) | ||
| 124 | #define CyETC (0x20) | ||
| 125 | #define CyCtsAE (0x02) | ||
| 126 | #define CyCOR3 (0x16) | ||
| 127 | #define Cy_1_STOP (0x02) | ||
| 128 | #define Cy_2_STOP (0x04) | ||
| 129 | #define CyCOR4 (0x15) | ||
| 130 | #define CyREC_FIFO (0x0F) /* Receive FIFO threshold */ | ||
| 131 | #define CyCOR5 (0x14) | ||
| 132 | #define CyCOR6 (0x18) | ||
| 133 | #define CyCOR7 (0x07) | ||
| 134 | #define CyRBPR (0xcb) | ||
| 135 | #define CyRCOR (0xc8) | ||
| 136 | #define CyTBPR (0xc3) | ||
| 137 | #define CyTCOR (0xc0) | ||
| 138 | #define CySCHR1 (0x1f) | ||
| 139 | #define CySCHR2 (0x1e) | ||
| 140 | #define CyTPR (0xda) | ||
| 141 | #define CyPILR1 (0xe3) | ||
| 142 | #define CyPILR2 (0xe0) | ||
| 143 | #define CyPILR3 (0xe1) | ||
| 144 | #define CyCMR (0x1b) | ||
| 145 | #define CyASYNC (0x02) | ||
| 146 | #define CyLICR (0x26) | ||
| 147 | #define CyLIVR (0x09) | ||
| 148 | #define CySCRL (0x23) | ||
| 149 | #define CySCRH (0x22) | ||
| 150 | #define CyTFTC (0x80) | ||
| 151 | |||
| 152 | |||
| 153 | /* max number of chars in the FIFO */ | ||
| 154 | |||
| 155 | #define CyMAX_CHAR_FIFO 12 | ||
| 156 | |||
| 157 | /***************************************************************************/ | ||
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index a416e92012ef..c174c90fb3fb 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
| @@ -65,11 +65,38 @@ enum { | |||
| 65 | * platform device. Using these will make your driver | 65 | * platform device. Using these will make your driver |
| 66 | * dependent on the 8250 driver. | 66 | * dependent on the 8250 driver. |
| 67 | */ | 67 | */ |
| 68 | struct uart_port; | 68 | |
| 69 | struct uart_8250_port; | 69 | struct uart_8250_port { |
| 70 | struct uart_port port; | ||
| 71 | struct timer_list timer; /* "no irq" timer */ | ||
| 72 | struct list_head list; /* ports on this IRQ */ | ||
| 73 | unsigned short capabilities; /* port capabilities */ | ||
| 74 | unsigned short bugs; /* port bugs */ | ||
| 75 | unsigned int tx_loadsz; /* transmit fifo load size */ | ||
| 76 | unsigned char acr; | ||
| 77 | unsigned char ier; | ||
| 78 | unsigned char lcr; | ||
| 79 | unsigned char mcr; | ||
| 80 | unsigned char mcr_mask; /* mask of user bits */ | ||
| 81 | unsigned char mcr_force; /* mask of forced bits */ | ||
| 82 | unsigned char cur_iotype; /* Running I/O type */ | ||
| 83 | |||
| 84 | /* | ||
| 85 | * Some bits in registers are cleared on a read, so they must | ||
| 86 | * be saved whenever the register is read but the bits will not | ||
| 87 | * be immediately processed. | ||
| 88 | */ | ||
| 89 | #define LSR_SAVE_FLAGS UART_LSR_BRK_ERROR_BITS | ||
| 90 | unsigned char lsr_saved_flags; | ||
| 91 | #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA | ||
| 92 | unsigned char msr_saved_flags; | ||
| 93 | |||
| 94 | /* 8250 specific callbacks */ | ||
| 95 | int (*dl_read)(struct uart_8250_port *); | ||
| 96 | void (*dl_write)(struct uart_8250_port *, int); | ||
| 97 | }; | ||
| 70 | 98 | ||
| 71 | int serial8250_register_8250_port(struct uart_8250_port *); | 99 | int serial8250_register_8250_port(struct uart_8250_port *); |
| 72 | int serial8250_register_port(struct uart_port *); | ||
| 73 | void serial8250_unregister_port(int line); | 100 | void serial8250_unregister_port(int line); |
| 74 | void serial8250_suspend_port(int line); | 101 | void serial8250_suspend_port(int line); |
| 75 | void serial8250_resume_port(int line); | 102 | void serial8250_resume_port(int line); |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 0253c2022e53..f9b22ec7a9f3 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
| @@ -48,7 +48,8 @@ | |||
| 48 | #define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */ | 48 | #define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */ |
| 49 | #define PORT_XR17D15X 21 /* Exar XR17D15x UART */ | 49 | #define PORT_XR17D15X 21 /* Exar XR17D15x UART */ |
| 50 | #define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */ | 50 | #define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */ |
| 51 | #define PORT_MAX_8250 22 /* max port ID */ | 51 | #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */ |
| 52 | #define PORT_MAX_8250 23 /* max port ID */ | ||
| 52 | 53 | ||
| 53 | /* | 54 | /* |
| 54 | * ARM specific type numbers. These are not currently guaranteed | 55 | * ARM specific type numbers. These are not currently guaranteed |
| @@ -193,8 +194,8 @@ | |||
| 193 | /* SH-SCI */ | 194 | /* SH-SCI */ |
| 194 | #define PORT_SCIFB 93 | 195 | #define PORT_SCIFB 93 |
| 195 | 196 | ||
| 196 | /* MAX3107 */ | 197 | /* MAX310X */ |
| 197 | #define PORT_MAX3107 94 | 198 | #define PORT_MAX310X 94 |
| 198 | 199 | ||
| 199 | /* High Speed UART for Medfield */ | 200 | /* High Speed UART for Medfield */ |
| 200 | #define PORT_MFD 95 | 201 | #define PORT_MFD 95 |
| @@ -274,6 +275,7 @@ struct uart_ops { | |||
| 274 | int (*verify_port)(struct uart_port *, struct serial_struct *); | 275 | int (*verify_port)(struct uart_port *, struct serial_struct *); |
| 275 | int (*ioctl)(struct uart_port *, unsigned int, unsigned long); | 276 | int (*ioctl)(struct uart_port *, unsigned int, unsigned long); |
| 276 | #ifdef CONFIG_CONSOLE_POLL | 277 | #ifdef CONFIG_CONSOLE_POLL |
| 278 | int (*poll_init)(struct uart_port *); | ||
| 277 | void (*poll_put_char)(struct uart_port *, unsigned char); | 279 | void (*poll_put_char)(struct uart_port *, unsigned char); |
| 278 | int (*poll_get_char)(struct uart_port *); | 280 | int (*poll_get_char)(struct uart_port *); |
| 279 | #endif | 281 | #endif |
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h index 8ce70d76f836..5ed325e88a81 100644 --- a/include/linux/serial_reg.h +++ b/include/linux/serial_reg.h | |||
| @@ -40,6 +40,10 @@ | |||
| 40 | 40 | ||
| 41 | #define UART_IIR_BUSY 0x07 /* DesignWare APB Busy Detect */ | 41 | #define UART_IIR_BUSY 0x07 /* DesignWare APB Busy Detect */ |
| 42 | 42 | ||
| 43 | #define UART_IIR_RX_TIMEOUT 0x0c /* OMAP RX Timeout interrupt */ | ||
| 44 | #define UART_IIR_XOFF 0x10 /* OMAP XOFF/Special Character */ | ||
| 45 | #define UART_IIR_CTS_RTS_DSR 0x20 /* OMAP CTS/RTS/DSR Change */ | ||
| 46 | |||
| 43 | #define UART_FCR 2 /* Out: FIFO Control Register */ | 47 | #define UART_FCR 2 /* Out: FIFO Control Register */ |
| 44 | #define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */ | 48 | #define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */ |
| 45 | #define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */ | 49 | #define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */ |
diff --git a/include/linux/smpboot.h b/include/linux/smpboot.h new file mode 100644 index 000000000000..e0106d8581d3 --- /dev/null +++ b/include/linux/smpboot.h | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | #ifndef _LINUX_SMPBOOT_H | ||
| 2 | #define _LINUX_SMPBOOT_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | struct task_struct; | ||
| 7 | /* Cookie handed to the thread_fn*/ | ||
| 8 | struct smpboot_thread_data; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * struct smp_hotplug_thread - CPU hotplug related thread descriptor | ||
| 12 | * @store: Pointer to per cpu storage for the task pointers | ||
| 13 | * @list: List head for core management | ||
| 14 | * @thread_should_run: Check whether the thread should run or not. Called with | ||
| 15 | * preemption disabled. | ||
| 16 | * @thread_fn: The associated thread function | ||
| 17 | * @setup: Optional setup function, called when the thread gets | ||
| 18 | * operational the first time | ||
| 19 | * @cleanup: Optional cleanup function, called when the thread | ||
| 20 | * should stop (module exit) | ||
| 21 | * @park: Optional park function, called when the thread is | ||
| 22 | * parked (cpu offline) | ||
| 23 | * @unpark: Optional unpark function, called when the thread is | ||
| 24 | * unparked (cpu online) | ||
| 25 | * @thread_comm: The base name of the thread | ||
| 26 | */ | ||
| 27 | struct smp_hotplug_thread { | ||
| 28 | struct task_struct __percpu **store; | ||
| 29 | struct list_head list; | ||
| 30 | int (*thread_should_run)(unsigned int cpu); | ||
| 31 | void (*thread_fn)(unsigned int cpu); | ||
| 32 | void (*setup)(unsigned int cpu); | ||
| 33 | void (*cleanup)(unsigned int cpu, bool online); | ||
| 34 | void (*park)(unsigned int cpu); | ||
| 35 | void (*unpark)(unsigned int cpu); | ||
| 36 | const char *thread_comm; | ||
| 37 | }; | ||
| 38 | |||
| 39 | int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread); | ||
| 40 | void smpboot_unregister_percpu_thread(struct smp_hotplug_thread *plug_thread); | ||
| 41 | int smpboot_thread_schedule(void); | ||
| 42 | |||
| 43 | #endif | ||
diff --git a/include/linux/stallion.h b/include/linux/stallion.h deleted file mode 100644 index 336af33c6ea4..000000000000 --- a/include/linux/stallion.h +++ /dev/null | |||
| @@ -1,147 +0,0 @@ | |||
| 1 | /*****************************************************************************/ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * stallion.h -- stallion multiport serial driver. | ||
| 5 | * | ||
| 6 | * Copyright (C) 1996-1998 Stallion Technologies | ||
| 7 | * Copyright (C) 1994-1996 Greg Ungerer. | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | * GNU General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 22 | */ | ||
| 23 | |||
| 24 | /*****************************************************************************/ | ||
| 25 | #ifndef _STALLION_H | ||
| 26 | #define _STALLION_H | ||
| 27 | /*****************************************************************************/ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Define important driver constants here. | ||
| 31 | */ | ||
| 32 | #define STL_MAXBRDS 4 | ||
| 33 | #define STL_MAXPANELS 4 | ||
| 34 | #define STL_MAXBANKS 8 | ||
| 35 | #define STL_PORTSPERPANEL 16 | ||
| 36 | #define STL_MAXPORTS 64 | ||
| 37 | #define STL_MAXDEVS (STL_MAXBRDS * STL_MAXPORTS) | ||
| 38 | |||
| 39 | |||
| 40 | /* | ||
| 41 | * Define a set of structures to hold all the board/panel/port info | ||
| 42 | * for our ports. These will be dynamically allocated as required. | ||
| 43 | */ | ||
| 44 | |||
| 45 | /* | ||
| 46 | * Define a ring queue structure for each port. This will hold the | ||
| 47 | * TX data waiting to be output. Characters are fed into this buffer | ||
| 48 | * from the line discipline (or even direct from user space!) and | ||
| 49 | * then fed into the UARTs during interrupts. Will use a classic ring | ||
| 50 | * queue here for this. The good thing about this type of ring queue | ||
| 51 | * is that the head and tail pointers can be updated without interrupt | ||
| 52 | * protection - since "write" code only needs to change the head, and | ||
| 53 | * interrupt code only needs to change the tail. | ||
| 54 | */ | ||
| 55 | struct stlrq { | ||
| 56 | char *buf; | ||
| 57 | char *head; | ||
| 58 | char *tail; | ||
| 59 | }; | ||
| 60 | |||
| 61 | /* | ||
| 62 | * Port, panel and board structures to hold status info about each. | ||
| 63 | * The board structure contains pointers to structures for each panel | ||
| 64 | * connected to it, and in turn each panel structure contains pointers | ||
| 65 | * for each port structure for each port on that panel. Note that | ||
| 66 | * the port structure also contains the board and panel number that it | ||
| 67 | * is associated with, this makes it (fairly) easy to get back to the | ||
| 68 | * board/panel info for a port. | ||
| 69 | */ | ||
| 70 | struct stlport { | ||
| 71 | unsigned long magic; | ||
| 72 | struct tty_port port; | ||
| 73 | unsigned int portnr; | ||
| 74 | unsigned int panelnr; | ||
| 75 | unsigned int brdnr; | ||
| 76 | int ioaddr; | ||
| 77 | int uartaddr; | ||
| 78 | unsigned int pagenr; | ||
| 79 | unsigned long istate; | ||
| 80 | int baud_base; | ||
| 81 | int custom_divisor; | ||
| 82 | int close_delay; | ||
| 83 | int closing_wait; | ||
| 84 | int openwaitcnt; | ||
| 85 | int brklen; | ||
| 86 | unsigned int sigs; | ||
| 87 | unsigned int rxignoremsk; | ||
| 88 | unsigned int rxmarkmsk; | ||
| 89 | unsigned int imr; | ||
| 90 | unsigned int crenable; | ||
| 91 | unsigned long clk; | ||
| 92 | unsigned long hwid; | ||
| 93 | void *uartp; | ||
| 94 | comstats_t stats; | ||
| 95 | struct stlrq tx; | ||
| 96 | }; | ||
| 97 | |||
| 98 | struct stlpanel { | ||
| 99 | unsigned long magic; | ||
| 100 | unsigned int panelnr; | ||
| 101 | unsigned int brdnr; | ||
| 102 | unsigned int pagenr; | ||
| 103 | unsigned int nrports; | ||
| 104 | int iobase; | ||
| 105 | void *uartp; | ||
| 106 | void (*isr)(struct stlpanel *panelp, unsigned int iobase); | ||
| 107 | unsigned int hwid; | ||
| 108 | unsigned int ackmask; | ||
| 109 | struct stlport *ports[STL_PORTSPERPANEL]; | ||
| 110 | }; | ||
| 111 | |||
| 112 | struct stlbrd { | ||
| 113 | unsigned long magic; | ||
| 114 | unsigned int brdnr; | ||
| 115 | unsigned int brdtype; | ||
| 116 | unsigned int state; | ||
| 117 | unsigned int nrpanels; | ||
| 118 | unsigned int nrports; | ||
| 119 | unsigned int nrbnks; | ||
| 120 | int irq; | ||
| 121 | int irqtype; | ||
| 122 | int (*isr)(struct stlbrd *brdp); | ||
| 123 | unsigned int ioaddr1; | ||
| 124 | unsigned int ioaddr2; | ||
| 125 | unsigned int iosize1; | ||
| 126 | unsigned int iosize2; | ||
| 127 | unsigned int iostatus; | ||
| 128 | unsigned int ioctrl; | ||
| 129 | unsigned int ioctrlval; | ||
| 130 | unsigned int hwid; | ||
| 131 | unsigned long clk; | ||
| 132 | unsigned int bnkpageaddr[STL_MAXBANKS]; | ||
| 133 | unsigned int bnkstataddr[STL_MAXBANKS]; | ||
| 134 | struct stlpanel *bnk2panel[STL_MAXBANKS]; | ||
| 135 | struct stlpanel *panels[STL_MAXPANELS]; | ||
| 136 | }; | ||
| 137 | |||
| 138 | |||
| 139 | /* | ||
| 140 | * Define MAGIC numbers used for above structures. | ||
| 141 | */ | ||
| 142 | #define STL_PORTMAGIC 0x5a7182c9 | ||
| 143 | #define STL_PANELMAGIC 0x7ef621a1 | ||
| 144 | #define STL_BOARDMAGIC 0xa2267f52 | ||
| 145 | |||
| 146 | /*****************************************************************************/ | ||
| 147 | #endif | ||
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index cff40aa7db62..bf8c49ff7530 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -114,6 +114,7 @@ struct rpc_xprt_ops { | |||
| 114 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); | 114 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); |
| 115 | int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); | 115 | int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); |
| 116 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); | 116 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); |
| 117 | void (*alloc_slot)(struct rpc_xprt *xprt, struct rpc_task *task); | ||
| 117 | void (*rpcbind)(struct rpc_task *task); | 118 | void (*rpcbind)(struct rpc_task *task); |
| 118 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); | 119 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); |
| 119 | void (*connect)(struct rpc_task *task); | 120 | void (*connect)(struct rpc_task *task); |
| @@ -281,6 +282,8 @@ void xprt_connect(struct rpc_task *task); | |||
| 281 | void xprt_reserve(struct rpc_task *task); | 282 | void xprt_reserve(struct rpc_task *task); |
| 282 | int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task); | 283 | int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task); |
| 283 | int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); | 284 | int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); |
| 285 | void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); | ||
| 286 | void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); | ||
| 284 | int xprt_prepare_transmit(struct rpc_task *task); | 287 | int xprt_prepare_transmit(struct rpc_task *task); |
| 285 | void xprt_transmit(struct rpc_task *task); | 288 | void xprt_transmit(struct rpc_task *task); |
| 286 | void xprt_end_transmit(struct rpc_task *task); | 289 | void xprt_end_transmit(struct rpc_task *task); |
diff --git a/include/linux/task_work.h b/include/linux/task_work.h index fb46b03b1852..ca5a1cf27dae 100644 --- a/include/linux/task_work.h +++ b/include/linux/task_work.h | |||
| @@ -18,8 +18,7 @@ void task_work_run(void); | |||
| 18 | 18 | ||
| 19 | static inline void exit_task_work(struct task_struct *task) | 19 | static inline void exit_task_work(struct task_struct *task) |
| 20 | { | 20 | { |
| 21 | if (unlikely(task->task_works)) | 21 | task_work_run(); |
| 22 | task_work_run(); | ||
| 23 | } | 22 | } |
| 24 | 23 | ||
| 25 | #endif /* _LINUX_TASK_WORK_H */ | 24 | #endif /* _LINUX_TASK_WORK_H */ |
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h index 3ca0269dd0b5..932b76392248 100644 --- a/include/linux/ti_wilink_st.h +++ b/include/linux/ti_wilink_st.h | |||
| @@ -281,9 +281,10 @@ struct kim_data_s { | |||
| 281 | long st_kim_start(void *); | 281 | long st_kim_start(void *); |
| 282 | long st_kim_stop(void *); | 282 | long st_kim_stop(void *); |
| 283 | 283 | ||
| 284 | void st_kim_recv(void *, const unsigned char *, long count); | ||
| 285 | void st_kim_complete(void *); | 284 | void st_kim_complete(void *); |
| 286 | void kim_st_list_protocols(struct st_data_s *, void *); | 285 | void kim_st_list_protocols(struct st_data_s *, void *); |
| 286 | void st_kim_recv(void *, const unsigned char *, long); | ||
| 287 | |||
| 287 | 288 | ||
| 288 | /* | 289 | /* |
| 289 | * BTS headers | 290 | * BTS headers |
diff --git a/include/linux/timer.h b/include/linux/timer.h index 6abd9138beda..8c5a197e1587 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
| @@ -49,147 +49,112 @@ extern struct tvec_base boot_tvec_bases; | |||
| 49 | #endif | 49 | #endif |
| 50 | 50 | ||
| 51 | /* | 51 | /* |
| 52 | * Note that all tvec_bases are 2 byte aligned and lower bit of | 52 | * Note that all tvec_bases are at least 4 byte aligned and lower two bits |
| 53 | * base in timer_list is guaranteed to be zero. Use the LSB to | 53 | * of base in timer_list is guaranteed to be zero. Use them for flags. |
| 54 | * indicate whether the timer is deferrable. | ||
| 55 | * | 54 | * |
| 56 | * A deferrable timer will work normally when the system is busy, but | 55 | * A deferrable timer will work normally when the system is busy, but |
| 57 | * will not cause a CPU to come out of idle just to service it; instead, | 56 | * will not cause a CPU to come out of idle just to service it; instead, |
| 58 | * the timer will be serviced when the CPU eventually wakes up with a | 57 | * the timer will be serviced when the CPU eventually wakes up with a |
| 59 | * subsequent non-deferrable timer. | 58 | * subsequent non-deferrable timer. |
| 59 | * | ||
| 60 | * An irqsafe timer is executed with IRQ disabled and it's safe to wait for | ||
| 61 | * the completion of the running instance from IRQ handlers, for example, | ||
| 62 | * by calling del_timer_sync(). | ||
| 63 | * | ||
| 64 | * Note: The irq disabled callback execution is a special case for | ||
| 65 | * workqueue locking issues. It's not meant for executing random crap | ||
| 66 | * with interrupts disabled. Abuse is monitored! | ||
| 60 | */ | 67 | */ |
| 61 | #define TBASE_DEFERRABLE_FLAG (0x1) | 68 | #define TIMER_DEFERRABLE 0x1LU |
| 69 | #define TIMER_IRQSAFE 0x2LU | ||
| 62 | 70 | ||
| 63 | #define TIMER_INITIALIZER(_function, _expires, _data) { \ | 71 | #define TIMER_FLAG_MASK 0x3LU |
| 72 | |||
| 73 | #define __TIMER_INITIALIZER(_function, _expires, _data, _flags) { \ | ||
| 64 | .entry = { .prev = TIMER_ENTRY_STATIC }, \ | 74 | .entry = { .prev = TIMER_ENTRY_STATIC }, \ |
| 65 | .function = (_function), \ | 75 | .function = (_function), \ |
| 66 | .expires = (_expires), \ | 76 | .expires = (_expires), \ |
| 67 | .data = (_data), \ | 77 | .data = (_data), \ |
| 68 | .base = &boot_tvec_bases, \ | 78 | .base = (void *)((unsigned long)&boot_tvec_bases + (_flags)), \ |
| 69 | .slack = -1, \ | 79 | .slack = -1, \ |
| 70 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ | 80 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ |
| 71 | __FILE__ ":" __stringify(__LINE__)) \ | 81 | __FILE__ ":" __stringify(__LINE__)) \ |
| 72 | } | 82 | } |
| 73 | 83 | ||
| 74 | #define TBASE_MAKE_DEFERRED(ptr) ((struct tvec_base *) \ | 84 | #define TIMER_INITIALIZER(_function, _expires, _data) \ |
| 75 | ((unsigned char *)(ptr) + TBASE_DEFERRABLE_FLAG)) | 85 | __TIMER_INITIALIZER((_function), (_expires), (_data), 0) |
| 76 | 86 | ||
| 77 | #define TIMER_DEFERRED_INITIALIZER(_function, _expires, _data) {\ | 87 | #define TIMER_DEFERRED_INITIALIZER(_function, _expires, _data) \ |
| 78 | .entry = { .prev = TIMER_ENTRY_STATIC }, \ | 88 | __TIMER_INITIALIZER((_function), (_expires), (_data), TIMER_DEFERRABLE) |
| 79 | .function = (_function), \ | ||
| 80 | .expires = (_expires), \ | ||
| 81 | .data = (_data), \ | ||
| 82 | .base = TBASE_MAKE_DEFERRED(&boot_tvec_bases), \ | ||
| 83 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ | ||
| 84 | __FILE__ ":" __stringify(__LINE__)) \ | ||
| 85 | } | ||
| 86 | 89 | ||
| 87 | #define DEFINE_TIMER(_name, _function, _expires, _data) \ | 90 | #define DEFINE_TIMER(_name, _function, _expires, _data) \ |
| 88 | struct timer_list _name = \ | 91 | struct timer_list _name = \ |
| 89 | TIMER_INITIALIZER(_function, _expires, _data) | 92 | TIMER_INITIALIZER(_function, _expires, _data) |
| 90 | 93 | ||
| 91 | void init_timer_key(struct timer_list *timer, | 94 | void init_timer_key(struct timer_list *timer, unsigned int flags, |
| 92 | const char *name, | 95 | const char *name, struct lock_class_key *key); |
| 93 | struct lock_class_key *key); | 96 | |
| 94 | void init_timer_deferrable_key(struct timer_list *timer, | 97 | #ifdef CONFIG_DEBUG_OBJECTS_TIMERS |
| 95 | const char *name, | 98 | extern void init_timer_on_stack_key(struct timer_list *timer, |
| 96 | struct lock_class_key *key); | 99 | unsigned int flags, const char *name, |
| 100 | struct lock_class_key *key); | ||
| 101 | extern void destroy_timer_on_stack(struct timer_list *timer); | ||
| 102 | #else | ||
| 103 | static inline void destroy_timer_on_stack(struct timer_list *timer) { } | ||
| 104 | static inline void init_timer_on_stack_key(struct timer_list *timer, | ||
| 105 | unsigned int flags, const char *name, | ||
| 106 | struct lock_class_key *key) | ||
| 107 | { | ||
| 108 | init_timer_key(timer, flags, name, key); | ||
| 109 | } | ||
| 110 | #endif | ||
| 97 | 111 | ||
| 98 | #ifdef CONFIG_LOCKDEP | 112 | #ifdef CONFIG_LOCKDEP |
| 99 | #define init_timer(timer) \ | 113 | #define __init_timer(_timer, _flags) \ |
| 100 | do { \ | 114 | do { \ |
| 101 | static struct lock_class_key __key; \ | 115 | static struct lock_class_key __key; \ |
| 102 | init_timer_key((timer), #timer, &__key); \ | 116 | init_timer_key((_timer), (_flags), #_timer, &__key); \ |
| 103 | } while (0) | 117 | } while (0) |
| 104 | 118 | ||
| 105 | #define init_timer_deferrable(timer) \ | 119 | #define __init_timer_on_stack(_timer, _flags) \ |
| 106 | do { \ | 120 | do { \ |
| 107 | static struct lock_class_key __key; \ | 121 | static struct lock_class_key __key; \ |
| 108 | init_timer_deferrable_key((timer), #timer, &__key); \ | 122 | init_timer_on_stack_key((_timer), (_flags), #_timer, &__key); \ |
| 109 | } while (0) | 123 | } while (0) |
| 124 | #else | ||
| 125 | #define __init_timer(_timer, _flags) \ | ||
| 126 | init_timer_key((_timer), (_flags), NULL, NULL) | ||
| 127 | #define __init_timer_on_stack(_timer, _flags) \ | ||
| 128 | init_timer_on_stack_key((_timer), (_flags), NULL, NULL) | ||
| 129 | #endif | ||
| 110 | 130 | ||
| 131 | #define init_timer(timer) \ | ||
| 132 | __init_timer((timer), 0) | ||
| 133 | #define init_timer_deferrable(timer) \ | ||
| 134 | __init_timer((timer), TIMER_DEFERRABLE) | ||
| 111 | #define init_timer_on_stack(timer) \ | 135 | #define init_timer_on_stack(timer) \ |
| 136 | __init_timer_on_stack((timer), 0) | ||
| 137 | |||
| 138 | #define __setup_timer(_timer, _fn, _data, _flags) \ | ||
| 112 | do { \ | 139 | do { \ |
| 113 | static struct lock_class_key __key; \ | 140 | __init_timer((_timer), (_flags)); \ |
| 114 | init_timer_on_stack_key((timer), #timer, &__key); \ | 141 | (_timer)->function = (_fn); \ |
| 142 | (_timer)->data = (_data); \ | ||
| 115 | } while (0) | 143 | } while (0) |
| 116 | 144 | ||
| 117 | #define setup_timer(timer, fn, data) \ | 145 | #define __setup_timer_on_stack(_timer, _fn, _data, _flags) \ |
| 118 | do { \ | 146 | do { \ |
| 119 | static struct lock_class_key __key; \ | 147 | __init_timer_on_stack((_timer), (_flags)); \ |
| 120 | setup_timer_key((timer), #timer, &__key, (fn), (data));\ | 148 | (_timer)->function = (_fn); \ |
| 149 | (_timer)->data = (_data); \ | ||
| 121 | } while (0) | 150 | } while (0) |
| 122 | 151 | ||
| 152 | #define setup_timer(timer, fn, data) \ | ||
| 153 | __setup_timer((timer), (fn), (data), 0) | ||
| 123 | #define setup_timer_on_stack(timer, fn, data) \ | 154 | #define setup_timer_on_stack(timer, fn, data) \ |
| 124 | do { \ | 155 | __setup_timer_on_stack((timer), (fn), (data), 0) |
| 125 | static struct lock_class_key __key; \ | ||
| 126 | setup_timer_on_stack_key((timer), #timer, &__key, \ | ||
| 127 | (fn), (data)); \ | ||
| 128 | } while (0) | ||
| 129 | #define setup_deferrable_timer_on_stack(timer, fn, data) \ | 156 | #define setup_deferrable_timer_on_stack(timer, fn, data) \ |
| 130 | do { \ | 157 | __setup_timer_on_stack((timer), (fn), (data), TIMER_DEFERRABLE) |
| 131 | static struct lock_class_key __key; \ | ||
| 132 | setup_deferrable_timer_on_stack_key((timer), #timer, \ | ||
| 133 | &__key, (fn), \ | ||
| 134 | (data)); \ | ||
| 135 | } while (0) | ||
| 136 | #else | ||
| 137 | #define init_timer(timer)\ | ||
| 138 | init_timer_key((timer), NULL, NULL) | ||
| 139 | #define init_timer_deferrable(timer)\ | ||
| 140 | init_timer_deferrable_key((timer), NULL, NULL) | ||
| 141 | #define init_timer_on_stack(timer)\ | ||
| 142 | init_timer_on_stack_key((timer), NULL, NULL) | ||
| 143 | #define setup_timer(timer, fn, data)\ | ||
| 144 | setup_timer_key((timer), NULL, NULL, (fn), (data)) | ||
| 145 | #define setup_timer_on_stack(timer, fn, data)\ | ||
| 146 | setup_timer_on_stack_key((timer), NULL, NULL, (fn), (data)) | ||
| 147 | #define setup_deferrable_timer_on_stack(timer, fn, data)\ | ||
| 148 | setup_deferrable_timer_on_stack_key((timer), NULL, NULL, (fn), (data)) | ||
| 149 | #endif | ||
| 150 | |||
| 151 | #ifdef CONFIG_DEBUG_OBJECTS_TIMERS | ||
| 152 | extern void init_timer_on_stack_key(struct timer_list *timer, | ||
| 153 | const char *name, | ||
| 154 | struct lock_class_key *key); | ||
| 155 | extern void destroy_timer_on_stack(struct timer_list *timer); | ||
| 156 | #else | ||
| 157 | static inline void destroy_timer_on_stack(struct timer_list *timer) { } | ||
| 158 | static inline void init_timer_on_stack_key(struct timer_list *timer, | ||
| 159 | const char *name, | ||
| 160 | struct lock_class_key *key) | ||
| 161 | { | ||
| 162 | init_timer_key(timer, name, key); | ||
| 163 | } | ||
| 164 | #endif | ||
| 165 | |||
| 166 | static inline void setup_timer_key(struct timer_list * timer, | ||
| 167 | const char *name, | ||
| 168 | struct lock_class_key *key, | ||
| 169 | void (*function)(unsigned long), | ||
| 170 | unsigned long data) | ||
| 171 | { | ||
| 172 | timer->function = function; | ||
| 173 | timer->data = data; | ||
| 174 | init_timer_key(timer, name, key); | ||
| 175 | } | ||
| 176 | |||
| 177 | static inline void setup_timer_on_stack_key(struct timer_list *timer, | ||
| 178 | const char *name, | ||
| 179 | struct lock_class_key *key, | ||
| 180 | void (*function)(unsigned long), | ||
| 181 | unsigned long data) | ||
| 182 | { | ||
| 183 | timer->function = function; | ||
| 184 | timer->data = data; | ||
| 185 | init_timer_on_stack_key(timer, name, key); | ||
| 186 | } | ||
| 187 | |||
| 188 | extern void setup_deferrable_timer_on_stack_key(struct timer_list *timer, | ||
| 189 | const char *name, | ||
| 190 | struct lock_class_key *key, | ||
| 191 | void (*function)(unsigned long), | ||
| 192 | unsigned long data); | ||
| 193 | 158 | ||
| 194 | /** | 159 | /** |
| 195 | * timer_pending - is a timer pending? | 160 | * timer_pending - is a timer pending? |
diff --git a/include/linux/topology.h b/include/linux/topology.h index fec12d667211..d3cf0d6e7712 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
| @@ -129,7 +129,6 @@ int arch_update_cpu_topology(void); | |||
| 129 | | 1*SD_BALANCE_FORK \ | 129 | | 1*SD_BALANCE_FORK \ |
| 130 | | 0*SD_BALANCE_WAKE \ | 130 | | 0*SD_BALANCE_WAKE \ |
| 131 | | 1*SD_WAKE_AFFINE \ | 131 | | 1*SD_WAKE_AFFINE \ |
| 132 | | 0*SD_PREFER_LOCAL \ | ||
| 133 | | 0*SD_SHARE_CPUPOWER \ | 132 | | 0*SD_SHARE_CPUPOWER \ |
| 134 | | 1*SD_SHARE_PKG_RESOURCES \ | 133 | | 1*SD_SHARE_PKG_RESOURCES \ |
| 135 | | 0*SD_SERIALIZE \ | 134 | | 0*SD_SERIALIZE \ |
| @@ -160,7 +159,6 @@ int arch_update_cpu_topology(void); | |||
| 160 | | 1*SD_BALANCE_FORK \ | 159 | | 1*SD_BALANCE_FORK \ |
| 161 | | 0*SD_BALANCE_WAKE \ | 160 | | 0*SD_BALANCE_WAKE \ |
| 162 | | 1*SD_WAKE_AFFINE \ | 161 | | 1*SD_WAKE_AFFINE \ |
| 163 | | 0*SD_PREFER_LOCAL \ | ||
| 164 | | 0*SD_SHARE_CPUPOWER \ | 162 | | 0*SD_SHARE_CPUPOWER \ |
| 165 | | 0*SD_SHARE_PKG_RESOURCES \ | 163 | | 0*SD_SHARE_PKG_RESOURCES \ |
| 166 | | 0*SD_SERIALIZE \ | 164 | | 0*SD_SERIALIZE \ |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 802de56c41e8..2f322c38bd4d 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
| @@ -136,6 +136,22 @@ static inline void tracepoint_synchronize_unregister(void) | |||
| 136 | postrcu; \ | 136 | postrcu; \ |
| 137 | } while (0) | 137 | } while (0) |
| 138 | 138 | ||
| 139 | #ifndef MODULE | ||
| 140 | #define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args) \ | ||
| 141 | static inline void trace_##name##_rcuidle(proto) \ | ||
| 142 | { \ | ||
| 143 | if (static_key_false(&__tracepoint_##name.key)) \ | ||
| 144 | __DO_TRACE(&__tracepoint_##name, \ | ||
| 145 | TP_PROTO(data_proto), \ | ||
| 146 | TP_ARGS(data_args), \ | ||
| 147 | TP_CONDITION(cond), \ | ||
| 148 | rcu_idle_exit(), \ | ||
| 149 | rcu_idle_enter()); \ | ||
| 150 | } | ||
| 151 | #else | ||
| 152 | #define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args) | ||
| 153 | #endif | ||
| 154 | |||
| 139 | /* | 155 | /* |
| 140 | * Make sure the alignment of the structure in the __tracepoints section will | 156 | * Make sure the alignment of the structure in the __tracepoints section will |
| 141 | * not add unwanted padding between the beginning of the section and the | 157 | * not add unwanted padding between the beginning of the section and the |
| @@ -151,16 +167,8 @@ static inline void tracepoint_synchronize_unregister(void) | |||
| 151 | TP_ARGS(data_args), \ | 167 | TP_ARGS(data_args), \ |
| 152 | TP_CONDITION(cond),,); \ | 168 | TP_CONDITION(cond),,); \ |
| 153 | } \ | 169 | } \ |
| 154 | static inline void trace_##name##_rcuidle(proto) \ | 170 | __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args), \ |
| 155 | { \ | 171 | PARAMS(cond), PARAMS(data_proto), PARAMS(data_args)) \ |
| 156 | if (static_key_false(&__tracepoint_##name.key)) \ | ||
| 157 | __DO_TRACE(&__tracepoint_##name, \ | ||
| 158 | TP_PROTO(data_proto), \ | ||
| 159 | TP_ARGS(data_args), \ | ||
| 160 | TP_CONDITION(cond), \ | ||
| 161 | rcu_idle_exit(), \ | ||
| 162 | rcu_idle_enter()); \ | ||
| 163 | } \ | ||
| 164 | static inline int \ | 172 | static inline int \ |
| 165 | register_trace_##name(void (*probe)(data_proto), void *data) \ | 173 | register_trace_##name(void (*probe)(data_proto), void *data) \ |
| 166 | { \ | 174 | { \ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 9f47ab540f65..1509b86825d8 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | #include <linux/tty_driver.h> | 43 | #include <linux/tty_driver.h> |
| 44 | #include <linux/tty_ldisc.h> | 44 | #include <linux/tty_ldisc.h> |
| 45 | #include <linux/mutex.h> | 45 | #include <linux/mutex.h> |
| 46 | #include <linux/tty_flags.h> | ||
| 46 | 47 | ||
| 47 | 48 | ||
| 48 | 49 | ||
| @@ -103,28 +104,28 @@ struct tty_bufhead { | |||
| 103 | #define TTY_PARITY 3 | 104 | #define TTY_PARITY 3 |
| 104 | #define TTY_OVERRUN 4 | 105 | #define TTY_OVERRUN 4 |
| 105 | 106 | ||
| 106 | #define INTR_CHAR(tty) ((tty)->termios->c_cc[VINTR]) | 107 | #define INTR_CHAR(tty) ((tty)->termios.c_cc[VINTR]) |
| 107 | #define QUIT_CHAR(tty) ((tty)->termios->c_cc[VQUIT]) | 108 | #define QUIT_CHAR(tty) ((tty)->termios.c_cc[VQUIT]) |
| 108 | #define ERASE_CHAR(tty) ((tty)->termios->c_cc[VERASE]) | 109 | #define ERASE_CHAR(tty) ((tty)->termios.c_cc[VERASE]) |
| 109 | #define KILL_CHAR(tty) ((tty)->termios->c_cc[VKILL]) | 110 | #define KILL_CHAR(tty) ((tty)->termios.c_cc[VKILL]) |
| 110 | #define EOF_CHAR(tty) ((tty)->termios->c_cc[VEOF]) | 111 | #define EOF_CHAR(tty) ((tty)->termios.c_cc[VEOF]) |
| 111 | #define TIME_CHAR(tty) ((tty)->termios->c_cc[VTIME]) | 112 | #define TIME_CHAR(tty) ((tty)->termios.c_cc[VTIME]) |
| 112 | #define MIN_CHAR(tty) ((tty)->termios->c_cc[VMIN]) | 113 | #define MIN_CHAR(tty) ((tty)->termios.c_cc[VMIN]) |
| 113 | #define SWTC_CHAR(tty) ((tty)->termios->c_cc[VSWTC]) | 114 | #define SWTC_CHAR(tty) ((tty)->termios.c_cc[VSWTC]) |
| 114 | #define START_CHAR(tty) ((tty)->termios->c_cc[VSTART]) | 115 | #define START_CHAR(tty) ((tty)->termios.c_cc[VSTART]) |
| 115 | #define STOP_CHAR(tty) ((tty)->termios->c_cc[VSTOP]) | 116 | #define STOP_CHAR(tty) ((tty)->termios.c_cc[VSTOP]) |
| 116 | #define SUSP_CHAR(tty) ((tty)->termios->c_cc[VSUSP]) | 117 | #define SUSP_CHAR(tty) ((tty)->termios.c_cc[VSUSP]) |
| 117 | #define EOL_CHAR(tty) ((tty)->termios->c_cc[VEOL]) | 118 | #define EOL_CHAR(tty) ((tty)->termios.c_cc[VEOL]) |
| 118 | #define REPRINT_CHAR(tty) ((tty)->termios->c_cc[VREPRINT]) | 119 | #define REPRINT_CHAR(tty) ((tty)->termios.c_cc[VREPRINT]) |
| 119 | #define DISCARD_CHAR(tty) ((tty)->termios->c_cc[VDISCARD]) | 120 | #define DISCARD_CHAR(tty) ((tty)->termios.c_cc[VDISCARD]) |
| 120 | #define WERASE_CHAR(tty) ((tty)->termios->c_cc[VWERASE]) | 121 | #define WERASE_CHAR(tty) ((tty)->termios.c_cc[VWERASE]) |
| 121 | #define LNEXT_CHAR(tty) ((tty)->termios->c_cc[VLNEXT]) | 122 | #define LNEXT_CHAR(tty) ((tty)->termios.c_cc[VLNEXT]) |
| 122 | #define EOL2_CHAR(tty) ((tty)->termios->c_cc[VEOL2]) | 123 | #define EOL2_CHAR(tty) ((tty)->termios.c_cc[VEOL2]) |
| 123 | 124 | ||
| 124 | #define _I_FLAG(tty, f) ((tty)->termios->c_iflag & (f)) | 125 | #define _I_FLAG(tty, f) ((tty)->termios.c_iflag & (f)) |
| 125 | #define _O_FLAG(tty, f) ((tty)->termios->c_oflag & (f)) | 126 | #define _O_FLAG(tty, f) ((tty)->termios.c_oflag & (f)) |
| 126 | #define _C_FLAG(tty, f) ((tty)->termios->c_cflag & (f)) | 127 | #define _C_FLAG(tty, f) ((tty)->termios.c_cflag & (f)) |
| 127 | #define _L_FLAG(tty, f) ((tty)->termios->c_lflag & (f)) | 128 | #define _L_FLAG(tty, f) ((tty)->termios.c_lflag & (f)) |
| 128 | 129 | ||
| 129 | #define I_IGNBRK(tty) _I_FLAG((tty), IGNBRK) | 130 | #define I_IGNBRK(tty) _I_FLAG((tty), IGNBRK) |
| 130 | #define I_BRKINT(tty) _I_FLAG((tty), BRKINT) | 131 | #define I_BRKINT(tty) _I_FLAG((tty), BRKINT) |
| @@ -268,10 +269,11 @@ struct tty_struct { | |||
| 268 | struct mutex ldisc_mutex; | 269 | struct mutex ldisc_mutex; |
| 269 | struct tty_ldisc *ldisc; | 270 | struct tty_ldisc *ldisc; |
| 270 | 271 | ||
| 272 | struct mutex legacy_mutex; | ||
| 271 | struct mutex termios_mutex; | 273 | struct mutex termios_mutex; |
| 272 | spinlock_t ctrl_lock; | 274 | spinlock_t ctrl_lock; |
| 273 | /* Termios values are protected by the termios mutex */ | 275 | /* Termios values are protected by the termios mutex */ |
| 274 | struct ktermios *termios, *termios_locked; | 276 | struct ktermios termios, termios_locked; |
| 275 | struct termiox *termiox; /* May be NULL for unsupported */ | 277 | struct termiox *termiox; /* May be NULL for unsupported */ |
| 276 | char name[64]; | 278 | char name[64]; |
| 277 | struct pid *pgrp; /* Protected by ctrl lock */ | 279 | struct pid *pgrp; /* Protected by ctrl lock */ |
| @@ -410,6 +412,10 @@ extern int tty_register_driver(struct tty_driver *driver); | |||
| 410 | extern int tty_unregister_driver(struct tty_driver *driver); | 412 | extern int tty_unregister_driver(struct tty_driver *driver); |
| 411 | extern struct device *tty_register_device(struct tty_driver *driver, | 413 | extern struct device *tty_register_device(struct tty_driver *driver, |
| 412 | unsigned index, struct device *dev); | 414 | unsigned index, struct device *dev); |
| 415 | extern struct device *tty_register_device_attr(struct tty_driver *driver, | ||
| 416 | unsigned index, struct device *device, | ||
| 417 | void *drvdata, | ||
| 418 | const struct attribute_group **attr_grp); | ||
| 413 | extern void tty_unregister_device(struct tty_driver *driver, unsigned index); | 419 | extern void tty_unregister_device(struct tty_driver *driver, unsigned index); |
| 414 | extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, | 420 | extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, |
| 415 | int buflen); | 421 | int buflen); |
| @@ -423,7 +429,6 @@ extern void tty_unthrottle(struct tty_struct *tty); | |||
| 423 | extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws); | 429 | extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws); |
| 424 | extern void tty_driver_remove_tty(struct tty_driver *driver, | 430 | extern void tty_driver_remove_tty(struct tty_driver *driver, |
| 425 | struct tty_struct *tty); | 431 | struct tty_struct *tty); |
| 426 | extern void tty_shutdown(struct tty_struct *tty); | ||
| 427 | extern void tty_free_termios(struct tty_struct *tty); | 432 | extern void tty_free_termios(struct tty_struct *tty); |
| 428 | extern int is_current_pgrp_orphaned(void); | 433 | extern int is_current_pgrp_orphaned(void); |
| 429 | extern struct pid *tty_get_pgrp(struct tty_struct *tty); | 434 | extern struct pid *tty_get_pgrp(struct tty_struct *tty); |
| @@ -497,6 +502,15 @@ extern int tty_write_lock(struct tty_struct *tty, int ndelay); | |||
| 497 | #define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock)) | 502 | #define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock)) |
| 498 | 503 | ||
| 499 | extern void tty_port_init(struct tty_port *port); | 504 | extern void tty_port_init(struct tty_port *port); |
| 505 | extern void tty_port_link_device(struct tty_port *port, | ||
| 506 | struct tty_driver *driver, unsigned index); | ||
| 507 | extern struct device *tty_port_register_device(struct tty_port *port, | ||
| 508 | struct tty_driver *driver, unsigned index, | ||
| 509 | struct device *device); | ||
| 510 | extern struct device *tty_port_register_device_attr(struct tty_port *port, | ||
| 511 | struct tty_driver *driver, unsigned index, | ||
| 512 | struct device *device, void *drvdata, | ||
| 513 | const struct attribute_group **attr_grp); | ||
| 500 | extern int tty_port_alloc_xmit_buf(struct tty_port *port); | 514 | extern int tty_port_alloc_xmit_buf(struct tty_port *port); |
| 501 | extern void tty_port_free_xmit_buf(struct tty_port *port); | 515 | extern void tty_port_free_xmit_buf(struct tty_port *port); |
| 502 | extern void tty_port_put(struct tty_port *port); | 516 | extern void tty_port_put(struct tty_port *port); |
| @@ -508,6 +522,12 @@ static inline struct tty_port *tty_port_get(struct tty_port *port) | |||
| 508 | return port; | 522 | return port; |
| 509 | } | 523 | } |
| 510 | 524 | ||
| 525 | /* If the cts flow control is enabled, return true. */ | ||
| 526 | static inline bool tty_port_cts_enabled(struct tty_port *port) | ||
| 527 | { | ||
| 528 | return port->flags & ASYNC_CTS_FLOW; | ||
| 529 | } | ||
| 530 | |||
| 511 | extern struct tty_struct *tty_port_tty_get(struct tty_port *port); | 531 | extern struct tty_struct *tty_port_tty_get(struct tty_port *port); |
| 512 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); | 532 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); |
| 513 | extern int tty_port_carrier_raised(struct tty_port *port); | 533 | extern int tty_port_carrier_raised(struct tty_port *port); |
| @@ -521,6 +541,8 @@ extern int tty_port_close_start(struct tty_port *port, | |||
| 521 | extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); | 541 | extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); |
| 522 | extern void tty_port_close(struct tty_port *port, | 542 | extern void tty_port_close(struct tty_port *port, |
| 523 | struct tty_struct *tty, struct file *filp); | 543 | struct tty_struct *tty, struct file *filp); |
| 544 | extern int tty_port_install(struct tty_port *port, struct tty_driver *driver, | ||
| 545 | struct tty_struct *tty); | ||
| 524 | extern int tty_port_open(struct tty_port *port, | 546 | extern int tty_port_open(struct tty_port *port, |
| 525 | struct tty_struct *tty, struct file *filp); | 547 | struct tty_struct *tty, struct file *filp); |
| 526 | static inline int tty_port_users(struct tty_port *port) | 548 | static inline int tty_port_users(struct tty_port *port) |
| @@ -605,8 +627,12 @@ extern long vt_compat_ioctl(struct tty_struct *tty, | |||
| 605 | 627 | ||
| 606 | /* tty_mutex.c */ | 628 | /* tty_mutex.c */ |
| 607 | /* functions for preparation of BKL removal */ | 629 | /* functions for preparation of BKL removal */ |
| 608 | extern void __lockfunc tty_lock(void) __acquires(tty_lock); | 630 | extern void __lockfunc tty_lock(struct tty_struct *tty); |
| 609 | extern void __lockfunc tty_unlock(void) __releases(tty_lock); | 631 | extern void __lockfunc tty_unlock(struct tty_struct *tty); |
| 632 | extern void __lockfunc tty_lock_pair(struct tty_struct *tty, | ||
| 633 | struct tty_struct *tty2); | ||
| 634 | extern void __lockfunc tty_unlock_pair(struct tty_struct *tty, | ||
| 635 | struct tty_struct *tty2); | ||
| 610 | 636 | ||
| 611 | /* | 637 | /* |
| 612 | * this shall be called only from where BTM is held (like close) | 638 | * this shall be called only from where BTM is held (like close) |
| @@ -621,9 +647,9 @@ extern void __lockfunc tty_unlock(void) __releases(tty_lock); | |||
| 621 | static inline void tty_wait_until_sent_from_close(struct tty_struct *tty, | 647 | static inline void tty_wait_until_sent_from_close(struct tty_struct *tty, |
| 622 | long timeout) | 648 | long timeout) |
| 623 | { | 649 | { |
| 624 | tty_unlock(); /* tty->ops->close holds the BTM, drop it while waiting */ | 650 | tty_unlock(tty); /* tty->ops->close holds the BTM, drop it while waiting */ |
| 625 | tty_wait_until_sent(tty, timeout); | 651 | tty_wait_until_sent(tty, timeout); |
| 626 | tty_lock(); | 652 | tty_lock(tty); |
| 627 | } | 653 | } |
| 628 | 654 | ||
| 629 | /* | 655 | /* |
| @@ -638,16 +664,16 @@ static inline void tty_wait_until_sent_from_close(struct tty_struct *tty, | |||
| 638 | * | 664 | * |
| 639 | * Do not use in new code. | 665 | * Do not use in new code. |
| 640 | */ | 666 | */ |
| 641 | #define wait_event_interruptible_tty(wq, condition) \ | 667 | #define wait_event_interruptible_tty(tty, wq, condition) \ |
| 642 | ({ \ | 668 | ({ \ |
| 643 | int __ret = 0; \ | 669 | int __ret = 0; \ |
| 644 | if (!(condition)) { \ | 670 | if (!(condition)) { \ |
| 645 | __wait_event_interruptible_tty(wq, condition, __ret); \ | 671 | __wait_event_interruptible_tty(tty, wq, condition, __ret); \ |
| 646 | } \ | 672 | } \ |
| 647 | __ret; \ | 673 | __ret; \ |
| 648 | }) | 674 | }) |
| 649 | 675 | ||
| 650 | #define __wait_event_interruptible_tty(wq, condition, ret) \ | 676 | #define __wait_event_interruptible_tty(tty, wq, condition, ret) \ |
| 651 | do { \ | 677 | do { \ |
| 652 | DEFINE_WAIT(__wait); \ | 678 | DEFINE_WAIT(__wait); \ |
| 653 | \ | 679 | \ |
| @@ -656,9 +682,9 @@ do { \ | |||
| 656 | if (condition) \ | 682 | if (condition) \ |
| 657 | break; \ | 683 | break; \ |
| 658 | if (!signal_pending(current)) { \ | 684 | if (!signal_pending(current)) { \ |
| 659 | tty_unlock(); \ | 685 | tty_unlock(tty); \ |
| 660 | schedule(); \ | 686 | schedule(); \ |
| 661 | tty_lock(); \ | 687 | tty_lock(tty); \ |
| 662 | continue; \ | 688 | continue; \ |
| 663 | } \ | 689 | } \ |
| 664 | ret = -ERESTARTSYS; \ | 690 | ret = -ERESTARTSYS; \ |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 6e6dbb7447b6..dd976cfb6131 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
| @@ -45,14 +45,9 @@ | |||
| 45 | * | 45 | * |
| 46 | * void (*shutdown)(struct tty_struct * tty); | 46 | * void (*shutdown)(struct tty_struct * tty); |
| 47 | * | 47 | * |
| 48 | * This routine is called synchronously when a particular tty device | 48 | * This routine is called under the tty lock when a particular tty device |
| 49 | * is closed for the last time freeing up the resources. | 49 | * is closed for the last time. It executes before the tty resources |
| 50 | * Note that tty_shutdown() is not called if ops->shutdown is defined. | 50 | * are freed so may execute while another function holds a tty kref. |
| 51 | * This means one is responsible to take care of calling ops->remove (e.g. | ||
| 52 | * via tty_driver_remove_tty) and releasing tty->termios. | ||
| 53 | * Note that this hook may be called from *all* the contexts where one | ||
| 54 | * uses tty refcounting (e.g. tty_port_tty_get). | ||
| 55 | * | ||
| 56 | * | 51 | * |
| 57 | * void (*cleanup)(struct tty_struct * tty); | 52 | * void (*cleanup)(struct tty_struct * tty); |
| 58 | * | 53 | * |
| @@ -294,18 +289,18 @@ struct tty_operations { | |||
| 294 | struct tty_driver { | 289 | struct tty_driver { |
| 295 | int magic; /* magic number for this structure */ | 290 | int magic; /* magic number for this structure */ |
| 296 | struct kref kref; /* Reference management */ | 291 | struct kref kref; /* Reference management */ |
| 297 | struct cdev cdev; | 292 | struct cdev *cdevs; |
| 298 | struct module *owner; | 293 | struct module *owner; |
| 299 | const char *driver_name; | 294 | const char *driver_name; |
| 300 | const char *name; | 295 | const char *name; |
| 301 | int name_base; /* offset of printed name */ | 296 | int name_base; /* offset of printed name */ |
| 302 | int major; /* major device number */ | 297 | int major; /* major device number */ |
| 303 | int minor_start; /* start of minor device number */ | 298 | int minor_start; /* start of minor device number */ |
| 304 | int num; /* number of devices allocated */ | 299 | unsigned int num; /* number of devices allocated */ |
| 305 | short type; /* type of tty driver */ | 300 | short type; /* type of tty driver */ |
| 306 | short subtype; /* subtype of tty driver */ | 301 | short subtype; /* subtype of tty driver */ |
| 307 | struct ktermios init_termios; /* Initial termios */ | 302 | struct ktermios init_termios; /* Initial termios */ |
| 308 | int flags; /* tty driver flags */ | 303 | unsigned long flags; /* tty driver flags */ |
| 309 | struct proc_dir_entry *proc_entry; /* /proc fs entry */ | 304 | struct proc_dir_entry *proc_entry; /* /proc fs entry */ |
| 310 | struct tty_driver *other; /* only used for the PTY driver */ | 305 | struct tty_driver *other; /* only used for the PTY driver */ |
| 311 | 306 | ||
| @@ -313,6 +308,7 @@ struct tty_driver { | |||
| 313 | * Pointer to the tty data structures | 308 | * Pointer to the tty data structures |
| 314 | */ | 309 | */ |
| 315 | struct tty_struct **ttys; | 310 | struct tty_struct **ttys; |
| 311 | struct tty_port **ports; | ||
| 316 | struct ktermios **termios; | 312 | struct ktermios **termios; |
| 317 | void *driver_state; | 313 | void *driver_state; |
| 318 | 314 | ||
| @@ -326,7 +322,8 @@ struct tty_driver { | |||
| 326 | 322 | ||
| 327 | extern struct list_head tty_drivers; | 323 | extern struct list_head tty_drivers; |
| 328 | 324 | ||
| 329 | extern struct tty_driver *__alloc_tty_driver(int lines, struct module *owner); | 325 | extern struct tty_driver *__tty_alloc_driver(unsigned int lines, |
| 326 | struct module *owner, unsigned long flags); | ||
| 330 | extern void put_tty_driver(struct tty_driver *driver); | 327 | extern void put_tty_driver(struct tty_driver *driver); |
| 331 | extern void tty_set_operations(struct tty_driver *driver, | 328 | extern void tty_set_operations(struct tty_driver *driver, |
| 332 | const struct tty_operations *op); | 329 | const struct tty_operations *op); |
| @@ -334,7 +331,21 @@ extern struct tty_driver *tty_find_polling_driver(char *name, int *line); | |||
| 334 | 331 | ||
| 335 | extern void tty_driver_kref_put(struct tty_driver *driver); | 332 | extern void tty_driver_kref_put(struct tty_driver *driver); |
| 336 | 333 | ||
| 337 | #define alloc_tty_driver(lines) __alloc_tty_driver(lines, THIS_MODULE) | 334 | /* Use TTY_DRIVER_* flags below */ |
| 335 | #define tty_alloc_driver(lines, flags) \ | ||
| 336 | __tty_alloc_driver(lines, THIS_MODULE, flags) | ||
| 337 | |||
| 338 | /* | ||
| 339 | * DEPRECATED Do not use this in new code, use tty_alloc_driver instead. | ||
| 340 | * (And change the return value checks.) | ||
| 341 | */ | ||
| 342 | static inline struct tty_driver *alloc_tty_driver(unsigned int lines) | ||
| 343 | { | ||
| 344 | struct tty_driver *ret = tty_alloc_driver(lines, 0); | ||
| 345 | if (IS_ERR(ret)) | ||
| 346 | return NULL; | ||
| 347 | return ret; | ||
| 348 | } | ||
| 338 | 349 | ||
| 339 | static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) | 350 | static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) |
| 340 | { | 351 | { |
| @@ -380,6 +391,14 @@ static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) | |||
| 380 | * the requested timeout to the caller instead of using a simple | 391 | * the requested timeout to the caller instead of using a simple |
| 381 | * on/off interface. | 392 | * on/off interface. |
| 382 | * | 393 | * |
| 394 | * TTY_DRIVER_DYNAMIC_ALLOC -- do not allocate structures which are | ||
| 395 | * needed per line for this driver as it would waste memory. | ||
| 396 | * The driver will take care. | ||
| 397 | * | ||
| 398 | * TTY_DRIVER_UNNUMBERED_NODE -- do not create numbered /dev nodes. In | ||
| 399 | * other words create /dev/ttyprintk and not /dev/ttyprintk0. | ||
| 400 | * Applicable only when a driver for a single tty device is | ||
| 401 | * being allocated. | ||
| 383 | */ | 402 | */ |
| 384 | #define TTY_DRIVER_INSTALLED 0x0001 | 403 | #define TTY_DRIVER_INSTALLED 0x0001 |
| 385 | #define TTY_DRIVER_RESET_TERMIOS 0x0002 | 404 | #define TTY_DRIVER_RESET_TERMIOS 0x0002 |
| @@ -387,6 +406,8 @@ static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) | |||
| 387 | #define TTY_DRIVER_DYNAMIC_DEV 0x0008 | 406 | #define TTY_DRIVER_DYNAMIC_DEV 0x0008 |
| 388 | #define TTY_DRIVER_DEVPTS_MEM 0x0010 | 407 | #define TTY_DRIVER_DEVPTS_MEM 0x0010 |
| 389 | #define TTY_DRIVER_HARDWARE_BREAK 0x0020 | 408 | #define TTY_DRIVER_HARDWARE_BREAK 0x0020 |
| 409 | #define TTY_DRIVER_DYNAMIC_ALLOC 0x0040 | ||
| 410 | #define TTY_DRIVER_UNNUMBERED_NODE 0x0080 | ||
| 390 | 411 | ||
| 391 | /* tty driver types */ | 412 | /* tty driver types */ |
| 392 | #define TTY_DRIVER_TYPE_SYSTEM 0x0001 | 413 | #define TTY_DRIVER_TYPE_SYSTEM 0x0001 |
diff --git a/include/linux/tty_flags.h b/include/linux/tty_flags.h new file mode 100644 index 000000000000..eefcb483a2c0 --- /dev/null +++ b/include/linux/tty_flags.h | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | #ifndef _LINUX_TTY_FLAGS_H | ||
| 2 | #define _LINUX_TTY_FLAGS_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Definitions for async_struct (and serial_struct) flags field also | ||
| 6 | * shared by the tty_port flags structures. | ||
| 7 | * | ||
| 8 | * Define ASYNCB_* for convenient use with {test,set,clear}_bit. | ||
| 9 | */ | ||
| 10 | #define ASYNCB_HUP_NOTIFY 0 /* Notify getty on hangups and closes | ||
| 11 | * on the callout port */ | ||
| 12 | #define ASYNCB_FOURPORT 1 /* Set OU1, OUT2 per AST Fourport settings */ | ||
| 13 | #define ASYNCB_SAK 2 /* Secure Attention Key (Orange book) */ | ||
| 14 | #define ASYNCB_SPLIT_TERMIOS 3 /* Separate termios for dialin/callout */ | ||
| 15 | #define ASYNCB_SPD_HI 4 /* Use 56000 instead of 38400 bps */ | ||
| 16 | #define ASYNCB_SPD_VHI 5 /* Use 115200 instead of 38400 bps */ | ||
| 17 | #define ASYNCB_SKIP_TEST 6 /* Skip UART test during autoconfiguration */ | ||
| 18 | #define ASYNCB_AUTO_IRQ 7 /* Do automatic IRQ during | ||
| 19 | * autoconfiguration */ | ||
| 20 | #define ASYNCB_SESSION_LOCKOUT 8 /* Lock out cua opens based on session */ | ||
| 21 | #define ASYNCB_PGRP_LOCKOUT 9 /* Lock out cua opens based on pgrp */ | ||
| 22 | #define ASYNCB_CALLOUT_NOHUP 10 /* Don't do hangups for cua device */ | ||
| 23 | #define ASYNCB_HARDPPS_CD 11 /* Call hardpps when CD goes high */ | ||
| 24 | #define ASYNCB_SPD_SHI 12 /* Use 230400 instead of 38400 bps */ | ||
| 25 | #define ASYNCB_LOW_LATENCY 13 /* Request low latency behaviour */ | ||
| 26 | #define ASYNCB_BUGGY_UART 14 /* This is a buggy UART, skip some safety | ||
| 27 | * checks. Note: can be dangerous! */ | ||
| 28 | #define ASYNCB_AUTOPROBE 15 /* Port was autoprobed by PCI or PNP code */ | ||
| 29 | #define ASYNCB_LAST_USER 15 | ||
| 30 | |||
| 31 | /* Internal flags used only by kernel */ | ||
| 32 | #define ASYNCB_INITIALIZED 31 /* Serial port was initialized */ | ||
| 33 | #define ASYNCB_SUSPENDED 30 /* Serial port is suspended */ | ||
| 34 | #define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */ | ||
| 35 | #define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */ | ||
| 36 | #define ASYNCB_CLOSING 27 /* Serial port is closing */ | ||
| 37 | #define ASYNCB_CTS_FLOW 26 /* Do CTS flow control */ | ||
| 38 | #define ASYNCB_CHECK_CD 25 /* i.e., CLOCAL */ | ||
| 39 | #define ASYNCB_SHARE_IRQ 24 /* for multifunction cards, no longer used */ | ||
| 40 | #define ASYNCB_CONS_FLOW 23 /* flow control for console */ | ||
| 41 | #define ASYNCB_FIRST_KERNEL 22 | ||
| 42 | |||
| 43 | #define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY) | ||
| 44 | #define ASYNC_SUSPENDED (1U << ASYNCB_SUSPENDED) | ||
| 45 | #define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT) | ||
| 46 | #define ASYNC_SAK (1U << ASYNCB_SAK) | ||
| 47 | #define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS) | ||
| 48 | #define ASYNC_SPD_HI (1U << ASYNCB_SPD_HI) | ||
| 49 | #define ASYNC_SPD_VHI (1U << ASYNCB_SPD_VHI) | ||
| 50 | #define ASYNC_SKIP_TEST (1U << ASYNCB_SKIP_TEST) | ||
| 51 | #define ASYNC_AUTO_IRQ (1U << ASYNCB_AUTO_IRQ) | ||
| 52 | #define ASYNC_SESSION_LOCKOUT (1U << ASYNCB_SESSION_LOCKOUT) | ||
| 53 | #define ASYNC_PGRP_LOCKOUT (1U << ASYNCB_PGRP_LOCKOUT) | ||
| 54 | #define ASYNC_CALLOUT_NOHUP (1U << ASYNCB_CALLOUT_NOHUP) | ||
| 55 | #define ASYNC_HARDPPS_CD (1U << ASYNCB_HARDPPS_CD) | ||
| 56 | #define ASYNC_SPD_SHI (1U << ASYNCB_SPD_SHI) | ||
| 57 | #define ASYNC_LOW_LATENCY (1U << ASYNCB_LOW_LATENCY) | ||
| 58 | #define ASYNC_BUGGY_UART (1U << ASYNCB_BUGGY_UART) | ||
| 59 | #define ASYNC_AUTOPROBE (1U << ASYNCB_AUTOPROBE) | ||
| 60 | |||
| 61 | #define ASYNC_FLAGS ((1U << (ASYNCB_LAST_USER + 1)) - 1) | ||
| 62 | #define ASYNC_USR_MASK (ASYNC_SPD_MASK|ASYNC_CALLOUT_NOHUP| \ | ||
| 63 | ASYNC_LOW_LATENCY) | ||
| 64 | #define ASYNC_SPD_CUST (ASYNC_SPD_HI|ASYNC_SPD_VHI) | ||
| 65 | #define ASYNC_SPD_WARP (ASYNC_SPD_HI|ASYNC_SPD_SHI) | ||
| 66 | #define ASYNC_SPD_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI|ASYNC_SPD_SHI) | ||
| 67 | |||
| 68 | #define ASYNC_INITIALIZED (1U << ASYNCB_INITIALIZED) | ||
| 69 | #define ASYNC_NORMAL_ACTIVE (1U << ASYNCB_NORMAL_ACTIVE) | ||
| 70 | #define ASYNC_BOOT_AUTOCONF (1U << ASYNCB_BOOT_AUTOCONF) | ||
| 71 | #define ASYNC_CLOSING (1U << ASYNCB_CLOSING) | ||
| 72 | #define ASYNC_CTS_FLOW (1U << ASYNCB_CTS_FLOW) | ||
| 73 | #define ASYNC_CHECK_CD (1U << ASYNCB_CHECK_CD) | ||
| 74 | #define ASYNC_SHARE_IRQ (1U << ASYNCB_SHARE_IRQ) | ||
| 75 | #define ASYNC_CONS_FLOW (1U << ASYNCB_CONS_FLOW) | ||
| 76 | #define ASYNC_INTERNAL_FLAGS (~((1U << ASYNCB_FIRST_KERNEL) - 1)) | ||
| 77 | |||
| 78 | #endif | ||
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index efe4b3308c74..e6f0331e3d45 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h | |||
| @@ -99,25 +99,27 @@ struct xol_area { | |||
| 99 | 99 | ||
| 100 | struct uprobes_state { | 100 | struct uprobes_state { |
| 101 | struct xol_area *xol_area; | 101 | struct xol_area *xol_area; |
| 102 | atomic_t count; | ||
| 103 | }; | 102 | }; |
| 103 | |||
| 104 | extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); | 104 | extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); |
| 105 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr, bool verify); | 105 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); |
| 106 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); | 106 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); |
| 107 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); | 107 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
| 108 | extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); | 108 | extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
| 109 | extern int uprobe_mmap(struct vm_area_struct *vma); | 109 | extern int uprobe_mmap(struct vm_area_struct *vma); |
| 110 | extern void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end); | 110 | extern void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end); |
| 111 | extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); | ||
| 111 | extern void uprobe_free_utask(struct task_struct *t); | 112 | extern void uprobe_free_utask(struct task_struct *t); |
| 112 | extern void uprobe_copy_process(struct task_struct *t); | 113 | extern void uprobe_copy_process(struct task_struct *t); |
| 113 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); | 114 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); |
| 115 | extern void __weak arch_uprobe_enable_step(struct arch_uprobe *arch); | ||
| 116 | extern void __weak arch_uprobe_disable_step(struct arch_uprobe *arch); | ||
| 114 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); | 117 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); |
| 115 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); | 118 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); |
| 116 | extern void uprobe_notify_resume(struct pt_regs *regs); | 119 | extern void uprobe_notify_resume(struct pt_regs *regs); |
| 117 | extern bool uprobe_deny_signal(void); | 120 | extern bool uprobe_deny_signal(void); |
| 118 | extern bool __weak arch_uprobe_skip_sstep(struct arch_uprobe *aup, struct pt_regs *regs); | 121 | extern bool __weak arch_uprobe_skip_sstep(struct arch_uprobe *aup, struct pt_regs *regs); |
| 119 | extern void uprobe_clear_state(struct mm_struct *mm); | 122 | extern void uprobe_clear_state(struct mm_struct *mm); |
| 120 | extern void uprobe_reset_state(struct mm_struct *mm); | ||
| 121 | #else /* !CONFIG_UPROBES */ | 123 | #else /* !CONFIG_UPROBES */ |
| 122 | struct uprobes_state { | 124 | struct uprobes_state { |
| 123 | }; | 125 | }; |
| @@ -138,6 +140,10 @@ static inline void | |||
| 138 | uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end) | 140 | uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end) |
| 139 | { | 141 | { |
| 140 | } | 142 | } |
| 143 | static inline void | ||
| 144 | uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm) | ||
| 145 | { | ||
| 146 | } | ||
| 141 | static inline void uprobe_notify_resume(struct pt_regs *regs) | 147 | static inline void uprobe_notify_resume(struct pt_regs *regs) |
| 142 | { | 148 | { |
| 143 | } | 149 | } |
| @@ -158,8 +164,5 @@ static inline void uprobe_copy_process(struct task_struct *t) | |||
| 158 | static inline void uprobe_clear_state(struct mm_struct *mm) | 164 | static inline void uprobe_clear_state(struct mm_struct *mm) |
| 159 | { | 165 | { |
| 160 | } | 166 | } |
| 161 | static inline void uprobe_reset_state(struct mm_struct *mm) | ||
| 162 | { | ||
| 163 | } | ||
| 164 | #endif /* !CONFIG_UPROBES */ | 167 | #endif /* !CONFIG_UPROBES */ |
| 165 | #endif /* _LINUX_UPROBES_H */ | 168 | #endif /* _LINUX_UPROBES_H */ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 30d1ae38eab1..07915a32fb9d 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -384,6 +384,13 @@ enum usb_device_removable { | |||
| 384 | USB_DEVICE_FIXED, | 384 | USB_DEVICE_FIXED, |
| 385 | }; | 385 | }; |
| 386 | 386 | ||
| 387 | enum usb_port_connect_type { | ||
| 388 | USB_PORT_CONNECT_TYPE_UNKNOWN = 0, | ||
| 389 | USB_PORT_CONNECT_TYPE_HOT_PLUG, | ||
| 390 | USB_PORT_CONNECT_TYPE_HARD_WIRED, | ||
| 391 | USB_PORT_NOT_USED, | ||
| 392 | }; | ||
| 393 | |||
| 387 | /* | 394 | /* |
| 388 | * USB 3.0 Link Power Management (LPM) parameters. | 395 | * USB 3.0 Link Power Management (LPM) parameters. |
| 389 | * | 396 | * |
| @@ -469,7 +476,6 @@ struct usb3_lpm_parameters { | |||
| 469 | * access from userspace | 476 | * access from userspace |
| 470 | * @usbfs_dentry: usbfs dentry entry for the device | 477 | * @usbfs_dentry: usbfs dentry entry for the device |
| 471 | * @maxchild: number of ports if hub | 478 | * @maxchild: number of ports if hub |
| 472 | * @children: child devices - USB devices that are attached to this hub | ||
| 473 | * @quirks: quirks of the whole device | 479 | * @quirks: quirks of the whole device |
| 474 | * @urbnum: number of URBs submitted for the whole device | 480 | * @urbnum: number of URBs submitted for the whole device |
| 475 | * @active_duration: total time device is not suspended | 481 | * @active_duration: total time device is not suspended |
| @@ -543,7 +549,6 @@ struct usb_device { | |||
| 543 | struct list_head filelist; | 549 | struct list_head filelist; |
| 544 | 550 | ||
| 545 | int maxchild; | 551 | int maxchild; |
| 546 | struct usb_device **children; | ||
| 547 | 552 | ||
| 548 | u32 quirks; | 553 | u32 quirks; |
| 549 | atomic_t urbnum; | 554 | atomic_t urbnum; |
| @@ -572,6 +577,19 @@ static inline struct usb_device *interface_to_usbdev(struct usb_interface *intf) | |||
| 572 | 577 | ||
| 573 | extern struct usb_device *usb_get_dev(struct usb_device *dev); | 578 | extern struct usb_device *usb_get_dev(struct usb_device *dev); |
| 574 | extern void usb_put_dev(struct usb_device *dev); | 579 | extern void usb_put_dev(struct usb_device *dev); |
| 580 | extern struct usb_device *usb_hub_find_child(struct usb_device *hdev, | ||
| 581 | int port1); | ||
| 582 | |||
| 583 | /** | ||
| 584 | * usb_hub_for_each_child - iterate over all child devices on the hub | ||
| 585 | * @hdev: USB device belonging to the usb hub | ||
| 586 | * @port1: portnum associated with child device | ||
| 587 | * @child: child device pointer | ||
| 588 | */ | ||
| 589 | #define usb_hub_for_each_child(hdev, port1, child) \ | ||
| 590 | for (port1 = 1, child = usb_hub_find_child(hdev, port1); \ | ||
| 591 | port1 <= hdev->maxchild; \ | ||
| 592 | child = usb_hub_find_child(hdev, ++port1)) | ||
| 575 | 593 | ||
| 576 | /* USB device locking */ | 594 | /* USB device locking */ |
| 577 | #define usb_lock_device(udev) device_lock(&(udev)->dev) | 595 | #define usb_lock_device(udev) device_lock(&(udev)->dev) |
| @@ -584,6 +602,16 @@ extern int usb_lock_device_for_reset(struct usb_device *udev, | |||
| 584 | extern int usb_reset_device(struct usb_device *dev); | 602 | extern int usb_reset_device(struct usb_device *dev); |
| 585 | extern void usb_queue_reset_device(struct usb_interface *dev); | 603 | extern void usb_queue_reset_device(struct usb_interface *dev); |
| 586 | 604 | ||
| 605 | #ifdef CONFIG_ACPI | ||
| 606 | extern int usb_acpi_set_power_state(struct usb_device *hdev, int index, | ||
| 607 | bool enable); | ||
| 608 | extern bool usb_acpi_power_manageable(struct usb_device *hdev, int index); | ||
| 609 | #else | ||
| 610 | static inline int usb_acpi_set_power_state(struct usb_device *hdev, int index, | ||
| 611 | bool enable) { return 0; } | ||
| 612 | static inline bool usb_acpi_power_manageable(struct usb_device *hdev, int index) | ||
| 613 | { return true; } | ||
| 614 | #endif | ||
| 587 | 615 | ||
| 588 | /* USB autosuspend and autoresume */ | 616 | /* USB autosuspend and autoresume */ |
| 589 | #ifdef CONFIG_USB_SUSPEND | 617 | #ifdef CONFIG_USB_SUSPEND |
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h index b6c2863b2c94..7692dc69ccf7 100644 --- a/include/linux/usb/ch11.h +++ b/include/linux/usb/ch11.h | |||
| @@ -236,8 +236,8 @@ struct usb_hub_descriptor { | |||
| 236 | 236 | ||
| 237 | struct { | 237 | struct { |
| 238 | __u8 bHubHdrDecLat; | 238 | __u8 bHubHdrDecLat; |
| 239 | __u16 wHubDelay; | 239 | __le16 wHubDelay; |
| 240 | __u16 DeviceRemovable; | 240 | __le16 DeviceRemovable; |
| 241 | } __attribute__ ((packed)) ss; | 241 | } __attribute__ ((packed)) ss; |
| 242 | } u; | 242 | } u; |
| 243 | } __attribute__ ((packed)); | 243 | } __attribute__ ((packed)); |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 9d8c3b634493..f8dda0621800 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
| @@ -34,6 +34,8 @@ | |||
| 34 | * the composite model the host can use both functions at the same time. | 34 | * the composite model the host can use both functions at the same time. |
| 35 | */ | 35 | */ |
| 36 | 36 | ||
| 37 | #include <linux/bcd.h> | ||
| 38 | #include <linux/version.h> | ||
| 37 | #include <linux/usb/ch9.h> | 39 | #include <linux/usb/ch9.h> |
| 38 | #include <linux/usb/gadget.h> | 40 | #include <linux/usb/gadget.h> |
| 39 | 41 | ||
| @@ -46,6 +48,9 @@ | |||
| 46 | */ | 48 | */ |
| 47 | #define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */ | 49 | #define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */ |
| 48 | 50 | ||
| 51 | /* big enough to hold our biggest descriptor */ | ||
| 52 | #define USB_COMP_EP0_BUFSIZ 1024 | ||
| 53 | |||
| 49 | struct usb_configuration; | 54 | struct usb_configuration; |
| 50 | 55 | ||
| 51 | /** | 56 | /** |
| @@ -245,24 +250,31 @@ int usb_add_config(struct usb_composite_dev *, | |||
| 245 | void usb_remove_config(struct usb_composite_dev *, | 250 | void usb_remove_config(struct usb_composite_dev *, |
| 246 | struct usb_configuration *); | 251 | struct usb_configuration *); |
| 247 | 252 | ||
| 253 | /* predefined index for usb_composite_driver */ | ||
| 254 | enum { | ||
| 255 | USB_GADGET_MANUFACTURER_IDX = 0, | ||
| 256 | USB_GADGET_PRODUCT_IDX, | ||
| 257 | USB_GADGET_SERIAL_IDX, | ||
| 258 | USB_GADGET_FIRST_AVAIL_IDX, | ||
| 259 | }; | ||
| 260 | |||
| 248 | /** | 261 | /** |
| 249 | * struct usb_composite_driver - groups configurations into a gadget | 262 | * struct usb_composite_driver - groups configurations into a gadget |
| 250 | * @name: For diagnostics, identifies the driver. | 263 | * @name: For diagnostics, identifies the driver. |
| 251 | * @iProduct: Used as iProduct override if @dev->iProduct is not set. | ||
| 252 | * If NULL value of @name is taken. | ||
| 253 | * @iManufacturer: Used as iManufacturer override if @dev->iManufacturer is | ||
| 254 | * not set. If NULL a default "<system> <release> with <udc>" value | ||
| 255 | * will be used. | ||
| 256 | * @iSerialNumber: Used as iSerialNumber override if @dev->iSerialNumber is | ||
| 257 | * not set. | ||
| 258 | * @dev: Template descriptor for the device, including default device | 264 | * @dev: Template descriptor for the device, including default device |
| 259 | * identifiers. | 265 | * identifiers. |
| 260 | * @strings: tables of strings, keyed by identifiers assigned during bind() | 266 | * @strings: tables of strings, keyed by identifiers assigned during @bind |
| 261 | * and language IDs provided in control requests | 267 | * and language IDs provided in control requests. Note: The first entries |
| 268 | * are predefined. The first entry that may be used is | ||
| 269 | * USB_GADGET_FIRST_AVAIL_IDX | ||
| 262 | * @max_speed: Highest speed the driver supports. | 270 | * @max_speed: Highest speed the driver supports. |
| 263 | * @needs_serial: set to 1 if the gadget needs userspace to provide | 271 | * @needs_serial: set to 1 if the gadget needs userspace to provide |
| 264 | * a serial number. If one is not provided, warning will be printed. | 272 | * a serial number. If one is not provided, warning will be printed. |
| 265 | * @unbind: Reverses bind; called as a side effect of unregistering | 273 | * @bind: (REQUIRED) Used to allocate resources that are shared across the |
| 274 | * whole device, such as string IDs, and add its configurations using | ||
| 275 | * @usb_add_config(). This may fail by returning a negative errno | ||
| 276 | * value; it should return zero on successful initialization. | ||
| 277 | * @unbind: Reverses @bind; called as a side effect of unregistering | ||
| 266 | * this driver. | 278 | * this driver. |
| 267 | * @disconnect: optional driver disconnect method | 279 | * @disconnect: optional driver disconnect method |
| 268 | * @suspend: Notifies when the host stops sending USB traffic, | 280 | * @suspend: Notifies when the host stops sending USB traffic, |
| @@ -271,9 +283,9 @@ void usb_remove_config(struct usb_composite_dev *, | |||
| 271 | * before function notifications | 283 | * before function notifications |
| 272 | * | 284 | * |
| 273 | * Devices default to reporting self powered operation. Devices which rely | 285 | * Devices default to reporting self powered operation. Devices which rely |
| 274 | * on bus powered operation should report this in their @bind() method. | 286 | * on bus powered operation should report this in their @bind method. |
| 275 | * | 287 | * |
| 276 | * Before returning from bind, various fields in the template descriptor | 288 | * Before returning from @bind, various fields in the template descriptor |
| 277 | * may be overridden. These include the idVendor/idProduct/bcdDevice values | 289 | * may be overridden. These include the idVendor/idProduct/bcdDevice values |
| 278 | * normally to bind the appropriate host side driver, and the three strings | 290 | * normally to bind the appropriate host side driver, and the three strings |
| 279 | * (iManufacturer, iProduct, iSerialNumber) normally used to provide user | 291 | * (iManufacturer, iProduct, iSerialNumber) normally used to provide user |
| @@ -283,14 +295,12 @@ void usb_remove_config(struct usb_composite_dev *, | |||
| 283 | */ | 295 | */ |
| 284 | struct usb_composite_driver { | 296 | struct usb_composite_driver { |
| 285 | const char *name; | 297 | const char *name; |
| 286 | const char *iProduct; | ||
| 287 | const char *iManufacturer; | ||
| 288 | const char *iSerialNumber; | ||
| 289 | const struct usb_device_descriptor *dev; | 298 | const struct usb_device_descriptor *dev; |
| 290 | struct usb_gadget_strings **strings; | 299 | struct usb_gadget_strings **strings; |
| 291 | enum usb_device_speed max_speed; | 300 | enum usb_device_speed max_speed; |
| 292 | unsigned needs_serial:1; | 301 | unsigned needs_serial:1; |
| 293 | 302 | ||
| 303 | int (*bind)(struct usb_composite_dev *cdev); | ||
| 294 | int (*unbind)(struct usb_composite_dev *); | 304 | int (*unbind)(struct usb_composite_dev *); |
| 295 | 305 | ||
| 296 | void (*disconnect)(struct usb_composite_dev *); | 306 | void (*disconnect)(struct usb_composite_dev *); |
| @@ -298,10 +308,10 @@ struct usb_composite_driver { | |||
| 298 | /* global suspend hooks */ | 308 | /* global suspend hooks */ |
| 299 | void (*suspend)(struct usb_composite_dev *); | 309 | void (*suspend)(struct usb_composite_dev *); |
| 300 | void (*resume)(struct usb_composite_dev *); | 310 | void (*resume)(struct usb_composite_dev *); |
| 311 | struct usb_gadget_driver gadget_driver; | ||
| 301 | }; | 312 | }; |
| 302 | 313 | ||
| 303 | extern int usb_composite_probe(struct usb_composite_driver *driver, | 314 | extern int usb_composite_probe(struct usb_composite_driver *driver); |
| 304 | int (*bind)(struct usb_composite_dev *cdev)); | ||
| 305 | extern void usb_composite_unregister(struct usb_composite_driver *driver); | 315 | extern void usb_composite_unregister(struct usb_composite_driver *driver); |
| 306 | extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); | 316 | extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); |
| 307 | 317 | ||
| @@ -310,7 +320,6 @@ extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); | |||
| 310 | * struct usb_composite_device - represents one composite usb gadget | 320 | * struct usb_composite_device - represents one composite usb gadget |
| 311 | * @gadget: read-only, abstracts the gadget's usb peripheral controller | 321 | * @gadget: read-only, abstracts the gadget's usb peripheral controller |
| 312 | * @req: used for control responses; buffer is pre-allocated | 322 | * @req: used for control responses; buffer is pre-allocated |
| 313 | * @bufsiz: size of buffer pre-allocated in @req | ||
| 314 | * @config: the currently active configuration | 323 | * @config: the currently active configuration |
| 315 | * | 324 | * |
| 316 | * One of these devices is allocated and initialized before the | 325 | * One of these devices is allocated and initialized before the |
| @@ -341,7 +350,6 @@ extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); | |||
| 341 | struct usb_composite_dev { | 350 | struct usb_composite_dev { |
| 342 | struct usb_gadget *gadget; | 351 | struct usb_gadget *gadget; |
| 343 | struct usb_request *req; | 352 | struct usb_request *req; |
| 344 | unsigned bufsiz; | ||
| 345 | 353 | ||
| 346 | struct usb_configuration *config; | 354 | struct usb_configuration *config; |
| 347 | 355 | ||
| @@ -352,9 +360,7 @@ struct usb_composite_dev { | |||
| 352 | struct list_head configs; | 360 | struct list_head configs; |
| 353 | struct usb_composite_driver *driver; | 361 | struct usb_composite_driver *driver; |
| 354 | u8 next_string_id; | 362 | u8 next_string_id; |
| 355 | u8 manufacturer_override; | 363 | char *def_manufacturer; |
| 356 | u8 product_override; | ||
| 357 | u8 serial_override; | ||
| 358 | 364 | ||
| 359 | /* the gadget driver won't enable the data pullup | 365 | /* the gadget driver won't enable the data pullup |
| 360 | * while the deactivation count is nonzero. | 366 | * while the deactivation count is nonzero. |
| @@ -375,6 +381,53 @@ extern int usb_string_ids_tab(struct usb_composite_dev *c, | |||
| 375 | struct usb_string *str); | 381 | struct usb_string *str); |
| 376 | extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n); | 382 | extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n); |
| 377 | 383 | ||
| 384 | /* | ||
| 385 | * Some systems will need runtime overrides for the product identifiers | ||
| 386 | * published in the device descriptor, either numbers or strings or both. | ||
| 387 | * String parameters are in UTF-8 (superset of ASCII's 7 bit characters). | ||
| 388 | */ | ||
| 389 | struct usb_composite_overwrite { | ||
| 390 | u16 idVendor; | ||
| 391 | u16 idProduct; | ||
| 392 | u16 bcdDevice; | ||
| 393 | char *serial_number; | ||
| 394 | char *manufacturer; | ||
| 395 | char *product; | ||
| 396 | }; | ||
| 397 | #define USB_GADGET_COMPOSITE_OPTIONS() \ | ||
| 398 | static struct usb_composite_overwrite coverwrite; \ | ||
| 399 | \ | ||
| 400 | module_param_named(idVendor, coverwrite.idVendor, ushort, S_IRUGO); \ | ||
| 401 | MODULE_PARM_DESC(idVendor, "USB Vendor ID"); \ | ||
| 402 | \ | ||
| 403 | module_param_named(idProduct, coverwrite.idProduct, ushort, S_IRUGO); \ | ||
| 404 | MODULE_PARM_DESC(idProduct, "USB Product ID"); \ | ||
| 405 | \ | ||
| 406 | module_param_named(bcdDevice, coverwrite.bcdDevice, ushort, S_IRUGO); \ | ||
| 407 | MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)"); \ | ||
| 408 | \ | ||
| 409 | module_param_named(iSerialNumber, coverwrite.serial_number, charp, \ | ||
| 410 | S_IRUGO); \ | ||
| 411 | MODULE_PARM_DESC(iSerialNumber, "SerialNumber string"); \ | ||
| 412 | \ | ||
| 413 | module_param_named(iManufacturer, coverwrite.manufacturer, charp, \ | ||
| 414 | S_IRUGO); \ | ||
| 415 | MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string"); \ | ||
| 416 | \ | ||
| 417 | module_param_named(iProduct, coverwrite.product, charp, S_IRUGO); \ | ||
| 418 | MODULE_PARM_DESC(iProduct, "USB Product string") | ||
| 419 | |||
| 420 | void usb_composite_overwrite_options(struct usb_composite_dev *cdev, | ||
| 421 | struct usb_composite_overwrite *covr); | ||
| 422 | |||
| 423 | static inline u16 get_default_bcdDevice(void) | ||
| 424 | { | ||
| 425 | u16 bcdDevice; | ||
| 426 | |||
| 427 | bcdDevice = bin2bcd((LINUX_VERSION_CODE >> 16 & 0xff)) << 8; | ||
| 428 | bcdDevice |= bin2bcd((LINUX_VERSION_CODE >> 8 & 0xff)); | ||
| 429 | return bcdDevice; | ||
| 430 | } | ||
| 378 | 431 | ||
| 379 | /* messaging utils */ | 432 | /* messaging utils */ |
| 380 | #define DBG(d, fmt, args...) \ | 433 | #define DBG(d, fmt, args...) \ |
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h index de4b9ed5d5dd..daec99af5d54 100644 --- a/include/linux/usb/ehci_def.h +++ b/include/linux/usb/ehci_def.h | |||
| @@ -171,18 +171,18 @@ struct ehci_regs { | |||
| 171 | #define USBMODE_CM_HC (3<<0) /* host controller mode */ | 171 | #define USBMODE_CM_HC (3<<0) /* host controller mode */ |
| 172 | #define USBMODE_CM_IDLE (0<<0) /* idle state */ | 172 | #define USBMODE_CM_IDLE (0<<0) /* idle state */ |
| 173 | 173 | ||
| 174 | u32 reserved4[7]; | 174 | u32 reserved4[6]; |
| 175 | 175 | ||
| 176 | /* Moorestown has some non-standard registers, partially due to the fact that | 176 | /* Moorestown has some non-standard registers, partially due to the fact that |
| 177 | * its EHCI controller has both TT and LPM support. HOSTPCx are extensions to | 177 | * its EHCI controller has both TT and LPM support. HOSTPCx are extensions to |
| 178 | * PORTSCx | 178 | * PORTSCx |
| 179 | */ | 179 | */ |
| 180 | /* HOSTPC: offset 0x84 */ | 180 | /* HOSTPC: offset 0x84 */ |
| 181 | u32 hostpc[0]; /* HOSTPC extension */ | 181 | u32 hostpc[1]; /* HOSTPC extension */ |
| 182 | #define HOSTPC_PHCD (1<<22) /* Phy clock disable */ | 182 | #define HOSTPC_PHCD (1<<22) /* Phy clock disable */ |
| 183 | #define HOSTPC_PSPD (3<<25) /* Port speed detection */ | 183 | #define HOSTPC_PSPD (3<<25) /* Port speed detection */ |
| 184 | 184 | ||
| 185 | u32 reserved5[17]; | 185 | u32 reserved5[16]; |
| 186 | 186 | ||
| 187 | /* USBMODE_EX: offset 0xc8 */ | 187 | /* USBMODE_EX: offset 0xc8 */ |
| 188 | u32 usbmode_ex; /* USB Device mode extension */ | 188 | u32 usbmode_ex; /* USB Device mode extension */ |
| @@ -221,18 +221,35 @@ extern int __init early_dbgp_init(char *s); | |||
| 221 | extern struct console early_dbgp_console; | 221 | extern struct console early_dbgp_console; |
| 222 | #endif /* CONFIG_EARLY_PRINTK_DBGP */ | 222 | #endif /* CONFIG_EARLY_PRINTK_DBGP */ |
| 223 | 223 | ||
| 224 | struct usb_hcd; | ||
| 225 | |||
| 226 | #ifdef CONFIG_XEN_DOM0 | ||
| 227 | extern int xen_dbgp_reset_prep(struct usb_hcd *); | ||
| 228 | extern int xen_dbgp_external_startup(struct usb_hcd *); | ||
| 229 | #else | ||
| 230 | static inline int xen_dbgp_reset_prep(struct usb_hcd *hcd) | ||
| 231 | { | ||
| 232 | return 1; /* Shouldn't this be 0? */ | ||
| 233 | } | ||
| 234 | |||
| 235 | static inline int xen_dbgp_external_startup(struct usb_hcd *hcd) | ||
| 236 | { | ||
| 237 | return -1; | ||
| 238 | } | ||
| 239 | #endif | ||
| 240 | |||
| 224 | #ifdef CONFIG_EARLY_PRINTK_DBGP | 241 | #ifdef CONFIG_EARLY_PRINTK_DBGP |
| 225 | /* Call backs from ehci host driver to ehci debug driver */ | 242 | /* Call backs from ehci host driver to ehci debug driver */ |
| 226 | extern int dbgp_external_startup(void); | 243 | extern int dbgp_external_startup(struct usb_hcd *); |
| 227 | extern int dbgp_reset_prep(void); | 244 | extern int dbgp_reset_prep(struct usb_hcd *hcd); |
| 228 | #else | 245 | #else |
| 229 | static inline int dbgp_reset_prep(void) | 246 | static inline int dbgp_reset_prep(struct usb_hcd *hcd) |
| 230 | { | 247 | { |
| 231 | return 1; | 248 | return xen_dbgp_reset_prep(hcd); |
| 232 | } | 249 | } |
| 233 | static inline int dbgp_external_startup(void) | 250 | static inline int dbgp_external_startup(struct usb_hcd *hcd) |
| 234 | { | 251 | { |
| 235 | return -1; | 252 | return xen_dbgp_external_startup(hcd); |
| 236 | } | 253 | } |
| 237 | #endif | 254 | #endif |
| 238 | 255 | ||
diff --git a/include/linux/usb/ehci_pdriver.h b/include/linux/usb/ehci_pdriver.h index 1894f42fe3f7..c9d09f8b7ff2 100644 --- a/include/linux/usb/ehci_pdriver.h +++ b/include/linux/usb/ehci_pdriver.h | |||
| @@ -41,6 +41,14 @@ struct usb_ehci_pdata { | |||
| 41 | unsigned big_endian_mmio:1; | 41 | unsigned big_endian_mmio:1; |
| 42 | unsigned port_power_on:1; | 42 | unsigned port_power_on:1; |
| 43 | unsigned port_power_off:1; | 43 | unsigned port_power_off:1; |
| 44 | |||
| 45 | /* Turn on all power and clocks */ | ||
| 46 | int (*power_on)(struct platform_device *pdev); | ||
| 47 | /* Turn off all power and clocks */ | ||
| 48 | void (*power_off)(struct platform_device *pdev); | ||
| 49 | /* Turn on only VBUS suspend power and hotplug detection, | ||
| 50 | * turn off everything else */ | ||
| 51 | void (*power_suspend)(struct platform_device *pdev); | ||
| 44 | }; | 52 | }; |
| 45 | 53 | ||
| 46 | #endif /* __USB_CORE_EHCI_PDRIVER_H */ | 54 | #endif /* __USB_CORE_EHCI_PDRIVER_H */ |
diff --git a/include/linux/usb/ezusb.h b/include/linux/usb/ezusb.h new file mode 100644 index 000000000000..fc618d8d1e92 --- /dev/null +++ b/include/linux/usb/ezusb.h | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #ifndef __EZUSB_H | ||
| 2 | #define __EZUSB_H | ||
| 3 | |||
| 4 | |||
| 5 | extern int ezusb_writememory(struct usb_device *dev, int address, | ||
| 6 | unsigned char *data, int length, __u8 bRequest); | ||
| 7 | |||
| 8 | extern int ezusb_fx1_set_reset(struct usb_device *dev, unsigned char reset_bit); | ||
| 9 | extern int ezusb_fx2_set_reset(struct usb_device *dev, unsigned char reset_bit); | ||
| 10 | |||
| 11 | extern int ezusb_fx1_ihex_firmware_download(struct usb_device *dev, | ||
| 12 | const char *firmware_path); | ||
| 13 | extern int ezusb_fx2_ihex_firmware_download(struct usb_device *dev, | ||
| 14 | const char *firmware_path); | ||
| 15 | |||
| 16 | #endif /* __EZUSB_H */ | ||
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 9517466ababb..5b6e50888248 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
| @@ -474,7 +474,8 @@ struct usb_gadget_ops { | |||
| 474 | 474 | ||
| 475 | /* Those two are deprecated */ | 475 | /* Those two are deprecated */ |
| 476 | int (*start)(struct usb_gadget_driver *, | 476 | int (*start)(struct usb_gadget_driver *, |
| 477 | int (*bind)(struct usb_gadget *)); | 477 | int (*bind)(struct usb_gadget *, |
| 478 | struct usb_gadget_driver *driver)); | ||
| 478 | int (*stop)(struct usb_gadget_driver *); | 479 | int (*stop)(struct usb_gadget_driver *); |
| 479 | }; | 480 | }; |
| 480 | 481 | ||
| @@ -502,6 +503,8 @@ struct usb_gadget_ops { | |||
| 502 | * @name: Identifies the controller hardware type. Used in diagnostics | 503 | * @name: Identifies the controller hardware type. Used in diagnostics |
| 503 | * and sometimes configuration. | 504 | * and sometimes configuration. |
| 504 | * @dev: Driver model state for this abstract device. | 505 | * @dev: Driver model state for this abstract device. |
| 506 | * @out_epnum: last used out ep number | ||
| 507 | * @in_epnum: last used in ep number | ||
| 505 | * | 508 | * |
| 506 | * Gadgets have a mostly-portable "gadget driver" implementing device | 509 | * Gadgets have a mostly-portable "gadget driver" implementing device |
| 507 | * functions, handling all usb configurations and interfaces. Gadget | 510 | * functions, handling all usb configurations and interfaces. Gadget |
| @@ -536,6 +539,8 @@ struct usb_gadget { | |||
| 536 | unsigned a_alt_hnp_support:1; | 539 | unsigned a_alt_hnp_support:1; |
| 537 | const char *name; | 540 | const char *name; |
| 538 | struct device dev; | 541 | struct device dev; |
| 542 | unsigned out_epnum; | ||
| 543 | unsigned in_epnum; | ||
| 539 | }; | 544 | }; |
| 540 | 545 | ||
| 541 | static inline void set_gadget_data(struct usb_gadget *gadget, void *data) | 546 | static inline void set_gadget_data(struct usb_gadget *gadget, void *data) |
| @@ -558,14 +563,7 @@ static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev) | |||
| 558 | */ | 563 | */ |
| 559 | static inline int gadget_is_dualspeed(struct usb_gadget *g) | 564 | static inline int gadget_is_dualspeed(struct usb_gadget *g) |
| 560 | { | 565 | { |
| 561 | #ifdef CONFIG_USB_GADGET_DUALSPEED | 566 | return g->max_speed >= USB_SPEED_HIGH; |
| 562 | /* runtime test would check "g->max_speed" ... that might be | ||
| 563 | * useful to work around hardware bugs, but is mostly pointless | ||
| 564 | */ | ||
| 565 | return 1; | ||
| 566 | #else | ||
| 567 | return 0; | ||
| 568 | #endif | ||
| 569 | } | 567 | } |
| 570 | 568 | ||
| 571 | /** | 569 | /** |
| @@ -575,15 +573,7 @@ static inline int gadget_is_dualspeed(struct usb_gadget *g) | |||
| 575 | */ | 573 | */ |
| 576 | static inline int gadget_is_superspeed(struct usb_gadget *g) | 574 | static inline int gadget_is_superspeed(struct usb_gadget *g) |
| 577 | { | 575 | { |
| 578 | #ifdef CONFIG_USB_GADGET_SUPERSPEED | 576 | return g->max_speed >= USB_SPEED_SUPER; |
| 579 | /* | ||
| 580 | * runtime test would check "g->max_speed" ... that might be | ||
| 581 | * useful to work around hardware bugs, but is mostly pointless | ||
| 582 | */ | ||
| 583 | return 1; | ||
| 584 | #else | ||
| 585 | return 0; | ||
| 586 | #endif | ||
| 587 | } | 577 | } |
| 588 | 578 | ||
| 589 | /** | 579 | /** |
| @@ -781,6 +771,7 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget) | |||
| 781 | * when the host is disconnected. May be called in_interrupt; this | 771 | * when the host is disconnected. May be called in_interrupt; this |
| 782 | * may not sleep. Some devices can't detect disconnect, so this might | 772 | * may not sleep. Some devices can't detect disconnect, so this might |
| 783 | * not be called except as part of controller shutdown. | 773 | * not be called except as part of controller shutdown. |
| 774 | * @bind: the driver's bind callback | ||
| 784 | * @unbind: Invoked when the driver is unbound from a gadget, | 775 | * @unbind: Invoked when the driver is unbound from a gadget, |
| 785 | * usually from rmmod (after a disconnect is reported). | 776 | * usually from rmmod (after a disconnect is reported). |
| 786 | * Called in a context that permits sleeping. | 777 | * Called in a context that permits sleeping. |
| @@ -835,6 +826,8 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget) | |||
| 835 | struct usb_gadget_driver { | 826 | struct usb_gadget_driver { |
| 836 | char *function; | 827 | char *function; |
| 837 | enum usb_device_speed max_speed; | 828 | enum usb_device_speed max_speed; |
| 829 | int (*bind)(struct usb_gadget *gadget, | ||
| 830 | struct usb_gadget_driver *driver); | ||
| 838 | void (*unbind)(struct usb_gadget *); | 831 | void (*unbind)(struct usb_gadget *); |
| 839 | int (*setup)(struct usb_gadget *, | 832 | int (*setup)(struct usb_gadget *, |
| 840 | const struct usb_ctrlrequest *); | 833 | const struct usb_ctrlrequest *); |
| @@ -860,7 +853,6 @@ struct usb_gadget_driver { | |||
| 860 | /** | 853 | /** |
| 861 | * usb_gadget_probe_driver - probe a gadget driver | 854 | * usb_gadget_probe_driver - probe a gadget driver |
| 862 | * @driver: the driver being registered | 855 | * @driver: the driver being registered |
| 863 | * @bind: the driver's bind callback | ||
| 864 | * Context: can sleep | 856 | * Context: can sleep |
| 865 | * | 857 | * |
| 866 | * Call this in your gadget driver's module initialization function, | 858 | * Call this in your gadget driver's module initialization function, |
| @@ -869,8 +861,7 @@ struct usb_gadget_driver { | |||
| 869 | * registration call returns. It's expected that the @bind() function will | 861 | * registration call returns. It's expected that the @bind() function will |
| 870 | * be in init sections. | 862 | * be in init sections. |
| 871 | */ | 863 | */ |
| 872 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | 864 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver); |
| 873 | int (*bind)(struct usb_gadget *)); | ||
| 874 | 865 | ||
| 875 | /** | 866 | /** |
| 876 | * usb_gadget_unregister_driver - unregister a gadget driver | 867 | * usb_gadget_unregister_driver - unregister a gadget driver |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index c5fdb148fc02..608050b2545f 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
| @@ -135,8 +135,8 @@ struct usb_hcd { | |||
| 135 | 135 | ||
| 136 | unsigned int irq; /* irq allocated */ | 136 | unsigned int irq; /* irq allocated */ |
| 137 | void __iomem *regs; /* device memory/io */ | 137 | void __iomem *regs; /* device memory/io */ |
| 138 | u64 rsrc_start; /* memory/io resource start */ | 138 | resource_size_t rsrc_start; /* memory/io resource start */ |
| 139 | u64 rsrc_len; /* memory/io resource length */ | 139 | resource_size_t rsrc_len; /* memory/io resource length */ |
| 140 | unsigned power_budget; /* in mA, 0 = no limit */ | 140 | unsigned power_budget; /* in mA, 0 = no limit */ |
| 141 | 141 | ||
| 142 | /* bandwidth_mutex should be taken before adding or removing | 142 | /* bandwidth_mutex should be taken before adding or removing |
diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/nop-usb-xceiv.h new file mode 100644 index 000000000000..28884c717411 --- /dev/null +++ b/include/linux/usb/nop-usb-xceiv.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | #ifndef __LINUX_USB_NOP_XCEIV_H | ||
| 2 | #define __LINUX_USB_NOP_XCEIV_H | ||
| 3 | |||
| 4 | #include <linux/usb/otg.h> | ||
| 5 | |||
| 6 | struct nop_usb_xceiv_platform_data { | ||
| 7 | enum usb_phy_type type; | ||
| 8 | }; | ||
| 9 | |||
| 10 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) | ||
| 11 | /* sometimes transceivers are accessed only through e.g. ULPI */ | ||
| 12 | extern void usb_nop_xceiv_register(void); | ||
| 13 | extern void usb_nop_xceiv_unregister(void); | ||
| 14 | #else | ||
| 15 | static inline void usb_nop_xceiv_register(void) | ||
| 16 | { | ||
| 17 | } | ||
| 18 | |||
| 19 | static inline void usb_nop_xceiv_unregister(void) | ||
| 20 | { | ||
| 21 | } | ||
| 22 | #endif | ||
| 23 | |||
| 24 | #endif /* __LINUX_USB_NOP_XCEIV_H */ | ||
diff --git a/include/linux/usb/ohci_pdriver.h b/include/linux/usb/ohci_pdriver.h index 2808f2a9cce8..74e7755168b7 100644 --- a/include/linux/usb/ohci_pdriver.h +++ b/include/linux/usb/ohci_pdriver.h | |||
| @@ -33,6 +33,14 @@ struct usb_ohci_pdata { | |||
| 33 | unsigned big_endian_desc:1; | 33 | unsigned big_endian_desc:1; |
| 34 | unsigned big_endian_mmio:1; | 34 | unsigned big_endian_mmio:1; |
| 35 | unsigned no_big_frame_no:1; | 35 | unsigned no_big_frame_no:1; |
| 36 | |||
| 37 | /* Turn on all power and clocks */ | ||
| 38 | int (*power_on)(struct platform_device *pdev); | ||
| 39 | /* Turn off all power and clocks */ | ||
| 40 | void (*power_off)(struct platform_device *pdev); | ||
| 41 | /* Turn on only VBUS suspend power and hotplug detection, | ||
| 42 | * turn off everything else */ | ||
| 43 | void (*power_suspend)(struct platform_device *pdev); | ||
| 36 | }; | 44 | }; |
| 37 | 45 | ||
| 38 | #endif /* __USB_CORE_OHCI_PDRIVER_H */ | 46 | #endif /* __USB_CORE_OHCI_PDRIVER_H */ |
diff --git a/include/linux/usb/omap_usb.h b/include/linux/usb/omap_usb.h new file mode 100644 index 000000000000..0ea17f8ae820 --- /dev/null +++ b/include/linux/usb/omap_usb.h | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | /* | ||
| 2 | * omap_usb.h -- omap usb2 phy header file | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * Author: Kishon Vijay Abraham I <kishon@ti.com> | ||
| 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 | */ | ||
| 18 | |||
| 19 | #ifndef __DRIVERS_OMAP_USB2_H | ||
| 20 | #define __DRIVERS_OMAP_USB2_H | ||
| 21 | |||
| 22 | #include <linux/usb/otg.h> | ||
| 23 | |||
| 24 | struct omap_usb { | ||
| 25 | struct usb_phy phy; | ||
| 26 | struct phy_companion *comparator; | ||
| 27 | struct device *dev; | ||
| 28 | u32 __iomem *control_dev; | ||
| 29 | struct clk *wkupclk; | ||
| 30 | u8 is_suspended:1; | ||
| 31 | }; | ||
| 32 | |||
| 33 | #define PHY_PD 0x1 | ||
| 34 | |||
| 35 | #define phy_to_omapusb(x) container_of((x), struct omap_usb, phy) | ||
| 36 | |||
| 37 | #if defined(CONFIG_OMAP_USB2) || defined(CONFIG_OMAP_USB2_MODULE) | ||
| 38 | extern int omap_usb2_set_comparator(struct phy_companion *comparator); | ||
| 39 | #else | ||
| 40 | static inline int omap_usb2_set_comparator(struct phy_companion *comparator) | ||
| 41 | { | ||
| 42 | return -ENODEV; | ||
| 43 | } | ||
| 44 | #endif | ||
| 45 | |||
| 46 | #endif /* __DRIVERS_OMAP_USB_H */ | ||
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 45824be0a2f9..e8a5fe87c6bd 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
| @@ -9,56 +9,7 @@ | |||
| 9 | #ifndef __LINUX_USB_OTG_H | 9 | #ifndef __LINUX_USB_OTG_H |
| 10 | #define __LINUX_USB_OTG_H | 10 | #define __LINUX_USB_OTG_H |
| 11 | 11 | ||
| 12 | #include <linux/notifier.h> | 12 | #include <linux/usb/phy.h> |
| 13 | |||
| 14 | /* OTG defines lots of enumeration states before device reset */ | ||
| 15 | enum usb_otg_state { | ||
| 16 | OTG_STATE_UNDEFINED = 0, | ||
| 17 | |||
| 18 | /* single-role peripheral, and dual-role default-b */ | ||
| 19 | OTG_STATE_B_IDLE, | ||
| 20 | OTG_STATE_B_SRP_INIT, | ||
| 21 | OTG_STATE_B_PERIPHERAL, | ||
| 22 | |||
| 23 | /* extra dual-role default-b states */ | ||
| 24 | OTG_STATE_B_WAIT_ACON, | ||
| 25 | OTG_STATE_B_HOST, | ||
| 26 | |||
| 27 | /* dual-role default-a */ | ||
| 28 | OTG_STATE_A_IDLE, | ||
| 29 | OTG_STATE_A_WAIT_VRISE, | ||
| 30 | OTG_STATE_A_WAIT_BCON, | ||
| 31 | OTG_STATE_A_HOST, | ||
| 32 | OTG_STATE_A_SUSPEND, | ||
| 33 | OTG_STATE_A_PERIPHERAL, | ||
| 34 | OTG_STATE_A_WAIT_VFALL, | ||
| 35 | OTG_STATE_A_VBUS_ERR, | ||
| 36 | }; | ||
| 37 | |||
| 38 | enum usb_phy_events { | ||
| 39 | USB_EVENT_NONE, /* no events or cable disconnected */ | ||
| 40 | USB_EVENT_VBUS, /* vbus valid event */ | ||
| 41 | USB_EVENT_ID, /* id was grounded */ | ||
| 42 | USB_EVENT_CHARGER, /* usb dedicated charger */ | ||
| 43 | USB_EVENT_ENUMERATED, /* gadget driver enumerated */ | ||
| 44 | }; | ||
| 45 | |||
| 46 | /* associate a type with PHY */ | ||
| 47 | enum usb_phy_type { | ||
| 48 | USB_PHY_TYPE_UNDEFINED, | ||
| 49 | USB_PHY_TYPE_USB2, | ||
| 50 | USB_PHY_TYPE_USB3, | ||
| 51 | }; | ||
| 52 | |||
| 53 | struct usb_phy; | ||
| 54 | |||
| 55 | /* for transceivers connected thru an ULPI interface, the user must | ||
| 56 | * provide access ops | ||
| 57 | */ | ||
| 58 | struct usb_phy_io_ops { | ||
| 59 | int (*read)(struct usb_phy *x, u32 reg); | ||
| 60 | int (*write)(struct usb_phy *x, u32 val, u32 reg); | ||
| 61 | }; | ||
| 62 | 13 | ||
| 63 | struct usb_otg { | 14 | struct usb_otg { |
| 64 | u8 default_a; | 15 | u8 default_a; |
| @@ -85,134 +36,9 @@ struct usb_otg { | |||
| 85 | 36 | ||
| 86 | }; | 37 | }; |
| 87 | 38 | ||
| 88 | /* | ||
| 89 | * the otg driver needs to interact with both device side and host side | ||
| 90 | * usb controllers. it decides which controller is active at a given | ||
| 91 | * moment, using the transceiver, ID signal, HNP and sometimes static | ||
| 92 | * configuration information (including "board isn't wired for otg"). | ||
| 93 | */ | ||
| 94 | struct usb_phy { | ||
| 95 | struct device *dev; | ||
| 96 | const char *label; | ||
| 97 | unsigned int flags; | ||
| 98 | |||
| 99 | enum usb_phy_type type; | ||
| 100 | enum usb_otg_state state; | ||
| 101 | enum usb_phy_events last_event; | ||
| 102 | |||
| 103 | struct usb_otg *otg; | ||
| 104 | |||
| 105 | struct device *io_dev; | ||
| 106 | struct usb_phy_io_ops *io_ops; | ||
| 107 | void __iomem *io_priv; | ||
| 108 | |||
| 109 | /* for notification of usb_phy_events */ | ||
| 110 | struct atomic_notifier_head notifier; | ||
| 111 | |||
| 112 | /* to pass extra port status to the root hub */ | ||
| 113 | u16 port_status; | ||
| 114 | u16 port_change; | ||
| 115 | |||
| 116 | /* to support controllers that have multiple transceivers */ | ||
| 117 | struct list_head head; | ||
| 118 | |||
| 119 | /* initialize/shutdown the OTG controller */ | ||
| 120 | int (*init)(struct usb_phy *x); | ||
| 121 | void (*shutdown)(struct usb_phy *x); | ||
| 122 | |||
| 123 | /* effective for B devices, ignored for A-peripheral */ | ||
| 124 | int (*set_power)(struct usb_phy *x, | ||
| 125 | unsigned mA); | ||
| 126 | |||
| 127 | /* for non-OTG B devices: set transceiver into suspend mode */ | ||
| 128 | int (*set_suspend)(struct usb_phy *x, | ||
| 129 | int suspend); | ||
| 130 | |||
| 131 | /* notify phy connect status change */ | ||
| 132 | int (*notify_connect)(struct usb_phy *x, int port); | ||
| 133 | int (*notify_disconnect)(struct usb_phy *x, int port); | ||
| 134 | }; | ||
| 135 | |||
| 136 | |||
| 137 | /* for board-specific init logic */ | ||
| 138 | extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type); | ||
| 139 | extern void usb_remove_phy(struct usb_phy *); | ||
| 140 | |||
| 141 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) | ||
| 142 | /* sometimes transceivers are accessed only through e.g. ULPI */ | ||
| 143 | extern void usb_nop_xceiv_register(void); | ||
| 144 | extern void usb_nop_xceiv_unregister(void); | ||
| 145 | #else | ||
| 146 | static inline void usb_nop_xceiv_register(void) | ||
| 147 | { | ||
| 148 | } | ||
| 149 | |||
| 150 | static inline void usb_nop_xceiv_unregister(void) | ||
| 151 | { | ||
| 152 | } | ||
| 153 | #endif | ||
| 154 | |||
| 155 | /* helpers for direct access thru low-level io interface */ | ||
| 156 | static inline int usb_phy_io_read(struct usb_phy *x, u32 reg) | ||
| 157 | { | ||
| 158 | if (x->io_ops && x->io_ops->read) | ||
| 159 | return x->io_ops->read(x, reg); | ||
| 160 | |||
| 161 | return -EINVAL; | ||
| 162 | } | ||
| 163 | |||
| 164 | static inline int usb_phy_io_write(struct usb_phy *x, u32 val, u32 reg) | ||
| 165 | { | ||
| 166 | if (x->io_ops && x->io_ops->write) | ||
| 167 | return x->io_ops->write(x, val, reg); | ||
| 168 | |||
| 169 | return -EINVAL; | ||
| 170 | } | ||
| 171 | |||
| 172 | static inline int | ||
| 173 | usb_phy_init(struct usb_phy *x) | ||
| 174 | { | ||
| 175 | if (x->init) | ||
| 176 | return x->init(x); | ||
| 177 | |||
| 178 | return 0; | ||
| 179 | } | ||
| 180 | |||
| 181 | static inline void | ||
| 182 | usb_phy_shutdown(struct usb_phy *x) | ||
| 183 | { | ||
| 184 | if (x->shutdown) | ||
| 185 | x->shutdown(x); | ||
| 186 | } | ||
| 187 | |||
| 188 | /* for usb host and peripheral controller drivers */ | ||
| 189 | #ifdef CONFIG_USB_OTG_UTILS | 39 | #ifdef CONFIG_USB_OTG_UTILS |
| 190 | extern struct usb_phy *usb_get_phy(enum usb_phy_type type); | ||
| 191 | extern struct usb_phy *devm_usb_get_phy(struct device *dev, | ||
| 192 | enum usb_phy_type type); | ||
| 193 | extern void usb_put_phy(struct usb_phy *); | ||
| 194 | extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); | ||
| 195 | extern const char *otg_state_string(enum usb_otg_state state); | 40 | extern const char *otg_state_string(enum usb_otg_state state); |
| 196 | #else | 41 | #else |
| 197 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) | ||
| 198 | { | ||
| 199 | return NULL; | ||
| 200 | } | ||
| 201 | |||
| 202 | static inline struct usb_phy *devm_usb_get_phy(struct device *dev, | ||
| 203 | enum usb_phy_type type) | ||
| 204 | { | ||
| 205 | return NULL; | ||
| 206 | } | ||
| 207 | |||
| 208 | static inline void usb_put_phy(struct usb_phy *x) | ||
| 209 | { | ||
| 210 | } | ||
| 211 | |||
| 212 | static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x) | ||
| 213 | { | ||
| 214 | } | ||
| 215 | |||
| 216 | static inline const char *otg_state_string(enum usb_otg_state state) | 42 | static inline const char *otg_state_string(enum usb_otg_state state) |
| 217 | { | 43 | { |
| 218 | return NULL; | 44 | return NULL; |
| @@ -262,42 +88,6 @@ otg_set_peripheral(struct usb_otg *otg, struct usb_gadget *periph) | |||
| 262 | } | 88 | } |
| 263 | 89 | ||
| 264 | static inline int | 90 | static inline int |
| 265 | usb_phy_set_power(struct usb_phy *x, unsigned mA) | ||
| 266 | { | ||
| 267 | if (x && x->set_power) | ||
| 268 | return x->set_power(x, mA); | ||
| 269 | return 0; | ||
| 270 | } | ||
| 271 | |||
| 272 | /* Context: can sleep */ | ||
| 273 | static inline int | ||
| 274 | usb_phy_set_suspend(struct usb_phy *x, int suspend) | ||
| 275 | { | ||
| 276 | if (x->set_suspend != NULL) | ||
| 277 | return x->set_suspend(x, suspend); | ||
| 278 | else | ||
| 279 | return 0; | ||
| 280 | } | ||
| 281 | |||
| 282 | static inline int | ||
| 283 | usb_phy_notify_connect(struct usb_phy *x, int port) | ||
| 284 | { | ||
| 285 | if (x->notify_connect) | ||
| 286 | return x->notify_connect(x, port); | ||
| 287 | else | ||
| 288 | return 0; | ||
| 289 | } | ||
| 290 | |||
| 291 | static inline int | ||
| 292 | usb_phy_notify_disconnect(struct usb_phy *x, int port) | ||
| 293 | { | ||
| 294 | if (x->notify_disconnect) | ||
| 295 | return x->notify_disconnect(x, port); | ||
| 296 | else | ||
| 297 | return 0; | ||
| 298 | } | ||
| 299 | |||
| 300 | static inline int | ||
| 301 | otg_start_srp(struct usb_otg *otg) | 91 | otg_start_srp(struct usb_otg *otg) |
| 302 | { | 92 | { |
| 303 | if (otg && otg->start_srp) | 93 | if (otg && otg->start_srp) |
| @@ -306,31 +96,7 @@ otg_start_srp(struct usb_otg *otg) | |||
| 306 | return -ENOTSUPP; | 96 | return -ENOTSUPP; |
| 307 | } | 97 | } |
| 308 | 98 | ||
| 309 | /* notifiers */ | ||
| 310 | static inline int | ||
| 311 | usb_register_notifier(struct usb_phy *x, struct notifier_block *nb) | ||
| 312 | { | ||
| 313 | return atomic_notifier_chain_register(&x->notifier, nb); | ||
| 314 | } | ||
| 315 | |||
| 316 | static inline void | ||
| 317 | usb_unregister_notifier(struct usb_phy *x, struct notifier_block *nb) | ||
| 318 | { | ||
| 319 | atomic_notifier_chain_unregister(&x->notifier, nb); | ||
| 320 | } | ||
| 321 | |||
| 322 | /* for OTG controller drivers (and maybe other stuff) */ | 99 | /* for OTG controller drivers (and maybe other stuff) */ |
| 323 | extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); | 100 | extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); |
| 324 | 101 | ||
| 325 | static inline const char *usb_phy_type_string(enum usb_phy_type type) | ||
| 326 | { | ||
| 327 | switch (type) { | ||
| 328 | case USB_PHY_TYPE_USB2: | ||
| 329 | return "USB2 PHY"; | ||
| 330 | case USB_PHY_TYPE_USB3: | ||
| 331 | return "USB3 PHY"; | ||
| 332 | default: | ||
| 333 | return "UNKNOWN PHY TYPE"; | ||
| 334 | } | ||
| 335 | } | ||
| 336 | #endif /* __LINUX_USB_OTG_H */ | 102 | #endif /* __LINUX_USB_OTG_H */ |
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h new file mode 100644 index 000000000000..06b5bae35b29 --- /dev/null +++ b/include/linux/usb/phy.h | |||
| @@ -0,0 +1,233 @@ | |||
| 1 | /* USB OTG (On The Go) defines */ | ||
| 2 | /* | ||
| 3 | * | ||
| 4 | * These APIs may be used between USB controllers. USB device drivers | ||
| 5 | * (for either host or peripheral roles) don't use these calls; they | ||
| 6 | * continue to use just usb_device and usb_gadget. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __LINUX_USB_PHY_H | ||
| 10 | #define __LINUX_USB_PHY_H | ||
| 11 | |||
| 12 | #include <linux/notifier.h> | ||
| 13 | |||
| 14 | enum usb_phy_events { | ||
| 15 | USB_EVENT_NONE, /* no events or cable disconnected */ | ||
| 16 | USB_EVENT_VBUS, /* vbus valid event */ | ||
| 17 | USB_EVENT_ID, /* id was grounded */ | ||
| 18 | USB_EVENT_CHARGER, /* usb dedicated charger */ | ||
| 19 | USB_EVENT_ENUMERATED, /* gadget driver enumerated */ | ||
| 20 | }; | ||
| 21 | |||
| 22 | /* associate a type with PHY */ | ||
| 23 | enum usb_phy_type { | ||
| 24 | USB_PHY_TYPE_UNDEFINED, | ||
| 25 | USB_PHY_TYPE_USB2, | ||
| 26 | USB_PHY_TYPE_USB3, | ||
| 27 | }; | ||
| 28 | |||
| 29 | /* OTG defines lots of enumeration states before device reset */ | ||
| 30 | enum usb_otg_state { | ||
| 31 | OTG_STATE_UNDEFINED = 0, | ||
| 32 | |||
| 33 | /* single-role peripheral, and dual-role default-b */ | ||
| 34 | OTG_STATE_B_IDLE, | ||
| 35 | OTG_STATE_B_SRP_INIT, | ||
| 36 | OTG_STATE_B_PERIPHERAL, | ||
| 37 | |||
| 38 | /* extra dual-role default-b states */ | ||
| 39 | OTG_STATE_B_WAIT_ACON, | ||
| 40 | OTG_STATE_B_HOST, | ||
| 41 | |||
| 42 | /* dual-role default-a */ | ||
| 43 | OTG_STATE_A_IDLE, | ||
| 44 | OTG_STATE_A_WAIT_VRISE, | ||
| 45 | OTG_STATE_A_WAIT_BCON, | ||
| 46 | OTG_STATE_A_HOST, | ||
| 47 | OTG_STATE_A_SUSPEND, | ||
| 48 | OTG_STATE_A_PERIPHERAL, | ||
| 49 | OTG_STATE_A_WAIT_VFALL, | ||
| 50 | OTG_STATE_A_VBUS_ERR, | ||
| 51 | }; | ||
| 52 | |||
| 53 | struct usb_phy; | ||
| 54 | struct usb_otg; | ||
| 55 | |||
| 56 | /* for transceivers connected thru an ULPI interface, the user must | ||
| 57 | * provide access ops | ||
| 58 | */ | ||
| 59 | struct usb_phy_io_ops { | ||
| 60 | int (*read)(struct usb_phy *x, u32 reg); | ||
| 61 | int (*write)(struct usb_phy *x, u32 val, u32 reg); | ||
| 62 | }; | ||
| 63 | |||
| 64 | struct usb_phy { | ||
| 65 | struct device *dev; | ||
| 66 | const char *label; | ||
| 67 | unsigned int flags; | ||
| 68 | |||
| 69 | enum usb_phy_type type; | ||
| 70 | enum usb_otg_state state; | ||
| 71 | enum usb_phy_events last_event; | ||
| 72 | |||
| 73 | struct usb_otg *otg; | ||
| 74 | |||
| 75 | struct device *io_dev; | ||
| 76 | struct usb_phy_io_ops *io_ops; | ||
| 77 | void __iomem *io_priv; | ||
| 78 | |||
| 79 | /* for notification of usb_phy_events */ | ||
| 80 | struct atomic_notifier_head notifier; | ||
| 81 | |||
| 82 | /* to pass extra port status to the root hub */ | ||
| 83 | u16 port_status; | ||
| 84 | u16 port_change; | ||
| 85 | |||
| 86 | /* to support controllers that have multiple transceivers */ | ||
| 87 | struct list_head head; | ||
| 88 | |||
| 89 | /* initialize/shutdown the OTG controller */ | ||
| 90 | int (*init)(struct usb_phy *x); | ||
| 91 | void (*shutdown)(struct usb_phy *x); | ||
| 92 | |||
| 93 | /* effective for B devices, ignored for A-peripheral */ | ||
| 94 | int (*set_power)(struct usb_phy *x, | ||
| 95 | unsigned mA); | ||
| 96 | |||
| 97 | /* for non-OTG B devices: set transceiver into suspend mode */ | ||
| 98 | int (*set_suspend)(struct usb_phy *x, | ||
| 99 | int suspend); | ||
| 100 | |||
| 101 | /* notify phy connect status change */ | ||
| 102 | int (*notify_connect)(struct usb_phy *x, int port); | ||
| 103 | int (*notify_disconnect)(struct usb_phy *x, int port); | ||
| 104 | }; | ||
| 105 | |||
| 106 | |||
| 107 | /* for board-specific init logic */ | ||
| 108 | extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type); | ||
| 109 | extern void usb_remove_phy(struct usb_phy *); | ||
| 110 | |||
| 111 | /* helpers for direct access thru low-level io interface */ | ||
| 112 | static inline int usb_phy_io_read(struct usb_phy *x, u32 reg) | ||
| 113 | { | ||
| 114 | if (x->io_ops && x->io_ops->read) | ||
| 115 | return x->io_ops->read(x, reg); | ||
| 116 | |||
| 117 | return -EINVAL; | ||
| 118 | } | ||
| 119 | |||
| 120 | static inline int usb_phy_io_write(struct usb_phy *x, u32 val, u32 reg) | ||
| 121 | { | ||
| 122 | if (x->io_ops && x->io_ops->write) | ||
| 123 | return x->io_ops->write(x, val, reg); | ||
| 124 | |||
| 125 | return -EINVAL; | ||
| 126 | } | ||
| 127 | |||
| 128 | static inline int | ||
| 129 | usb_phy_init(struct usb_phy *x) | ||
| 130 | { | ||
| 131 | if (x->init) | ||
| 132 | return x->init(x); | ||
| 133 | |||
| 134 | return 0; | ||
| 135 | } | ||
| 136 | |||
| 137 | static inline void | ||
| 138 | usb_phy_shutdown(struct usb_phy *x) | ||
| 139 | { | ||
| 140 | if (x->shutdown) | ||
| 141 | x->shutdown(x); | ||
| 142 | } | ||
| 143 | |||
| 144 | /* for usb host and peripheral controller drivers */ | ||
| 145 | #ifdef CONFIG_USB_OTG_UTILS | ||
| 146 | extern struct usb_phy *usb_get_phy(enum usb_phy_type type); | ||
| 147 | extern struct usb_phy *devm_usb_get_phy(struct device *dev, | ||
| 148 | enum usb_phy_type type); | ||
| 149 | extern void usb_put_phy(struct usb_phy *); | ||
| 150 | extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); | ||
| 151 | #else | ||
| 152 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) | ||
| 153 | { | ||
| 154 | return NULL; | ||
| 155 | } | ||
| 156 | |||
| 157 | static inline struct usb_phy *devm_usb_get_phy(struct device *dev, | ||
| 158 | enum usb_phy_type type) | ||
| 159 | { | ||
| 160 | return NULL; | ||
| 161 | } | ||
| 162 | |||
| 163 | static inline void usb_put_phy(struct usb_phy *x) | ||
| 164 | { | ||
| 165 | } | ||
| 166 | |||
| 167 | static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x) | ||
| 168 | { | ||
| 169 | } | ||
| 170 | |||
| 171 | #endif | ||
| 172 | |||
| 173 | static inline int | ||
| 174 | usb_phy_set_power(struct usb_phy *x, unsigned mA) | ||
| 175 | { | ||
| 176 | if (x && x->set_power) | ||
| 177 | return x->set_power(x, mA); | ||
| 178 | return 0; | ||
| 179 | } | ||
| 180 | |||
| 181 | /* Context: can sleep */ | ||
| 182 | static inline int | ||
| 183 | usb_phy_set_suspend(struct usb_phy *x, int suspend) | ||
| 184 | { | ||
| 185 | if (x->set_suspend != NULL) | ||
| 186 | return x->set_suspend(x, suspend); | ||
| 187 | else | ||
| 188 | return 0; | ||
| 189 | } | ||
| 190 | |||
| 191 | static inline int | ||
| 192 | usb_phy_notify_connect(struct usb_phy *x, int port) | ||
| 193 | { | ||
| 194 | if (x->notify_connect) | ||
| 195 | return x->notify_connect(x, port); | ||
| 196 | else | ||
| 197 | return 0; | ||
| 198 | } | ||
| 199 | |||
| 200 | static inline int | ||
| 201 | usb_phy_notify_disconnect(struct usb_phy *x, int port) | ||
| 202 | { | ||
| 203 | if (x->notify_disconnect) | ||
| 204 | return x->notify_disconnect(x, port); | ||
| 205 | else | ||
| 206 | return 0; | ||
| 207 | } | ||
| 208 | |||
| 209 | /* notifiers */ | ||
| 210 | static inline int | ||
| 211 | usb_register_notifier(struct usb_phy *x, struct notifier_block *nb) | ||
| 212 | { | ||
| 213 | return atomic_notifier_chain_register(&x->notifier, nb); | ||
| 214 | } | ||
| 215 | |||
| 216 | static inline void | ||
| 217 | usb_unregister_notifier(struct usb_phy *x, struct notifier_block *nb) | ||
| 218 | { | ||
| 219 | atomic_notifier_chain_unregister(&x->notifier, nb); | ||
| 220 | } | ||
| 221 | |||
| 222 | static inline const char *usb_phy_type_string(enum usb_phy_type type) | ||
| 223 | { | ||
| 224 | switch (type) { | ||
| 225 | case USB_PHY_TYPE_USB2: | ||
| 226 | return "USB2 PHY"; | ||
| 227 | case USB_PHY_TYPE_USB3: | ||
| 228 | return "USB3 PHY"; | ||
| 229 | default: | ||
| 230 | return "UNKNOWN PHY TYPE"; | ||
| 231 | } | ||
| 232 | } | ||
| 233 | #endif /* __LINUX_USB_PHY_H */ | ||
diff --git a/include/linux/usb/phy_companion.h b/include/linux/usb/phy_companion.h new file mode 100644 index 000000000000..edd2ec23d282 --- /dev/null +++ b/include/linux/usb/phy_companion.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * phy-companion.h -- phy companion to indicate the comparator part of PHY | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * Author: Kishon Vijay Abraham I <kishon@ti.com> | ||
| 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 | */ | ||
| 18 | |||
| 19 | #ifndef __DRIVERS_PHY_COMPANION_H | ||
| 20 | #define __DRIVERS_PHY_COMPANION_H | ||
| 21 | |||
| 22 | #include <linux/usb/otg.h> | ||
| 23 | |||
| 24 | /* phy_companion to take care of VBUS, ID and srp capabilities */ | ||
| 25 | struct phy_companion { | ||
| 26 | |||
| 27 | /* effective for A-peripheral, ignored for B devices */ | ||
| 28 | int (*set_vbus)(struct phy_companion *x, bool enabled); | ||
| 29 | |||
| 30 | /* for B devices only: start session with A-Host */ | ||
| 31 | int (*start_srp)(struct phy_companion *x); | ||
| 32 | }; | ||
| 33 | |||
| 34 | #endif /* __DRIVERS_PHY_COMPANION_H */ | ||
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h index 3e93de7ecbc3..52f944dfe2fd 100644 --- a/include/linux/usb/quirks.h +++ b/include/linux/usb/quirks.h | |||
| @@ -19,8 +19,8 @@ | |||
| 19 | /* device can't handle its Configuration or Interface strings */ | 19 | /* device can't handle its Configuration or Interface strings */ |
| 20 | #define USB_QUIRK_CONFIG_INTF_STRINGS 0x00000008 | 20 | #define USB_QUIRK_CONFIG_INTF_STRINGS 0x00000008 |
| 21 | 21 | ||
| 22 | /*device will morph if reset, don't use reset for handling errors */ | 22 | /* device can't be reset(e.g morph devices), don't use reset */ |
| 23 | #define USB_QUIRK_RESET_MORPHS 0x00000010 | 23 | #define USB_QUIRK_RESET 0x00000010 |
| 24 | 24 | ||
| 25 | /* device has more interface descriptions than the bNumInterfaces count, | 25 | /* device has more interface descriptions than the bNumInterfaces count, |
| 26 | and can't handle talking to these interfaces */ | 26 | and can't handle talking to these interfaces */ |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 86c0b451745d..ef9be7e1e190 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
| @@ -301,17 +301,13 @@ extern void usb_serial_port_softint(struct usb_serial_port *port); | |||
| 301 | extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message); | 301 | extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message); |
| 302 | extern int usb_serial_resume(struct usb_interface *intf); | 302 | extern int usb_serial_resume(struct usb_interface *intf); |
| 303 | 303 | ||
| 304 | extern int ezusb_writememory(struct usb_serial *serial, int address, | ||
| 305 | unsigned char *data, int length, __u8 bRequest); | ||
| 306 | extern int ezusb_set_reset(struct usb_serial *serial, unsigned char reset_bit); | ||
| 307 | |||
| 308 | /* USB Serial console functions */ | 304 | /* USB Serial console functions */ |
| 309 | #ifdef CONFIG_USB_SERIAL_CONSOLE | 305 | #ifdef CONFIG_USB_SERIAL_CONSOLE |
| 310 | extern void usb_serial_console_init(int debug, int minor); | 306 | extern void usb_serial_console_init(int minor); |
| 311 | extern void usb_serial_console_exit(void); | 307 | extern void usb_serial_console_exit(void); |
| 312 | extern void usb_serial_console_disconnect(struct usb_serial *serial); | 308 | extern void usb_serial_console_disconnect(struct usb_serial *serial); |
| 313 | #else | 309 | #else |
| 314 | static inline void usb_serial_console_init(int debug, int minor) { } | 310 | static inline void usb_serial_console_init(int minor) { } |
| 315 | static inline void usb_serial_console_exit(void) { } | 311 | static inline void usb_serial_console_exit(void) { } |
| 316 | static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} | 312 | static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} |
| 317 | #endif | 313 | #endif |
| @@ -333,7 +329,7 @@ extern void usb_serial_generic_throttle(struct tty_struct *tty); | |||
| 333 | extern void usb_serial_generic_unthrottle(struct tty_struct *tty); | 329 | extern void usb_serial_generic_unthrottle(struct tty_struct *tty); |
| 334 | extern void usb_serial_generic_disconnect(struct usb_serial *serial); | 330 | extern void usb_serial_generic_disconnect(struct usb_serial *serial); |
| 335 | extern void usb_serial_generic_release(struct usb_serial *serial); | 331 | extern void usb_serial_generic_release(struct usb_serial *serial); |
| 336 | extern int usb_serial_generic_register(int debug); | 332 | extern int usb_serial_generic_register(void); |
| 337 | extern void usb_serial_generic_deregister(void); | 333 | extern void usb_serial_generic_deregister(void); |
| 338 | extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, | 334 | extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, |
| 339 | gfp_t mem_flags); | 335 | gfp_t mem_flags); |
| @@ -355,30 +351,14 @@ extern struct usb_serial_driver usb_serial_generic_device; | |||
| 355 | extern struct bus_type usb_serial_bus_type; | 351 | extern struct bus_type usb_serial_bus_type; |
| 356 | extern struct tty_driver *usb_serial_tty_driver; | 352 | extern struct tty_driver *usb_serial_tty_driver; |
| 357 | 353 | ||
| 358 | static inline void usb_serial_debug_data(int debug, | 354 | static inline void usb_serial_debug_data(struct device *dev, |
| 359 | struct device *dev, | ||
| 360 | const char *function, int size, | 355 | const char *function, int size, |
| 361 | const unsigned char *data) | 356 | const unsigned char *data) |
| 362 | { | 357 | { |
| 363 | int i; | 358 | dev_dbg(dev, "%s - length = %d, data = %*ph\n", |
| 364 | 359 | function, size, size, data); | |
| 365 | if (debug) { | ||
| 366 | dev_printk(KERN_DEBUG, dev, "%s - length = %d, data = ", | ||
| 367 | function, size); | ||
| 368 | for (i = 0; i < size; ++i) | ||
| 369 | printk("%.2x ", data[i]); | ||
| 370 | printk("\n"); | ||
| 371 | } | ||
| 372 | } | 360 | } |
| 373 | 361 | ||
| 374 | /* Use our own dbg macro */ | ||
| 375 | #undef dbg | ||
| 376 | #define dbg(format, arg...) \ | ||
| 377 | do { \ | ||
| 378 | if (debug) \ | ||
| 379 | printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \ | ||
| 380 | } while (0) | ||
| 381 | |||
| 382 | /* | 362 | /* |
| 383 | * Macro for reporting errors in write path to avoid inifinite loop | 363 | * Macro for reporting errors in write path to avoid inifinite loop |
| 384 | * when port is used as a console. | 364 | * when port is used as a console. |
diff --git a/include/linux/usb/tegra_usb_phy.h b/include/linux/usb/tegra_usb_phy.h new file mode 100644 index 000000000000..176b1ca06ae4 --- /dev/null +++ b/include/linux/usb/tegra_usb_phy.h | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2010 Google, Inc. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __TEGRA_USB_PHY_H | ||
| 16 | #define __TEGRA_USB_PHY_H | ||
| 17 | |||
| 18 | #include <linux/clk.h> | ||
| 19 | #include <linux/usb/otg.h> | ||
| 20 | |||
| 21 | struct tegra_utmip_config { | ||
| 22 | u8 hssync_start_delay; | ||
| 23 | u8 elastic_limit; | ||
| 24 | u8 idle_wait_delay; | ||
| 25 | u8 term_range_adj; | ||
| 26 | u8 xcvr_setup; | ||
| 27 | u8 xcvr_lsfslew; | ||
| 28 | u8 xcvr_lsrslew; | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct tegra_ulpi_config { | ||
| 32 | int reset_gpio; | ||
| 33 | const char *clk; | ||
| 34 | }; | ||
| 35 | |||
| 36 | enum tegra_usb_phy_port_speed { | ||
| 37 | TEGRA_USB_PHY_PORT_SPEED_FULL = 0, | ||
| 38 | TEGRA_USB_PHY_PORT_SPEED_LOW, | ||
| 39 | TEGRA_USB_PHY_PORT_SPEED_HIGH, | ||
| 40 | }; | ||
| 41 | |||
| 42 | enum tegra_usb_phy_mode { | ||
| 43 | TEGRA_USB_PHY_MODE_DEVICE, | ||
| 44 | TEGRA_USB_PHY_MODE_HOST, | ||
| 45 | }; | ||
| 46 | |||
| 47 | struct tegra_xtal_freq; | ||
| 48 | |||
| 49 | struct tegra_usb_phy { | ||
| 50 | int instance; | ||
| 51 | const struct tegra_xtal_freq *freq; | ||
| 52 | void __iomem *regs; | ||
| 53 | void __iomem *pad_regs; | ||
| 54 | struct clk *clk; | ||
| 55 | struct clk *pll_u; | ||
| 56 | struct clk *pad_clk; | ||
| 57 | enum tegra_usb_phy_mode mode; | ||
| 58 | void *config; | ||
| 59 | struct usb_phy *ulpi; | ||
| 60 | struct usb_phy u_phy; | ||
| 61 | struct device *dev; | ||
| 62 | }; | ||
| 63 | |||
| 64 | struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance, | ||
| 65 | void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode); | ||
| 66 | |||
| 67 | void tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy); | ||
| 68 | |||
| 69 | void tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy); | ||
| 70 | |||
| 71 | void tegra_usb_phy_preresume(struct tegra_usb_phy *phy); | ||
| 72 | |||
| 73 | void tegra_usb_phy_postresume(struct tegra_usb_phy *phy); | ||
| 74 | |||
| 75 | void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy, | ||
| 76 | enum tegra_usb_phy_port_speed port_speed); | ||
| 77 | |||
| 78 | void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy); | ||
| 79 | |||
| 80 | #endif /* __TEGRA_USB_PHY_H */ | ||
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index e84e769aaddc..bf99cd01be20 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
| @@ -72,33 +72,9 @@ | |||
| 72 | enum { US_DO_ALL_FLAGS }; | 72 | enum { US_DO_ALL_FLAGS }; |
| 73 | #undef US_FLAG | 73 | #undef US_FLAG |
| 74 | 74 | ||
| 75 | /* | ||
| 76 | * The bias field for libusual and friends. | ||
| 77 | */ | ||
| 78 | #define USB_US_TYPE_NONE 0 | ||
| 79 | #define USB_US_TYPE_STOR 1 /* usb-storage */ | ||
| 80 | #define USB_US_TYPE_UB 2 /* ub */ | ||
| 81 | |||
| 82 | #define USB_US_TYPE(flags) (((flags) >> 24) & 0xFF) | ||
| 83 | #define USB_US_ORIG_FLAGS(flags) ((flags) & 0x00FFFFFF) | ||
| 84 | |||
| 85 | #include <linux/usb/storage.h> | 75 | #include <linux/usb/storage.h> |
| 86 | 76 | ||
| 87 | /* | ||
| 88 | */ | ||
| 89 | extern int usb_usual_ignore_device(struct usb_interface *intf); | 77 | extern int usb_usual_ignore_device(struct usb_interface *intf); |
| 90 | extern struct usb_device_id usb_storage_usb_ids[]; | 78 | extern struct usb_device_id usb_storage_usb_ids[]; |
| 91 | 79 | ||
| 92 | #ifdef CONFIG_USB_LIBUSUAL | ||
| 93 | |||
| 94 | extern void usb_usual_set_present(int type); | ||
| 95 | extern void usb_usual_clear_present(int type); | ||
| 96 | extern int usb_usual_check_type(const struct usb_device_id *, int type); | ||
| 97 | #else | ||
| 98 | |||
| 99 | #define usb_usual_set_present(t) do { } while(0) | ||
| 100 | #define usb_usual_clear_present(t) do { } while(0) | ||
| 101 | #define usb_usual_check_type(id, t) (0) | ||
| 102 | #endif /* CONFIG_USB_LIBUSUAL */ | ||
| 103 | |||
| 104 | #endif /* __LINUX_USB_USUAL_H */ | 80 | #endif /* __LINUX_USB_USUAL_H */ |
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index 3b74666be027..4abe28e41cbc 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h | |||
| @@ -131,6 +131,19 @@ struct usbdevfs_hub_portinfo { | |||
| 131 | #define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04 | 131 | #define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04 |
| 132 | #define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08 | 132 | #define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08 |
| 133 | 133 | ||
| 134 | /* USBDEVFS_DISCONNECT_CLAIM flags & struct */ | ||
| 135 | |||
| 136 | /* disconnect-and-claim if the driver matches the driver field */ | ||
| 137 | #define USBDEVFS_DISCONNECT_CLAIM_IF_DRIVER 0x01 | ||
| 138 | /* disconnect-and-claim except when the driver matches the driver field */ | ||
| 139 | #define USBDEVFS_DISCONNECT_CLAIM_EXCEPT_DRIVER 0x02 | ||
| 140 | |||
| 141 | struct usbdevfs_disconnect_claim { | ||
| 142 | unsigned int interface; | ||
| 143 | unsigned int flags; | ||
| 144 | char driver[USBDEVFS_MAXDRIVERNAME + 1]; | ||
| 145 | }; | ||
| 146 | |||
| 134 | #ifdef __KERNEL__ | 147 | #ifdef __KERNEL__ |
| 135 | #ifdef CONFIG_COMPAT | 148 | #ifdef CONFIG_COMPAT |
| 136 | #include <linux/compat.h> | 149 | #include <linux/compat.h> |
| @@ -211,5 +224,6 @@ struct usbdevfs_ioctl32 { | |||
| 211 | #define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int) | 224 | #define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int) |
| 212 | #define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int) | 225 | #define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int) |
| 213 | #define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32) | 226 | #define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32) |
| 227 | #define USBDEVFS_DISCONNECT_CLAIM _IOR('U', 27, struct usbdevfs_disconnect_claim) | ||
| 214 | 228 | ||
| 215 | #endif /* _LINUX_USBDEVICE_FS_H */ | 229 | #endif /* _LINUX_USBDEVICE_FS_H */ |
diff --git a/include/linux/w1-gpio.h b/include/linux/w1-gpio.h index 3adeff82212f..065e3ae79ab0 100644 --- a/include/linux/w1-gpio.h +++ b/include/linux/w1-gpio.h | |||
| @@ -19,6 +19,7 @@ struct w1_gpio_platform_data { | |||
| 19 | unsigned int pin; | 19 | unsigned int pin; |
| 20 | unsigned int is_open_drain:1; | 20 | unsigned int is_open_drain:1; |
| 21 | void (*enable_external_pullup)(int enable); | 21 | void (*enable_external_pullup)(int enable); |
| 22 | unsigned int ext_pullup_enable_pin; | ||
| 22 | }; | 23 | }; |
| 23 | 24 | ||
| 24 | #endif /* _LINUX_W1_GPIO_H */ | 25 | #endif /* _LINUX_W1_GPIO_H */ |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 22e61fdf75a2..28e493b5b94c 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
| @@ -84,6 +84,8 @@ struct xfrm_replay_state { | |||
| 84 | __u32 bitmap; | 84 | __u32 bitmap; |
| 85 | }; | 85 | }; |
| 86 | 86 | ||
| 87 | #define XFRMA_REPLAY_ESN_MAX 4096 | ||
| 88 | |||
| 87 | struct xfrm_replay_state_esn { | 89 | struct xfrm_replay_state_esn { |
| 88 | unsigned int bmp_len; | 90 | unsigned int bmp_len; |
| 89 | __u32 oseq; | 91 | __u32 oseq; |
diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h index ca356a734920..8b27927b2a55 100644 --- a/include/net/bluetooth/smp.h +++ b/include/net/bluetooth/smp.h | |||
| @@ -136,7 +136,7 @@ struct smp_chan { | |||
| 136 | }; | 136 | }; |
| 137 | 137 | ||
| 138 | /* SMP Commands */ | 138 | /* SMP Commands */ |
| 139 | int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level); | 139 | int smp_conn_security(struct hci_conn *hcon, __u8 sec_level); |
| 140 | int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); | 140 | int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); |
| 141 | int smp_distribute_keys(struct l2cap_conn *conn, __u8 force); | 141 | int smp_distribute_keys(struct l2cap_conn *conn, __u8 force); |
| 142 | int smp_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, __le32 passkey); | 142 | int smp_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, __le32 passkey); |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 0fedbd8d747a..9fc7114159e8 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
| @@ -111,9 +111,8 @@ struct rt6_info { | |||
| 111 | struct inet6_dev *rt6i_idev; | 111 | struct inet6_dev *rt6i_idev; |
| 112 | unsigned long _rt6i_peer; | 112 | unsigned long _rt6i_peer; |
| 113 | 113 | ||
| 114 | #ifdef CONFIG_XFRM | 114 | u32 rt6i_genid; |
| 115 | u32 rt6i_flow_cache_genid; | 115 | |
| 116 | #endif | ||
| 117 | /* more non-fragment space at head required */ | 116 | /* more non-fragment space at head required */ |
| 118 | unsigned short rt6i_nfheader_len; | 117 | unsigned short rt6i_nfheader_len; |
| 119 | 118 | ||
diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h index 59ba38bc400f..80ffde3bb164 100644 --- a/include/net/irda/ircomm_tty.h +++ b/include/net/irda/ircomm_tty.h | |||
| @@ -52,21 +52,16 @@ | |||
| 52 | /* Same for payload size. See qos.c for the smallest max data size */ | 52 | /* Same for payload size. See qos.c for the smallest max data size */ |
| 53 | #define IRCOMM_TTY_DATA_UNINITIALISED (64 - IRCOMM_TTY_HDR_UNINITIALISED) | 53 | #define IRCOMM_TTY_DATA_UNINITIALISED (64 - IRCOMM_TTY_HDR_UNINITIALISED) |
| 54 | 54 | ||
| 55 | /* Those are really defined in include/linux/serial.h - Jean II */ | ||
| 56 | #define ASYNC_B_INITIALIZED 31 /* Serial port was initialized */ | ||
| 57 | #define ASYNC_B_NORMAL_ACTIVE 29 /* Normal device is active */ | ||
| 58 | #define ASYNC_B_CLOSING 27 /* Serial port is closing */ | ||
| 59 | |||
| 60 | /* | 55 | /* |
| 61 | * IrCOMM TTY driver state | 56 | * IrCOMM TTY driver state |
| 62 | */ | 57 | */ |
| 63 | struct ircomm_tty_cb { | 58 | struct ircomm_tty_cb { |
| 64 | irda_queue_t queue; /* Must be first */ | 59 | irda_queue_t queue; /* Must be first */ |
| 60 | struct tty_port port; | ||
| 65 | magic_t magic; | 61 | magic_t magic; |
| 66 | 62 | ||
| 67 | int state; /* Connect state */ | 63 | int state; /* Connect state */ |
| 68 | 64 | ||
| 69 | struct tty_struct *tty; | ||
| 70 | struct ircomm_cb *ircomm; /* IrCOMM layer instance */ | 65 | struct ircomm_cb *ircomm; /* IrCOMM layer instance */ |
| 71 | 66 | ||
| 72 | struct sk_buff *tx_skb; /* Transmit buffer */ | 67 | struct sk_buff *tx_skb; /* Transmit buffer */ |
| @@ -80,7 +75,6 @@ struct ircomm_tty_cb { | |||
| 80 | LOCAL_FLOW flow; /* IrTTP flow status */ | 75 | LOCAL_FLOW flow; /* IrTTP flow status */ |
| 81 | 76 | ||
| 82 | int line; | 77 | int line; |
| 83 | unsigned long flags; | ||
| 84 | 78 | ||
| 85 | __u8 dlsap_sel; | 79 | __u8 dlsap_sel; |
| 86 | __u8 slsap_sel; | 80 | __u8 slsap_sel; |
| @@ -97,19 +91,10 @@ struct ircomm_tty_cb { | |||
| 97 | void *skey; | 91 | void *skey; |
| 98 | void *ckey; | 92 | void *ckey; |
| 99 | 93 | ||
| 100 | wait_queue_head_t open_wait; | ||
| 101 | wait_queue_head_t close_wait; | ||
| 102 | struct timer_list watchdog_timer; | 94 | struct timer_list watchdog_timer; |
| 103 | struct work_struct tqueue; | 95 | struct work_struct tqueue; |
| 104 | 96 | ||
| 105 | unsigned short close_delay; | ||
| 106 | unsigned short closing_wait; /* time to wait before closing */ | ||
| 107 | |||
| 108 | int open_count; | ||
| 109 | int blocked_open; /* # of blocked opens */ | ||
| 110 | |||
| 111 | /* Protect concurent access to : | 97 | /* Protect concurent access to : |
| 112 | * o self->open_count | ||
| 113 | * o self->ctrl_skb | 98 | * o self->ctrl_skb |
| 114 | * o self->tx_skb | 99 | * o self->tx_skb |
| 115 | * Maybe other things may gain to be protected as well... | 100 | * Maybe other things may gain to be protected as well... |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index ae1cd6c9ba52..fd87963a0ea5 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
| @@ -102,6 +102,7 @@ struct net { | |||
| 102 | #endif | 102 | #endif |
| 103 | struct netns_ipvs *ipvs; | 103 | struct netns_ipvs *ipvs; |
| 104 | struct sock *diag_nlsk; | 104 | struct sock *diag_nlsk; |
| 105 | atomic_t rt_genid; | ||
| 105 | }; | 106 | }; |
| 106 | 107 | ||
| 107 | 108 | ||
| @@ -300,5 +301,14 @@ static inline void unregister_net_sysctl_table(struct ctl_table_header *header) | |||
| 300 | } | 301 | } |
| 301 | #endif | 302 | #endif |
| 302 | 303 | ||
| 304 | static inline int rt_genid(struct net *net) | ||
| 305 | { | ||
| 306 | return atomic_read(&net->rt_genid); | ||
| 307 | } | ||
| 308 | |||
| 309 | static inline void rt_genid_bump(struct net *net) | ||
| 310 | { | ||
| 311 | atomic_inc(&net->rt_genid); | ||
| 312 | } | ||
| 303 | 313 | ||
| 304 | #endif /* __NET_NET_NAMESPACE_H */ | 314 | #endif /* __NET_NET_NAMESPACE_H */ |
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index e1ce1048fe5f..4a045cda9c60 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
| @@ -18,6 +18,7 @@ struct nf_conntrack_ecache { | |||
| 18 | u16 ctmask; /* bitmask of ct events to be delivered */ | 18 | u16 ctmask; /* bitmask of ct events to be delivered */ |
| 19 | u16 expmask; /* bitmask of expect events to be delivered */ | 19 | u16 expmask; /* bitmask of expect events to be delivered */ |
| 20 | u32 pid; /* netlink pid of destroyer */ | 20 | u32 pid; /* netlink pid of destroyer */ |
| 21 | struct timer_list timeout; | ||
| 21 | }; | 22 | }; |
| 22 | 23 | ||
| 23 | static inline struct nf_conntrack_ecache * | 24 | static inline struct nf_conntrack_ecache * |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 1474dd65c66f..eb24dbccd81e 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
| @@ -65,7 +65,6 @@ struct netns_ipv4 { | |||
| 65 | unsigned int sysctl_ping_group_range[2]; | 65 | unsigned int sysctl_ping_group_range[2]; |
| 66 | long sysctl_tcp_mem[3]; | 66 | long sysctl_tcp_mem[3]; |
| 67 | 67 | ||
| 68 | atomic_t rt_genid; | ||
| 69 | atomic_t dev_addr_genid; | 68 | atomic_t dev_addr_genid; |
| 70 | 69 | ||
| 71 | #ifdef CONFIG_IP_MROUTE | 70 | #ifdef CONFIG_IP_MROUTE |
diff --git a/include/net/route.h b/include/net/route.h index 776a27f1ab78..da22243d2760 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
| @@ -108,7 +108,7 @@ extern struct ip_rt_acct __percpu *ip_rt_acct; | |||
| 108 | 108 | ||
| 109 | struct in_device; | 109 | struct in_device; |
| 110 | extern int ip_rt_init(void); | 110 | extern int ip_rt_init(void); |
| 111 | extern void rt_cache_flush(struct net *net, int how); | 111 | extern void rt_cache_flush(struct net *net); |
| 112 | extern void rt_flush_dev(struct net_device *dev); | 112 | extern void rt_flush_dev(struct net_device *dev); |
| 113 | extern struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp); | 113 | extern struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp); |
| 114 | extern struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp, | 114 | extern struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp, |
diff --git a/include/net/sock.h b/include/net/sock.h index 72132aef53fc..adb7da20b5a1 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -1332,7 +1332,7 @@ static inline bool sk_wmem_schedule(struct sock *sk, int size) | |||
| 1332 | } | 1332 | } |
| 1333 | 1333 | ||
| 1334 | static inline bool | 1334 | static inline bool |
| 1335 | sk_rmem_schedule(struct sock *sk, struct sk_buff *skb, unsigned int size) | 1335 | sk_rmem_schedule(struct sock *sk, struct sk_buff *skb, int size) |
| 1336 | { | 1336 | { |
| 1337 | if (!sk_has_account(sk)) | 1337 | if (!sk_has_account(sk)) |
| 1338 | return true; | 1338 | return true; |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 976a81abe1a2..639dd1316d37 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -273,6 +273,9 @@ struct xfrm_replay { | |||
| 273 | int (*check)(struct xfrm_state *x, | 273 | int (*check)(struct xfrm_state *x, |
| 274 | struct sk_buff *skb, | 274 | struct sk_buff *skb, |
| 275 | __be32 net_seq); | 275 | __be32 net_seq); |
| 276 | int (*recheck)(struct xfrm_state *x, | ||
| 277 | struct sk_buff *skb, | ||
| 278 | __be32 net_seq); | ||
| 276 | void (*notify)(struct xfrm_state *x, int event); | 279 | void (*notify)(struct xfrm_state *x, int event); |
| 277 | int (*overflow)(struct xfrm_state *x, struct sk_buff *skb); | 280 | int (*overflow)(struct xfrm_state *x, struct sk_buff *skb); |
| 278 | }; | 281 | }; |
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index f1405d335a96..941c84bf1065 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h | |||
| @@ -23,7 +23,9 @@ struct se_subsystem_api { | |||
| 23 | struct se_device *(*create_virtdevice)(struct se_hba *, | 23 | struct se_device *(*create_virtdevice)(struct se_hba *, |
| 24 | struct se_subsystem_dev *, void *); | 24 | struct se_subsystem_dev *, void *); |
| 25 | void (*free_device)(void *); | 25 | void (*free_device)(void *); |
| 26 | int (*transport_complete)(struct se_cmd *cmd, struct scatterlist *); | 26 | void (*transport_complete)(struct se_cmd *cmd, |
| 27 | struct scatterlist *, | ||
| 28 | unsigned char *); | ||
| 27 | 29 | ||
| 28 | int (*parse_cdb)(struct se_cmd *cmd); | 30 | int (*parse_cdb)(struct se_cmd *cmd); |
| 29 | ssize_t (*check_configfs_dev_params)(struct se_hba *, | 31 | ssize_t (*check_configfs_dev_params)(struct se_hba *, |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 015cea01ae39..5be89373ceac 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
| @@ -121,6 +121,7 @@ | |||
| 121 | 121 | ||
| 122 | #define SE_INQUIRY_BUF 512 | 122 | #define SE_INQUIRY_BUF 512 |
| 123 | #define SE_MODE_PAGE_BUF 512 | 123 | #define SE_MODE_PAGE_BUF 512 |
| 124 | #define SE_SENSE_BUF 96 | ||
| 124 | 125 | ||
| 125 | /* struct se_hba->hba_flags */ | 126 | /* struct se_hba->hba_flags */ |
| 126 | enum hba_flags_table { | 127 | enum hba_flags_table { |
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h index b0b4eb24d592..1905ca8dd399 100644 --- a/include/trace/define_trace.h +++ b/include/trace/define_trace.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Trace files that want to automate creationg of all tracepoints defined | 2 | * Trace files that want to automate creation of all tracepoints defined |
| 3 | * in their file should include this file. The following are macros that the | 3 | * in their file should include this file. The following are macros that the |
| 4 | * trace file may define: | 4 | * trace file may define: |
| 5 | * | 5 | * |
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index 5f889f16b0c8..08fa27244da7 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h | |||
| @@ -214,7 +214,7 @@ TRACE_EVENT(mm_page_alloc, | |||
| 214 | 214 | ||
| 215 | TP_printk("page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%s", | 215 | TP_printk("page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%s", |
| 216 | __entry->page, | 216 | __entry->page, |
| 217 | page_to_pfn(__entry->page), | 217 | __entry->page ? page_to_pfn(__entry->page) : 0, |
| 218 | __entry->order, | 218 | __entry->order, |
| 219 | __entry->migratetype, | 219 | __entry->migratetype, |
| 220 | show_gfp_flags(__entry->gfp_flags)) | 220 | show_gfp_flags(__entry->gfp_flags)) |
| @@ -240,7 +240,7 @@ DECLARE_EVENT_CLASS(mm_page, | |||
| 240 | 240 | ||
| 241 | TP_printk("page=%p pfn=%lu order=%u migratetype=%d percpu_refill=%d", | 241 | TP_printk("page=%p pfn=%lu order=%u migratetype=%d percpu_refill=%d", |
| 242 | __entry->page, | 242 | __entry->page, |
| 243 | page_to_pfn(__entry->page), | 243 | __entry->page ? page_to_pfn(__entry->page) : 0, |
| 244 | __entry->order, | 244 | __entry->order, |
| 245 | __entry->migratetype, | 245 | __entry->migratetype, |
| 246 | __entry->order == 0) | 246 | __entry->order == 0) |
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index 11e27c3af3cb..f19fff8650e9 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h | |||
| @@ -187,6 +187,7 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, | |||
| 187 | struct gnttab_map_grant_ref *kmap_ops, | 187 | struct gnttab_map_grant_ref *kmap_ops, |
| 188 | struct page **pages, unsigned int count); | 188 | struct page **pages, unsigned int count); |
| 189 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | 189 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, |
| 190 | struct page **pages, unsigned int count, bool clear_pte); | 190 | struct gnttab_map_grant_ref *kunmap_ops, |
| 191 | struct page **pages, unsigned int count); | ||
| 191 | 192 | ||
| 192 | #endif /* __ASM_GNTTAB_H__ */ | 193 | #endif /* __ASM_GNTTAB_H__ */ |
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h index 9ce788d8cf49..bfa1d50fe15b 100644 --- a/include/xen/interface/physdev.h +++ b/include/xen/interface/physdev.h | |||
| @@ -258,6 +258,22 @@ struct physdev_pci_device { | |||
| 258 | uint8_t devfn; | 258 | uint8_t devfn; |
| 259 | }; | 259 | }; |
| 260 | 260 | ||
| 261 | #define PHYSDEVOP_DBGP_RESET_PREPARE 1 | ||
| 262 | #define PHYSDEVOP_DBGP_RESET_DONE 2 | ||
| 263 | |||
| 264 | #define PHYSDEVOP_DBGP_BUS_UNKNOWN 0 | ||
| 265 | #define PHYSDEVOP_DBGP_BUS_PCI 1 | ||
| 266 | |||
| 267 | #define PHYSDEVOP_dbgp_op 29 | ||
| 268 | struct physdev_dbgp_op { | ||
| 269 | /* IN */ | ||
| 270 | uint8_t op; | ||
| 271 | uint8_t bus; | ||
| 272 | union { | ||
| 273 | struct physdev_pci_device pci; | ||
| 274 | } u; | ||
| 275 | }; | ||
| 276 | |||
| 261 | /* | 277 | /* |
| 262 | * Notify that some PIRQ-bound event channels have been unmasked. | 278 | * Notify that some PIRQ-bound event channels have been unmasked. |
| 263 | * ** This command is obsolete since interface version 0x00030202 and is ** | 279 | * ** This command is obsolete since interface version 0x00030202 and is ** |
