diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/clk/zynq.h | 24 | ||||
| -rw-r--r-- | include/linux/devpts_fs.h | 20 | ||||
| -rw-r--r-- | include/linux/dma/ipu-dma.h | 177 | ||||
| -rw-r--r-- | include/linux/mfd/menelaus.h | 47 | ||||
| -rw-r--r-- | include/linux/platform_data/asoc-imx-ssi.h | 2 | ||||
| -rw-r--r-- | include/linux/platform_data/dma-imx.h | 4 | ||||
| -rw-r--r-- | include/linux/platform_data/gpio-omap.h | 1 | ||||
| -rw-r--r-- | include/linux/platform_data/leds-omap.h | 22 | ||||
| -rw-r--r-- | include/linux/platform_data/mmc-omap.h | 150 | ||||
| -rw-r--r-- | include/linux/platform_data/mtd-nand-omap2.h | 46 | ||||
| -rw-r--r-- | include/linux/platform_data/mtd-onenand-omap2.h | 28 | ||||
| -rw-r--r-- | include/linux/platform_data/omap-wd-timer.h | 38 | ||||
| -rw-r--r-- | include/linux/platform_data/uio_pruss.h | 3 | ||||
| -rw-r--r-- | include/linux/platform_data/usb-omap.h | 80 | ||||
| -rw-r--r-- | include/linux/tty.h | 44 | ||||
| -rw-r--r-- | include/linux/tty_flip.h | 2 |
16 files changed, 604 insertions, 84 deletions
diff --git a/include/linux/clk/zynq.h b/include/linux/clk/zynq.h new file mode 100644 index 000000000000..56be7cd9aa8b --- /dev/null +++ b/include/linux/clk/zynq.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2012 National Instruments | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __LINUX_CLK_ZYNQ_H_ | ||
| 20 | #define __LINUX_CLK_ZYNQ_H_ | ||
| 21 | |||
| 22 | void __init xilinx_zynq_clocks_init(void __iomem *slcr); | ||
| 23 | |||
| 24 | #endif | ||
diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h index 5ce0e5fd712e..251a2090a554 100644 --- a/include/linux/devpts_fs.h +++ b/include/linux/devpts_fs.h | |||
| @@ -20,28 +20,28 @@ | |||
| 20 | int devpts_new_index(struct inode *ptmx_inode); | 20 | int devpts_new_index(struct inode *ptmx_inode); |
| 21 | void devpts_kill_index(struct inode *ptmx_inode, int idx); | 21 | void devpts_kill_index(struct inode *ptmx_inode, int idx); |
| 22 | /* mknod in devpts */ | 22 | /* mknod in devpts */ |
| 23 | int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty); | 23 | struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index, |
| 24 | /* get tty structure */ | 24 | void *priv); |
| 25 | struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number); | 25 | /* get private structure */ |
| 26 | void *devpts_get_priv(struct inode *pts_inode); | ||
| 26 | /* unlink */ | 27 | /* unlink */ |
| 27 | void devpts_pty_kill(struct tty_struct *tty); | 28 | void devpts_pty_kill(struct inode *inode); |
| 28 | 29 | ||
| 29 | #else | 30 | #else |
| 30 | 31 | ||
| 31 | /* Dummy stubs in the no-pty case */ | 32 | /* Dummy stubs in the no-pty case */ |
| 32 | static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; } | 33 | static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; } |
| 33 | static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { } | 34 | static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { } |
| 34 | static inline int devpts_pty_new(struct inode *ptmx_inode, | 35 | static inline struct inode *devpts_pty_new(struct inode *ptmx_inode, |
| 35 | struct tty_struct *tty) | 36 | dev_t device, int index, void *priv) |
| 36 | { | 37 | { |
| 37 | return -EINVAL; | 38 | return ERR_PTR(-EINVAL); |
| 38 | } | 39 | } |
| 39 | static inline struct tty_struct *devpts_get_tty(struct inode *pts_inode, | 40 | static inline void *devpts_get_priv(struct inode *pts_inode) |
| 40 | int number) | ||
| 41 | { | 41 | { |
| 42 | return NULL; | 42 | return NULL; |
| 43 | } | 43 | } |
| 44 | static inline void devpts_pty_kill(struct tty_struct *tty) { } | 44 | static inline void devpts_pty_kill(struct inode *inode) { } |
| 45 | 45 | ||
| 46 | #endif | 46 | #endif |
| 47 | 47 | ||
diff --git a/include/linux/dma/ipu-dma.h b/include/linux/dma/ipu-dma.h new file mode 100644 index 000000000000..18031115c668 --- /dev/null +++ b/include/linux/dma/ipu-dma.h | |||
| @@ -0,0 +1,177 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2008 | ||
| 3 | * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de> | ||
| 4 | * | ||
| 5 | * Copyright (C) 2005-2007 Freescale Semiconductor, Inc. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __LINUX_DMA_IPU_DMA_H | ||
| 13 | #define __LINUX_DMA_IPU_DMA_H | ||
| 14 | |||
| 15 | #include <linux/types.h> | ||
| 16 | #include <linux/dmaengine.h> | ||
| 17 | |||
| 18 | /* IPU DMA Controller channel definitions. */ | ||
| 19 | enum ipu_channel { | ||
| 20 | IDMAC_IC_0 = 0, /* IC (encoding task) to memory */ | ||
| 21 | IDMAC_IC_1 = 1, /* IC (viewfinder task) to memory */ | ||
| 22 | IDMAC_ADC_0 = 1, | ||
| 23 | IDMAC_IC_2 = 2, | ||
| 24 | IDMAC_ADC_1 = 2, | ||
| 25 | IDMAC_IC_3 = 3, | ||
| 26 | IDMAC_IC_4 = 4, | ||
| 27 | IDMAC_IC_5 = 5, | ||
| 28 | IDMAC_IC_6 = 6, | ||
| 29 | IDMAC_IC_7 = 7, /* IC (sensor data) to memory */ | ||
| 30 | IDMAC_IC_8 = 8, | ||
| 31 | IDMAC_IC_9 = 9, | ||
| 32 | IDMAC_IC_10 = 10, | ||
| 33 | IDMAC_IC_11 = 11, | ||
| 34 | IDMAC_IC_12 = 12, | ||
| 35 | IDMAC_IC_13 = 13, | ||
| 36 | IDMAC_SDC_0 = 14, /* Background synchronous display data */ | ||
| 37 | IDMAC_SDC_1 = 15, /* Foreground data (overlay) */ | ||
| 38 | IDMAC_SDC_2 = 16, | ||
| 39 | IDMAC_SDC_3 = 17, | ||
| 40 | IDMAC_ADC_2 = 18, | ||
| 41 | IDMAC_ADC_3 = 19, | ||
| 42 | IDMAC_ADC_4 = 20, | ||
| 43 | IDMAC_ADC_5 = 21, | ||
| 44 | IDMAC_ADC_6 = 22, | ||
| 45 | IDMAC_ADC_7 = 23, | ||
| 46 | IDMAC_PF_0 = 24, | ||
| 47 | IDMAC_PF_1 = 25, | ||
| 48 | IDMAC_PF_2 = 26, | ||
| 49 | IDMAC_PF_3 = 27, | ||
| 50 | IDMAC_PF_4 = 28, | ||
| 51 | IDMAC_PF_5 = 29, | ||
| 52 | IDMAC_PF_6 = 30, | ||
| 53 | IDMAC_PF_7 = 31, | ||
| 54 | }; | ||
| 55 | |||
| 56 | /* Order significant! */ | ||
| 57 | enum ipu_channel_status { | ||
| 58 | IPU_CHANNEL_FREE, | ||
| 59 | IPU_CHANNEL_INITIALIZED, | ||
| 60 | IPU_CHANNEL_READY, | ||
| 61 | IPU_CHANNEL_ENABLED, | ||
| 62 | }; | ||
| 63 | |||
| 64 | #define IPU_CHANNELS_NUM 32 | ||
| 65 | |||
| 66 | enum pixel_fmt { | ||
| 67 | /* 1 byte */ | ||
| 68 | IPU_PIX_FMT_GENERIC, | ||
| 69 | IPU_PIX_FMT_RGB332, | ||
| 70 | IPU_PIX_FMT_YUV420P, | ||
| 71 | IPU_PIX_FMT_YUV422P, | ||
| 72 | IPU_PIX_FMT_YUV420P2, | ||
| 73 | IPU_PIX_FMT_YVU422P, | ||
| 74 | /* 2 bytes */ | ||
| 75 | IPU_PIX_FMT_RGB565, | ||
| 76 | IPU_PIX_FMT_RGB666, | ||
| 77 | IPU_PIX_FMT_BGR666, | ||
| 78 | IPU_PIX_FMT_YUYV, | ||
| 79 | IPU_PIX_FMT_UYVY, | ||
| 80 | /* 3 bytes */ | ||
| 81 | IPU_PIX_FMT_RGB24, | ||
| 82 | IPU_PIX_FMT_BGR24, | ||
| 83 | /* 4 bytes */ | ||
| 84 | IPU_PIX_FMT_GENERIC_32, | ||
| 85 | IPU_PIX_FMT_RGB32, | ||
| 86 | IPU_PIX_FMT_BGR32, | ||
| 87 | IPU_PIX_FMT_ABGR32, | ||
| 88 | IPU_PIX_FMT_BGRA32, | ||
| 89 | IPU_PIX_FMT_RGBA32, | ||
| 90 | }; | ||
| 91 | |||
| 92 | enum ipu_color_space { | ||
| 93 | IPU_COLORSPACE_RGB, | ||
| 94 | IPU_COLORSPACE_YCBCR, | ||
| 95 | IPU_COLORSPACE_YUV | ||
| 96 | }; | ||
| 97 | |||
| 98 | /* | ||
| 99 | * Enumeration of IPU rotation modes | ||
| 100 | */ | ||
| 101 | enum ipu_rotate_mode { | ||
| 102 | /* Note the enum values correspond to BAM value */ | ||
| 103 | IPU_ROTATE_NONE = 0, | ||
| 104 | IPU_ROTATE_VERT_FLIP = 1, | ||
| 105 | IPU_ROTATE_HORIZ_FLIP = 2, | ||
| 106 | IPU_ROTATE_180 = 3, | ||
| 107 | IPU_ROTATE_90_RIGHT = 4, | ||
| 108 | IPU_ROTATE_90_RIGHT_VFLIP = 5, | ||
| 109 | IPU_ROTATE_90_RIGHT_HFLIP = 6, | ||
| 110 | IPU_ROTATE_90_LEFT = 7, | ||
| 111 | }; | ||
| 112 | |||
| 113 | /* | ||
| 114 | * Enumeration of DI ports for ADC. | ||
| 115 | */ | ||
| 116 | enum display_port { | ||
| 117 | DISP0, | ||
| 118 | DISP1, | ||
| 119 | DISP2, | ||
| 120 | DISP3 | ||
| 121 | }; | ||
| 122 | |||
| 123 | struct idmac_video_param { | ||
| 124 | unsigned short in_width; | ||
| 125 | unsigned short in_height; | ||
| 126 | uint32_t in_pixel_fmt; | ||
| 127 | unsigned short out_width; | ||
| 128 | unsigned short out_height; | ||
| 129 | uint32_t out_pixel_fmt; | ||
| 130 | unsigned short out_stride; | ||
| 131 | bool graphics_combine_en; | ||
| 132 | bool global_alpha_en; | ||
| 133 | bool key_color_en; | ||
| 134 | enum display_port disp; | ||
| 135 | unsigned short out_left; | ||
| 136 | unsigned short out_top; | ||
| 137 | }; | ||
| 138 | |||
| 139 | /* | ||
| 140 | * Union of initialization parameters for a logical channel. So far only video | ||
| 141 | * parameters are used. | ||
| 142 | */ | ||
| 143 | union ipu_channel_param { | ||
| 144 | struct idmac_video_param video; | ||
| 145 | }; | ||
| 146 | |||
| 147 | struct idmac_tx_desc { | ||
| 148 | struct dma_async_tx_descriptor txd; | ||
| 149 | struct scatterlist *sg; /* scatterlist for this */ | ||
| 150 | unsigned int sg_len; /* tx-descriptor. */ | ||
| 151 | struct list_head list; | ||
| 152 | }; | ||
| 153 | |||
| 154 | struct idmac_channel { | ||
| 155 | struct dma_chan dma_chan; | ||
| 156 | dma_cookie_t completed; /* last completed cookie */ | ||
| 157 | union ipu_channel_param params; | ||
| 158 | enum ipu_channel link; /* input channel, linked to the output */ | ||
| 159 | enum ipu_channel_status status; | ||
| 160 | void *client; /* Only one client per channel */ | ||
| 161 | unsigned int n_tx_desc; | ||
| 162 | struct idmac_tx_desc *desc; /* allocated tx-descriptors */ | ||
| 163 | struct scatterlist *sg[2]; /* scatterlist elements in buffer-0 and -1 */ | ||
| 164 | struct list_head free_list; /* free tx-descriptors */ | ||
| 165 | struct list_head queue; /* queued tx-descriptors */ | ||
| 166 | spinlock_t lock; /* protects sg[0,1], queue */ | ||
| 167 | struct mutex chan_mutex; /* protects status, cookie, free_list */ | ||
| 168 | bool sec_chan_en; | ||
| 169 | int active_buffer; | ||
| 170 | unsigned int eof_irq; | ||
| 171 | char eof_name[16]; /* EOF IRQ name for request_irq() */ | ||
| 172 | }; | ||
| 173 | |||
| 174 | #define to_tx_desc(tx) container_of(tx, struct idmac_tx_desc, txd) | ||
| 175 | #define to_idmac_chan(c) container_of(c, struct idmac_channel, dma_chan) | ||
| 176 | |||
| 177 | #endif /* __LINUX_DMA_IPU_DMA_H */ | ||
diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h new file mode 100644 index 000000000000..f097e89134cb --- /dev/null +++ b/include/linux/mfd/menelaus.h | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | /* | ||
| 2 | * Functions to access Menelaus power management chip | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef __ASM_ARCH_MENELAUS_H | ||
| 6 | #define __ASM_ARCH_MENELAUS_H | ||
| 7 | |||
| 8 | struct device; | ||
| 9 | |||
| 10 | struct menelaus_platform_data { | ||
| 11 | int (* late_init)(struct device *dev); | ||
| 12 | }; | ||
| 13 | |||
| 14 | extern int menelaus_register_mmc_callback(void (*callback)(void *data, u8 card_mask), | ||
| 15 | void *data); | ||
| 16 | extern void menelaus_unregister_mmc_callback(void); | ||
| 17 | extern int menelaus_set_mmc_opendrain(int slot, int enable); | ||
| 18 | extern int menelaus_set_mmc_slot(int slot, int enable, int power, int cd_on); | ||
| 19 | |||
| 20 | extern int menelaus_set_vmem(unsigned int mV); | ||
| 21 | extern int menelaus_set_vio(unsigned int mV); | ||
| 22 | extern int menelaus_set_vmmc(unsigned int mV); | ||
| 23 | extern int menelaus_set_vaux(unsigned int mV); | ||
| 24 | extern int menelaus_set_vdcdc(int dcdc, unsigned int mV); | ||
| 25 | extern int menelaus_set_slot_sel(int enable); | ||
| 26 | extern int menelaus_get_slot_pin_states(void); | ||
| 27 | extern int menelaus_set_vcore_sw(unsigned int mV); | ||
| 28 | extern int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV); | ||
| 29 | |||
| 30 | #define EN_VPLL_SLEEP (1 << 7) | ||
| 31 | #define EN_VMMC_SLEEP (1 << 6) | ||
| 32 | #define EN_VAUX_SLEEP (1 << 5) | ||
| 33 | #define EN_VIO_SLEEP (1 << 4) | ||
| 34 | #define EN_VMEM_SLEEP (1 << 3) | ||
| 35 | #define EN_DC3_SLEEP (1 << 2) | ||
| 36 | #define EN_DC2_SLEEP (1 << 1) | ||
| 37 | #define EN_VC_SLEEP (1 << 0) | ||
| 38 | |||
| 39 | extern int menelaus_set_regulator_sleep(int enable, u32 val); | ||
| 40 | |||
| 41 | #if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_MENELAUS) | ||
| 42 | #define omap_has_menelaus() 1 | ||
| 43 | #else | ||
| 44 | #define omap_has_menelaus() 0 | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #endif | ||
diff --git a/include/linux/platform_data/asoc-imx-ssi.h b/include/linux/platform_data/asoc-imx-ssi.h index 63f3c2804239..92c7fd72f636 100644 --- a/include/linux/platform_data/asoc-imx-ssi.h +++ b/include/linux/platform_data/asoc-imx-ssi.h | |||
| @@ -17,5 +17,7 @@ struct imx_ssi_platform_data { | |||
| 17 | void (*ac97_warm_reset)(struct snd_ac97 *ac97); | 17 | void (*ac97_warm_reset)(struct snd_ac97 *ac97); |
| 18 | }; | 18 | }; |
| 19 | 19 | ||
| 20 | extern int mxc_set_irq_fiq(unsigned int irq, unsigned int type); | ||
| 21 | |||
| 20 | #endif /* __MACH_SSI_H */ | 22 | #endif /* __MACH_SSI_H */ |
| 21 | 23 | ||
diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h index 1b9080385b46..f6d30cc1cb77 100644 --- a/include/linux/platform_data/dma-imx.h +++ b/include/linux/platform_data/dma-imx.h | |||
| @@ -61,7 +61,9 @@ static inline int imx_dma_is_ipu(struct dma_chan *chan) | |||
| 61 | static inline int imx_dma_is_general_purpose(struct dma_chan *chan) | 61 | static inline int imx_dma_is_general_purpose(struct dma_chan *chan) |
| 62 | { | 62 | { |
| 63 | return strstr(dev_name(chan->device->dev), "sdma") || | 63 | return strstr(dev_name(chan->device->dev), "sdma") || |
| 64 | !strcmp(dev_name(chan->device->dev), "imx-dma"); | 64 | !strcmp(dev_name(chan->device->dev), "imx1-dma") || |
| 65 | !strcmp(dev_name(chan->device->dev), "imx21-dma") || | ||
| 66 | !strcmp(dev_name(chan->device->dev), "imx27-dma"); | ||
| 65 | } | 67 | } |
| 66 | 68 | ||
| 67 | #endif | 69 | #endif |
diff --git a/include/linux/platform_data/gpio-omap.h b/include/linux/platform_data/gpio-omap.h index e8741c2678d5..5d50b25a73d7 100644 --- a/include/linux/platform_data/gpio-omap.h +++ b/include/linux/platform_data/gpio-omap.h | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | 26 | ||
| 27 | #include <linux/io.h> | 27 | #include <linux/io.h> |
| 28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
| 29 | #include <mach/irqs.h> | ||
| 30 | 29 | ||
| 31 | #define OMAP1_MPUIO_BASE 0xfffb5000 | 30 | #define OMAP1_MPUIO_BASE 0xfffb5000 |
| 32 | 31 | ||
diff --git a/include/linux/platform_data/leds-omap.h b/include/linux/platform_data/leds-omap.h new file mode 100644 index 000000000000..56c9b2a0ada5 --- /dev/null +++ b/include/linux/platform_data/leds-omap.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2006 Samsung Electronics | ||
| 3 | * Kyungmin Park <kyungmin.park@samsung.com> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | */ | ||
| 9 | #ifndef ASMARM_ARCH_LED_H | ||
| 10 | #define ASMARM_ARCH_LED_H | ||
| 11 | |||
| 12 | struct omap_led_config { | ||
| 13 | struct led_classdev cdev; | ||
| 14 | s16 gpio; | ||
| 15 | }; | ||
| 16 | |||
| 17 | struct omap_led_platform_data { | ||
| 18 | s16 nr_leds; | ||
| 19 | struct omap_led_config *leds; | ||
| 20 | }; | ||
| 21 | |||
| 22 | #endif | ||
diff --git a/include/linux/platform_data/mmc-omap.h b/include/linux/platform_data/mmc-omap.h new file mode 100644 index 000000000000..2bf6ea82ff94 --- /dev/null +++ b/include/linux/platform_data/mmc-omap.h | |||
| @@ -0,0 +1,150 @@ | |||
| 1 | /* | ||
| 2 | * MMC definitions for OMAP2 | ||
| 3 | * | ||
| 4 | * Copyright (C) 2006 Nokia Corporation | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #define OMAP_MMC_MAX_SLOTS 2 | ||
| 12 | |||
| 13 | /* | ||
| 14 | * struct omap_mmc_dev_attr.flags possibilities | ||
| 15 | * | ||
| 16 | * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can | ||
| 17 | * operate with either 1.8Vdc or 3.0Vdc card voltages; this flag | ||
| 18 | * should be set if this is the case. See for example Section 22.5.3 | ||
| 19 | * "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia | ||
| 20 | * Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R). | ||
| 21 | * | ||
| 22 | * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers | ||
| 23 | * don't work correctly on some MMC controller instances on some | ||
| 24 | * OMAP3 SoCs; this flag should be set if this is the case. See | ||
| 25 | * for example Advisory 2.1.1.128 "MMC: Multiple Block Read | ||
| 26 | * Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_ | ||
| 27 | * Revision F (October 2010) (SPRZ278F). | ||
| 28 | */ | ||
| 29 | #define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0) | ||
| 30 | #define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1) | ||
| 31 | |||
| 32 | struct mmc_card; | ||
| 33 | |||
| 34 | struct omap_mmc_dev_attr { | ||
| 35 | u8 flags; | ||
| 36 | }; | ||
| 37 | |||
| 38 | struct omap_mmc_platform_data { | ||
| 39 | /* back-link to device */ | ||
| 40 | struct device *dev; | ||
| 41 | |||
| 42 | /* number of slots per controller */ | ||
| 43 | unsigned nr_slots:2; | ||
| 44 | |||
| 45 | /* set if your board has components or wiring that limits the | ||
| 46 | * maximum frequency on the MMC bus */ | ||
| 47 | unsigned int max_freq; | ||
| 48 | |||
| 49 | /* switch the bus to a new slot */ | ||
| 50 | int (*switch_slot)(struct device *dev, int slot); | ||
| 51 | /* initialize board-specific MMC functionality, can be NULL if | ||
| 52 | * not supported */ | ||
| 53 | int (*init)(struct device *dev); | ||
| 54 | void (*cleanup)(struct device *dev); | ||
| 55 | void (*shutdown)(struct device *dev); | ||
| 56 | |||
| 57 | /* To handle board related suspend/resume functionality for MMC */ | ||
| 58 | int (*suspend)(struct device *dev, int slot); | ||
| 59 | int (*resume)(struct device *dev, int slot); | ||
| 60 | |||
| 61 | /* Return context loss count due to PM states changing */ | ||
| 62 | int (*get_context_loss_count)(struct device *dev); | ||
| 63 | |||
| 64 | /* Integrating attributes from the omap_hwmod layer */ | ||
| 65 | u8 controller_flags; | ||
| 66 | |||
| 67 | /* Register offset deviation */ | ||
| 68 | u16 reg_offset; | ||
| 69 | |||
| 70 | struct omap_mmc_slot_data { | ||
| 71 | |||
| 72 | /* | ||
| 73 | * 4/8 wires and any additional host capabilities | ||
| 74 | * need to OR'd all capabilities (ref. linux/mmc/host.h) | ||
| 75 | */ | ||
| 76 | u8 wires; /* Used for the MMC driver on omap1 and 2420 */ | ||
| 77 | u32 caps; /* Used for the MMC driver on 2430 and later */ | ||
| 78 | u32 pm_caps; /* PM capabilities of the mmc */ | ||
| 79 | |||
| 80 | /* | ||
| 81 | * nomux means "standard" muxing is wrong on this board, and | ||
| 82 | * that board-specific code handled it before common init logic. | ||
| 83 | */ | ||
| 84 | unsigned nomux:1; | ||
| 85 | |||
| 86 | /* switch pin can be for card detect (default) or card cover */ | ||
| 87 | unsigned cover:1; | ||
| 88 | |||
| 89 | /* use the internal clock */ | ||
| 90 | unsigned internal_clock:1; | ||
| 91 | |||
| 92 | /* nonremovable e.g. eMMC */ | ||
| 93 | unsigned nonremovable:1; | ||
| 94 | |||
| 95 | /* Try to sleep or power off when possible */ | ||
| 96 | unsigned power_saving:1; | ||
| 97 | |||
| 98 | /* If using power_saving and the MMC power is not to go off */ | ||
| 99 | unsigned no_off:1; | ||
| 100 | |||
| 101 | /* eMMC does not handle power off when not in sleep state */ | ||
| 102 | unsigned no_regulator_off_init:1; | ||
| 103 | |||
| 104 | /* Regulator off remapped to sleep */ | ||
| 105 | unsigned vcc_aux_disable_is_sleep:1; | ||
| 106 | |||
| 107 | /* we can put the features above into this variable */ | ||
| 108 | #define HSMMC_HAS_PBIAS (1 << 0) | ||
| 109 | #define HSMMC_HAS_UPDATED_RESET (1 << 1) | ||
| 110 | #define MMC_OMAP7XX (1 << 2) | ||
| 111 | #define MMC_OMAP15XX (1 << 3) | ||
| 112 | #define MMC_OMAP16XX (1 << 4) | ||
| 113 | unsigned features; | ||
| 114 | |||
| 115 | int switch_pin; /* gpio (card detect) */ | ||
| 116 | int gpio_wp; /* gpio (write protect) */ | ||
| 117 | |||
| 118 | int (*set_bus_mode)(struct device *dev, int slot, int bus_mode); | ||
| 119 | int (*set_power)(struct device *dev, int slot, | ||
| 120 | int power_on, int vdd); | ||
| 121 | int (*get_ro)(struct device *dev, int slot); | ||
| 122 | void (*remux)(struct device *dev, int slot, int power_on); | ||
| 123 | /* Call back before enabling / disabling regulators */ | ||
| 124 | void (*before_set_reg)(struct device *dev, int slot, | ||
| 125 | int power_on, int vdd); | ||
| 126 | /* Call back after enabling / disabling regulators */ | ||
| 127 | void (*after_set_reg)(struct device *dev, int slot, | ||
| 128 | int power_on, int vdd); | ||
| 129 | /* if we have special card, init it using this callback */ | ||
| 130 | void (*init_card)(struct mmc_card *card); | ||
| 131 | |||
| 132 | /* return MMC cover switch state, can be NULL if not supported. | ||
| 133 | * | ||
| 134 | * possible return values: | ||
| 135 | * 0 - closed | ||
| 136 | * 1 - open | ||
| 137 | */ | ||
| 138 | int (*get_cover_state)(struct device *dev, int slot); | ||
| 139 | |||
| 140 | const char *name; | ||
| 141 | u32 ocr_mask; | ||
| 142 | |||
| 143 | /* Card detection IRQs */ | ||
| 144 | int card_detect_irq; | ||
| 145 | int (*card_detect)(struct device *dev, int slot); | ||
| 146 | |||
| 147 | unsigned int ban_openended:1; | ||
| 148 | |||
| 149 | } slots[OMAP_MMC_MAX_SLOTS]; | ||
| 150 | }; | ||
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h index 1a68c1e5fe53..24d32ca34bef 100644 --- a/include/linux/platform_data/mtd-nand-omap2.h +++ b/include/linux/platform_data/mtd-nand-omap2.h | |||
| @@ -8,9 +8,13 @@ | |||
| 8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <plat/gpmc.h> | 11 | #ifndef _MTD_NAND_OMAP2_H |
| 12 | #define _MTD_NAND_OMAP2_H | ||
| 13 | |||
| 12 | #include <linux/mtd/partitions.h> | 14 | #include <linux/mtd/partitions.h> |
| 13 | 15 | ||
| 16 | #define GPMC_BCH_NUM_REMAINDER 8 | ||
| 17 | |||
| 14 | enum nand_io { | 18 | enum nand_io { |
| 15 | NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */ | 19 | NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */ |
| 16 | NAND_OMAP_POLLED, /* polled mode, without prefetch */ | 20 | NAND_OMAP_POLLED, /* polled mode, without prefetch */ |
| @@ -18,10 +22,38 @@ enum nand_io { | |||
| 18 | NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */ | 22 | NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */ |
| 19 | }; | 23 | }; |
| 20 | 24 | ||
| 25 | enum omap_ecc { | ||
| 26 | /* 1-bit ecc: stored at end of spare area */ | ||
| 27 | OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */ | ||
| 28 | OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */ | ||
| 29 | /* 1-bit ecc: stored at beginning of spare area as romcode */ | ||
| 30 | OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */ | ||
| 31 | OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */ | ||
| 32 | OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */ | ||
| 33 | }; | ||
| 34 | |||
| 35 | struct gpmc_nand_regs { | ||
| 36 | void __iomem *gpmc_status; | ||
| 37 | void __iomem *gpmc_nand_command; | ||
| 38 | void __iomem *gpmc_nand_address; | ||
| 39 | void __iomem *gpmc_nand_data; | ||
| 40 | void __iomem *gpmc_prefetch_config1; | ||
| 41 | void __iomem *gpmc_prefetch_config2; | ||
| 42 | void __iomem *gpmc_prefetch_control; | ||
| 43 | void __iomem *gpmc_prefetch_status; | ||
| 44 | void __iomem *gpmc_ecc_config; | ||
| 45 | void __iomem *gpmc_ecc_control; | ||
| 46 | void __iomem *gpmc_ecc_size_config; | ||
| 47 | void __iomem *gpmc_ecc1_result; | ||
| 48 | void __iomem *gpmc_bch_result0[GPMC_BCH_NUM_REMAINDER]; | ||
| 49 | void __iomem *gpmc_bch_result1[GPMC_BCH_NUM_REMAINDER]; | ||
| 50 | void __iomem *gpmc_bch_result2[GPMC_BCH_NUM_REMAINDER]; | ||
| 51 | void __iomem *gpmc_bch_result3[GPMC_BCH_NUM_REMAINDER]; | ||
| 52 | }; | ||
| 53 | |||
| 21 | struct omap_nand_platform_data { | 54 | struct omap_nand_platform_data { |
| 22 | int cs; | 55 | int cs; |
| 23 | struct mtd_partition *parts; | 56 | struct mtd_partition *parts; |
| 24 | struct gpmc_timings *gpmc_t; | ||
| 25 | int nr_parts; | 57 | int nr_parts; |
| 26 | bool dev_ready; | 58 | bool dev_ready; |
| 27 | enum nand_io xfer_type; | 59 | enum nand_io xfer_type; |
| @@ -30,14 +62,4 @@ struct omap_nand_platform_data { | |||
| 30 | struct gpmc_nand_regs reg; | 62 | struct gpmc_nand_regs reg; |
| 31 | }; | 63 | }; |
| 32 | 64 | ||
| 33 | /* minimum size for IO mapping */ | ||
| 34 | #define NAND_IO_SIZE 4 | ||
| 35 | |||
| 36 | #if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE) | ||
| 37 | extern int gpmc_nand_init(struct omap_nand_platform_data *d); | ||
| 38 | #else | ||
| 39 | static inline int gpmc_nand_init(struct omap_nand_platform_data *d) | ||
| 40 | { | ||
| 41 | return 0; | ||
| 42 | } | ||
| 43 | #endif | 65 | #endif |
diff --git a/include/linux/platform_data/mtd-onenand-omap2.h b/include/linux/platform_data/mtd-onenand-omap2.h index 2858667d2e4f..685af7e8b120 100644 --- a/include/linux/platform_data/mtd-onenand-omap2.h +++ b/include/linux/platform_data/mtd-onenand-omap2.h | |||
| @@ -9,17 +9,15 @@ | |||
| 9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #ifndef __MTD_ONENAND_OMAP2_H | ||
| 13 | #define __MTD_ONENAND_OMAP2_H | ||
| 14 | |||
| 12 | #include <linux/mtd/mtd.h> | 15 | #include <linux/mtd/mtd.h> |
| 13 | #include <linux/mtd/partitions.h> | 16 | #include <linux/mtd/partitions.h> |
| 14 | 17 | ||
| 15 | #define ONENAND_SYNC_READ (1 << 0) | 18 | #define ONENAND_SYNC_READ (1 << 0) |
| 16 | #define ONENAND_SYNC_READWRITE (1 << 1) | 19 | #define ONENAND_SYNC_READWRITE (1 << 1) |
| 17 | 20 | #define ONENAND_IN_OMAP34XX (1 << 2) | |
| 18 | struct onenand_freq_info { | ||
| 19 | u16 maf_id; | ||
| 20 | u16 dev_id; | ||
| 21 | u16 ver_id; | ||
| 22 | }; | ||
| 23 | 21 | ||
| 24 | struct omap_onenand_platform_data { | 22 | struct omap_onenand_platform_data { |
| 25 | int cs; | 23 | int cs; |
| @@ -27,27 +25,9 @@ struct omap_onenand_platform_data { | |||
| 27 | struct mtd_partition *parts; | 25 | struct mtd_partition *parts; |
| 28 | int nr_parts; | 26 | int nr_parts; |
| 29 | int (*onenand_setup)(void __iomem *, int *freq_ptr); | 27 | int (*onenand_setup)(void __iomem *, int *freq_ptr); |
| 30 | int (*get_freq)(const struct onenand_freq_info *freq_info, | ||
| 31 | bool *clk_dep); | ||
| 32 | int dma_channel; | 28 | int dma_channel; |
| 33 | u8 flags; | 29 | u8 flags; |
| 34 | u8 regulator_can_sleep; | 30 | u8 regulator_can_sleep; |
| 35 | u8 skip_initial_unlocking; | 31 | u8 skip_initial_unlocking; |
| 36 | }; | 32 | }; |
| 37 | |||
| 38 | #define ONENAND_MAX_PARTITIONS 8 | ||
| 39 | |||
| 40 | #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ | ||
| 41 | defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) | ||
| 42 | |||
| 43 | extern void gpmc_onenand_init(struct omap_onenand_platform_data *d); | ||
| 44 | |||
| 45 | #else | ||
| 46 | |||
| 47 | #define board_onenand_data NULL | ||
| 48 | |||
| 49 | static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d) | ||
| 50 | { | ||
| 51 | } | ||
| 52 | |||
| 53 | #endif | 33 | #endif |
diff --git a/include/linux/platform_data/omap-wd-timer.h b/include/linux/platform_data/omap-wd-timer.h new file mode 100644 index 000000000000..d75f5f802d98 --- /dev/null +++ b/include/linux/platform_data/omap-wd-timer.h | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | /* | ||
| 2 | * OMAP2+ WDTIMER-specific function prototypes | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Texas Instruments, Inc. | ||
| 5 | * Paul Walmsley | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __LINUX_PLATFORM_DATA_OMAP_WD_TIMER_H | ||
| 14 | #define __LINUX_PLATFORM_DATA_OMAP_WD_TIMER_H | ||
| 15 | |||
| 16 | #include <linux/types.h> | ||
| 17 | |||
| 18 | /* | ||
| 19 | * Standardized OMAP reset source bits | ||
| 20 | * | ||
| 21 | * This is a subset of the ones listed in arch/arm/mach-omap2/prm.h | ||
| 22 | * and are the only ones needed in the watchdog driver. | ||
| 23 | */ | ||
| 24 | #define OMAP_MPU_WD_RST_SRC_ID_SHIFT 3 | ||
| 25 | |||
| 26 | /** | ||
| 27 | * struct omap_wd_timer_platform_data - WDTIMER integration to the host SoC | ||
| 28 | * @read_reset_sources - fn ptr for the SoC to indicate the last reset cause | ||
| 29 | * | ||
| 30 | * The function pointed to by @read_reset_sources must return its data | ||
| 31 | * in a standard format - search for RST_SRC_ID_SHIFT in | ||
| 32 | * arch/arm/mach-omap2 | ||
| 33 | */ | ||
| 34 | struct omap_wd_timer_platform_data { | ||
| 35 | u32 (*read_reset_sources)(void); | ||
| 36 | }; | ||
| 37 | |||
| 38 | #endif | ||
diff --git a/include/linux/platform_data/uio_pruss.h b/include/linux/platform_data/uio_pruss.h index f39140aabc6f..3d47d219827f 100644 --- a/include/linux/platform_data/uio_pruss.h +++ b/include/linux/platform_data/uio_pruss.h | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | /* To configure the PRUSS INTC base offset for UIO driver */ | 21 | /* To configure the PRUSS INTC base offset for UIO driver */ |
| 22 | struct uio_pruss_pdata { | 22 | struct uio_pruss_pdata { |
| 23 | u32 pintc_base; | 23 | u32 pintc_base; |
| 24 | struct gen_pool *sram_pool; | ||
| 24 | }; | 25 | }; |
| 25 | #endif /* _UIO_PRUSS_H_ */ | 26 | #endif /* _UIO_PRUSS_H_ */ |
diff --git a/include/linux/platform_data/usb-omap.h b/include/linux/platform_data/usb-omap.h new file mode 100644 index 000000000000..8570bcfe6311 --- /dev/null +++ b/include/linux/platform_data/usb-omap.h | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | /* | ||
| 2 | * usb-omap.h - Platform data for the various OMAP USB IPs | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com | ||
| 5 | * | ||
| 6 | * This software is distributed under the terms of the GNU General Public | ||
| 7 | * License ("GPL") version 2, as published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| 10 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 11 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 12 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
| 13 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| 14 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
| 15 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
| 16 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
| 17 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 18 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
| 19 | * POSSIBILITY OF SUCH DAMAGE. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #define OMAP3_HS_USB_PORTS 3 | ||
| 23 | |||
| 24 | enum usbhs_omap_port_mode { | ||
| 25 | OMAP_USBHS_PORT_MODE_UNUSED, | ||
| 26 | OMAP_EHCI_PORT_MODE_PHY, | ||
| 27 | OMAP_EHCI_PORT_MODE_TLL, | ||
| 28 | OMAP_EHCI_PORT_MODE_HSIC, | ||
| 29 | OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0, | ||
| 30 | OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM, | ||
| 31 | OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0, | ||
| 32 | OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM, | ||
| 33 | OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0, | ||
| 34 | OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM, | ||
| 35 | OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0, | ||
| 36 | OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM, | ||
| 37 | OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0, | ||
| 38 | OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM | ||
| 39 | }; | ||
| 40 | |||
| 41 | struct usbtll_omap_platform_data { | ||
| 42 | enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; | ||
| 43 | }; | ||
| 44 | |||
| 45 | struct ehci_hcd_omap_platform_data { | ||
| 46 | enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; | ||
| 47 | int reset_gpio_port[OMAP3_HS_USB_PORTS]; | ||
| 48 | struct regulator *regulator[OMAP3_HS_USB_PORTS]; | ||
| 49 | unsigned phy_reset:1; | ||
| 50 | }; | ||
| 51 | |||
| 52 | struct ohci_hcd_omap_platform_data { | ||
| 53 | enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; | ||
| 54 | unsigned es2_compatibility:1; | ||
| 55 | }; | ||
| 56 | |||
| 57 | struct usbhs_omap_platform_data { | ||
| 58 | enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; | ||
| 59 | |||
| 60 | struct ehci_hcd_omap_platform_data *ehci_data; | ||
| 61 | struct ohci_hcd_omap_platform_data *ohci_data; | ||
| 62 | }; | ||
| 63 | |||
| 64 | /*-------------------------------------------------------------------------*/ | ||
| 65 | |||
| 66 | struct omap_musb_board_data { | ||
| 67 | u8 interface_type; | ||
| 68 | u8 mode; | ||
| 69 | u16 power; | ||
| 70 | unsigned extvbus:1; | ||
| 71 | void (*set_phy_power)(u8 on); | ||
| 72 | void (*clear_irq)(void); | ||
| 73 | void (*set_mode)(u8 mode); | ||
| 74 | void (*reset)(void); | ||
| 75 | }; | ||
| 76 | |||
| 77 | enum musb_interface { | ||
| 78 | MUSB_INTERFACE_ULPI, | ||
| 79 | MUSB_INTERFACE_UTMI | ||
| 80 | }; | ||
diff --git a/include/linux/tty.h b/include/linux/tty.h index f0b4eb47297c..d7ff88fb8967 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -188,7 +188,9 @@ struct tty_port_operations { | |||
| 188 | }; | 188 | }; |
| 189 | 189 | ||
| 190 | struct tty_port { | 190 | struct tty_port { |
| 191 | struct tty_bufhead buf; /* Locked internally */ | ||
| 191 | struct tty_struct *tty; /* Back pointer */ | 192 | struct tty_struct *tty; /* Back pointer */ |
| 193 | struct tty_struct *itty; /* internal back ptr */ | ||
| 192 | const struct tty_port_operations *ops; /* Port operations */ | 194 | const struct tty_port_operations *ops; /* Port operations */ |
| 193 | spinlock_t lock; /* Lock protecting tty field */ | 195 | spinlock_t lock; /* Lock protecting tty field */ |
| 194 | int blocked_open; /* Waiting to open */ | 196 | int blocked_open; /* Waiting to open */ |
| @@ -197,6 +199,9 @@ struct tty_port { | |||
| 197 | wait_queue_head_t close_wait; /* Close waiters */ | 199 | wait_queue_head_t close_wait; /* Close waiters */ |
| 198 | wait_queue_head_t delta_msr_wait; /* Modem status change */ | 200 | wait_queue_head_t delta_msr_wait; /* Modem status change */ |
| 199 | unsigned long flags; /* TTY flags ASY_*/ | 201 | unsigned long flags; /* TTY flags ASY_*/ |
| 202 | unsigned long iflags; /* TTYP_ internal flags */ | ||
| 203 | #define TTYP_FLUSHING 1 /* Flushing to ldisc in progress */ | ||
| 204 | #define TTYP_FLUSHPENDING 2 /* Queued buffer flush pending */ | ||
| 200 | unsigned char console:1; /* port is a console */ | 205 | unsigned char console:1; /* port is a console */ |
| 201 | struct mutex mutex; /* Locking */ | 206 | struct mutex mutex; /* Locking */ |
| 202 | struct mutex buf_mutex; /* Buffer alloc lock */ | 207 | struct mutex buf_mutex; /* Buffer alloc lock */ |
| @@ -235,6 +240,7 @@ struct tty_struct { | |||
| 235 | struct mutex ldisc_mutex; | 240 | struct mutex ldisc_mutex; |
| 236 | struct tty_ldisc *ldisc; | 241 | struct tty_ldisc *ldisc; |
| 237 | 242 | ||
| 243 | struct mutex atomic_write_lock; | ||
| 238 | struct mutex legacy_mutex; | 244 | struct mutex legacy_mutex; |
| 239 | struct mutex termios_mutex; | 245 | struct mutex termios_mutex; |
| 240 | spinlock_t ctrl_lock; | 246 | spinlock_t ctrl_lock; |
| @@ -254,7 +260,6 @@ struct tty_struct { | |||
| 254 | 260 | ||
| 255 | struct tty_struct *link; | 261 | struct tty_struct *link; |
| 256 | struct fasync_struct *fasync; | 262 | struct fasync_struct *fasync; |
| 257 | struct tty_bufhead buf; /* Locked internally */ | ||
| 258 | int alt_speed; /* For magic substitution of 38400 bps */ | 263 | int alt_speed; /* For magic substitution of 38400 bps */ |
| 259 | wait_queue_head_t write_wait; | 264 | wait_queue_head_t write_wait; |
| 260 | wait_queue_head_t read_wait; | 265 | wait_queue_head_t read_wait; |
| @@ -265,37 +270,10 @@ struct tty_struct { | |||
| 265 | 270 | ||
| 266 | #define N_TTY_BUF_SIZE 4096 | 271 | #define N_TTY_BUF_SIZE 4096 |
| 267 | 272 | ||
| 268 | /* | ||
| 269 | * The following is data for the N_TTY line discipline. For | ||
| 270 | * historical reasons, this is included in the tty structure. | ||
| 271 | * Mostly locked by the BKL. | ||
| 272 | */ | ||
| 273 | unsigned int column; | ||
| 274 | unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1; | ||
| 275 | unsigned char closing:1; | 273 | unsigned char closing:1; |
| 276 | unsigned char echo_overrun:1; | ||
| 277 | unsigned short minimum_to_wake; | 274 | unsigned short minimum_to_wake; |
| 278 | unsigned long overrun_time; | ||
| 279 | int num_overrun; | ||
| 280 | unsigned long process_char_map[256/(8*sizeof(unsigned long))]; | ||
| 281 | char *read_buf; | ||
| 282 | int read_head; | ||
| 283 | int read_tail; | ||
| 284 | int read_cnt; | ||
| 285 | unsigned long read_flags[N_TTY_BUF_SIZE/(8*sizeof(unsigned long))]; | ||
| 286 | unsigned char *echo_buf; | ||
| 287 | unsigned int echo_pos; | ||
| 288 | unsigned int echo_cnt; | ||
| 289 | int canon_data; | ||
| 290 | unsigned long canon_head; | ||
| 291 | unsigned int canon_column; | ||
| 292 | struct mutex atomic_read_lock; | ||
| 293 | struct mutex atomic_write_lock; | ||
| 294 | struct mutex output_lock; | ||
| 295 | struct mutex echo_lock; | ||
| 296 | unsigned char *write_buf; | 275 | unsigned char *write_buf; |
| 297 | int write_cnt; | 276 | int write_cnt; |
| 298 | spinlock_t read_lock; | ||
| 299 | /* If the tty has a pending do_SAK, queue it here - akpm */ | 277 | /* If the tty has a pending do_SAK, queue it here - akpm */ |
| 300 | struct work_struct SAK_work; | 278 | struct work_struct SAK_work; |
| 301 | struct tty_port *port; | 279 | struct tty_port *port; |
| @@ -335,8 +313,6 @@ struct tty_file_private { | |||
| 335 | #define TTY_PTY_LOCK 16 /* pty private */ | 313 | #define TTY_PTY_LOCK 16 /* pty private */ |
| 336 | #define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ | 314 | #define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ |
| 337 | #define TTY_HUPPED 18 /* Post driver->hangup() */ | 315 | #define TTY_HUPPED 18 /* Post driver->hangup() */ |
| 338 | #define TTY_FLUSHING 19 /* Flushing to ldisc in progress */ | ||
| 339 | #define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */ | ||
| 340 | #define TTY_HUPPING 21 /* ->hangup() in progress */ | 316 | #define TTY_HUPPING 21 /* ->hangup() in progress */ |
| 341 | 317 | ||
| 342 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) | 318 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) |
| @@ -412,9 +388,9 @@ extern void disassociate_ctty(int priv); | |||
| 412 | extern void no_tty(void); | 388 | extern void no_tty(void); |
| 413 | extern void tty_flip_buffer_push(struct tty_struct *tty); | 389 | extern void tty_flip_buffer_push(struct tty_struct *tty); |
| 414 | extern void tty_flush_to_ldisc(struct tty_struct *tty); | 390 | extern void tty_flush_to_ldisc(struct tty_struct *tty); |
| 415 | extern void tty_buffer_free_all(struct tty_struct *tty); | 391 | extern void tty_buffer_free_all(struct tty_port *port); |
| 416 | extern void tty_buffer_flush(struct tty_struct *tty); | 392 | extern void tty_buffer_flush(struct tty_struct *tty); |
| 417 | extern void tty_buffer_init(struct tty_struct *tty); | 393 | extern void tty_buffer_init(struct tty_port *port); |
| 418 | extern speed_t tty_get_baud_rate(struct tty_struct *tty); | 394 | extern speed_t tty_get_baud_rate(struct tty_struct *tty); |
| 419 | extern speed_t tty_termios_baud_rate(struct ktermios *termios); | 395 | extern speed_t tty_termios_baud_rate(struct ktermios *termios); |
| 420 | extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); | 396 | extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); |
| @@ -535,7 +511,7 @@ extern void n_tty_inherit_ops(struct tty_ldisc_ops *ops); | |||
| 535 | /* tty_audit.c */ | 511 | /* tty_audit.c */ |
| 536 | #ifdef CONFIG_AUDIT | 512 | #ifdef CONFIG_AUDIT |
| 537 | extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, | 513 | extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, |
| 538 | size_t size); | 514 | size_t size, unsigned icanon); |
| 539 | extern void tty_audit_exit(void); | 515 | extern void tty_audit_exit(void); |
| 540 | extern void tty_audit_fork(struct signal_struct *sig); | 516 | extern void tty_audit_fork(struct signal_struct *sig); |
| 541 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); | 517 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); |
| @@ -544,7 +520,7 @@ extern int tty_audit_push_task(struct task_struct *tsk, | |||
| 544 | kuid_t loginuid, u32 sessionid); | 520 | kuid_t loginuid, u32 sessionid); |
| 545 | #else | 521 | #else |
| 546 | static inline void tty_audit_add_data(struct tty_struct *tty, | 522 | static inline void tty_audit_add_data(struct tty_struct *tty, |
| 547 | unsigned char *data, size_t size) | 523 | unsigned char *data, size_t size, unsigned icanon) |
| 548 | { | 524 | { |
| 549 | } | 525 | } |
| 550 | static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch) | 526 | static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch) |
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index 9239d033a0a3..2002344ed36a 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h | |||
| @@ -11,7 +11,7 @@ void tty_schedule_flip(struct tty_struct *tty); | |||
| 11 | static inline int tty_insert_flip_char(struct tty_struct *tty, | 11 | static inline int tty_insert_flip_char(struct tty_struct *tty, |
| 12 | unsigned char ch, char flag) | 12 | unsigned char ch, char flag) |
| 13 | { | 13 | { |
| 14 | struct tty_buffer *tb = tty->buf.tail; | 14 | struct tty_buffer *tb = tty->port->buf.tail; |
| 15 | if (tb && tb->used < tb->size) { | 15 | if (tb && tb->used < tb->size) { |
| 16 | tb->flag_buf_ptr[tb->used] = flag; | 16 | tb->flag_buf_ptr[tb->used] = flag; |
| 17 | tb->char_buf_ptr[tb->used++] = ch; | 17 | tb->char_buf_ptr[tb->used++] = ch; |
