aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-04-03 09:08:57 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-04-03 09:08:57 -0400
commit76467874b83835129dc454e3a7a8e5d1186101b0 (patch)
tree162129f0c36c35be4aa323cf00626db0e804c3fc /include
parent8628de0583504138551a05ad44ca388467f0f552 (diff)
parent6246b6128bbe34d0752f119cf7c5111c85fe481d (diff)
Merge branch 'master'
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/arch-at91rm9200/at91rm9200_mci.h104
-rw-r--r--include/asm-arm/arch-at91rm9200/board.h24
-rw-r--r--include/asm-arm/arch-at91rm9200/hardware.h3
-rw-r--r--include/asm-arm/arch-ep93xx/ts72xx.h11
-rw-r--r--include/asm-arm/arch-imx/dma.h17
-rw-r--r--include/asm-arm/arch-imx/imx-dma.h90
-rw-r--r--include/asm-arm/arch-imx/mmc.h12
-rw-r--r--include/asm-arm/arch-ixp23xx/memory.h17
-rw-r--r--include/asm-arm/arch-ixp23xx/platform.h1
-rw-r--r--include/asm-arm/arch-ixp23xx/uncompress.h11
-rw-r--r--include/asm-arm/arch-omap/aic23.h4
-rw-r--r--include/asm-arm/arch-omap/board-ams-delta.h65
-rw-r--r--include/asm-arm/arch-omap/board-apollon.h45
-rw-r--r--include/asm-arm/arch-omap/board-h2.h4
-rw-r--r--include/asm-arm/arch-omap/board-h3.h4
-rw-r--r--include/asm-arm/arch-omap/board-h4.h8
-rw-r--r--include/asm-arm/arch-omap/board-netstar.h19
-rw-r--r--include/asm-arm/arch-omap/board-nokia.h54
-rw-r--r--include/asm-arm/arch-omap/board-perseus2.h4
-rw-r--r--include/asm-arm/arch-omap/board.h30
-rw-r--r--include/asm-arm/arch-omap/clock.h13
-rw-r--r--include/asm-arm/arch-omap/dma.h1
-rw-r--r--include/asm-arm/arch-omap/dmtimer.h1
-rw-r--r--include/asm-arm/arch-omap/dsp.h6
-rw-r--r--include/asm-arm/arch-omap/dsp_common.h13
-rw-r--r--include/asm-arm/arch-omap/gpioexpander.h24
-rw-r--r--include/asm-arm/arch-omap/hardware.h8
-rw-r--r--include/asm-arm/arch-omap/irda.h36
-rw-r--r--include/asm-arm/arch-omap/irqs.h5
-rw-r--r--include/asm-arm/arch-omap/keypad.h36
-rw-r--r--include/asm-arm/arch-omap/lcd_lph8923.h14
-rw-r--r--include/asm-arm/arch-omap/mcbsp.h65
-rw-r--r--include/asm-arm/arch-omap/mcspi.h16
-rw-r--r--include/asm-arm/arch-omap/menelaus.h2
-rw-r--r--include/asm-arm/arch-omap/mux.h54
-rw-r--r--include/asm-arm/arch-omap/omap-alsa.h124
-rw-r--r--include/asm-arm/arch-omap/omapfb.h98
-rw-r--r--include/asm-arm/arch-omap/param.h8
-rw-r--r--include/asm-arm/arch-omap/pm.h81
-rw-r--r--include/asm-arm/arch-omap/prcm.h404
-rw-r--r--include/asm-arm/arch-omap/sram.h2
-rw-r--r--include/asm-arm/arch-omap/system.h17
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h2
-rw-r--r--include/asm-arm/arch-pxa/sharpsl.h2
-rw-r--r--include/asm-arm/arch-s3c2410/entry-macro.S167
-rw-r--r--include/asm-arm/dma-mapping.h22
-rw-r--r--include/asm-arm/memory.h8
-rw-r--r--include/asm-arm/pgtable-hwdef.h1
-rw-r--r--include/asm-arm/pgtable.h1
-rw-r--r--include/asm-arm/unistd.h11
-rw-r--r--include/asm-generic/local.h13
-rw-r--r--include/asm-generic/mutex-dec.h30
-rw-r--r--include/asm-generic/mutex-xchg.h33
-rw-r--r--include/asm-i386/apicdef.h1
-rw-r--r--include/asm-i386/floppy.h34
-rw-r--r--include/asm-i386/local.h6
-rw-r--r--include/asm-i386/unistd.h3
-rw-r--r--include/asm-ia64/pal.h34
-rw-r--r--include/asm-powerpc/eeh.h20
-rw-r--r--include/asm-powerpc/hvcall.h185
-rw-r--r--include/asm-powerpc/system.h5
-rw-r--r--include/asm-s390/percpu.h2
-rw-r--r--include/asm-sparc/unistd.h6
-rw-r--r--include/asm-sparc64/unistd.h4
-rw-r--r--include/asm-um/desc.h12
-rw-r--r--include/asm-um/host_ldt-i386.h34
-rw-r--r--include/asm-um/host_ldt-x86_64.h (renamed from include/asm-um/ldt-x86_64.h)39
-rw-r--r--include/asm-um/ldt-i386.h69
-rw-r--r--include/asm-um/ldt.h41
-rw-r--r--include/asm-um/processor-i386.h35
-rw-r--r--include/asm-um/processor-x86_64.h9
-rw-r--r--include/asm-um/ptrace-generic.h16
-rw-r--r--include/asm-um/ptrace-i386.h41
-rw-r--r--include/asm-um/ptrace-x86_64.h35
-rw-r--r--include/asm-um/segment.h6
-rw-r--r--include/asm-um/thread_info.h16
-rw-r--r--include/asm-um/uaccess.h2
-rw-r--r--include/asm-x86_64/local.h10
-rw-r--r--include/linux/backlight.h25
-rw-r--r--include/linux/dcache.h1
-rw-r--r--include/linux/fadvise.h6
-rw-r--r--include/linux/fb.h2
-rw-r--r--include/linux/fs.h24
-rw-r--r--include/linux/gameport.h7
-rw-r--r--include/linux/hrtimer.h18
-rw-r--r--include/linux/input.h23
-rw-r--r--include/linux/ipmi_smi.h16
-rw-r--r--include/linux/kbd_kern.h2
-rw-r--r--include/linux/keyboard.h13
-rw-r--r--include/linux/leds.h111
-rw-r--r--include/linux/libps2.h2
-rw-r--r--include/linux/migrate.h5
-rw-r--r--include/linux/mtd/blktrans.h4
-rw-r--r--include/linux/mtd/doc2000.h4
-rw-r--r--include/linux/mtd/inftl.h5
-rw-r--r--include/linux/namei.h1
-rw-r--r--include/linux/netdevice.h55
-rw-r--r--include/linux/netfilter/x_tables.h67
-rw-r--r--include/linux/netfilter/xt_esp.h14
-rw-r--r--include/linux/netfilter/xt_multiport.h30
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h18
-rw-r--r--include/linux/netfilter_ipv4/ipt_esp.h14
-rw-r--r--include/linux/netfilter_ipv4/ipt_multiport.h31
-rw-r--r--include/linux/netfilter_ipv6/ip6t_esp.h12
-rw-r--r--include/linux/netfilter_ipv6/ip6t_multiport.h25
-rw-r--r--include/linux/pagemap.h4
-rw-r--r--include/linux/pid.h96
-rw-r--r--include/linux/pipe_fs_i.h9
-rw-r--r--include/linux/sched.h18
-rw-r--r--include/linux/serio.h9
-rw-r--r--include/linux/skbuff.h29
-rw-r--r--include/linux/syscalls.h2
-rw-r--r--include/linux/timer.h8
-rw-r--r--include/linux/tiocl.h1
-rw-r--r--include/linux/uinput.h4
-rw-r--r--include/linux/videodev2.h65
-rw-r--r--include/media/cx25840.h64
-rw-r--r--include/media/msp3400.h60
-rw-r--r--include/media/saa7115.h37
-rw-r--r--include/media/saa7127.h41
-rw-r--r--include/media/upd64031a.h40
-rw-r--r--include/media/upd64083.h58
-rw-r--r--include/net/tcp.h3
-rw-r--r--include/net/xfrm.h19
-rw-r--r--include/pcmcia/bulkmem.h4
-rw-r--r--include/pcmcia/ciscode.h5
-rw-r--r--include/pcmcia/cistpl.h21
-rw-r--r--include/pcmcia/cs.h34
-rw-r--r--include/pcmcia/ds.h80
-rw-r--r--include/pcmcia/ss.h11
-rw-r--r--include/sound/core.h4
-rw-r--r--include/sound/pcm.h15
-rw-r--r--include/sound/pcm_oss.h3
133 files changed, 2453 insertions, 1336 deletions
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_mci.h b/include/asm-arm/arch-at91rm9200/at91rm9200_mci.h
new file mode 100644
index 000000000000..f28636d61e39
--- /dev/null
+++ b/include/asm-arm/arch-at91rm9200/at91rm9200_mci.h
@@ -0,0 +1,104 @@
1/*
2 * include/asm-arm/arch-at91rm9200/at91rm9200_mci.h
3 *
4 * Copyright (C) 2005 Ivan Kokshaysky
5 * Copyright (C) SAN People
6 *
7 * MultiMedia Card Interface (MCI) registers.
8 * Based on AT91RM9200 datasheet revision E.
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 AT91RM9200_MCI_H
17#define AT91RM9200_MCI_H
18
19#define AT91_MCI_CR 0x00 /* Control Register */
20#define AT91_MCI_MCIEN (1 << 0) /* Multi-Media Interface Enable */
21#define AT91_MCI_MCIDIS (1 << 1) /* Multi-Media Interface Disable */
22#define AT91_MCI_PWSEN (1 << 2) /* Power Save Mode Enable */
23#define AT91_MCI_PWSDIS (1 << 3) /* Power Save Mode Disable */
24#define AT91_MCI_SWRST (1 << 7) /* Software Reset */
25
26#define AT91_MCI_MR 0x04 /* Mode Register */
27#define AT91_MCI_CLKDIV (0xff << 0) /* Clock Divider */
28#define AT91_MCI_PWSDIV (3 << 8) /* Power Saving Divider */
29#define AT91_MCI_PDCPADV (1 << 14) /* PDC Padding Value */
30#define AT91_MCI_PDCMODE (1 << 15) /* PDC-orientated Mode */
31#define AT91_MCI_BLKLEN (0xfff << 18) /* Data Block Length */
32
33#define AT91_MCI_DTOR 0x08 /* Data Timeout Register */
34#define AT91_MCI_DTOCYC (0xf << 0) /* Data Timeout Cycle Number */
35#define AT91_MCI_DTOMUL (7 << 4) /* Data Timeout Multiplier */
36#define AT91_MCI_DTOMUL_1 (0 << 4)
37#define AT91_MCI_DTOMUL_16 (1 << 4)
38#define AT91_MCI_DTOMUL_128 (2 << 4)
39#define AT91_MCI_DTOMUL_256 (3 << 4)
40#define AT91_MCI_DTOMUL_1K (4 << 4)
41#define AT91_MCI_DTOMUL_4K (5 << 4)
42#define AT91_MCI_DTOMUL_64K (6 << 4)
43#define AT91_MCI_DTOMUL_1M (7 << 4)
44
45#define AT91_MCI_SDCR 0x0c /* SD Card Register */
46#define AT91_MCI_SDCSEL (0xf << 0) /* SD Card Selector */
47#define AT91_MCI_SDCBUS (1 << 7) /* 1-bit or 4-bit bus */
48
49#define AT91_MCI_ARGR 0x10 /* Argument Register */
50
51#define AT91_MCI_CMDR 0x14 /* Command Register */
52#define AT91_MCI_CMDNB (0x3f << 0) /* Command Number */
53#define AT91_MCI_RSPTYP (3 << 6) /* Response Type */
54#define AT91_MCI_RSPTYP_NONE (0 << 6)
55#define AT91_MCI_RSPTYP_48 (1 << 6)
56#define AT91_MCI_RSPTYP_136 (2 << 6)
57#define AT91_MCI_SPCMD (7 << 8) /* Special Command */
58#define AT91_MCI_SPCMD_NONE (0 << 8)
59#define AT91_MCI_SPCMD_INIT (1 << 8)
60#define AT91_MCI_SPCMD_SYNC (2 << 8)
61#define AT91_MCI_SPCMD_ICMD (4 << 8)
62#define AT91_MCI_SPCMD_IRESP (5 << 8)
63#define AT91_MCI_OPDCMD (1 << 11) /* Open Drain Command */
64#define AT91_MCI_MAXLAT (1 << 12) /* Max Latency for Command to Response */
65#define AT91_MCI_TRCMD (3 << 16) /* Transfer Command */
66#define AT91_MCI_TRCMD_NONE (0 << 16)
67#define AT91_MCI_TRCMD_START (1 << 16)
68#define AT91_MCI_TRCMD_STOP (2 << 16)
69#define AT91_MCI_TRDIR (1 << 18) /* Transfer Direction */
70#define AT91_MCI_TRTYP (3 << 19) /* Transfer Type */
71#define AT91_MCI_TRTYP_BLOCK (0 << 19)
72#define AT91_MCI_TRTYP_MULTIPLE (1 << 19)
73#define AT91_MCI_TRTYP_STREAM (2 << 19)
74
75#define AT91_MCI_RSPR(n) (0x20 + ((n) * 4)) /* Response Registers 0-3 */
76#define AT91_MCR_RDR 0x30 /* Receive Data Register */
77#define AT91_MCR_TDR 0x34 /* Transmit Data Register */
78
79#define AT91_MCI_SR 0x40 /* Status Register */
80#define AT91_MCI_CMDRDY (1 << 0) /* Command Ready */
81#define AT91_MCI_RXRDY (1 << 1) /* Receiver Ready */
82#define AT91_MCI_TXRDY (1 << 2) /* Transmit Ready */
83#define AT91_MCI_BLKE (1 << 3) /* Data Block Ended */
84#define AT91_MCI_DTIP (1 << 4) /* Data Transfer in Progress */
85#define AT91_MCI_NOTBUSY (1 << 5) /* Data Not Busy */
86#define AT91_MCI_ENDRX (1 << 6) /* End of RX Buffer */
87#define AT91_MCI_ENDTX (1 << 7) /* End fo TX Buffer */
88#define AT91_MCI_RXBUFF (1 << 14) /* RX Buffer Full */
89#define AT91_MCI_TXBUFE (1 << 15) /* TX Buffer Empty */
90#define AT91_MCI_RINDE (1 << 16) /* Response Index Error */
91#define AT91_MCI_RDIRE (1 << 17) /* Response Direction Error */
92#define AT91_MCI_RCRCE (1 << 18) /* Response CRC Error */
93#define AT91_MCI_RENDE (1 << 19) /* Response End Bit Error */
94#define AT91_MCI_RTOE (1 << 20) /* Reponse Time-out Error */
95#define AT91_MCI_DCRCE (1 << 21) /* Data CRC Error */
96#define AT91_MCI_DTOE (1 << 22) /* Data Time-out Error */
97#define AT91_MCI_OVRE (1 << 30) /* Overrun */
98#define AT91_MCI_UNRE (1 << 31) /* Underrun */
99
100#define AT91_MCI_IER 0x44 /* Interrupt Enable Register */
101#define AT91_MCI_IDR 0x48 /* Interrupt Disable Register */
102#define AT91_MCI_IMR 0x4c /* Interrupt Mask Register */
103
104#endif
diff --git a/include/asm-arm/arch-at91rm9200/board.h b/include/asm-arm/arch-at91rm9200/board.h
index 2e7d1139a799..4fdef13d01d4 100644
--- a/include/asm-arm/arch-at91rm9200/board.h
+++ b/include/asm-arm/arch-at91rm9200/board.h
@@ -38,6 +38,8 @@ extern unsigned long at91_master_clock;
38extern int at91_serial_map[AT91_NR_UART]; 38extern int at91_serial_map[AT91_NR_UART];
39extern int at91_console_port; 39extern int at91_console_port;
40 40
41#include <linux/mtd/partitions.h>
42
41 /* USB Device */ 43 /* USB Device */
42struct at91_udc_data { 44struct at91_udc_data {
43 u8 vbus_pin; /* high == host powering us */ 45 u8 vbus_pin; /* high == host powering us */
@@ -77,4 +79,26 @@ struct at91_usbh_data {
77}; 79};
78extern void __init at91_add_device_usbh(struct at91_usbh_data *data); 80extern void __init at91_add_device_usbh(struct at91_usbh_data *data);
79 81
82 /* NAND / SmartMedia */
83struct at91_nand_data {
84 u8 enable_pin; /* chip enable */
85 u8 det_pin; /* card detect */
86 u8 rdy_pin; /* ready/busy */
87 u8 ale; /* address line number connected to ALE */
88 u8 cle; /* address line number connected to CLE */
89 struct mtd_partition* (*partition_info)(int, int*);
90};
91extern void __init at91_add_device_nand(struct at91_nand_data *data);
92
93 /* I2C*/
94void __init at91_add_device_i2c(void);
95
96 /* RTC */
97void __init at91_add_device_rtc(void);
98
99 /* LEDs */
100extern u8 at91_leds_cpu;
101extern u8 at91_leds_timer;
102extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
103
80#endif 104#endif
diff --git a/include/asm-arm/arch-at91rm9200/hardware.h b/include/asm-arm/arch-at91rm9200/hardware.h
index 2646c01f8e97..59e6f44d3a0d 100644
--- a/include/asm-arm/arch-at91rm9200/hardware.h
+++ b/include/asm-arm/arch-at91rm9200/hardware.h
@@ -65,6 +65,9 @@
65/* SmartMedia */ 65/* SmartMedia */
66#define AT91_SMARTMEDIA_BASE 0x40000000 /* NCS3: Smartmedia physical base address */ 66#define AT91_SMARTMEDIA_BASE 0x40000000 /* NCS3: Smartmedia physical base address */
67 67
68/* Compact Flash */
69#define AT91_CF_BASE 0x50000000 /* NCS4-NCS6: Compact Flash physical base address */
70
68/* Multi-Master Memory controller */ 71/* Multi-Master Memory controller */
69#define AT91_UHP_BASE 0x00300000 /* USB Host controller */ 72#define AT91_UHP_BASE 0x00300000 /* USB Host controller */
70 73
diff --git a/include/asm-arm/arch-ep93xx/ts72xx.h b/include/asm-arm/arch-ep93xx/ts72xx.h
index 412215e77f44..a94f63ff0535 100644
--- a/include/asm-arm/arch-ep93xx/ts72xx.h
+++ b/include/asm-arm/arch-ep93xx/ts72xx.h
@@ -12,6 +12,8 @@
12 * febfc000 [67]0000000 4K NAND data register 12 * febfc000 [67]0000000 4K NAND data register
13 * febfb000 [67]0400000 4K NAND control register 13 * febfb000 [67]0400000 4K NAND control register
14 * febfa000 [67]0800000 4K NAND busy register 14 * febfa000 [67]0800000 4K NAND busy register
15 * febf9000 10800000 4K TS-5620 RTC index register
16 * febf8000 11700000 4K TS-5620 RTC data register
15 */ 17 */
16 18
17#define TS72XX_MODEL_PHYS_BASE 0x22000000 19#define TS72XX_MODEL_PHYS_BASE 0x22000000
@@ -58,6 +60,15 @@
58#define TS72XX_NAND_BUSY_SIZE 0x00001000 60#define TS72XX_NAND_BUSY_SIZE 0x00001000
59 61
60 62
63#define TS72XX_RTC_INDEX_VIRT_BASE 0xfebf9000
64#define TS72XX_RTC_INDEX_PHYS_BASE 0x10800000
65#define TS72XX_RTC_INDEX_SIZE 0x00001000
66
67#define TS72XX_RTC_DATA_VIRT_BASE 0xfebf8000
68#define TS72XX_RTC_DATA_PHYS_BASE 0x11700000
69#define TS72XX_RTC_DATA_SIZE 0x00001000
70
71
61#ifndef __ASSEMBLY__ 72#ifndef __ASSEMBLY__
62#include <asm/io.h> 73#include <asm/io.h>
63 74
diff --git a/include/asm-arm/arch-imx/dma.h b/include/asm-arm/arch-imx/dma.h
index b45fa367d71e..621ff2c730f2 100644
--- a/include/asm-arm/arch-imx/dma.h
+++ b/include/asm-arm/arch-imx/dma.h
@@ -17,27 +17,16 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20
20#ifndef __ASM_ARCH_DMA_H 21#ifndef __ASM_ARCH_DMA_H
21#define __ASM_ARCH_DMA_H 22#define __ASM_ARCH_DMA_H
22 23
23/*
24 * DMA registration
25 */
26
27typedef enum { 24typedef enum {
28 DMA_PRIO_HIGH = 0, 25 DMA_PRIO_HIGH = 0,
29 DMA_PRIO_MEDIUM = 3, 26 DMA_PRIO_MEDIUM = 1,
30 DMA_PRIO_LOW = 6 27 DMA_PRIO_LOW = 2
31} imx_dma_prio; 28} imx_dma_prio;
32 29
33int imx_request_dma(char *name, imx_dma_prio prio,
34 void (*irq_handler) (int, void *, struct pt_regs *),
35 void (*err_handler) (int, void *, struct pt_regs *),
36 void *data);
37
38void imx_free_dma(int dma_ch);
39
40
41#define DMA_REQ_UART3_T 2 30#define DMA_REQ_UART3_T 2
42#define DMA_REQ_UART3_R 3 31#define DMA_REQ_UART3_R 3
43#define DMA_REQ_SSI2_T 4 32#define DMA_REQ_SSI2_T 4
diff --git a/include/asm-arm/arch-imx/imx-dma.h b/include/asm-arm/arch-imx/imx-dma.h
new file mode 100644
index 000000000000..f2063c1d610d
--- /dev/null
+++ b/include/asm-arm/arch-imx/imx-dma.h
@@ -0,0 +1,90 @@
1/*
2 * linux/include/asm-arm/imxads/dma.h
3 *
4 * Copyright (C) 1997,1998 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
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 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <asm/dma.h>
22
23#ifndef __ASM_ARCH_IMX_DMA_H
24#define __ASM_ARCH_IMX_DMA_H
25
26#define IMX_DMA_CHANNELS 11
27
28/*
29 * struct imx_dma_channel - i.MX specific DMA extension
30 * @name: name specified by DMA client
31 * @irq_handler: client callback for end of transfer
32 * @err_handler: client callback for error condition
33 * @data: clients context data for callbacks
34 * @dma_mode: direction of the transfer %DMA_MODE_READ or %DMA_MODE_WRITE
35 * @sg: pointer to the actual read/written chunk for scatter-gather emulation
36 * @sgbc: counter of processed bytes in the actual read/written chunk
37 * @resbytes: total residual number of bytes to transfer
38 * (it can be lower or same as sum of SG mapped chunk sizes)
39 * @sgcount: number of chunks to be read/written
40 *
41 * Structure is used for IMX DMA processing. It would be probably good
42 * @struct dma_struct in the future for external interfacing and use
43 * @struct imx_dma_channel only as extension to it.
44 */
45
46struct imx_dma_channel {
47 const char *name;
48 void (*irq_handler) (int, void *, struct pt_regs *);
49 void (*err_handler) (int, void *, struct pt_regs *);
50 void *data;
51 dmamode_t dma_mode;
52 struct scatterlist *sg;
53 unsigned int sgbc;
54 unsigned int sgcount;
55 unsigned int resbytes;
56 int dma_num;
57};
58
59extern struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS];
60
61
62/* The type to distinguish channel numbers parameter from ordinal int type */
63typedef int imx_dmach_t;
64
65int
66imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address,
67 unsigned int dma_length, unsigned int dev_addr, dmamode_t dmamode);
68
69int
70imx_dma_setup_sg(imx_dmach_t dma_ch,
71 struct scatterlist *sg, unsigned int sgcount, unsigned int dma_length,
72 unsigned int dev_addr, dmamode_t dmamode);
73
74int
75imx_dma_setup_handlers(imx_dmach_t dma_ch,
76 void (*irq_handler) (int, void *, struct pt_regs *),
77 void (*err_handler) (int, void *, struct pt_regs *), void *data);
78
79void imx_dma_enable(imx_dmach_t dma_ch);
80
81void imx_dma_disable(imx_dmach_t dma_ch);
82
83int imx_dma_request(imx_dmach_t dma_ch, const char *name);
84
85void imx_dma_free(imx_dmach_t dma_ch);
86
87int imx_dma_request_by_prio(imx_dmach_t *pdma_ch, const char *name, imx_dma_prio prio);
88
89
90#endif /* _ASM_ARCH_IMX_DMA_H */
diff --git a/include/asm-arm/arch-imx/mmc.h b/include/asm-arm/arch-imx/mmc.h
new file mode 100644
index 000000000000..1937151665c7
--- /dev/null
+++ b/include/asm-arm/arch-imx/mmc.h
@@ -0,0 +1,12 @@
1#ifndef ASMARM_ARCH_MMC_H
2#define ASMARM_ARCH_MMC_H
3
4#include <linux/mmc/protocol.h>
5
6struct imxmmc_platform_data {
7 int (*card_present)(void);
8};
9
10extern void imx_set_mmc_info(struct imxmmc_platform_data *info);
11
12#endif
diff --git a/include/asm-arm/arch-ixp23xx/memory.h b/include/asm-arm/arch-ixp23xx/memory.h
index bebcf0aa0d72..6e19f46d54d1 100644
--- a/include/asm-arm/arch-ixp23xx/memory.h
+++ b/include/asm-arm/arch-ixp23xx/memory.h
@@ -28,6 +28,7 @@
28 * to an address that the kernel can use. 28 * to an address that the kernel can use.
29 */ 29 */
30#ifndef __ASSEMBLY__ 30#ifndef __ASSEMBLY__
31#include <asm/mach-types.h>
31 32
32#define __virt_to_bus(v) \ 33#define __virt_to_bus(v) \
33 ({ unsigned int ret; \ 34 ({ unsigned int ret; \
@@ -40,6 +41,22 @@
40 data = *((volatile int *)IXP23XX_PCI_SDRAM_BAR); \ 41 data = *((volatile int *)IXP23XX_PCI_SDRAM_BAR); \
41 __phys_to_virt((((b - (data & 0xfffffff0)) + 0x00000000))); }) 42 __phys_to_virt((((b - (data & 0xfffffff0)) + 0x00000000))); })
42 43
44/*
45 * Coherency support. Only supported on A2 CPUs or on A1
46 * systems that have the cache coherency workaround.
47 */
48static inline int __ixp23xx_arch_is_coherent(void)
49{
50 extern unsigned int processor_id;
51
52 if (((processor_id & 15) >= 2) || machine_is_roadrunner())
53 return 1;
54
55 return 0;
56}
57
58#define arch_is_coherent() __ixp23xx_arch_is_coherent()
59
43#endif 60#endif
44 61
45 62
diff --git a/include/asm-arm/arch-ixp23xx/platform.h b/include/asm-arm/arch-ixp23xx/platform.h
index f85b4685a491..e4d99060a049 100644
--- a/include/asm-arm/arch-ixp23xx/platform.h
+++ b/include/asm-arm/arch-ixp23xx/platform.h
@@ -22,6 +22,7 @@ void ixp23xx_sys_init(void);
22int ixp23xx_pci_setup(int, struct pci_sys_data *); 22int ixp23xx_pci_setup(int, struct pci_sys_data *);
23void ixp23xx_pci_preinit(void); 23void ixp23xx_pci_preinit(void);
24struct pci_bus *ixp23xx_pci_scan_bus(int, struct pci_sys_data*); 24struct pci_bus *ixp23xx_pci_scan_bus(int, struct pci_sys_data*);
25void ixp23xx_pci_slave_init(void);
25 26
26extern struct sys_timer ixp23xx_timer; 27extern struct sys_timer ixp23xx_timer;
27 28
diff --git a/include/asm-arm/arch-ixp23xx/uncompress.h b/include/asm-arm/arch-ixp23xx/uncompress.h
index 62623fa9b2f7..013575e6a9a1 100644
--- a/include/asm-arm/arch-ixp23xx/uncompress.h
+++ b/include/asm-arm/arch-ixp23xx/uncompress.h
@@ -16,26 +16,21 @@
16 16
17#define UART_BASE ((volatile u32 *)IXP23XX_UART1_PHYS) 17#define UART_BASE ((volatile u32 *)IXP23XX_UART1_PHYS)
18 18
19static __inline__ void putc(char c) 19static inline void putc(char c)
20{ 20{
21 int j; 21 int j;
22 22
23 for (j = 0; j < 0x1000; j++) { 23 for (j = 0; j < 0x1000; j++) {
24 if (UART_BASE[UART_LSR] & UART_LSR_THRE) 24 if (UART_BASE[UART_LSR] & UART_LSR_THRE)
25 break; 25 break;
26 barrier();
26 } 27 }
27 28
28 UART_BASE[UART_TX] = c; 29 UART_BASE[UART_TX] = c;
29} 30}
30 31
31static void putstr(const char *s) 32static inline void flush(void)
32{ 33{
33 while (*s) {
34 putc(*s);
35 if (*s == '\n')
36 putc('\r');
37 s++;
38 }
39} 34}
40 35
41#define arch_decomp_setup() 36#define arch_decomp_setup()
diff --git a/include/asm-arm/arch-omap/aic23.h b/include/asm-arm/arch-omap/aic23.h
index 590bac25b7c4..6513065941d0 100644
--- a/include/asm-arm/arch-omap/aic23.h
+++ b/include/asm-arm/arch-omap/aic23.h
@@ -57,6 +57,7 @@
57#define LHV_MIN 0x0000 57#define LHV_MIN 0x0000
58 58
59// Analog audio path control register 59// Analog audio path control register
60#define STA_REG(x) ((x)<<6)
60#define STE_ENABLED 0x0020 61#define STE_ENABLED 0x0020
61#define DAC_SELECTED 0x0010 62#define DAC_SELECTED 0x0010
62#define BYPASS_ON 0x0008 63#define BYPASS_ON 0x0008
@@ -109,4 +110,7 @@
109#define TLV320AIC23ID1 (0x1a) // cs low 110#define TLV320AIC23ID1 (0x1a) // cs low
110#define TLV320AIC23ID2 (0x1b) // cs high 111#define TLV320AIC23ID2 (0x1b) // cs high
111 112
113void tlv320aic23_power_up(void);
114void tlv320aic23_power_down(void);
115
112#endif /* __ASM_ARCH_AIC23_H */ 116#endif /* __ASM_ARCH_AIC23_H */
diff --git a/include/asm-arm/arch-omap/board-ams-delta.h b/include/asm-arm/arch-omap/board-ams-delta.h
new file mode 100644
index 000000000000..0070f6d3b75c
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-ams-delta.h
@@ -0,0 +1,65 @@
1/*
2 * linux/include/asm-arm/arch-omap/board-ams-delta.h
3 *
4 * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li>
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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
12 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
15 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
18 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
20 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26#ifndef __ASM_ARCH_OMAP_AMS_DELTA_H
27#define __ASM_ARCH_OMAP_AMS_DELTA_H
28
29#if defined (CONFIG_MACH_AMS_DELTA)
30
31#define AMS_DELTA_LATCH1_PHYS 0x01000000
32#define AMS_DELTA_LATCH1_VIRT 0xEA000000
33#define AMS_DELTA_MODEM_PHYS 0x04000000
34#define AMS_DELTA_MODEM_VIRT 0xEB000000
35#define AMS_DELTA_LATCH2_PHYS 0x08000000
36#define AMS_DELTA_LATCH2_VIRT 0xEC000000
37
38#define AMS_DELTA_LATCH1_LED_CAMERA 0x01
39#define AMS_DELTA_LATCH1_LED_ADVERT 0x02
40#define AMS_DELTA_LATCH1_LED_EMAIL 0x04
41#define AMS_DELTA_LATCH1_LED_HANDSFREE 0x08
42#define AMS_DELTA_LATCH1_LED_VOICEMAIL 0x10
43#define AMS_DELTA_LATCH1_LED_VOICE 0x20
44
45#define AMS_DELTA_LATCH2_LCD_VBLEN 0x0001
46#define AMS_DELTA_LATCH2_LCD_NDISP 0x0002
47#define AMS_DELTA_LATCH2_NAND_NCE 0x0004
48#define AMS_DELTA_LATCH2_NAND_NRE 0x0008
49#define AMS_DELTA_LATCH2_NAND_NWP 0x0010
50#define AMS_DELTA_LATCH2_NAND_NWE 0x0020
51#define AMS_DELTA_LATCH2_NAND_ALE 0x0040
52#define AMS_DELTA_LATCH2_NAND_CLE 0x0080
53#define AMS_DELTA_LATCH2_MODEM_NRESET 0x1000
54#define AMS_DELTA_LATCH2_MODEM_CODEC 0x2000
55
56#define AMS_DELTA_GPIO_PIN_NAND_RB 12
57
58#ifndef __ASSEMBLY__
59void ams_delta_latch1_write(u8 mask, u8 value);
60void ams_delta_latch2_write(u16 mask, u16 value);
61#endif
62
63#endif /* CONFIG_MACH_AMS_DELTA */
64
65#endif /* __ASM_ARCH_OMAP_AMS_DELTA_H */
diff --git a/include/asm-arm/arch-omap/board-apollon.h b/include/asm-arm/arch-omap/board-apollon.h
new file mode 100644
index 000000000000..de0c5b792c58
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-apollon.h
@@ -0,0 +1,45 @@
1/*
2 * linux/include/asm-arm/arch-omap/board-apollon.h
3 *
4 * Hardware definitions for Samsung OMAP24XX Apollon board.
5 *
6 * Initial creation by Kyungmin Park <kyungmin.park@samsung.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#ifndef __ASM_ARCH_OMAP_APOLLON_H
30#define __ASM_ARCH_OMAP_APOLLON_H
31
32/* Placeholder for APOLLON specific defines */
33/* GPMC CS0 */
34#define APOLLON_CS0_BASE 0x00000000
35/* GPMC CS1 */
36#define APOLLON_CS1_BASE 0x08000000
37#define APOLLON_ETHR_START (APOLLON_CS1_BASE + 0x300)
38#define APOLLON_ETHR_GPIO_IRQ 74
39/* GPMC CS2 - reserved for OneNAND */
40#define APOLLON_CS2_BASE 0x10000000
41/* GPMC CS3 - reserved for NOR or NAND */
42#define APOLLON_CS3_BASE 0x18000000
43
44#endif /* __ASM_ARCH_OMAP_APOLLON_H */
45
diff --git a/include/asm-arm/arch-omap/board-h2.h b/include/asm-arm/arch-omap/board-h2.h
index 39ca5a31aeea..b2888ef9e9b4 100644
--- a/include/asm-arm/arch-omap/board-h2.h
+++ b/include/asm-arm/arch-omap/board-h2.h
@@ -34,9 +34,5 @@
34/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 34/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
35#define OMAP1610_ETHR_START 0x04000300 35#define OMAP1610_ETHR_START 0x04000300
36 36
37/* Samsung NAND flash at CS2B or CS3(NAND Boot) */
38#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */
39#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */
40
41#endif /* __ASM_ARCH_OMAP_H2_H */ 37#endif /* __ASM_ARCH_OMAP_H2_H */
42 38
diff --git a/include/asm-arm/arch-omap/board-h3.h b/include/asm-arm/arch-omap/board-h3.h
index 1b12c1dcc2fa..761ea0a17897 100644
--- a/include/asm-arm/arch-omap/board-h3.h
+++ b/include/asm-arm/arch-omap/board-h3.h
@@ -30,10 +30,6 @@
30/* In OMAP1710 H3 the Ethernet is directly connected to CS1 */ 30/* In OMAP1710 H3 the Ethernet is directly connected to CS1 */
31#define OMAP1710_ETHR_START 0x04000300 31#define OMAP1710_ETHR_START 0x04000300
32 32
33/* Samsung NAND flash at CS2B or CS3(NAND Boot) */
34#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */
35#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */
36
37#define MAXIRQNUM (IH_BOARD_BASE) 33#define MAXIRQNUM (IH_BOARD_BASE)
38#define MAXFIQNUM MAXIRQNUM 34#define MAXFIQNUM MAXIRQNUM
39#define MAXSWINUM MAXIRQNUM 35#define MAXSWINUM MAXIRQNUM
diff --git a/include/asm-arm/arch-omap/board-h4.h b/include/asm-arm/arch-omap/board-h4.h
index 33ea29a41654..7ef664bc9e33 100644
--- a/include/asm-arm/arch-omap/board-h4.h
+++ b/include/asm-arm/arch-omap/board-h4.h
@@ -33,12 +33,6 @@
33/* GPMC CS1 */ 33/* GPMC CS1 */
34#define OMAP24XX_ETHR_START 0x08000300 34#define OMAP24XX_ETHR_START 0x08000300
35#define OMAP24XX_ETHR_GPIO_IRQ 92 35#define OMAP24XX_ETHR_GPIO_IRQ 92
36 36#define H4_CS0_BASE 0x04000000
37#define H4_CS0_BASE 0x04000000
38
39#define H4_CS0_BASE 0x04000000
40
41#define H4_CS0_BASE 0x04000000
42
43#endif /* __ASM_ARCH_OMAP_H4_H */ 37#endif /* __ASM_ARCH_OMAP_H4_H */
44 38
diff --git a/include/asm-arm/arch-omap/board-netstar.h b/include/asm-arm/arch-omap/board-netstar.h
deleted file mode 100644
index 77cc0fb54d54..000000000000
--- a/include/asm-arm/arch-omap/board-netstar.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * Copyright (C) 2004 2N Telekomunikace, Ladislav Michl <michl@2n.cz>
3 *
4 * Hardware definitions for OMAP5910 based NetStar board.
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 __ASM_ARCH_NETSTAR_H
12#define __ASM_ARCH_NETSTAR_H
13
14#include <asm/arch/tc.h>
15
16#define OMAP_NAND_FLASH_START1 OMAP_CS1_PHYS + (1 << 23)
17#define OMAP_NAND_FLASH_START2 OMAP_CS1_PHYS + (2 << 23)
18
19#endif /* __ASM_ARCH_NETSTAR_H */
diff --git a/include/asm-arm/arch-omap/board-nokia.h b/include/asm-arm/arch-omap/board-nokia.h
new file mode 100644
index 000000000000..72deea203493
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-nokia.h
@@ -0,0 +1,54 @@
1/*
2 * linux/include/asm-arm/arch-omap/board-nokia.h
3 *
4 * Information structures for Nokia-specific board config data
5 *
6 * Copyright (C) 2005 Nokia Corporation
7 */
8
9#ifndef _OMAP_BOARD_NOKIA_H
10#define _OMAP_BOARD_NOKIA_H
11
12#include <linux/types.h>
13
14#define OMAP_TAG_NOKIA_BT 0x4e01
15#define OMAP_TAG_WLAN_CX3110X 0x4e02
16#define OMAP_TAG_CBUS 0x4e03
17#define OMAP_TAG_EM_ASIC_BB5 0x4e04
18
19
20#define BT_CHIP_CSR 1
21#define BT_CHIP_TI 2
22
23#define BT_SYSCLK_12 1
24#define BT_SYSCLK_38_4 2
25
26struct omap_bluetooth_config {
27 u8 chip_type;
28 u8 bt_wakeup_gpio;
29 u8 host_wakeup_gpio;
30 u8 reset_gpio;
31 u8 bt_uart;
32 u8 bd_addr[6];
33 u8 bt_sysclk;
34};
35
36struct omap_wlan_cx3110x_config {
37 u8 chip_type;
38 s16 power_gpio;
39 s16 irq_gpio;
40 s16 spi_cs_gpio;
41};
42
43struct omap_cbus_config {
44 s16 clk_gpio;
45 s16 dat_gpio;
46 s16 sel_gpio;
47};
48
49struct omap_em_asic_bb5_config {
50 s16 retu_irq_gpio;
51 s16 tahvo_irq_gpio;
52};
53
54#endif
diff --git a/include/asm-arm/arch-omap/board-perseus2.h b/include/asm-arm/arch-omap/board-perseus2.h
index 691e52a52b43..eb74420cb439 100644
--- a/include/asm-arm/arch-omap/board-perseus2.h
+++ b/include/asm-arm/arch-omap/board-perseus2.h
@@ -42,8 +42,4 @@
42 42
43#define NR_IRQS (MAXIRQNUM + 1) 43#define NR_IRQS (MAXIRQNUM + 1)
44 44
45/* Samsung NAND flash at CS2B or CS3(NAND Boot) */
46#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */
47#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */
48
49#endif 45#endif
diff --git a/include/asm-arm/arch-omap/board.h b/include/asm-arm/arch-omap/board.h
index a0040cd86639..6d6240a4681c 100644
--- a/include/asm-arm/arch-omap/board.h
+++ b/include/asm-arm/arch-omap/board.h
@@ -21,9 +21,12 @@
21#define OMAP_TAG_LCD 0x4f05 21#define OMAP_TAG_LCD 0x4f05
22#define OMAP_TAG_GPIO_SWITCH 0x4f06 22#define OMAP_TAG_GPIO_SWITCH 0x4f06
23#define OMAP_TAG_UART 0x4f07 23#define OMAP_TAG_UART 0x4f07
24#define OMAP_TAG_FBMEM 0x4f08
25#define OMAP_TAG_STI_CONSOLE 0x4f09
24 26
25#define OMAP_TAG_BOOT_REASON 0x4f80 27#define OMAP_TAG_BOOT_REASON 0x4f80
26#define OMAP_TAG_FLASH_PART 0x4f81 28#define OMAP_TAG_FLASH_PART 0x4f81
29#define OMAP_TAG_VERSION_STR 0x4f82
27 30
28struct omap_clock_config { 31struct omap_clock_config {
29 /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */ 32 /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */
@@ -54,6 +57,11 @@ struct omap_serial_console_config {
54 u32 console_speed; 57 u32 console_speed;
55}; 58};
56 59
60struct omap_sti_console_config {
61 unsigned enable:1;
62 u8 channel;
63};
64
57struct omap_usb_config { 65struct omap_usb_config {
58 /* Configure drivers according to the connectors on your board: 66 /* Configure drivers according to the connectors on your board:
59 * - "A" connector (rectagular) 67 * - "A" connector (rectagular)
@@ -87,6 +95,13 @@ struct omap_lcd_config {
87 char ctrl_name[16]; 95 char ctrl_name[16];
88}; 96};
89 97
98struct omap_fbmem_config {
99 u32 fb_sram_start;
100 u32 fb_sram_size;
101 u32 fb_sdram_start;
102 u32 fb_sdram_size;
103};
104
90/* Cover: 105/* Cover:
91 * high -> closed 106 * high -> closed
92 * low -> open 107 * low -> open
@@ -106,6 +121,12 @@ struct omap_gpio_switch_config {
106 int key_code:24; /* Linux key code */ 121 int key_code:24; /* Linux key code */
107}; 122};
108 123
124struct omap_uart_config {
125 /* Bit field of UARTs present; bit 0 --> UART1 */
126 unsigned int enabled_uarts;
127};
128
129
109struct omap_flash_part_config { 130struct omap_flash_part_config {
110 char part_table[0]; 131 char part_table[0];
111}; 132};
@@ -114,11 +135,14 @@ struct omap_boot_reason_config {
114 char reason_str[12]; 135 char reason_str[12];
115}; 136};
116 137
117struct omap_uart_config { 138struct omap_version_config {
118 /* Bit field of UARTs present; bit 0 --> UART1 */ 139 char component[12];
119 unsigned int enabled_uarts; 140 char version[12];
120}; 141};
121 142
143
144#include <asm-arm/arch-omap/board-nokia.h>
145
122struct omap_board_config_entry { 146struct omap_board_config_entry {
123 u16 tag; 147 u16 tag;
124 u16 len; 148 u16 len;
diff --git a/include/asm-arm/arch-omap/clock.h b/include/asm-arm/arch-omap/clock.h
index 46a0402696de..3c4eb9fbe48a 100644
--- a/include/asm-arm/arch-omap/clock.h
+++ b/include/asm-arm/arch-omap/clock.h
@@ -19,6 +19,7 @@ struct clk {
19 struct list_head node; 19 struct list_head node;
20 struct module *owner; 20 struct module *owner;
21 const char *name; 21 const char *name;
22 int id;
22 struct clk *parent; 23 struct clk *parent;
23 unsigned long rate; 24 unsigned long rate;
24 __u32 flags; 25 __u32 flags;
@@ -57,6 +58,7 @@ extern void propagate_rate(struct clk *clk);
57extern void followparent_recalc(struct clk * clk); 58extern void followparent_recalc(struct clk * clk);
58extern void clk_allow_idle(struct clk *clk); 59extern void clk_allow_idle(struct clk *clk);
59extern void clk_deny_idle(struct clk *clk); 60extern void clk_deny_idle(struct clk *clk);
61extern int clk_get_usecount(struct clk *clk);
60 62
61/* Clock flags */ 63/* Clock flags */
62#define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */ 64#define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */
@@ -80,10 +82,11 @@ extern void clk_deny_idle(struct clk *clk);
80#define CM_PLL_SEL1 (1 << 18) 82#define CM_PLL_SEL1 (1 << 18)
81#define CM_PLL_SEL2 (1 << 19) 83#define CM_PLL_SEL2 (1 << 19)
82#define CM_SYSCLKOUT_SEL1 (1 << 20) 84#define CM_SYSCLKOUT_SEL1 (1 << 20)
83#define CLOCK_IN_OMAP730 (1 << 21) 85#define CLOCK_IN_OMAP310 (1 << 21)
84#define CLOCK_IN_OMAP1510 (1 << 22) 86#define CLOCK_IN_OMAP730 (1 << 22)
85#define CLOCK_IN_OMAP16XX (1 << 23) 87#define CLOCK_IN_OMAP1510 (1 << 23)
86#define CLOCK_IN_OMAP242X (1 << 24) 88#define CLOCK_IN_OMAP16XX (1 << 24)
87#define CLOCK_IN_OMAP243X (1 << 25) 89#define CLOCK_IN_OMAP242X (1 << 25)
90#define CLOCK_IN_OMAP243X (1 << 26)
88 91
89#endif 92#endif
diff --git a/include/asm-arm/arch-omap/dma.h b/include/asm-arm/arch-omap/dma.h
index d4e73efcb816..ca1202312a45 100644
--- a/include/asm-arm/arch-omap/dma.h
+++ b/include/asm-arm/arch-omap/dma.h
@@ -404,6 +404,7 @@ extern void omap_free_lcd_dma(void);
404extern void omap_setup_lcd_dma(void); 404extern void omap_setup_lcd_dma(void);
405extern void omap_enable_lcd_dma(void); 405extern void omap_enable_lcd_dma(void);
406extern void omap_stop_lcd_dma(void); 406extern void omap_stop_lcd_dma(void);
407extern int omap_lcd_dma_ext_running(void);
407extern void omap_set_lcd_dma_ext_controller(int external); 408extern void omap_set_lcd_dma_ext_controller(int external);
408extern void omap_set_lcd_dma_single_transfer(int single); 409extern void omap_set_lcd_dma_single_transfer(int single);
409extern void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres, 410extern void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres,
diff --git a/include/asm-arm/arch-omap/dmtimer.h b/include/asm-arm/arch-omap/dmtimer.h
index 11772c792f3e..e6522e6a3834 100644
--- a/include/asm-arm/arch-omap/dmtimer.h
+++ b/include/asm-arm/arch-omap/dmtimer.h
@@ -88,5 +88,6 @@ unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer);
88void omap_dm_timer_reset_counter(struct omap_dm_timer *timer); 88void omap_dm_timer_reset_counter(struct omap_dm_timer *timer);
89 89
90int omap_dm_timers_active(void); 90int omap_dm_timers_active(void);
91u32 omap_dm_timer_modify_idlect_mask(u32 inputmask);
91 92
92#endif /* __ASM_ARCH_TIMER_H */ 93#endif /* __ASM_ARCH_TIMER_H */
diff --git a/include/asm-arm/arch-omap/dsp.h b/include/asm-arm/arch-omap/dsp.h
index 57bf4f39ca58..06dad83dd41f 100644
--- a/include/asm-arm/arch-omap/dsp.h
+++ b/include/asm-arm/arch-omap/dsp.h
@@ -181,10 +181,16 @@ struct omap_dsp_varinfo {
181#define OMAP_DSP_MBCMD_PM_ENABLE 0x01 181#define OMAP_DSP_MBCMD_PM_ENABLE 0x01
182 182
183#define OMAP_DSP_MBCMD_KFUNC_FBCTL 0x00 183#define OMAP_DSP_MBCMD_KFUNC_FBCTL 0x00
184#define OMAP_DSP_MBCMD_KFUNC_AUDIO_PWR 0x01
184 185
186#define OMAP_DSP_MBCMD_FBCTL_UPD 0x0000
185#define OMAP_DSP_MBCMD_FBCTL_ENABLE 0x0002 187#define OMAP_DSP_MBCMD_FBCTL_ENABLE 0x0002
186#define OMAP_DSP_MBCMD_FBCTL_DISABLE 0x0003 188#define OMAP_DSP_MBCMD_FBCTL_DISABLE 0x0003
187 189
190#define OMAP_DSP_MBCMD_AUDIO_PWR_UP 0x0000
191#define OMAP_DSP_MBCMD_AUDIO_PWR_DOWN1 0x0001
192#define OMAP_DSP_MBCMD_AUDIO_PWR_DOWN2 0x0002
193
188#define OMAP_DSP_MBCMD_TDEL_SAFE 0x0000 194#define OMAP_DSP_MBCMD_TDEL_SAFE 0x0000
189#define OMAP_DSP_MBCMD_TDEL_KILL 0x0001 195#define OMAP_DSP_MBCMD_TDEL_KILL 0x0001
190 196
diff --git a/include/asm-arm/arch-omap/dsp_common.h b/include/asm-arm/arch-omap/dsp_common.h
index 4fcce6944056..16a459dfa714 100644
--- a/include/asm-arm/arch-omap/dsp_common.h
+++ b/include/asm-arm/arch-omap/dsp_common.h
@@ -27,11 +27,12 @@
27#ifndef ASM_ARCH_DSP_COMMON_H 27#ifndef ASM_ARCH_DSP_COMMON_H
28#define ASM_ARCH_DSP_COMMON_H 28#define ASM_ARCH_DSP_COMMON_H
29 29
30void omap_dsp_pm_suspend(void); 30extern void omap_dsp_request_mpui(void);
31void omap_dsp_pm_resume(void); 31extern void omap_dsp_release_mpui(void);
32void omap_dsp_request_mpui(void); 32extern int omap_dsp_request_mem(void);
33void omap_dsp_release_mpui(void); 33extern int omap_dsp_release_mem(void);
34int omap_dsp_request_mem(void); 34
35int omap_dsp_release_mem(void); 35extern void (*omap_dsp_audio_pwr_up_request)(int stage);
36extern void (*omap_dsp_audio_pwr_down_request)(int stage);
36 37
37#endif /* ASM_ARCH_DSP_COMMON_H */ 38#endif /* ASM_ARCH_DSP_COMMON_H */
diff --git a/include/asm-arm/arch-omap/gpioexpander.h b/include/asm-arm/arch-omap/gpioexpander.h
new file mode 100644
index 000000000000..7a43b0a912e4
--- /dev/null
+++ b/include/asm-arm/arch-omap/gpioexpander.h
@@ -0,0 +1,24 @@
1/*
2 * linux/include/asm-arm/arch-omap/gpioexpander.h
3 *
4 *
5 * Copyright (C) 2004 Texas Instruments, Inc.
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 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
12 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
13 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14 */
15
16#ifndef __ASM_ARCH_OMAP_GPIOEXPANDER_H
17#define __ASM_ARCH_OMAP_GPIOEXPANDER_H
18
19/* Function Prototypes for GPIO Expander functions */
20
21int read_gpio_expa(u8 *, int);
22int write_gpio_expa(u8 , int);
23
24#endif /* __ASM_ARCH_OMAP_GPIOEXPANDER_H */
diff --git a/include/asm-arm/arch-omap/hardware.h b/include/asm-arm/arch-omap/hardware.h
index 5406b875c422..7909b729826c 100644
--- a/include/asm-arm/arch-omap/hardware.h
+++ b/include/asm-arm/arch-omap/hardware.h
@@ -306,6 +306,10 @@
306#include "board-h4.h" 306#include "board-h4.h"
307#endif 307#endif
308 308
309#ifdef CONFIG_MACH_OMAP_APOLLON
310#include "board-apollon.h"
311#endif
312
309#ifdef CONFIG_MACH_OMAP_OSK 313#ifdef CONFIG_MACH_OMAP_OSK
310#include "board-osk.h" 314#include "board-osk.h"
311#endif 315#endif
@@ -314,10 +318,6 @@
314#include "board-voiceblue.h" 318#include "board-voiceblue.h"
315#endif 319#endif
316 320
317#ifdef CONFIG_MACH_NETSTAR
318#include "board-netstar.h"
319#endif
320
321#endif /* !__ASSEMBLER__ */ 321#endif /* !__ASSEMBLER__ */
322 322
323#endif /* __ASM_ARCH_OMAP_HARDWARE_H */ 323#endif /* __ASM_ARCH_OMAP_HARDWARE_H */
diff --git a/include/asm-arm/arch-omap/irda.h b/include/asm-arm/arch-omap/irda.h
new file mode 100644
index 000000000000..805ae3575e44
--- /dev/null
+++ b/include/asm-arm/arch-omap/irda.h
@@ -0,0 +1,36 @@
1/*
2 * linux/include/asm-arm/arch-omap/irda.h
3 *
4 * Copyright (C) 2005-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_IRDA_H
11#define ASMARM_ARCH_IRDA_H
12
13/* board specific transceiver capabilities */
14
15#define IR_SEL 1 /* Selects IrDA */
16#define IR_SIRMODE 2
17#define IR_FIRMODE 4
18#define IR_MIRMODE 8
19
20struct omap_irda_config {
21 int transceiver_cap;
22 int (*transceiver_mode)(struct device *dev, int mode);
23 int (*select_irda)(struct device *dev, int state);
24 /* Very specific to the needs of some platforms (h3,h4)
25 * having calls which can sleep in irda_set_speed.
26 */
27 struct work_struct gpio_expa;
28 int rx_channel;
29 int tx_channel;
30 unsigned long dest_start;
31 unsigned long src_start;
32 int tx_trigger;
33 int rx_trigger;
34};
35
36#endif
diff --git a/include/asm-arm/arch-omap/irqs.h b/include/asm-arm/arch-omap/irqs.h
index 4ffce1d77759..42098d99f302 100644
--- a/include/asm-arm/arch-omap/irqs.h
+++ b/include/asm-arm/arch-omap/irqs.h
@@ -242,6 +242,11 @@
242#define INT_24XX_GPIO_BANK2 30 242#define INT_24XX_GPIO_BANK2 30
243#define INT_24XX_GPIO_BANK3 31 243#define INT_24XX_GPIO_BANK3 31
244#define INT_24XX_GPIO_BANK4 32 244#define INT_24XX_GPIO_BANK4 32
245#define INT_24XX_MCBSP1_IRQ_TX 59
246#define INT_24XX_MCBSP1_IRQ_RX 60
247#define INT_24XX_MCBSP2_IRQ_TX 62
248#define INT_24XX_MCBSP2_IRQ_RX 63
249#define INT_24XX_UART3_IRQ 74
245 250
246/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and 251/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and
247 * 16 MPUIO lines */ 252 * 16 MPUIO lines */
diff --git a/include/asm-arm/arch-omap/keypad.h b/include/asm-arm/arch-omap/keypad.h
new file mode 100644
index 000000000000..8a023a984acb
--- /dev/null
+++ b/include/asm-arm/arch-omap/keypad.h
@@ -0,0 +1,36 @@
1/*
2 * linux/include/asm-arm/arch-omap/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
13struct omap_kp_platform_data {
14 int rows;
15 int cols;
16 int *keymap;
17 unsigned int rep:1;
18 /* specific to OMAP242x*/
19 unsigned int *row_gpios;
20 unsigned int *col_gpios;
21};
22
23/* Group (0..3) -- when multiple keys are pressed, only the
24 * keys pressed in the same group are considered as pressed. This is
25 * in order to workaround certain crappy HW designs that produce ghost
26 * keypresses. */
27#define GROUP_0 (0 << 16)
28#define GROUP_1 (1 << 16)
29#define GROUP_2 (2 << 16)
30#define GROUP_3 (3 << 16)
31#define GROUP_MASK GROUP_3
32
33#define KEY(col, row, val) (((col) << 28) | ((row) << 24) | (val))
34
35#endif
36
diff --git a/include/asm-arm/arch-omap/lcd_lph8923.h b/include/asm-arm/arch-omap/lcd_lph8923.h
new file mode 100644
index 000000000000..004e67e22ca7
--- /dev/null
+++ b/include/asm-arm/arch-omap/lcd_lph8923.h
@@ -0,0 +1,14 @@
1#ifndef __LCD_LPH8923_H
2#define __LCD_LPH8923_H
3
4enum lcd_lph8923_test_num {
5 LCD_LPH8923_TEST_RGB_LINES,
6};
7
8enum lcd_lph8923_test_result {
9 LCD_LPH8923_TEST_SUCCESS,
10 LCD_LPH8923_TEST_INVALID,
11 LCD_LPH8923_TEST_FAILED,
12};
13
14#endif
diff --git a/include/asm-arm/arch-omap/mcbsp.h b/include/asm-arm/arch-omap/mcbsp.h
index e79d98ab2ab6..ed0dde4f7219 100644
--- a/include/asm-arm/arch-omap/mcbsp.h
+++ b/include/asm-arm/arch-omap/mcbsp.h
@@ -37,6 +37,11 @@
37#define OMAP1610_MCBSP2_BASE 0xfffb1000 37#define OMAP1610_MCBSP2_BASE 0xfffb1000
38#define OMAP1610_MCBSP3_BASE 0xe1017000 38#define OMAP1610_MCBSP3_BASE 0xe1017000
39 39
40#define OMAP24XX_MCBSP1_BASE 0x48074000
41#define OMAP24XX_MCBSP2_BASE 0x48076000
42
43#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730)
44
40#define OMAP_MCBSP_REG_DRR2 0x00 45#define OMAP_MCBSP_REG_DRR2 0x00
41#define OMAP_MCBSP_REG_DRR1 0x02 46#define OMAP_MCBSP_REG_DRR1 0x02
42#define OMAP_MCBSP_REG_DXR2 0x04 47#define OMAP_MCBSP_REG_DXR2 0x04
@@ -71,9 +76,62 @@
71 76
72#define OMAP_MAX_MCBSP_COUNT 3 77#define OMAP_MAX_MCBSP_COUNT 3
73 78
79#define AUDIO_MCBSP_DATAWRITE (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DXR1)
80#define AUDIO_MCBSP_DATAREAD (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DRR1)
81
82#define AUDIO_MCBSP OMAP_MCBSP1
83#define AUDIO_DMA_TX OMAP_DMA_MCBSP1_TX
84#define AUDIO_DMA_RX OMAP_DMA_MCBSP1_RX
85
86#elif defined(CONFIG_ARCH_OMAP24XX)
87
88#define OMAP_MCBSP_REG_DRR2 0x00
89#define OMAP_MCBSP_REG_DRR1 0x04
90#define OMAP_MCBSP_REG_DXR2 0x08
91#define OMAP_MCBSP_REG_DXR1 0x0C
92#define OMAP_MCBSP_REG_SPCR2 0x10
93#define OMAP_MCBSP_REG_SPCR1 0x14
94#define OMAP_MCBSP_REG_RCR2 0x18
95#define OMAP_MCBSP_REG_RCR1 0x1C
96#define OMAP_MCBSP_REG_XCR2 0x20
97#define OMAP_MCBSP_REG_XCR1 0x24
98#define OMAP_MCBSP_REG_SRGR2 0x28
99#define OMAP_MCBSP_REG_SRGR1 0x2C
100#define OMAP_MCBSP_REG_MCR2 0x30
101#define OMAP_MCBSP_REG_MCR1 0x34
102#define OMAP_MCBSP_REG_RCERA 0x38
103#define OMAP_MCBSP_REG_RCERB 0x3C
104#define OMAP_MCBSP_REG_XCERA 0x40
105#define OMAP_MCBSP_REG_XCERB 0x44
106#define OMAP_MCBSP_REG_PCR0 0x48
107#define OMAP_MCBSP_REG_RCERC 0x4C
108#define OMAP_MCBSP_REG_RCERD 0x50
109#define OMAP_MCBSP_REG_XCERC 0x54
110#define OMAP_MCBSP_REG_XCERD 0x58
111#define OMAP_MCBSP_REG_RCERE 0x5C
112#define OMAP_MCBSP_REG_RCERF 0x60
113#define OMAP_MCBSP_REG_XCERE 0x64
114#define OMAP_MCBSP_REG_XCERF 0x68
115#define OMAP_MCBSP_REG_RCERG 0x6C
116#define OMAP_MCBSP_REG_RCERH 0x70
117#define OMAP_MCBSP_REG_XCERG 0x74
118#define OMAP_MCBSP_REG_XCERH 0x78
119
120#define OMAP_MAX_MCBSP_COUNT 2
121
122#define AUDIO_MCBSP_DATAWRITE (OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR1)
123#define AUDIO_MCBSP_DATAREAD (OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR1)
124
125#define AUDIO_MCBSP OMAP_MCBSP2
126#define AUDIO_DMA_TX OMAP24XX_DMA_MCBSP2_TX
127#define AUDIO_DMA_RX OMAP24XX_DMA_MCBSP2_RX
128
129#endif
130
74#define OMAP_MCBSP_READ(base, reg) __raw_readw((base) + OMAP_MCBSP_REG_##reg) 131#define OMAP_MCBSP_READ(base, reg) __raw_readw((base) + OMAP_MCBSP_REG_##reg)
75#define OMAP_MCBSP_WRITE(base, reg, val) __raw_writew((val), (base) + OMAP_MCBSP_REG_##reg) 132#define OMAP_MCBSP_WRITE(base, reg, val) __raw_writew((val), (base) + OMAP_MCBSP_REG_##reg)
76 133
134
77/************************** McBSP SPCR1 bit definitions ***********************/ 135/************************** McBSP SPCR1 bit definitions ***********************/
78#define RRST 0x0001 136#define RRST 0x0001
79#define RRDY 0x0002 137#define RRDY 0x0002
@@ -195,6 +253,10 @@ typedef enum {
195 OMAP_MCBSP3, 253 OMAP_MCBSP3,
196} omap_mcbsp_id; 254} omap_mcbsp_id;
197 255
256typedef int __bitwise omap_mcbsp_io_type_t;
257#define OMAP_MCBSP_IRQ_IO ((__force omap_mcbsp_io_type_t) 1)
258#define OMAP_MCBSP_POLL_IO ((__force omap_mcbsp_io_type_t) 2)
259
198typedef enum { 260typedef enum {
199 OMAP_MCBSP_WORD_8 = 0, 261 OMAP_MCBSP_WORD_8 = 0,
200 OMAP_MCBSP_WORD_12, 262 OMAP_MCBSP_WORD_12,
@@ -246,6 +308,9 @@ u32 omap_mcbsp_recv_word(unsigned int id);
246 308
247int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); 309int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, unsigned int length);
248int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); 310int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int length);
311int omap_mcbsp_spi_master_xmit_word_poll(unsigned int id, u32 word);
312int omap_mcbsp_spi_master_recv_word_poll(unsigned int id, u32 * word);
313
249 314
250/* SPI specific API */ 315/* SPI specific API */
251void omap_mcbsp_set_spi_mode(unsigned int id, const struct omap_mcbsp_spi_cfg * spi_cfg); 316void omap_mcbsp_set_spi_mode(unsigned int id, const struct omap_mcbsp_spi_cfg * spi_cfg);
diff --git a/include/asm-arm/arch-omap/mcspi.h b/include/asm-arm/arch-omap/mcspi.h
new file mode 100644
index 000000000000..9e7f40a88e1b
--- /dev/null
+++ b/include/asm-arm/arch-omap/mcspi.h
@@ -0,0 +1,16 @@
1#ifndef _OMAP2_MCSPI_H
2#define _OMAP2_MCSPI_H
3
4struct omap2_mcspi_platform_config {
5 unsigned long base;
6 unsigned short num_cs;
7};
8
9struct omap2_mcspi_device_config {
10 unsigned turbo_mode:1;
11
12 /* Do we want one channel enabled at the same time? */
13 unsigned single_channel:1;
14};
15
16#endif
diff --git a/include/asm-arm/arch-omap/menelaus.h b/include/asm-arm/arch-omap/menelaus.h
index 46be8b8d6346..88cd4c87f0de 100644
--- a/include/asm-arm/arch-omap/menelaus.h
+++ b/include/asm-arm/arch-omap/menelaus.h
@@ -7,7 +7,7 @@
7#ifndef __ASM_ARCH_MENELAUS_H 7#ifndef __ASM_ARCH_MENELAUS_H
8#define __ASM_ARCH_MENELAUS_H 8#define __ASM_ARCH_MENELAUS_H
9 9
10extern void menelaus_mmc_register(void (*callback)(u8 card_mask), 10extern void menelaus_mmc_register(void (*callback)(unsigned long data, u8 card_mask),
11 unsigned long data); 11 unsigned long data);
12extern void menelaus_mmc_remove(void); 12extern void menelaus_mmc_remove(void);
13extern void menelaus_mmc_opendrain(int enable); 13extern void menelaus_mmc_opendrain(int enable);
diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h
index 13415a9aab06..0dc24d4ba59c 100644
--- a/include/asm-arm/arch-omap/mux.h
+++ b/include/asm-arm/arch-omap/mux.h
@@ -112,14 +112,13 @@
112 * as mux config 112 * as mux config
113 */ 113 */
114#define MUX_CFG_730(desc, mux_reg, mode_offset, mode, \ 114#define MUX_CFG_730(desc, mux_reg, mode_offset, mode, \
115 pull_reg, pull_bit, pull_status, \ 115 pull_bit, pull_status, debug_status)\
116 pu_pd_reg, pu_pd_status, debug_status)\
117{ \ 116{ \
118 .name = desc, \ 117 .name = desc, \
119 .debug = debug_status, \ 118 .debug = debug_status, \
120 MUX_REG_730(mux_reg, mode_offset, mode) \ 119 MUX_REG_730(mux_reg, mode_offset, mode) \
121 PULL_REG_730(mux_reg, pull_bit, pull_status) \ 120 PULL_REG_730(mux_reg, pull_bit, pull_status) \
122 PU_PD_REG(pu_pd_reg, pu_pd_status) \ 121 PU_PD_REG(NA, 0) \
123}, 122},
124 123
125#define MUX_CFG_24XX(desc, reg_offset, mode, \ 124#define MUX_CFG_24XX(desc, reg_offset, mode, \
@@ -172,6 +171,11 @@ enum omap730_index {
172 E4_730_KBC2, 171 E4_730_KBC2,
173 F4_730_KBC3, 172 F4_730_KBC3,
174 E3_730_KBC4, 173 E3_730_KBC4,
174
175 /* USB */
176 AA17_730_USB_DM,
177 W16_730_USB_PU_EN,
178 W17_730_USB_VBUSI,
175}; 179};
176 180
177enum omap1xxx_index { 181enum omap1xxx_index {
@@ -403,9 +407,53 @@ enum omap24xx_index {
403 /* 24xx Menelaus interrupt */ 407 /* 24xx Menelaus interrupt */
404 W19_24XX_SYS_NIRQ, 408 W19_24XX_SYS_NIRQ,
405 409
410 /* 24xx clock */
411 W14_24XX_SYS_CLKOUT,
412
413 /* 242X McBSP */
414 Y15_24XX_MCBSP2_CLKX,
415 R14_24XX_MCBSP2_FSX,
416 W15_24XX_MCBSP2_DR,
417 V15_24XX_MCBSP2_DX,
418
406 /* 24xx GPIO */ 419 /* 24xx GPIO */
420 M21_242X_GPIO11,
421 AA10_242X_GPIO13,
422 AA6_242X_GPIO14,
423 AA4_242X_GPIO15,
424 Y11_242X_GPIO16,
425 AA12_242X_GPIO17,
426 AA8_242X_GPIO58,
407 Y20_24XX_GPIO60, 427 Y20_24XX_GPIO60,
428 W4__24XX_GPIO74,
408 M15_24XX_GPIO92, 429 M15_24XX_GPIO92,
430 V14_24XX_GPIO117,
431
432 P20_24XX_TSC_IRQ,
433
434 /* UART3 */
435 K15_24XX_UART3_TX,
436 K14_24XX_UART3_RX,
437
438 /* Keypad GPIO*/
439 T19_24XX_KBR0,
440 R19_24XX_KBR1,
441 V18_24XX_KBR2,
442 M21_24XX_KBR3,
443 E5__24XX_KBR4,
444 M18_24XX_KBR5,
445 R20_24XX_KBC0,
446 M14_24XX_KBC1,
447 H19_24XX_KBC2,
448 V17_24XX_KBC3,
449 P21_24XX_KBC4,
450 L14_24XX_KBC5,
451 N19_24XX_KBC6,
452
453 /* 24xx Menelaus Keypad GPIO */
454 B3__24XX_KBR5,
455 AA4_24XX_KBC2,
456 B13_24XX_KBC6,
409}; 457};
410 458
411#ifdef CONFIG_OMAP_MUX 459#ifdef CONFIG_OMAP_MUX
diff --git a/include/asm-arm/arch-omap/omap-alsa.h b/include/asm-arm/arch-omap/omap-alsa.h
new file mode 100644
index 000000000000..df4695474e3d
--- /dev/null
+++ b/include/asm-arm/arch-omap/omap-alsa.h
@@ -0,0 +1,124 @@
1/*
2 * linux/include/asm-arm/arch-omap/omap-alsa.h
3 *
4 * Alsa Driver for AIC23 and TSC2101 codecs on OMAP platform boards.
5 *
6 * Copyright (C) 2006 Mika Laitio <lamikr@cc.jyu.fi>
7 *
8 * Copyright (C) 2005 Instituto Nokia de Tecnologia - INdT - Manaus Brazil
9 * Written by Daniel Petrini, David Cohen, Anderson Briglia
10 * {daniel.petrini, david.cohen, anderson.briglia}@indt.org.br
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 *
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
20 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * You should have received a copy of the GNU General Public License along
29 * with this program; if not, write to the Free Software Foundation, Inc.,
30 * 675 Mass Ave, Cambridge, MA 02139, USA.
31 *
32 * History
33 * -------
34 *
35 * 2005/07/25 INdT-10LE Kernel Team - Alsa driver for omap osk,
36 * original version based in sa1100 driver
37 * and omap oss driver.
38 */
39
40#ifndef __OMAP_ALSA_H
41#define __OMAP_ALSA_H
42
43#include <sound/driver.h>
44#include <asm/arch/dma.h>
45#include <sound/core.h>
46#include <sound/pcm.h>
47#include <asm/arch/mcbsp.h>
48#include <linux/platform_device.h>
49
50#define DMA_BUF_SIZE (1024 * 8)
51
52/*
53 * Buffer management for alsa and dma
54 */
55struct audio_stream {
56 char *id; /* identification string */
57 int stream_id; /* numeric identification */
58 int dma_dev; /* dma number of that device */
59 int *lch; /* Chain of channels this stream is linked to */
60 char started; /* to store if the chain was started or not */
61 int dma_q_head; /* DMA Channel Q Head */
62 int dma_q_tail; /* DMA Channel Q Tail */
63 char dma_q_count; /* DMA Channel Q Count */
64 int active:1; /* we are using this stream for transfer now */
65 int period; /* current transfer period */
66 int periods; /* current count of periods registerd in the DMA engine */
67 spinlock_t dma_lock; /* for locking in DMA operations */
68 snd_pcm_substream_t *stream; /* the pcm stream */
69 unsigned linked:1; /* dma channels linked */
70 int offset; /* store start position of the last period in the alsa buffer */
71 int (*hw_start)(void); /* interface to start HW interface, e.g. McBSP */
72 int (*hw_stop)(void); /* interface to stop HW interface, e.g. McBSP */
73};
74
75/*
76 * Alsa card structure for aic23
77 */
78struct snd_card_omap_codec {
79 snd_card_t *card;
80 snd_pcm_t *pcm;
81 long samplerate;
82 struct audio_stream s[2]; /* playback & capture */
83};
84
85/* Codec specific information and function pointers.
86 * Codec (omap-alsa-aic23.c and omap-alsa-tsc2101.c)
87 * are responsible for defining the function pointers.
88 */
89struct omap_alsa_codec_config {
90 char *name;
91 struct omap_mcbsp_reg_cfg *mcbsp_regs_alsa;
92 snd_pcm_hw_constraint_list_t *hw_constraints_rates;
93 snd_pcm_hardware_t *snd_omap_alsa_playback;
94 snd_pcm_hardware_t *snd_omap_alsa_capture;
95 void (*codec_configure_dev)(void);
96 void (*codec_set_samplerate)(long);
97 void (*codec_clock_setup)(void);
98 int (*codec_clock_on)(void);
99 int (*codec_clock_off)(void);
100 int (*get_default_samplerate)(void);
101};
102
103/*********** Mixer function prototypes *************************/
104int snd_omap_mixer(struct snd_card_omap_codec *);
105void snd_omap_init_mixer(void);
106
107#ifdef CONFIG_PM
108void snd_omap_suspend_mixer(void);
109void snd_omap_resume_mixer(void);
110#endif
111
112int snd_omap_alsa_post_probe(struct platform_device *pdev, struct omap_alsa_codec_config *config);
113int snd_omap_alsa_remove(struct platform_device *pdev);
114#ifdef CONFIG_PM
115int snd_omap_alsa_suspend(struct platform_device *pdev, pm_message_t state);
116int snd_omap_alsa_resume(struct platform_device *pdev);
117#else
118#define snd_omap_alsa_suspend NULL
119#define snd_omap_alsa_resume NULL
120#endif
121
122void callback_omap_alsa_sound_dma(void *);
123
124#endif
diff --git a/include/asm-arm/arch-omap/omapfb.h b/include/asm-arm/arch-omap/omapfb.h
index 4ba2622cc142..fccdb3db025f 100644
--- a/include/asm-arm/arch-omap/omapfb.h
+++ b/include/asm-arm/arch-omap/omapfb.h
@@ -34,9 +34,10 @@
34#define OMAPFB_MIRROR OMAP_IOW(31, int) 34#define OMAPFB_MIRROR OMAP_IOW(31, int)
35#define OMAPFB_SYNC_GFX OMAP_IO(37) 35#define OMAPFB_SYNC_GFX OMAP_IO(37)
36#define OMAPFB_VSYNC OMAP_IO(38) 36#define OMAPFB_VSYNC OMAP_IO(38)
37#define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, enum omapfb_update_mode) 37#define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int)
38#define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(41, struct omapfb_update_window_old)
38#define OMAPFB_GET_CAPS OMAP_IOR(42, unsigned long) 39#define OMAPFB_GET_CAPS OMAP_IOR(42, unsigned long)
39#define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, enum omapfb_update_mode) 40#define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int)
40#define OMAPFB_LCD_TEST OMAP_IOW(45, int) 41#define OMAPFB_LCD_TEST OMAP_IOW(45, int)
41#define OMAPFB_CTRL_TEST OMAP_IOW(46, int) 42#define OMAPFB_CTRL_TEST OMAP_IOW(46, int)
42#define OMAPFB_UPDATE_WINDOW OMAP_IOW(47, struct omapfb_update_window) 43#define OMAPFB_UPDATE_WINDOW OMAP_IOW(47, struct omapfb_update_window)
@@ -66,9 +67,14 @@ enum omapfb_color_format {
66}; 67};
67 68
68struct omapfb_update_window { 69struct omapfb_update_window {
69 u32 x, y; 70 __u32 x, y;
70 u32 width, height; 71 __u32 width, height;
71 u32 format; 72 __u32 format;
73};
74
75struct omapfb_update_window_old {
76 __u32 x, y;
77 __u32 width, height;
72}; 78};
73 79
74enum omapfb_plane { 80enum omapfb_plane {
@@ -83,17 +89,17 @@ enum omapfb_channel_out {
83}; 89};
84 90
85struct omapfb_setup_plane { 91struct omapfb_setup_plane {
86 u8 plane; 92 __u8 plane;
87 u8 channel_out; 93 __u8 channel_out;
88 u32 offset; 94 __u32 offset;
89 u32 pos_x, pos_y; 95 __u32 pos_x, pos_y;
90 u32 width, height; 96 __u32 width, height;
91 u32 color_mode; 97 __u32 color_mode;
92}; 98};
93 99
94struct omapfb_enable_plane { 100struct omapfb_enable_plane {
95 u8 plane; 101 __u8 plane;
96 u8 enable; 102 __u8 enable;
97}; 103};
98 104
99enum omapfb_color_key_type { 105enum omapfb_color_key_type {
@@ -103,10 +109,10 @@ enum omapfb_color_key_type {
103}; 109};
104 110
105struct omapfb_color_key { 111struct omapfb_color_key {
106 u8 channel_out; 112 __u8 channel_out;
107 u32 background; 113 __u32 background;
108 u32 trans_key; 114 __u32 trans_key;
109 u8 key_type; 115 __u8 key_type;
110}; 116};
111 117
112enum omapfb_update_mode { 118enum omapfb_update_mode {
@@ -120,6 +126,9 @@ enum omapfb_update_mode {
120#include <linux/completion.h> 126#include <linux/completion.h>
121#include <linux/interrupt.h> 127#include <linux/interrupt.h>
122#include <linux/fb.h> 128#include <linux/fb.h>
129#include <linux/mutex.h>
130
131#include <asm/arch/board.h>
123 132
124#define OMAP_LCDC_INV_VSYNC 0x0001 133#define OMAP_LCDC_INV_VSYNC 0x0001
125#define OMAP_LCDC_INV_HSYNC 0x0002 134#define OMAP_LCDC_INV_HSYNC 0x0002
@@ -184,19 +193,38 @@ struct extif_timings {
184 int re_cycle_time; 193 int re_cycle_time;
185 int cs_pulse_width; 194 int cs_pulse_width;
186 int access_time; 195 int access_time;
196
197 int clk_div;
198
199 u32 tim[5]; /* set by extif->convert_timings */
200
201 int converted;
187}; 202};
188 203
189struct lcd_ctrl_extif { 204struct lcd_ctrl_extif {
190 int (*init) (void); 205 int (*init) (void);
191 void (*cleanup) (void); 206 void (*cleanup) (void);
207 void (*get_clk_info) (u32 *clk_period, u32 *max_clk_div);
208 int (*convert_timings) (struct extif_timings *timings);
192 void (*set_timings) (const struct extif_timings *timings); 209 void (*set_timings) (const struct extif_timings *timings);
193 void (*write_command) (u32 cmd); 210 void (*set_bits_per_cycle)(int bpc);
194 u32 (*read_data) (void); 211 void (*write_command) (const void *buf, unsigned int len);
195 void (*write_data) (u32 data); 212 void (*read_data) (void *buf, unsigned int len);
213 void (*write_data) (const void *buf, unsigned int len);
196 void (*transfer_area) (int width, int height, 214 void (*transfer_area) (int width, int height,
197 void (callback)(void * data), void *data); 215 void (callback)(void * data), void *data);
216 unsigned long max_transmit_size;
198}; 217};
199 218
219struct omapfb_notifier_block {
220 struct notifier_block nb;
221 void *data;
222};
223
224typedef int (*omapfb_notifier_callback_t)(struct omapfb_notifier_block *,
225 unsigned long event,
226 struct omapfb_device *fbdev);
227
200struct lcd_ctrl { 228struct lcd_ctrl {
201 const char *name; 229 const char *name;
202 void *data; 230 void *data;
@@ -204,9 +232,11 @@ struct lcd_ctrl {
204 int (*init) (struct omapfb_device *fbdev, 232 int (*init) (struct omapfb_device *fbdev,
205 int ext_mode, int req_vram_size); 233 int ext_mode, int req_vram_size);
206 void (*cleanup) (void); 234 void (*cleanup) (void);
235 void (*bind_client) (struct omapfb_notifier_block *nb);
207 void (*get_vram_layout)(unsigned long *size, 236 void (*get_vram_layout)(unsigned long *size,
208 void **virt_base, 237 void **virt_base,
209 dma_addr_t *phys_base); 238 dma_addr_t *phys_base);
239 int (*mmap) (struct vm_area_struct *vma);
210 unsigned long (*get_caps) (void); 240 unsigned long (*get_caps) (void);
211 int (*set_update_mode)(enum omapfb_update_mode mode); 241 int (*set_update_mode)(enum omapfb_update_mode mode);
212 enum omapfb_update_mode (*get_update_mode)(void); 242 enum omapfb_update_mode (*get_update_mode)(void);
@@ -240,7 +270,7 @@ struct omapfb_device {
240 int state; 270 int state;
241 int ext_lcdc; /* Using external 271 int ext_lcdc; /* Using external
242 LCD controller */ 272 LCD controller */
243 struct semaphore rqueue_sema; 273 struct mutex rqueue_mutex;
244 274
245 void *vram_virt_base; 275 void *vram_virt_base;
246 dma_addr_t vram_phys_base; 276 dma_addr_t vram_phys_base;
@@ -261,12 +291,13 @@ struct omapfb_device {
261 struct device *dev; 291 struct device *dev;
262}; 292};
263 293
264extern struct lcd_panel h3_panel; 294struct omapfb_platform_data {
265extern struct lcd_panel h2_panel; 295 struct omap_lcd_config lcd;
266extern struct lcd_panel p2_panel; 296 struct omap_fbmem_config fbmem;
267extern struct lcd_panel osk_panel; 297};
268extern struct lcd_panel innovator1610_panel; 298
269extern struct lcd_panel innovator1510_panel; 299#define OMAPFB_EVENT_READY 1
300#define OMAPFB_EVENT_DISABLED 2
270 301
271#ifdef CONFIG_ARCH_OMAP1 302#ifdef CONFIG_ARCH_OMAP1
272extern struct lcd_ctrl omap1_lcd_ctrl; 303extern struct lcd_ctrl omap1_lcd_ctrl;
@@ -274,7 +305,20 @@ extern struct lcd_ctrl omap1_lcd_ctrl;
274extern struct lcd_ctrl omap2_disp_ctrl; 305extern struct lcd_ctrl omap2_disp_ctrl;
275#endif 306#endif
276 307
308extern void omapfb_register_panel(struct lcd_panel *panel);
277extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval); 309extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval);
310extern void omapfb_notify_clients(struct omapfb_device *fbdev,
311 unsigned long event);
312extern int omapfb_register_client(struct omapfb_notifier_block *nb,
313 omapfb_notifier_callback_t callback,
314 void *callback_data);
315extern int omapfb_unregister_client(struct omapfb_notifier_block *nb);
316extern int omapfb_update_window_async(struct omapfb_update_window *win,
317 void (*callback)(void *),
318 void *callback_data);
319
320/* in arch/arm/plat-omap/devices.c */
321extern void omapfb_reserve_mem(void);
278 322
279#endif /* __KERNEL__ */ 323#endif /* __KERNEL__ */
280 324
diff --git a/include/asm-arm/arch-omap/param.h b/include/asm-arm/arch-omap/param.h
new file mode 100644
index 000000000000..face9ad41e97
--- /dev/null
+++ b/include/asm-arm/arch-omap/param.h
@@ -0,0 +1,8 @@
1/*
2 * linux/include/asm-arm/arch-omap/param.h
3 *
4 */
5
6#ifdef CONFIG_OMAP_32K_TIMER_HZ
7#define HZ CONFIG_OMAP_32K_TIMER_HZ
8#endif
diff --git a/include/asm-arm/arch-omap/pm.h b/include/asm-arm/arch-omap/pm.h
index 7c790425e363..05b003f3a94c 100644
--- a/include/asm-arm/arch-omap/pm.h
+++ b/include/asm-arm/arch-omap/pm.h
@@ -49,7 +49,7 @@
49 49
50/* 50/*
51 * ---------------------------------------------------------------------------- 51 * ----------------------------------------------------------------------------
52 * Powermanagement bitmasks 52 * Power management bitmasks
53 * ---------------------------------------------------------------------------- 53 * ----------------------------------------------------------------------------
54 */ 54 */
55#define IDLE_WAIT_CYCLES 0x00000fff 55#define IDLE_WAIT_CYCLES 0x00000fff
@@ -112,32 +112,59 @@
112#endif 112#endif
113 113
114#ifndef __ASSEMBLER__ 114#ifndef __ASSEMBLER__
115
116#include <linux/clk.h>
117
118extern void prevent_idle_sleep(void);
119extern void allow_idle_sleep(void);
120
121/**
122 * clk_deny_idle - Prevents the clock from being idled during MPU idle
123 * @clk: clock signal handle
124 */
125void clk_deny_idle(struct clk *clk);
126
127/**
128 * clk_allow_idle - Counters previous clk_deny_idle
129 * @clk: clock signal handle
130 */
131void clk_deny_idle(struct clk *clk);
132
115extern void omap_pm_idle(void); 133extern void omap_pm_idle(void);
116extern void omap_pm_suspend(void); 134extern void omap_pm_suspend(void);
117extern void omap730_cpu_suspend(unsigned short, unsigned short); 135extern void omap730_cpu_suspend(unsigned short, unsigned short);
118extern void omap1510_cpu_suspend(unsigned short, unsigned short); 136extern void omap1510_cpu_suspend(unsigned short, unsigned short);
119extern void omap1610_cpu_suspend(unsigned short, unsigned short); 137extern void omap1610_cpu_suspend(unsigned short, unsigned short);
138extern void omap24xx_cpu_suspend(u32 dll_ctrl, u32 cpu_revision);
120extern void omap730_idle_loop_suspend(void); 139extern void omap730_idle_loop_suspend(void);
121extern void omap1510_idle_loop_suspend(void); 140extern void omap1510_idle_loop_suspend(void);
122extern void omap1610_idle_loop_suspend(void); 141extern void omap1610_idle_loop_suspend(void);
142extern void omap24xx_idle_loop_suspend(void);
143
144extern unsigned int omap730_cpu_suspend_sz;
145extern unsigned int omap1510_cpu_suspend_sz;
146extern unsigned int omap1610_cpu_suspend_sz;
147extern unsigned int omap24xx_cpu_suspend_sz;
148extern unsigned int omap730_idle_loop_suspend_sz;
149extern unsigned int omap1510_idle_loop_suspend_sz;
150extern unsigned int omap1610_idle_loop_suspend_sz;
151extern unsigned int omap24xx_idle_loop_suspend_sz;
123 152
124#ifdef CONFIG_OMAP_SERIAL_WAKE 153#ifdef CONFIG_OMAP_SERIAL_WAKE
125extern void omap_serial_wake_trigger(int enable); 154extern void omap_serial_wake_trigger(int enable);
126#else 155#else
156#define omap_serial_wakeup_init() {}
127#define omap_serial_wake_trigger(x) {} 157#define omap_serial_wake_trigger(x) {}
128#endif /* CONFIG_OMAP_SERIAL_WAKE */ 158#endif /* CONFIG_OMAP_SERIAL_WAKE */
129 159
130extern unsigned int omap730_cpu_suspend_sz;
131extern unsigned int omap730_idle_loop_suspend_sz;
132extern unsigned int omap1510_cpu_suspend_sz;
133extern unsigned int omap1510_idle_loop_suspend_sz;
134extern unsigned int omap1610_cpu_suspend_sz;
135extern unsigned int omap1610_idle_loop_suspend_sz;
136
137#define ARM_SAVE(x) arm_sleep_save[ARM_SLEEP_SAVE_##x] = omap_readl(x) 160#define ARM_SAVE(x) arm_sleep_save[ARM_SLEEP_SAVE_##x] = omap_readl(x)
138#define ARM_RESTORE(x) omap_writel((arm_sleep_save[ARM_SLEEP_SAVE_##x]), (x)) 161#define ARM_RESTORE(x) omap_writel((arm_sleep_save[ARM_SLEEP_SAVE_##x]), (x))
139#define ARM_SHOW(x) arm_sleep_save[ARM_SLEEP_SAVE_##x] 162#define ARM_SHOW(x) arm_sleep_save[ARM_SLEEP_SAVE_##x]
140 163
164#define DSP_SAVE(x) dsp_sleep_save[DSP_SLEEP_SAVE_##x] = __raw_readw(x)
165#define DSP_RESTORE(x) __raw_writew((dsp_sleep_save[DSP_SLEEP_SAVE_##x]), (x))
166#define DSP_SHOW(x) dsp_sleep_save[DSP_SLEEP_SAVE_##x]
167
141#define ULPD_SAVE(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] = omap_readw(x) 168#define ULPD_SAVE(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] = omap_readw(x)
142#define ULPD_RESTORE(x) omap_writew((ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]), (x)) 169#define ULPD_RESTORE(x) omap_writew((ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]), (x))
143#define ULPD_SHOW(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] 170#define ULPD_SHOW(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]
@@ -154,6 +181,10 @@ extern unsigned int omap1610_idle_loop_suspend_sz;
154#define MPUI1610_RESTORE(x) omap_writel((mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x]), (x)) 181#define MPUI1610_RESTORE(x) omap_writel((mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x]), (x))
155#define MPUI1610_SHOW(x) mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x] 182#define MPUI1610_SHOW(x) mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x]
156 183
184#define OMAP24XX_SAVE(x) omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x] = x
185#define OMAP24XX_RESTORE(x) x = omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x]
186#define OMAP24XX_SHOW(x) omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x]
187
157/* 188/*
158 * List of global OMAP registers to preserve. 189 * List of global OMAP registers to preserve.
159 * More ones like CP and general purpose register values are preserved 190 * More ones like CP and general purpose register values are preserved
@@ -176,6 +207,15 @@ enum arm_save_state {
176 ARM_SLEEP_SAVE_SIZE 207 ARM_SLEEP_SAVE_SIZE
177}; 208};
178 209
210enum dsp_save_state {
211 DSP_SLEEP_SAVE_START = 0,
212 /*
213 * DSP registers 16 bits
214 */
215 DSP_SLEEP_SAVE_DSP_IDLECT2,
216 DSP_SLEEP_SAVE_SIZE
217};
218
179enum ulpd_save_state { 219enum ulpd_save_state {
180 ULPD_SLEEP_SAVE_START = 0, 220 ULPD_SLEEP_SAVE_START = 0,
181 /* 221 /*
@@ -254,5 +294,30 @@ enum mpui1610_save_state {
254#endif 294#endif
255}; 295};
256 296
297enum omap24xx_save_state {
298 OMAP24XX_SLEEP_SAVE_START = 0,
299 OMAP24XX_SLEEP_SAVE_INTC_MIR0,
300 OMAP24XX_SLEEP_SAVE_INTC_MIR1,
301 OMAP24XX_SLEEP_SAVE_INTC_MIR2,
302 OMAP24XX_SLEEP_SAVE_CM_FCLKEN1_CORE,
303 OMAP24XX_SLEEP_SAVE_CM_FCLKEN2_CORE,
304 OMAP24XX_SLEEP_SAVE_CM_ICLKEN1_CORE,
305 OMAP24XX_SLEEP_SAVE_CM_ICLKEN2_CORE,
306 OMAP24XX_SLEEP_SAVE_CM_ICLKEN4_CORE,
307 OMAP24XX_SLEEP_SAVE_GPIO1_IRQENABLE1,
308 OMAP24XX_SLEEP_SAVE_GPIO2_IRQENABLE1,
309 OMAP24XX_SLEEP_SAVE_GPIO3_IRQENABLE1,
310 OMAP24XX_SLEEP_SAVE_GPIO4_IRQENABLE1,
311 OMAP24XX_SLEEP_SAVE_GPIO3_OE,
312 OMAP24XX_SLEEP_SAVE_GPIO4_OE,
313 OMAP24XX_SLEEP_SAVE_GPIO3_RISINGDETECT,
314 OMAP24XX_SLEEP_SAVE_GPIO3_FALLINGDETECT,
315 OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SPI1_NCS2,
316 OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_MCBSP1_DX,
317 OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SSI1_FLAG_TX,
318 OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SYS_NIRQW0,
319 OMAP24XX_SLEEP_SAVE_SIZE
320};
321
257#endif /* ASSEMBLER */ 322#endif /* ASSEMBLER */
258#endif /* __ASM_ARCH_OMAP_PM_H */ 323#endif /* __ASM_ARCH_OMAP_PM_H */
diff --git a/include/asm-arm/arch-omap/prcm.h b/include/asm-arm/arch-omap/prcm.h
index 7b48a5cbb15f..7bcaf94bde9f 100644
--- a/include/asm-arm/arch-omap/prcm.h
+++ b/include/asm-arm/arch-omap/prcm.h
@@ -1,5 +1,7 @@
1/* 1/*
2 * prcm.h - Access definations for use in OMAP24XX clock and power management 2 * linux/include/asm-arm/arch-omap/prcm.h
3 *
4 * Access definations for use in OMAP24XX clock and power management
3 * 5 *
4 * Copyright (C) 2005 Texas Instruments, Inc. 6 * Copyright (C) 2005 Texas Instruments, Inc.
5 * 7 *
@@ -21,405 +23,7 @@
21#ifndef __ASM_ARM_ARCH_DPM_PRCM_H 23#ifndef __ASM_ARM_ARCH_DPM_PRCM_H
22#define __ASM_ARM_ARCH_DPM_PRCM_H 24#define __ASM_ARM_ARCH_DPM_PRCM_H
23 25
24/* SET_PERFORMANCE_LEVEL PARAMETERS */ 26u32 omap_prcm_get_reset_sources(void);
25#define PRCM_HALF_SPEED 1
26#define PRCM_FULL_SPEED 2
27
28#ifndef __ASSEMBLER__
29
30#define PRCM_REG32(offset) __REG32(OMAP24XX_PRCM_BASE + (offset))
31
32#define PRCM_REVISION PRCM_REG32(0x000)
33#define PRCM_SYSCONFIG PRCM_REG32(0x010)
34#define PRCM_IRQSTATUS_MPU PRCM_REG32(0x018)
35#define PRCM_IRQENABLE_MPU PRCM_REG32(0x01C)
36#define PRCM_VOLTCTRL PRCM_REG32(0x050)
37#define PRCM_VOLTST PRCM_REG32(0x054)
38#define PRCM_CLKSRC_CTRL PRCM_REG32(0x060)
39#define PRCM_CLKOUT_CTRL PRCM_REG32(0x070)
40#define PRCM_CLKEMUL_CTRL PRCM_REG32(0x078)
41#define PRCM_CLKCFG_CTRL PRCM_REG32(0x080)
42#define PRCM_CLKCFG_STATUS PRCM_REG32(0x084)
43#define PRCM_VOLTSETUP PRCM_REG32(0x090)
44#define PRCM_CLKSSETUP PRCM_REG32(0x094)
45#define PRCM_POLCTRL PRCM_REG32(0x098)
46
47/* GENERAL PURPOSE */
48#define GENERAL_PURPOSE1 PRCM_REG32(0x0B0)
49#define GENERAL_PURPOSE2 PRCM_REG32(0x0B4)
50#define GENERAL_PURPOSE3 PRCM_REG32(0x0B8)
51#define GENERAL_PURPOSE4 PRCM_REG32(0x0BC)
52#define GENERAL_PURPOSE5 PRCM_REG32(0x0C0)
53#define GENERAL_PURPOSE6 PRCM_REG32(0x0C4)
54#define GENERAL_PURPOSE7 PRCM_REG32(0x0C8)
55#define GENERAL_PURPOSE8 PRCM_REG32(0x0CC)
56#define GENERAL_PURPOSE9 PRCM_REG32(0x0D0)
57#define GENERAL_PURPOSE10 PRCM_REG32(0x0D4)
58#define GENERAL_PURPOSE11 PRCM_REG32(0x0D8)
59#define GENERAL_PURPOSE12 PRCM_REG32(0x0DC)
60#define GENERAL_PURPOSE13 PRCM_REG32(0x0E0)
61#define GENERAL_PURPOSE14 PRCM_REG32(0x0E4)
62#define GENERAL_PURPOSE15 PRCM_REG32(0x0E8)
63#define GENERAL_PURPOSE16 PRCM_REG32(0x0EC)
64#define GENERAL_PURPOSE17 PRCM_REG32(0x0F0)
65#define GENERAL_PURPOSE18 PRCM_REG32(0x0F4)
66#define GENERAL_PURPOSE19 PRCM_REG32(0x0F8)
67#define GENERAL_PURPOSE20 PRCM_REG32(0x0FC)
68
69/* MPU */
70#define CM_CLKSEL_MPU PRCM_REG32(0x140)
71#define CM_CLKSTCTRL_MPU PRCM_REG32(0x148)
72#define RM_RSTST_MPU PRCM_REG32(0x158)
73#define PM_WKDEP_MPU PRCM_REG32(0x1C8)
74#define PM_EVGENCTRL_MPU PRCM_REG32(0x1D4)
75#define PM_EVEGENONTIM_MPU PRCM_REG32(0x1D8)
76#define PM_EVEGENOFFTIM_MPU PRCM_REG32(0x1DC)
77#define PM_PWSTCTRL_MPU PRCM_REG32(0x1E0)
78#define PM_PWSTST_MPU PRCM_REG32(0x1E4)
79
80/* CORE */
81#define CM_FCLKEN1_CORE PRCM_REG32(0x200)
82#define CM_FCLKEN2_CORE PRCM_REG32(0x204)
83#define CM_FCLKEN3_CORE PRCM_REG32(0x208)
84#define CM_ICLKEN1_CORE PRCM_REG32(0x210)
85#define CM_ICLKEN2_CORE PRCM_REG32(0x214)
86#define CM_ICLKEN3_CORE PRCM_REG32(0x218)
87#define CM_ICLKEN4_CORE PRCM_REG32(0x21C)
88#define CM_IDLEST1_CORE PRCM_REG32(0x220)
89#define CM_IDLEST2_CORE PRCM_REG32(0x224)
90#define CM_IDLEST3_CORE PRCM_REG32(0x228)
91#define CM_IDLEST4_CORE PRCM_REG32(0x22C)
92#define CM_AUTOIDLE1_CORE PRCM_REG32(0x230)
93#define CM_AUTOIDLE2_CORE PRCM_REG32(0x234)
94#define CM_AUTOIDLE3_CORE PRCM_REG32(0x238)
95#define CM_AUTOIDLE4_CORE PRCM_REG32(0x23C)
96#define CM_CLKSEL1_CORE PRCM_REG32(0x240)
97#define CM_CLKSEL2_CORE PRCM_REG32(0x244)
98#define CM_CLKSTCTRL_CORE PRCM_REG32(0x248)
99#define PM_WKEN1_CORE PRCM_REG32(0x2A0)
100#define PM_WKEN2_CORE PRCM_REG32(0x2A4)
101#define PM_WKST1_CORE PRCM_REG32(0x2B0)
102#define PM_WKST2_CORE PRCM_REG32(0x2B4)
103#define PM_WKDEP_CORE PRCM_REG32(0x2C8)
104#define PM_PWSTCTRL_CORE PRCM_REG32(0x2E0)
105#define PM_PWSTST_CORE PRCM_REG32(0x2E4)
106
107/* GFX */
108#define CM_FCLKEN_GFX PRCM_REG32(0x300)
109#define CM_ICLKEN_GFX PRCM_REG32(0x310)
110#define CM_IDLEST_GFX PRCM_REG32(0x320)
111#define CM_CLKSEL_GFX PRCM_REG32(0x340)
112#define CM_CLKSTCTRL_GFX PRCM_REG32(0x348)
113#define RM_RSTCTRL_GFX PRCM_REG32(0x350)
114#define RM_RSTST_GFX PRCM_REG32(0x358)
115#define PM_WKDEP_GFX PRCM_REG32(0x3C8)
116#define PM_PWSTCTRL_GFX PRCM_REG32(0x3E0)
117#define PM_PWSTST_GFX PRCM_REG32(0x3E4)
118
119/* WAKE-UP */
120#define CM_FCLKEN_WKUP PRCM_REG32(0x400)
121#define CM_ICLKEN_WKUP PRCM_REG32(0x410)
122#define CM_IDLEST_WKUP PRCM_REG32(0x420)
123#define CM_AUTOIDLE_WKUP PRCM_REG32(0x430)
124#define CM_CLKSEL_WKUP PRCM_REG32(0x440)
125#define RM_RSTCTRL_WKUP PRCM_REG32(0x450)
126#define RM_RSTTIME_WKUP PRCM_REG32(0x454)
127#define RM_RSTST_WKUP PRCM_REG32(0x458)
128#define PM_WKEN_WKUP PRCM_REG32(0x4A0)
129#define PM_WKST_WKUP PRCM_REG32(0x4B0)
130
131/* CLOCKS */
132#define CM_CLKEN_PLL PRCM_REG32(0x500)
133#define CM_IDLEST_CKGEN PRCM_REG32(0x520)
134#define CM_AUTOIDLE_PLL PRCM_REG32(0x530)
135#define CM_CLKSEL1_PLL PRCM_REG32(0x540)
136#define CM_CLKSEL2_PLL PRCM_REG32(0x544)
137
138/* DSP */
139#define CM_FCLKEN_DSP PRCM_REG32(0x800)
140#define CM_ICLKEN_DSP PRCM_REG32(0x810)
141#define CM_IDLEST_DSP PRCM_REG32(0x820)
142#define CM_AUTOIDLE_DSP PRCM_REG32(0x830)
143#define CM_CLKSEL_DSP PRCM_REG32(0x840)
144#define CM_CLKSTCTRL_DSP PRCM_REG32(0x848)
145#define RM_RSTCTRL_DSP PRCM_REG32(0x850)
146#define RM_RSTST_DSP PRCM_REG32(0x858)
147#define PM_WKEN_DSP PRCM_REG32(0x8A0)
148#define PM_WKDEP_DSP PRCM_REG32(0x8C8)
149#define PM_PWSTCTRL_DSP PRCM_REG32(0x8E0)
150#define PM_PWSTST_DSP PRCM_REG32(0x8E4)
151#define PRCM_IRQSTATUS_DSP PRCM_REG32(0x8F0)
152#define PRCM_IRQENABLE_DSP PRCM_REG32(0x8F4)
153
154/* IVA */
155#define PRCM_IRQSTATUS_IVA PRCM_REG32(0x8F8)
156#define PRCM_IRQENABLE_IVA PRCM_REG32(0x8FC)
157
158/* Modem on 2430 */
159#define CM_FCLKEN_MDM PRCM_REG32(0xC00)
160#define CM_ICLKEN_MDM PRCM_REG32(0xC10)
161#define CM_IDLEST_MDM PRCM_REG32(0xC20)
162#define CM_CLKSEL_MDM PRCM_REG32(0xC40)
163
164/* FIXME: Move to header for 2430 */
165#define DISP_BASE (OMAP24XX_L4_IO_BASE+0x50000)
166#define DISP_REG32(offset) __REG32(DISP_BASE + (offset))
167
168#define OMAP24XX_GPMC_BASE (L3_24XX_BASE + 0xa000)
169#define GPMC_BASE (OMAP24XX_GPMC_BASE)
170#define GPMC_REG32(offset) __REG32(GPMC_BASE + (offset))
171
172#define GPT1_BASE (OMAP24XX_GPT1)
173#define GPT1_REG32(offset) __REG32(GPT1_BASE + (offset))
174
175/* Misc sysconfig */
176#define DISPC_SYSCONFIG DISP_REG32(0x410)
177#define SPI_BASE (OMAP24XX_L4_IO_BASE+0x98000)
178#define MCSPI1_SYSCONFIG __REG32(SPI_BASE + 0x10)
179#define MCSPI2_SYSCONFIG __REG32(SPI_BASE+0x2000 + 0x10)
180
181//#define DSP_MMU_SYSCONFIG 0x5A000010
182#define CAMERA_MMU_SYSCONFIG __REG32(DISP_BASE+0x2C10)
183//#define IVA_MMU_SYSCONFIG 0x5D000010
184//#define DSP_DMA_SYSCONFIG 0x00FCC02C
185#define CAMERA_DMA_SYSCONFIG __REG32(DISP_BASE+0x282C)
186#define SYSTEM_DMA_SYSCONFIG __REG32(DISP_BASE+0x602C)
187#define GPMC_SYSCONFIG GPMC_REG32(0x010)
188#define MAILBOXES_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x94010)
189#define UART1_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6A054)
190#define UART2_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6C054)
191#define UART3_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6E054)
192//#define IVA_SYSCONFIG 0x5C060010
193#define SDRC_SYSCONFIG __REG32(OMAP24XX_SDRC_BASE+0x10)
194#define SMS_SYSCONFIG __REG32(OMAP24XX_SMS_BASE+0x10)
195#define SSI_SYSCONFIG __REG32(DISP_BASE+0x8010)
196//#define VLYNQ_SYSCONFIG 0x67FFFE10
197
198/* rkw - good cannidates for PM_ to start what nm was trying */
199#define OMAP24XX_GPT2 (OMAP24XX_L4_IO_BASE+0x2A000)
200#define OMAP24XX_GPT3 (OMAP24XX_L4_IO_BASE+0x78000)
201#define OMAP24XX_GPT4 (OMAP24XX_L4_IO_BASE+0x7A000)
202#define OMAP24XX_GPT5 (OMAP24XX_L4_IO_BASE+0x7C000)
203#define OMAP24XX_GPT6 (OMAP24XX_L4_IO_BASE+0x7E000)
204#define OMAP24XX_GPT7 (OMAP24XX_L4_IO_BASE+0x80000)
205#define OMAP24XX_GPT8 (OMAP24XX_L4_IO_BASE+0x82000)
206#define OMAP24XX_GPT9 (OMAP24XX_L4_IO_BASE+0x84000)
207#define OMAP24XX_GPT10 (OMAP24XX_L4_IO_BASE+0x86000)
208#define OMAP24XX_GPT11 (OMAP24XX_L4_IO_BASE+0x88000)
209#define OMAP24XX_GPT12 (OMAP24XX_L4_IO_BASE+0x8A000)
210
211#define GPTIMER1_SYSCONFIG GPT1_REG32(0x010)
212#define GPTIMER2_SYSCONFIG __REG32(OMAP24XX_GPT2 + 0x10)
213#define GPTIMER3_SYSCONFIG __REG32(OMAP24XX_GPT3 + 0x10)
214#define GPTIMER4_SYSCONFIG __REG32(OMAP24XX_GPT4 + 0x10)
215#define GPTIMER5_SYSCONFIG __REG32(OMAP24XX_GPT5 + 0x10)
216#define GPTIMER6_SYSCONFIG __REG32(OMAP24XX_GPT6 + 0x10)
217#define GPTIMER7_SYSCONFIG __REG32(OMAP24XX_GPT7 + 0x10)
218#define GPTIMER8_SYSCONFIG __REG32(OMAP24XX_GPT8 + 0x10)
219#define GPTIMER9_SYSCONFIG __REG32(OMAP24XX_GPT9 + 0x10)
220#define GPTIMER10_SYSCONFIG __REG32(OMAP24XX_GPT10 + 0x10)
221#define GPTIMER11_SYSCONFIG __REG32(OMAP24XX_GPT11 + 0x10)
222#define GPTIMER12_SYSCONFIG __REG32(OMAP24XX_GPT12 + 0x10)
223
224#define GPIOX_BASE(X) (OMAP24XX_GPIO_BASE+(0x2000*((X)-1)))
225
226#define GPIO1_SYSCONFIG __REG32((GPIOX_BASE(1)+0x10))
227#define GPIO2_SYSCONFIG __REG32((GPIOX_BASE(2)+0x10))
228#define GPIO3_SYSCONFIG __REG32((GPIOX_BASE(3)+0x10))
229#define GPIO4_SYSCONFIG __REG32((GPIOX_BASE(4)+0x10))
230
231/* GP TIMER 1 */
232#define GPTIMER1_TISTAT GPT1_REG32(0x014)
233#define GPTIMER1_TISR GPT1_REG32(0x018)
234#define GPTIMER1_TIER GPT1_REG32(0x01C)
235#define GPTIMER1_TWER GPT1_REG32(0x020)
236#define GPTIMER1_TCLR GPT1_REG32(0x024)
237#define GPTIMER1_TCRR GPT1_REG32(0x028)
238#define GPTIMER1_TLDR GPT1_REG32(0x02C)
239#define GPTIMER1_TTGR GPT1_REG32(0x030)
240#define GPTIMER1_TWPS GPT1_REG32(0x034)
241#define GPTIMER1_TMAR GPT1_REG32(0x038)
242#define GPTIMER1_TCAR1 GPT1_REG32(0x03C)
243#define GPTIMER1_TSICR GPT1_REG32(0x040)
244#define GPTIMER1_TCAR2 GPT1_REG32(0x044)
245
246/* rkw -- base fix up please... */
247#define GPTIMER3_TISR __REG32(OMAP24XX_L4_IO_BASE+0x78018)
248
249/* SDRC */
250#define SDRC_DLLA_CTRL __REG32(OMAP24XX_SDRC_BASE+0x060)
251#define SDRC_DLLA_STATUS __REG32(OMAP24XX_SDRC_BASE+0x064)
252#define SDRC_DLLB_CTRL __REG32(OMAP24XX_SDRC_BASE+0x068)
253#define SDRC_DLLB_STATUS __REG32(OMAP24XX_SDRC_BASE+0x06C)
254#define SDRC_POWER __REG32(OMAP24XX_SDRC_BASE+0x070)
255#define SDRC_MR_0 __REG32(OMAP24XX_SDRC_BASE+0x084)
256
257/* GPIO 1 */
258#define GPIO1_BASE GPIOX_BASE(1)
259#define GPIO1_REG32(offset) __REG32(GPIO1_BASE + (offset))
260#define GPIO1_IRQENABLE1 GPIO1_REG32(0x01C)
261#define GPIO1_IRQSTATUS1 GPIO1_REG32(0x018)
262#define GPIO1_IRQENABLE2 GPIO1_REG32(0x02C)
263#define GPIO1_IRQSTATUS2 GPIO1_REG32(0x028)
264#define GPIO1_WAKEUPENABLE GPIO1_REG32(0x020)
265#define GPIO1_RISINGDETECT GPIO1_REG32(0x048)
266#define GPIO1_DATAIN GPIO1_REG32(0x038)
267#define GPIO1_OE GPIO1_REG32(0x034)
268#define GPIO1_DATAOUT GPIO1_REG32(0x03C)
269
270/* GPIO2 */
271#define GPIO2_BASE GPIOX_BASE(2)
272#define GPIO2_REG32(offset) __REG32(GPIO2_BASE + (offset))
273#define GPIO2_IRQENABLE1 GPIO2_REG32(0x01C)
274#define GPIO2_IRQSTATUS1 GPIO2_REG32(0x018)
275#define GPIO2_IRQENABLE2 GPIO2_REG32(0x02C)
276#define GPIO2_IRQSTATUS2 GPIO2_REG32(0x028)
277#define GPIO2_WAKEUPENABLE GPIO2_REG32(0x020)
278#define GPIO2_RISINGDETECT GPIO2_REG32(0x048)
279#define GPIO2_DATAIN GPIO2_REG32(0x038)
280#define GPIO2_OE GPIO2_REG32(0x034)
281#define GPIO2_DATAOUT GPIO2_REG32(0x03C)
282
283/* GPIO 3 */
284#define GPIO3_BASE GPIOX_BASE(3)
285#define GPIO3_REG32(offset) __REG32(GPIO3_BASE + (offset))
286#define GPIO3_IRQENABLE1 GPIO3_REG32(0x01C)
287#define GPIO3_IRQSTATUS1 GPIO3_REG32(0x018)
288#define GPIO3_IRQENABLE2 GPIO3_REG32(0x02C)
289#define GPIO3_IRQSTATUS2 GPIO3_REG32(0x028)
290#define GPIO3_WAKEUPENABLE GPIO3_REG32(0x020)
291#define GPIO3_RISINGDETECT GPIO3_REG32(0x048)
292#define GPIO3_FALLINGDETECT GPIO3_REG32(0x04C)
293#define GPIO3_DATAIN GPIO3_REG32(0x038)
294#define GPIO3_OE GPIO3_REG32(0x034)
295#define GPIO3_DATAOUT GPIO3_REG32(0x03C)
296#define GPIO3_DEBOUNCENABLE GPIO3_REG32(0x050)
297#define GPIO3_DEBOUNCINGTIME GPIO3_REG32(0x054)
298
299/* GPIO 4 */
300#define GPIO4_BASE GPIOX_BASE(4)
301#define GPIO4_REG32(offset) __REG32(GPIO4_BASE + (offset))
302#define GPIO4_IRQENABLE1 GPIO4_REG32(0x01C)
303#define GPIO4_IRQSTATUS1 GPIO4_REG32(0x018)
304#define GPIO4_IRQENABLE2 GPIO4_REG32(0x02C)
305#define GPIO4_IRQSTATUS2 GPIO4_REG32(0x028)
306#define GPIO4_WAKEUPENABLE GPIO4_REG32(0x020)
307#define GPIO4_RISINGDETECT GPIO4_REG32(0x048)
308#define GPIO4_FALLINGDETECT GPIO4_REG32(0x04C)
309#define GPIO4_DATAIN GPIO4_REG32(0x038)
310#define GPIO4_OE GPIO4_REG32(0x034)
311#define GPIO4_DATAOUT GPIO4_REG32(0x03C)
312#define GPIO4_DEBOUNCENABLE GPIO4_REG32(0x050)
313#define GPIO4_DEBOUNCINGTIME GPIO4_REG32(0x054)
314
315
316/* IO CONFIG */
317#define CONTROL_BASE (OMAP24XX_CTRL_BASE)
318#define CONTROL_REG32(offset) __REG32(CONTROL_BASE + (offset))
319
320#define CONTROL_PADCONF_SPI1_NCS2 CONTROL_REG32(0x104)
321#define CONTROL_PADCONF_SYS_XTALOUT CONTROL_REG32(0x134)
322#define CONTROL_PADCONF_UART1_RX CONTROL_REG32(0x0C8)
323#define CONTROL_PADCONF_MCBSP1_DX CONTROL_REG32(0x10C)
324#define CONTROL_PADCONF_GPMC_NCS4 CONTROL_REG32(0x090)
325#define CONTROL_PADCONF_DSS_D5 CONTROL_REG32(0x0B8)
326#define CONTROL_PADCONF_DSS_D9 CONTROL_REG32(0x0BC)
327#define CONTROL_PADCONF_DSS_D13 CONTROL_REG32(0x0C0)
328#define CONTROL_PADCONF_DSS_VSYNC CONTROL_REG32(0x0CC)
329
330/* CONTROL */
331#define CONTROL_DEVCONF CONTROL_REG32(0x274)
332
333/* INTERRUPT CONTROLLER */
334#define INTC_BASE (OMAP24XX_L4_IO_BASE+0xfe000)
335#define INTC_REG32(offset) __REG32(INTC_BASE + (offset))
336
337#define INTC1_U_BASE INTC_REG32(0x000)
338#define INTC_MIR0 INTC_REG32(0x084)
339#define INTC_MIR_SET0 INTC_REG32(0x08C)
340#define INTC_MIR_CLEAR0 INTC_REG32(0x088)
341#define INTC_ISR_CLEAR0 INTC_REG32(0x094)
342#define INTC_MIR1 INTC_REG32(0x0A4)
343#define INTC_MIR_SET1 INTC_REG32(0x0AC)
344#define INTC_MIR_CLEAR1 INTC_REG32(0x0A8)
345#define INTC_ISR_CLEAR1 INTC_REG32(0x0B4)
346#define INTC_MIR2 INTC_REG32(0x0C4)
347#define INTC_MIR_SET2 INTC_REG32(0x0CC)
348#define INTC_MIR_CLEAR2 INTC_REG32(0x0C8)
349#define INTC_ISR_CLEAR2 INTC_REG32(0x0D4)
350#define INTC_SIR_IRQ INTC_REG32(0x040)
351#define INTC_CONTROL INTC_REG32(0x048)
352#define INTC_ILR11 INTC_REG32(0x12C)
353#define INTC_ILR32 INTC_REG32(0x180)
354#define INTC_ILR37 INTC_REG32(0x194)
355#define INTC_SYSCONFIG INTC_REG32(0x010)
356
357/* RAM FIREWALL */
358#define RAMFW_BASE (0x68005000)
359#define RAMFW_REG32(offset) __REG32(RAMFW_BASE + (offset))
360
361#define RAMFW_REQINFOPERM0 RAMFW_REG32(0x048)
362#define RAMFW_READPERM0 RAMFW_REG32(0x050)
363#define RAMFW_WRITEPERM0 RAMFW_REG32(0x058)
364
365/* GPMC CS1 FPGA ON USER INTERFACE MODULE */
366//#define DEBUG_BOARD_LED_REGISTER 0x04000014
367
368/* GPMC CS0 */
369#define GPMC_CONFIG1_0 GPMC_REG32(0x060)
370#define GPMC_CONFIG2_0 GPMC_REG32(0x064)
371#define GPMC_CONFIG3_0 GPMC_REG32(0x068)
372#define GPMC_CONFIG4_0 GPMC_REG32(0x06C)
373#define GPMC_CONFIG5_0 GPMC_REG32(0x070)
374#define GPMC_CONFIG6_0 GPMC_REG32(0x074)
375#define GPMC_CONFIG7_0 GPMC_REG32(0x078)
376
377/* GPMC CS1 */
378#define GPMC_CONFIG1_1 GPMC_REG32(0x090)
379#define GPMC_CONFIG2_1 GPMC_REG32(0x094)
380#define GPMC_CONFIG3_1 GPMC_REG32(0x098)
381#define GPMC_CONFIG4_1 GPMC_REG32(0x09C)
382#define GPMC_CONFIG5_1 GPMC_REG32(0x0a0)
383#define GPMC_CONFIG6_1 GPMC_REG32(0x0a4)
384#define GPMC_CONFIG7_1 GPMC_REG32(0x0a8)
385
386/* DSS */
387#define DSS_CONTROL DISP_REG32(0x040)
388#define DISPC_CONTROL DISP_REG32(0x440)
389#define DISPC_SYSSTATUS DISP_REG32(0x414)
390#define DISPC_IRQSTATUS DISP_REG32(0x418)
391#define DISPC_IRQENABLE DISP_REG32(0x41C)
392#define DISPC_CONFIG DISP_REG32(0x444)
393#define DISPC_DEFAULT_COLOR0 DISP_REG32(0x44C)
394#define DISPC_DEFAULT_COLOR1 DISP_REG32(0x450)
395#define DISPC_TRANS_COLOR0 DISP_REG32(0x454)
396#define DISPC_TRANS_COLOR1 DISP_REG32(0x458)
397#define DISPC_LINE_NUMBER DISP_REG32(0x460)
398#define DISPC_TIMING_H DISP_REG32(0x464)
399#define DISPC_TIMING_V DISP_REG32(0x468)
400#define DISPC_POL_FREQ DISP_REG32(0x46C)
401#define DISPC_DIVISOR DISP_REG32(0x470)
402#define DISPC_SIZE_DIG DISP_REG32(0x478)
403#define DISPC_SIZE_LCD DISP_REG32(0x47C)
404#define DISPC_GFX_BA0 DISP_REG32(0x480)
405#define DISPC_GFX_BA1 DISP_REG32(0x484)
406#define DISPC_GFX_POSITION DISP_REG32(0x488)
407#define DISPC_GFX_SIZE DISP_REG32(0x48C)
408#define DISPC_GFX_ATTRIBUTES DISP_REG32(0x4A0)
409#define DISPC_GFX_FIFO_THRESHOLD DISP_REG32(0x4A4)
410#define DISPC_GFX_ROW_INC DISP_REG32(0x4AC)
411#define DISPC_GFX_PIXEL_INC DISP_REG32(0x4B0)
412#define DISPC_GFX_WINDOW_SKIP DISP_REG32(0x4B4)
413#define DISPC_GFX_TABLE_BA DISP_REG32(0x4B8)
414#define DISPC_DATA_CYCLE1 DISP_REG32(0x5D4)
415#define DISPC_DATA_CYCLE2 DISP_REG32(0x5D8)
416#define DISPC_DATA_CYCLE3 DISP_REG32(0x5DC)
417
418/* Wake up define for board */
419#define GPIO97 (1 << 1)
420#define GPIO88 (1 << 24)
421
422#endif /* __ASSEMBLER__ */
423 27
424#endif 28#endif
425 29
diff --git a/include/asm-arm/arch-omap/sram.h b/include/asm-arm/arch-omap/sram.h
index e72ccbf0fe06..6fc0dd57b7c3 100644
--- a/include/asm-arm/arch-omap/sram.h
+++ b/include/asm-arm/arch-omap/sram.h
@@ -20,6 +20,8 @@ extern void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
20 u32 mem_type); 20 u32 mem_type);
21extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass); 21extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass);
22 22
23extern unsigned long omap_fb_sram_start;
24extern unsigned long omap_fb_sram_size;
23 25
24/* Do not use these */ 26/* Do not use these */
25extern void sram_reprogram_clock(u32 ckctl, u32 dpllctl); 27extern void sram_reprogram_clock(u32 ckctl, u32 dpllctl);
diff --git a/include/asm-arm/arch-omap/system.h b/include/asm-arm/arch-omap/system.h
index 6724a81bd10b..67970d1a2020 100644
--- a/include/asm-arm/arch-omap/system.h
+++ b/include/asm-arm/arch-omap/system.h
@@ -9,12 +9,13 @@
9 9
10#include <asm/mach-types.h> 10#include <asm/mach-types.h>
11#include <asm/hardware.h> 11#include <asm/hardware.h>
12#include <asm/arch/prcm.h>
13 12
14#ifndef CONFIG_MACH_VOICEBLUE 13#ifndef CONFIG_MACH_VOICEBLUE
15#define voiceblue_reset() do {} while (0) 14#define voiceblue_reset() do {} while (0)
16#endif 15#endif
17 16
17extern void omap_prcm_arch_reset(char mode);
18
18static inline void arch_idle(void) 19static inline void arch_idle(void)
19{ 20{
20 cpu_do_idle(); 21 cpu_do_idle();
@@ -38,24 +39,12 @@ static inline void omap1_arch_reset(char mode)
38 omap_writew(1, ARM_RSTCT1); 39 omap_writew(1, ARM_RSTCT1);
39} 40}
40 41
41static inline void omap2_arch_reset(char mode)
42{
43 u32 rate;
44 struct clk *vclk, *sclk;
45
46 vclk = clk_get(NULL, "virt_prcm_set");
47 sclk = clk_get(NULL, "sys_ck");
48 rate = clk_get_rate(sclk);
49 clk_set_rate(vclk, rate); /* go to bypass for OMAP limitation */
50 RM_RSTCTRL_WKUP |= 2;
51}
52
53static inline void arch_reset(char mode) 42static inline void arch_reset(char mode)
54{ 43{
55 if (!cpu_is_omap24xx()) 44 if (!cpu_is_omap24xx())
56 omap1_arch_reset(mode); 45 omap1_arch_reset(mode);
57 else 46 else
58 omap2_arch_reset(mode); 47 omap_prcm_arch_reset(mode);
59} 48}
60 49
61#endif 50#endif
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index 1409c5bd703f..c8f53a71c076 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -485,7 +485,7 @@
485#define SACR1_ENLBF (1 << 5) /* Enable Loopback */ 485#define SACR1_ENLBF (1 << 5) /* Enable Loopback */
486#define SACR1_DRPL (1 << 4) /* Disable Replaying Function */ 486#define SACR1_DRPL (1 << 4) /* Disable Replaying Function */
487#define SACR1_DREC (1 << 3) /* Disable Recording Function */ 487#define SACR1_DREC (1 << 3) /* Disable Recording Function */
488#define SACR1_AMSL (1 << 1) /* Specify Alternate Mode */ 488#define SACR1_AMSL (1 << 0) /* Specify Alternate Mode */
489 489
490#define SASR0_I2SOFF (1 << 7) /* Controller Status */ 490#define SASR0_I2SOFF (1 << 7) /* Controller Status */
491#define SASR0_ROR (1 << 6) /* Rx FIFO Overrun */ 491#define SASR0_ROR (1 << 6) /* Rx FIFO Overrun */
diff --git a/include/asm-arm/arch-pxa/sharpsl.h b/include/asm-arm/arch-pxa/sharpsl.h
index 0b43495d24b4..94cb4982af82 100644
--- a/include/asm-arm/arch-pxa/sharpsl.h
+++ b/include/asm-arm/arch-pxa/sharpsl.h
@@ -27,6 +27,8 @@ struct corgits_machinfo {
27 */ 27 */
28struct corgibl_machinfo { 28struct corgibl_machinfo {
29 int max_intensity; 29 int max_intensity;
30 int default_intensity;
31 int limit_mask;
30 void (*set_bl_intensity)(int intensity); 32 void (*set_bl_intensity)(int intensity);
31}; 33};
32extern void corgibl_limit_intensity(int limit); 34extern void corgibl_limit_intensity(int limit);
diff --git a/include/asm-arm/arch-s3c2410/entry-macro.S b/include/asm-arm/arch-s3c2410/entry-macro.S
index cc06b1bd37b2..894c35cf3b1e 100644
--- a/include/asm-arm/arch-s3c2410/entry-macro.S
+++ b/include/asm-arm/arch-s3c2410/entry-macro.S
@@ -6,116 +6,83 @@
6 * This file is licensed under the terms of the GNU General Public 6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any 7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9*/
10
11/* We have a problem that the INTOFFSET register does not always
12 * show one interrupt. Occasionally we get two interrupts through
13 * the prioritiser, and this causes the INTOFFSET register to show
14 * what looks like the logical-or of the two interrupt numbers.
15 *
16 * Thanks to Klaus, Shannon, et al for helping to debug this problem
17*/
18
19#define INTPND (0x10)
20#define INTOFFSET (0x14)
21#define EXTINTPEND (0xa8)
22#define EXTINTMASK (0xa4)
9 23
10 * Modifications:
11 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
12 */
13#include <asm/hardware.h> 24#include <asm/hardware.h>
14#include <asm/arch/irqs.h> 25#include <asm/arch/irqs.h>
15 26
16
17 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 27 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
18 28
19 mov \tmp, #S3C24XX_VA_IRQ 29 mov \base, #S3C24XX_VA_IRQ
20 ldr \irqnr, [ \tmp, #0x14 ] @ get irq no 30
2130000: 31 ldr \irqstat, [ \base, #INTPND]
22 teq \irqnr, #4 32 bics \irqnr, \irqstat, #3<<4 @@ only an GPIO IRQ
23 teqne \irqnr, #5 33 beq 2000f
24 beq 1002f @ external irq reg 34
25 35 @@ try the interrupt offset register, since it is there
26 @ debug check to see if interrupt reported is the same 36
27 @ as the offset.... 37 ldr \irqnr, [ \base, #INTOFFSET ]
28 38 mov \tmp, #1
29 teq \irqnr, #0 39 tst \irqstat, \tmp, lsl \irqnr
30 beq 20002f 40 addne \irqnr, \irqnr, #IRQ_EINT0
31 ldr \irqstat, [ \tmp, #0x10 ] @ INTPND 41 bne 1001f
32 mov \irqstat, \irqstat, lsr \irqnr 42
33 tst \irqstat, #1 43 @@ the number specified is not a valid irq, so try
34 bne 20002f 44 @@ and work it out for ourselves
35 45
36 /* debug/warning if we get an invalud response from the 46 mov \irqnr, #IRQ_EINT0 @@ start here
37 * INTOFFSET register */ 47 b 3000f
38#if 1 48
39 stmfd r13!, { r0 - r4 , r8-r12, r14 } 492000:
40 ldr r1, [ \tmp, #0x14 ] @ INTOFFSET 50 @@ load the GPIO interrupt register, and check it
41 ldr r2, [ \tmp, #0x10 ] @ INTPND 51
42 ldr r3, [ \tmp, #0x00 ] @ SRCPND 52 add \tmp, \base, #S3C24XX_VA_GPIO - S3C24XX_VA_IRQ
43 adr r0, 20003f 53 ldr \irqstat, [ \tmp, # EXTINTPEND ]
44 bl printk 54 ldr \irqnr, [ \tmp, # EXTINTMASK ]
45 b 20004f 55 bics \irqstat, \irqstat, \irqnr
46 56 beq 1001f
4720003: 57
48 .ascii "<7>irq: err - bad offset %d, intpnd=%08x, srcpnd=%08x\n" 58 mov \irqnr, #(IRQ_EINT4 - 4)
49 .byte 0 59
50 .align 4 60 @@ work out which irq (if any) we got
5120004: 613000:
52 mov r1, #1 62 movs \tmp, \irqstat, lsl#16
53 mov \tmp, #S3C24XX_VA_IRQ 63 addeq \irqnr, \irqnr, #16
54 ldmfd r13!, { r0 - r4 , r8-r12, r14 } 64 moveq \irqstat, \irqstat, lsr#16
55#endif 65 tst \irqstat, #0xff
56 66 addeq \irqnr, \irqnr, #8
57 @ try working out interrupt number for ourselves 67 moveq \irqstat, \irqstat, lsr#8
58 mov \irqnr, #0 68 tst \irqstat, #0xf
59 ldr \irqstat, [ \tmp, #0x10 ] @ INTPND 69 addeq \irqnr, \irqnr, #4
6010021: 70 moveq \irqstat, \irqstat, lsr#4
61 movs \irqstat, \irqstat, lsr#1 71 tst \irqstat, #0x3
62 bcs 30000b @ try and re-start the proccess 72 addeq \irqnr, \irqnr, #2
63 add \irqnr, \irqnr, #1 73 moveq \irqstat, \irqstat, lsr#2
64 cmp \irqnr, #32 74 tst \irqstat, #0x1
65 ble 10021b 75 addeq \irqnr, \irqnr, #1
66 76
67 @ found no interrupt, set Z flag and leave 77 @@ we have the value
68 movs \irqnr, #0 78 movs \irqnr, \irqnr
69 b 1001f 79
70
7120005:
7220002: @ exit
73 @ we base the s3c2410x interrupts at 16 and above to allow
74 @ isa peripherals to have their standard interrupts, also
75 @ ensure that Z flag is un-set on exit
76
77 @ note, we cannot be sure if we get IRQ_EINT0 (0) that
78 @ there is simply no interrupt pending, so in all other
79 @ cases we jump to say we have found something, otherwise
80 @ we check to see if the interrupt really is assrted
81 adds \irqnr, \irqnr, #IRQ_EINT0
82 teq \irqnr, #IRQ_EINT0
83 bne 1001f @ exit
84 ldr \irqstat, [ \tmp, #0x10 ] @ INTPND
85 teq \irqstat, #0
86 moveq \irqnr, #0
87 b 1001f
88
89 @ we get here from no main or external interrupts pending
901002:
91 add \tmp, \tmp, #S3C24XX_VA_GPIO - S3C24XX_VA_IRQ
92 ldr \irqstat, [ \tmp, # 0xa8 ] @ EXTINTPEND
93 ldr \irqnr, [ \tmp, # 0xa4 ] @ EXTINTMASK
94
95 bic \irqstat, \irqstat, \irqnr @ clear masked irqs
96
97 mov \irqnr, #IRQ_EINT4 @ start extint nos
98 mov \irqstat, \irqstat, lsr#4 @ ignore bottom 4 bits
9910021:
100 movs \irqstat, \irqstat, lsr#1
101 bcs 1004f
102 add \irqnr, \irqnr, #1
103 cmp \irqnr, #IRQ_EINT23
104 ble 10021b
105
106 @ found no interrupt, set Z flag and leave
107 movs \irqnr, #0
108
1091004: @ ensure Z flag clear in case our MOVS shifted out the last bit
110 teq \irqnr, #0
1111001: 801001:
112 @ exit irq routine 81 @@ exit here, Z flag unset if IRQ
113 .endm
114 82
83 .endm
115 84
116 /* currently don't need an disable_fiq macro */ 85 /* currently don't need an disable_fiq macro */
117 86
118 .macro disable_fiq 87 .macro disable_fiq
119 .endm 88 .endm
120
121
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h
index e3e8541ee63b..63ca7412a462 100644
--- a/include/asm-arm/dma-mapping.h
+++ b/include/asm-arm/dma-mapping.h
@@ -47,7 +47,7 @@ static inline int dma_get_cache_alignment(void)
47 47
48static inline int dma_is_consistent(dma_addr_t handle) 48static inline int dma_is_consistent(dma_addr_t handle)
49{ 49{
50 return 0; 50 return !!arch_is_coherent();
51} 51}
52 52
53/* 53/*
@@ -145,7 +145,9 @@ static inline dma_addr_t
145dma_map_single(struct device *dev, void *cpu_addr, size_t size, 145dma_map_single(struct device *dev, void *cpu_addr, size_t size,
146 enum dma_data_direction dir) 146 enum dma_data_direction dir)
147{ 147{
148 consistent_sync(cpu_addr, size, dir); 148 if (!arch_is_coherent())
149 consistent_sync(cpu_addr, size, dir);
150
149 return virt_to_dma(dev, (unsigned long)cpu_addr); 151 return virt_to_dma(dev, (unsigned long)cpu_addr);
150} 152}
151#else 153#else
@@ -255,7 +257,9 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
255 257
256 sg->dma_address = page_to_dma(dev, sg->page) + sg->offset; 258 sg->dma_address = page_to_dma(dev, sg->page) + sg->offset;
257 virt = page_address(sg->page) + sg->offset; 259 virt = page_address(sg->page) + sg->offset;
258 consistent_sync(virt, sg->length, dir); 260
261 if (!arch_is_coherent())
262 consistent_sync(virt, sg->length, dir);
259 } 263 }
260 264
261 return nents; 265 return nents;
@@ -310,14 +314,16 @@ static inline void
310dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, 314dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size,
311 enum dma_data_direction dir) 315 enum dma_data_direction dir)
312{ 316{
313 consistent_sync((void *)dma_to_virt(dev, handle), size, dir); 317 if (!arch_is_coherent())
318 consistent_sync((void *)dma_to_virt(dev, handle), size, dir);
314} 319}
315 320
316static inline void 321static inline void
317dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size, 322dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size,
318 enum dma_data_direction dir) 323 enum dma_data_direction dir)
319{ 324{
320 consistent_sync((void *)dma_to_virt(dev, handle), size, dir); 325 if (!arch_is_coherent())
326 consistent_sync((void *)dma_to_virt(dev, handle), size, dir);
321} 327}
322#else 328#else
323extern void dma_sync_single_for_cpu(struct device*, dma_addr_t, size_t, enum dma_data_direction); 329extern void dma_sync_single_for_cpu(struct device*, dma_addr_t, size_t, enum dma_data_direction);
@@ -347,7 +353,8 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents,
347 353
348 for (i = 0; i < nents; i++, sg++) { 354 for (i = 0; i < nents; i++, sg++) {
349 char *virt = page_address(sg->page) + sg->offset; 355 char *virt = page_address(sg->page) + sg->offset;
350 consistent_sync(virt, sg->length, dir); 356 if (!arch_is_coherent())
357 consistent_sync(virt, sg->length, dir);
351 } 358 }
352} 359}
353 360
@@ -359,7 +366,8 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents,
359 366
360 for (i = 0; i < nents; i++, sg++) { 367 for (i = 0; i < nents; i++, sg++) {
361 char *virt = page_address(sg->page) + sg->offset; 368 char *virt = page_address(sg->page) + sg->offset;
362 consistent_sync(virt, sg->length, dir); 369 if (!arch_is_coherent())
370 consistent_sync(virt, sg->length, dir);
363 } 371 }
364} 372}
365#else 373#else
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
index afa5c3ea077c..2b3cf69b3ed9 100644
--- a/include/asm-arm/memory.h
+++ b/include/asm-arm/memory.h
@@ -234,6 +234,14 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
234#define virt_to_dma(dev, addr) (__arch_virt_to_dma(dev, addr)) 234#define virt_to_dma(dev, addr) (__arch_virt_to_dma(dev, addr))
235#endif 235#endif
236 236
237/*
238 * Optional coherency support. Currently used only by selected
239 * Intel XSC3-based systems.
240 */
241#ifndef arch_is_coherent
242#define arch_is_coherent() 0
243#endif
244
237#endif 245#endif
238 246
239#include <asm-generic/memory_model.h> 247#include <asm-generic/memory_model.h>
diff --git a/include/asm-arm/pgtable-hwdef.h b/include/asm-arm/pgtable-hwdef.h
index 1d033495cc75..1bc1f997bda2 100644
--- a/include/asm-arm/pgtable-hwdef.h
+++ b/include/asm-arm/pgtable-hwdef.h
@@ -73,6 +73,7 @@
73#define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0) 73#define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0)
74#define PTE_EXT_TEX(x) ((x) << 6) /* v5 */ 74#define PTE_EXT_TEX(x) ((x) << 6) /* v5 */
75#define PTE_EXT_APX (1 << 9) /* v6 */ 75#define PTE_EXT_APX (1 << 9) /* v6 */
76#define PTE_EXT_COHERENT (1 << 9) /* XScale3 */
76#define PTE_EXT_SHARED (1 << 10) /* v6 */ 77#define PTE_EXT_SHARED (1 << 10) /* v6 */
77#define PTE_EXT_NG (1 << 11) /* v6 */ 78#define PTE_EXT_NG (1 << 11) /* v6 */
78 79
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
index e595ae24efe2..e85c08d78dda 100644
--- a/include/asm-arm/pgtable.h
+++ b/include/asm-arm/pgtable.h
@@ -156,6 +156,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val);
156#define L_PTE_WRITE (1 << 5) 156#define L_PTE_WRITE (1 << 5)
157#define L_PTE_EXEC (1 << 6) 157#define L_PTE_EXEC (1 << 6)
158#define L_PTE_DIRTY (1 << 7) 158#define L_PTE_DIRTY (1 << 7)
159#define L_PTE_COHERENT (1 << 9) /* I/O coherent (xsc3) */
159#define L_PTE_SHARED (1 << 10) /* shared between CPUs (v6) */ 160#define L_PTE_SHARED (1 << 10) /* shared between CPUs (v6) */
160#define L_PTE_ASID (1 << 11) /* non-global (use ASID, v6) */ 161#define L_PTE_ASID (1 << 11) /* non-global (use ASID, v6) */
161 162
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index 8f331bbd39a8..65ac305c2d45 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -308,8 +308,6 @@
308#define __NR_mq_notify (__NR_SYSCALL_BASE+278) 308#define __NR_mq_notify (__NR_SYSCALL_BASE+278)
309#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279) 309#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279)
310#define __NR_waitid (__NR_SYSCALL_BASE+280) 310#define __NR_waitid (__NR_SYSCALL_BASE+280)
311
312#if defined(__ARM_EABI__) /* reserve these for un-muxing socketcall */
313#define __NR_socket (__NR_SYSCALL_BASE+281) 311#define __NR_socket (__NR_SYSCALL_BASE+281)
314#define __NR_bind (__NR_SYSCALL_BASE+282) 312#define __NR_bind (__NR_SYSCALL_BASE+282)
315#define __NR_connect (__NR_SYSCALL_BASE+283) 313#define __NR_connect (__NR_SYSCALL_BASE+283)
@@ -327,9 +325,6 @@
327#define __NR_getsockopt (__NR_SYSCALL_BASE+295) 325#define __NR_getsockopt (__NR_SYSCALL_BASE+295)
328#define __NR_sendmsg (__NR_SYSCALL_BASE+296) 326#define __NR_sendmsg (__NR_SYSCALL_BASE+296)
329#define __NR_recvmsg (__NR_SYSCALL_BASE+297) 327#define __NR_recvmsg (__NR_SYSCALL_BASE+297)
330#endif
331
332#if defined(__ARM_EABI__) /* reserve these for un-muxing ipc */
333#define __NR_semop (__NR_SYSCALL_BASE+298) 328#define __NR_semop (__NR_SYSCALL_BASE+298)
334#define __NR_semget (__NR_SYSCALL_BASE+299) 329#define __NR_semget (__NR_SYSCALL_BASE+299)
335#define __NR_semctl (__NR_SYSCALL_BASE+300) 330#define __NR_semctl (__NR_SYSCALL_BASE+300)
@@ -341,16 +336,10 @@
341#define __NR_shmdt (__NR_SYSCALL_BASE+306) 336#define __NR_shmdt (__NR_SYSCALL_BASE+306)
342#define __NR_shmget (__NR_SYSCALL_BASE+307) 337#define __NR_shmget (__NR_SYSCALL_BASE+307)
343#define __NR_shmctl (__NR_SYSCALL_BASE+308) 338#define __NR_shmctl (__NR_SYSCALL_BASE+308)
344#endif
345
346#define __NR_add_key (__NR_SYSCALL_BASE+309) 339#define __NR_add_key (__NR_SYSCALL_BASE+309)
347#define __NR_request_key (__NR_SYSCALL_BASE+310) 340#define __NR_request_key (__NR_SYSCALL_BASE+310)
348#define __NR_keyctl (__NR_SYSCALL_BASE+311) 341#define __NR_keyctl (__NR_SYSCALL_BASE+311)
349
350#if defined(__ARM_EABI__) /* reserved for un-muxing ipc */
351#define __NR_semtimedop (__NR_SYSCALL_BASE+312) 342#define __NR_semtimedop (__NR_SYSCALL_BASE+312)
352#endif
353
354#define __NR_vserver (__NR_SYSCALL_BASE+313) 343#define __NR_vserver (__NR_SYSCALL_BASE+313)
355#define __NR_ioprio_set (__NR_SYSCALL_BASE+314) 344#define __NR_ioprio_set (__NR_SYSCALL_BASE+314)
356#define __NR_ioprio_get (__NR_SYSCALL_BASE+315) 345#define __NR_ioprio_get (__NR_SYSCALL_BASE+315)
diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h
index de4614840c2c..9291c24f5819 100644
--- a/include/asm-generic/local.h
+++ b/include/asm-generic/local.h
@@ -7,8 +7,15 @@
7#include <asm/atomic.h> 7#include <asm/atomic.h>
8#include <asm/types.h> 8#include <asm/types.h>
9 9
10/* An unsigned long type for operations which are atomic for a single 10/*
11 * CPU. Usually used in combination with per-cpu variables. */ 11 * A signed long type for operations which are atomic for a single CPU.
12 * Usually used in combination with per-cpu variables.
13 *
14 * This is the default implementation, which uses atomic_long_t. Which is
15 * rather pointless. The whole point behind local_t is that some processors
16 * can perform atomic adds and subtracts in a manner which is atomic wrt IRQs
17 * running on this CPU. local_t allows exploitation of such capabilities.
18 */
12 19
13/* Implement in terms of atomics. */ 20/* Implement in terms of atomics. */
14 21
@@ -20,7 +27,7 @@ typedef struct
20 27
21#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) } 28#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) }
22 29
23#define local_read(l) ((unsigned long)atomic_long_read(&(l)->a)) 30#define local_read(l) atomic_long_read(&(l)->a)
24#define local_set(l,i) atomic_long_set((&(l)->a),(i)) 31#define local_set(l,i) atomic_long_set((&(l)->a),(i))
25#define local_inc(l) atomic_long_inc(&(l)->a) 32#define local_inc(l) atomic_long_inc(&(l)->a)
26#define local_dec(l) atomic_long_dec(&(l)->a) 33#define local_dec(l) atomic_long_dec(&(l)->a)
diff --git a/include/asm-generic/mutex-dec.h b/include/asm-generic/mutex-dec.h
index 40c6d1f86598..29c6ac34e236 100644
--- a/include/asm-generic/mutex-dec.h
+++ b/include/asm-generic/mutex-dec.h
@@ -17,13 +17,14 @@
17 * it wasn't 1 originally. This function MUST leave the value lower than 17 * it wasn't 1 originally. This function MUST leave the value lower than
18 * 1 even when the "1" assertion wasn't true. 18 * 1 even when the "1" assertion wasn't true.
19 */ 19 */
20#define __mutex_fastpath_lock(count, fail_fn) \ 20static inline void
21do { \ 21__mutex_fastpath_lock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *))
22 if (unlikely(atomic_dec_return(count) < 0)) \ 22{
23 fail_fn(count); \ 23 if (unlikely(atomic_dec_return(count) < 0))
24 else \ 24 fail_fn(count);
25 smp_mb(); \ 25 else
26} while (0) 26 smp_mb();
27}
27 28
28/** 29/**
29 * __mutex_fastpath_lock_retval - try to take the lock by moving the count 30 * __mutex_fastpath_lock_retval - try to take the lock by moving the count
@@ -36,7 +37,7 @@ do { \
36 * or anything the slow path function returns. 37 * or anything the slow path function returns.
37 */ 38 */
38static inline int 39static inline int
39__mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *)) 40__mutex_fastpath_lock_retval(atomic_t *count, fastcall int (*fail_fn)(atomic_t *))
40{ 41{
41 if (unlikely(atomic_dec_return(count) < 0)) 42 if (unlikely(atomic_dec_return(count) < 0))
42 return fail_fn(count); 43 return fail_fn(count);
@@ -59,12 +60,13 @@ __mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *))
59 * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs 60 * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs
60 * to return 0 otherwise. 61 * to return 0 otherwise.
61 */ 62 */
62#define __mutex_fastpath_unlock(count, fail_fn) \ 63static inline void
63do { \ 64__mutex_fastpath_unlock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *))
64 smp_mb(); \ 65{
65 if (unlikely(atomic_inc_return(count) <= 0)) \ 66 smp_mb();
66 fail_fn(count); \ 67 if (unlikely(atomic_inc_return(count) <= 0))
67} while (0) 68 fail_fn(count);
69}
68 70
69#define __mutex_slowpath_needs_to_unlock() 1 71#define __mutex_slowpath_needs_to_unlock() 1
70 72
diff --git a/include/asm-generic/mutex-xchg.h b/include/asm-generic/mutex-xchg.h
index 1d24f47e6c48..32a2100c1aeb 100644
--- a/include/asm-generic/mutex-xchg.h
+++ b/include/asm-generic/mutex-xchg.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Generic implementation of the mutex fastpath, based on xchg(). 4 * Generic implementation of the mutex fastpath, based on xchg().
5 * 5 *
6 * NOTE: An xchg based implementation is less optimal than an atomic 6 * NOTE: An xchg based implementation might be less optimal than an atomic
7 * decrement/increment based implementation. If your architecture 7 * decrement/increment based implementation. If your architecture
8 * has a reasonable atomic dec/inc then you should probably use 8 * has a reasonable atomic dec/inc then you should probably use
9 * asm-generic/mutex-dec.h instead, or you could open-code an 9 * asm-generic/mutex-dec.h instead, or you could open-code an
@@ -22,14 +22,14 @@
22 * wasn't 1 originally. This function MUST leave the value lower than 1 22 * wasn't 1 originally. This function MUST leave the value lower than 1
23 * even when the "1" assertion wasn't true. 23 * even when the "1" assertion wasn't true.
24 */ 24 */
25#define __mutex_fastpath_lock(count, fail_fn) \ 25static inline void
26do { \ 26__mutex_fastpath_lock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *))
27 if (unlikely(atomic_xchg(count, 0) != 1)) \ 27{
28 fail_fn(count); \ 28 if (unlikely(atomic_xchg(count, 0) != 1))
29 else \ 29 fail_fn(count);
30 smp_mb(); \ 30 else
31} while (0) 31 smp_mb();
32 32}
33 33
34/** 34/**
35 * __mutex_fastpath_lock_retval - try to take the lock by moving the count 35 * __mutex_fastpath_lock_retval - try to take the lock by moving the count
@@ -42,7 +42,7 @@ do { \
42 * or anything the slow path function returns 42 * or anything the slow path function returns
43 */ 43 */
44static inline int 44static inline int
45__mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *)) 45__mutex_fastpath_lock_retval(atomic_t *count, fastcall int (*fail_fn)(atomic_t *))
46{ 46{
47 if (unlikely(atomic_xchg(count, 0) != 1)) 47 if (unlikely(atomic_xchg(count, 0) != 1))
48 return fail_fn(count); 48 return fail_fn(count);
@@ -64,12 +64,13 @@ __mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *))
64 * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs 64 * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs
65 * to return 0 otherwise. 65 * to return 0 otherwise.
66 */ 66 */
67#define __mutex_fastpath_unlock(count, fail_fn) \ 67static inline void
68do { \ 68__mutex_fastpath_unlock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *))
69 smp_mb(); \ 69{
70 if (unlikely(atomic_xchg(count, 1) != 0)) \ 70 smp_mb();
71 fail_fn(count); \ 71 if (unlikely(atomic_xchg(count, 1) != 0))
72} while (0) 72 fail_fn(count);
73}
73 74
74#define __mutex_slowpath_needs_to_unlock() 0 75#define __mutex_slowpath_needs_to_unlock() 0
75 76
diff --git a/include/asm-i386/apicdef.h b/include/asm-i386/apicdef.h
index 03185cef8e0a..5e4a35af2921 100644
--- a/include/asm-i386/apicdef.h
+++ b/include/asm-i386/apicdef.h
@@ -37,6 +37,7 @@
37#define APIC_SPIV_FOCUS_DISABLED (1<<9) 37#define APIC_SPIV_FOCUS_DISABLED (1<<9)
38#define APIC_SPIV_APIC_ENABLED (1<<8) 38#define APIC_SPIV_APIC_ENABLED (1<<8)
39#define APIC_ISR 0x100 39#define APIC_ISR 0x100
40#define APIC_ISR_NR 0x8 /* Number of 32 bit ISR registers. */
40#define APIC_TMR 0x180 41#define APIC_TMR 0x180
41#define APIC_IRR 0x200 42#define APIC_IRR 0x200
42#define APIC_ESR 0x280 43#define APIC_ESR 0x280
diff --git a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h
index 79727afb94c9..03403045c182 100644
--- a/include/asm-i386/floppy.h
+++ b/include/asm-i386/floppy.h
@@ -56,7 +56,6 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
56 register unsigned char st; 56 register unsigned char st;
57 57
58#undef TRACE_FLPY_INT 58#undef TRACE_FLPY_INT
59#define NO_FLOPPY_ASSEMBLER
60 59
61#ifdef TRACE_FLPY_INT 60#ifdef TRACE_FLPY_INT
62 static int calls=0; 61 static int calls=0;
@@ -71,38 +70,6 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
71 bytes = virtual_dma_count; 70 bytes = virtual_dma_count;
72#endif 71#endif
73 72
74#ifndef NO_FLOPPY_ASSEMBLER
75 __asm__ (
76 "testl %1,%1"
77 "je 3f"
78"1: inb %w4,%b0"
79 "andb $160,%b0"
80 "cmpb $160,%b0"
81 "jne 2f"
82 "incw %w4"
83 "testl %3,%3"
84 "jne 4f"
85 "inb %w4,%b0"
86 "movb %0,(%2)"
87 "jmp 5f"
88"4: movb (%2),%0"
89 "outb %b0,%w4"
90"5: decw %w4"
91 "outb %0,$0x80"
92 "decl %1"
93 "incl %2"
94 "testl %1,%1"
95 "jne 1b"
96"3: inb %w4,%b0"
97"2: "
98 : "=a" ((char) st),
99 "=c" ((long) virtual_dma_count),
100 "=S" ((long) virtual_dma_addr)
101 : "b" ((long) virtual_dma_mode),
102 "d" ((short) virtual_dma_port+4),
103 "1" ((long) virtual_dma_count),
104 "2" ((long) virtual_dma_addr));
105#else
106 { 73 {
107 register int lcount; 74 register int lcount;
108 register char *lptr; 75 register char *lptr;
@@ -122,7 +89,6 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
122 virtual_dma_addr = lptr; 89 virtual_dma_addr = lptr;
123 st = inb(virtual_dma_port+4); 90 st = inb(virtual_dma_port+4);
124 } 91 }
125#endif
126 92
127#ifdef TRACE_FLPY_INT 93#ifdef TRACE_FLPY_INT
128 calls++; 94 calls++;
diff --git a/include/asm-i386/local.h b/include/asm-i386/local.h
index 0177da80dde3..e67fa08260fe 100644
--- a/include/asm-i386/local.h
+++ b/include/asm-i386/local.h
@@ -5,7 +5,7 @@
5 5
6typedef struct 6typedef struct
7{ 7{
8 volatile unsigned long counter; 8 volatile long counter;
9} local_t; 9} local_t;
10 10
11#define LOCAL_INIT(i) { (i) } 11#define LOCAL_INIT(i) { (i) }
@@ -29,7 +29,7 @@ static __inline__ void local_dec(local_t *v)
29 :"m" (v->counter)); 29 :"m" (v->counter));
30} 30}
31 31
32static __inline__ void local_add(unsigned long i, local_t *v) 32static __inline__ void local_add(long i, local_t *v)
33{ 33{
34 __asm__ __volatile__( 34 __asm__ __volatile__(
35 "addl %1,%0" 35 "addl %1,%0"
@@ -37,7 +37,7 @@ static __inline__ void local_add(unsigned long i, local_t *v)
37 :"ir" (i), "m" (v->counter)); 37 :"ir" (i), "m" (v->counter));
38} 38}
39 39
40static __inline__ void local_sub(unsigned long i, local_t *v) 40static __inline__ void local_sub(long i, local_t *v)
41{ 41{
42 __asm__ __volatile__( 42 __asm__ __volatile__(
43 "subl %1,%0" 43 "subl %1,%0"
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index 789e9bdd0a40..2e7f3e257fdd 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -319,8 +319,9 @@
319#define __NR_set_robust_list 311 319#define __NR_set_robust_list 311
320#define __NR_get_robust_list 312 320#define __NR_get_robust_list 312
321#define __NR_sys_splice 313 321#define __NR_sys_splice 313
322#define __NR_sys_sync_file_range 314
322 323
323#define NR_syscalls 314 324#define NR_syscalls 315
324 325
325/* 326/*
326 * user-visible error numbers are in the range -1 - -128: see 327 * user-visible error numbers are in the range -1 - -128: see
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h
index 4e7e6f23b08c..37e52a2836b0 100644
--- a/include/asm-ia64/pal.h
+++ b/include/asm-ia64/pal.h
@@ -68,6 +68,7 @@
68#define PAL_SHUTDOWN 40 /* enter processor shutdown state */ 68#define PAL_SHUTDOWN 40 /* enter processor shutdown state */
69#define PAL_PREFETCH_VISIBILITY 41 /* Make Processor Prefetches Visible */ 69#define PAL_PREFETCH_VISIBILITY 41 /* Make Processor Prefetches Visible */
70#define PAL_LOGICAL_TO_PHYSICAL 42 /* returns information on logical to physical processor mapping */ 70#define PAL_LOGICAL_TO_PHYSICAL 42 /* returns information on logical to physical processor mapping */
71#define PAL_CACHE_SHARED_INFO 43 /* returns information on caches shared by logical processor */
71 72
72#define PAL_COPY_PAL 256 /* relocate PAL procedures and PAL PMI */ 73#define PAL_COPY_PAL 256 /* relocate PAL procedures and PAL PMI */
73#define PAL_HALT_INFO 257 /* return the low power capabilities of processor */ 74#define PAL_HALT_INFO 257 /* return the low power capabilities of processor */
@@ -130,7 +131,7 @@ typedef u64 pal_cache_line_state_t;
130#define PAL_CACHE_LINE_STATE_MODIFIED 3 /* Modified */ 131#define PAL_CACHE_LINE_STATE_MODIFIED 3 /* Modified */
131 132
132typedef struct pal_freq_ratio { 133typedef struct pal_freq_ratio {
133 u64 den : 32, num : 32; /* numerator & denominator */ 134 u32 den, num; /* numerator & denominator */
134} itc_ratio, proc_ratio; 135} itc_ratio, proc_ratio;
135 136
136typedef union pal_cache_config_info_1_s { 137typedef union pal_cache_config_info_1_s {
@@ -151,10 +152,10 @@ typedef union pal_cache_config_info_1_s {
151 152
152typedef union pal_cache_config_info_2_s { 153typedef union pal_cache_config_info_2_s {
153 struct { 154 struct {
154 u64 cache_size : 32, /*cache size in bytes*/ 155 u32 cache_size; /*cache size in bytes*/
155 156
156 157
157 alias_boundary : 8, /* 39-32 aliased addr 158 u32 alias_boundary : 8, /* 39-32 aliased addr
158 * separation for max 159 * separation for max
159 * performance. 160 * performance.
160 */ 161 */
@@ -1647,6 +1648,33 @@ ia64_pal_logical_to_phys(u64 proc_number, pal_logical_to_physical_t *mapping)
1647 1648
1648 return iprv.status; 1649 return iprv.status;
1649} 1650}
1651
1652typedef struct pal_cache_shared_info_s
1653{
1654 u64 num_shared;
1655 pal_proc_n_log_info1_t ppli1;
1656 pal_proc_n_log_info2_t ppli2;
1657} pal_cache_shared_info_t;
1658
1659/* Get information on logical to physical processor mappings. */
1660static inline s64
1661ia64_pal_cache_shared_info(u64 level,
1662 u64 type,
1663 u64 proc_number,
1664 pal_cache_shared_info_t *info)
1665{
1666 struct ia64_pal_retval iprv;
1667
1668 PAL_CALL(iprv, PAL_CACHE_SHARED_INFO, level, type, proc_number);
1669
1670 if (iprv.status == PAL_STATUS_SUCCESS) {
1671 info->num_shared = iprv.v0;
1672 info->ppli1.ppli1_data = iprv.v1;
1673 info->ppli2.ppli2_data = iprv.v2;
1674 }
1675
1676 return iprv.status;
1677}
1650#endif /* __ASSEMBLY__ */ 1678#endif /* __ASSEMBLY__ */
1651 1679
1652#endif /* _ASM_IA64_PAL_H */ 1680#endif /* _ASM_IA64_PAL_H */
diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h
index 5207758a6dd9..868c7139dbff 100644
--- a/include/asm-powerpc/eeh.h
+++ b/include/asm-powerpc/eeh.h
@@ -60,24 +60,10 @@ void __init pci_addr_cache_build(void);
60 * device (including config space i/o). Call eeh_add_device_late 60 * device (including config space i/o). Call eeh_add_device_late
61 * to finish the eeh setup for this device. 61 * to finish the eeh setup for this device.
62 */ 62 */
63void eeh_add_device_early(struct device_node *);
64void eeh_add_device_late(struct pci_dev *dev);
65void eeh_add_device_tree_early(struct device_node *); 63void eeh_add_device_tree_early(struct device_node *);
66void eeh_add_device_tree_late(struct pci_bus *); 64void eeh_add_device_tree_late(struct pci_bus *);
67 65
68/** 66/**
69 * eeh_remove_device - undo EEH setup for the indicated pci device
70 * @dev: pci device to be removed
71 *
72 * This routine should be called when a device is removed from
73 * a running system (e.g. by hotplug or dlpar). It unregisters
74 * the PCI device from the EEH subsystem. I/O errors affecting
75 * this device will no longer be detected after this call; thus,
76 * i/o errors affecting this slot may leave this device unusable.
77 */
78void eeh_remove_device(struct pci_dev *);
79
80/**
81 * eeh_remove_device_recursive - undo EEH for device & children. 67 * eeh_remove_device_recursive - undo EEH for device & children.
82 * @dev: pci device to be removed 68 * @dev: pci device to be removed
83 * 69 *
@@ -116,12 +102,6 @@ static inline int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *d
116 102
117static inline void pci_addr_cache_build(void) { } 103static inline void pci_addr_cache_build(void) { }
118 104
119static inline void eeh_add_device_early(struct device_node *dn) { }
120
121static inline void eeh_add_device_late(struct pci_dev *dev) { }
122
123static inline void eeh_remove_device(struct pci_dev *dev) { }
124
125static inline void eeh_add_device_tree_early(struct device_node *dn) { } 105static inline void eeh_add_device_tree_early(struct device_node *dn) { }
126 106
127static inline void eeh_add_device_tree_late(struct pci_bus *bus) { } 107static inline void eeh_add_device_tree_late(struct pci_bus *bus) { }
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h
index b72c04f3f551..6cc7e1fb7bfd 100644
--- a/include/asm-powerpc/hvcall.h
+++ b/include/asm-powerpc/hvcall.h
@@ -4,47 +4,88 @@
4 4
5#define HVSC .long 0x44000022 5#define HVSC .long 0x44000022
6 6
7#define H_Success 0 7#define H_SUCCESS 0
8#define H_Busy 1 /* Hardware busy -- retry later */ 8#define H_BUSY 1 /* Hardware busy -- retry later */
9#define H_Closed 2 /* Resource closed */ 9#define H_CLOSED 2 /* Resource closed */
10#define H_Constrained 4 /* Resource request constrained to max allowed */ 10#define H_NOT_AVAILABLE 3
11#define H_InProgress 14 /* Kind of like busy */ 11#define H_CONSTRAINED 4 /* Resource request constrained to max allowed */
12#define H_Pending 17 /* returned from H_POLL_PENDING */ 12#define H_PARTIAL 5
13#define H_Continue 18 /* Returned from H_Join on success */ 13#define H_IN_PROGRESS 14 /* Kind of like busy */
14#define H_LongBusyStartRange 9900 /* Start of long busy range */ 14#define H_PAGE_REGISTERED 15
15#define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */ 15#define H_PARTIAL_STORE 16
16#define H_LongBusyOrder10msec 9901 /* Long busy, hint that 10msec is a good time to retry */ 16#define H_PENDING 17 /* returned from H_POLL_PENDING */
17#define H_LongBusyOrder100msec 9902 /* Long busy, hint that 100msec is a good time to retry */ 17#define H_CONTINUE 18 /* Returned from H_Join on success */
18#define H_LongBusyOrder1sec 9903 /* Long busy, hint that 1sec is a good time to retry */ 18#define H_LONG_BUSY_START_RANGE 9900 /* Start of long busy range */
19#define H_LongBusyOrder10sec 9904 /* Long busy, hint that 10sec is a good time to retry */ 19#define H_LONG_BUSY_ORDER_1_MSEC 9900 /* Long busy, hint that 1msec \
20#define H_LongBusyOrder100sec 9905 /* Long busy, hint that 100sec is a good time to retry */ 20 is a good time to retry */
21#define H_LongBusyEndRange 9905 /* End of long busy range */ 21#define H_LONG_BUSY_ORDER_10_MSEC 9901 /* Long busy, hint that 10msec \
22#define H_Hardware -1 /* Hardware error */ 22 is a good time to retry */
23#define H_Function -2 /* Function not supported */ 23#define H_LONG_BUSY_ORDER_100_MSEC 9902 /* Long busy, hint that 100msec \
24#define H_Privilege -3 /* Caller not privileged */ 24 is a good time to retry */
25#define H_Parameter -4 /* Parameter invalid, out-of-range or conflicting */ 25#define H_LONG_BUSY_ORDER_1_SEC 9903 /* Long busy, hint that 1sec \
26#define H_Bad_Mode -5 /* Illegal msr value */ 26 is a good time to retry */
27#define H_PTEG_Full -6 /* PTEG is full */ 27#define H_LONG_BUSY_ORDER_10_SEC 9904 /* Long busy, hint that 10sec \
28#define H_Not_Found -7 /* PTE was not found" */ 28 is a good time to retry */
29#define H_Reserved_DABR -8 /* DABR address is reserved by the hypervisor on this processor" */ 29#define H_LONG_BUSY_ORDER_100_SEC 9905 /* Long busy, hint that 100sec \
30#define H_NoMem -9 30 is a good time to retry */
31#define H_Authority -10 31#define H_LONG_BUSY_END_RANGE 9905 /* End of long busy range */
32#define H_Permission -11 32#define H_HARDWARE -1 /* Hardware error */
33#define H_Dropped -12 33#define H_FUNCTION -2 /* Function not supported */
34#define H_SourceParm -13 34#define H_PRIVILEGE -3 /* Caller not privileged */
35#define H_DestParm -14 35#define H_PARAMETER -4 /* Parameter invalid, out-of-range or conflicting */
36#define H_RemoteParm -15 36#define H_BAD_MODE -5 /* Illegal msr value */
37#define H_Resource -16 37#define H_PTEG_FULL -6 /* PTEG is full */
38#define H_NOT_FOUND -7 /* PTE was not found" */
39#define H_RESERVED_DABR -8 /* DABR address is reserved by the hypervisor on this processor" */
40#define H_NO_MEM -9
41#define H_AUTHORITY -10
42#define H_PERMISSION -11
43#define H_DROPPED -12
44#define H_SOURCE_PARM -13
45#define H_DEST_PARM -14
46#define H_REMOTE_PARM -15
47#define H_RESOURCE -16
48#define H_ADAPTER_PARM -17
49#define H_RH_PARM -18
50#define H_RCQ_PARM -19
51#define H_SCQ_PARM -20
52#define H_EQ_PARM -21
53#define H_RT_PARM -22
54#define H_ST_PARM -23
55#define H_SIGT_PARM -24
56#define H_TOKEN_PARM -25
57#define H_MLENGTH_PARM -27
58#define H_MEM_PARM -28
59#define H_MEM_ACCESS_PARM -29
60#define H_ATTR_PARM -30
61#define H_PORT_PARM -31
62#define H_MCG_PARM -32
63#define H_VL_PARM -33
64#define H_TSIZE_PARM -34
65#define H_TRACE_PARM -35
66
67#define H_MASK_PARM -37
68#define H_MCG_FULL -38
69#define H_ALIAS_EXIST -39
70#define H_P_COUNTER -40
71#define H_TABLE_FULL -41
72#define H_ALT_TABLE -42
73#define H_MR_CONDITION -43
74#define H_NOT_ENOUGH_RESOURCES -44
75#define H_R_STATE -45
76#define H_RESCINDEND -46
77
38 78
39/* Long Busy is a condition that can be returned by the firmware 79/* Long Busy is a condition that can be returned by the firmware
40 * when a call cannot be completed now, but the identical call 80 * when a call cannot be completed now, but the identical call
41 * should be retried later. This prevents calls blocking in the 81 * should be retried later. This prevents calls blocking in the
42 * firmware for long periods of time. Annoyingly the firmware can return 82 * firmware for long periods of time. Annoyingly the firmware can return
43 * a range of return codes, hinting at how long we should wait before 83 * a range of return codes, hinting at how long we should wait before
44 * retrying. If you don't care for the hint, the macro below is a good 84 * retrying. If you don't care for the hint, the macro below is a good
45 * way to check for the long_busy return codes 85 * way to check for the long_busy return codes
46 */ 86 */
47#define H_isLongBusy(x) ((x >= H_LongBusyStartRange) && (x <= H_LongBusyEndRange)) 87#define H_IS_LONG_BUSY(x) ((x >= H_LONG_BUSY_START_RANGE) \
88 && (x <= H_LONG_BUSY_END_RANGE))
48 89
49/* Flags */ 90/* Flags */
50#define H_LARGE_PAGE (1UL<<(63-16)) 91#define H_LARGE_PAGE (1UL<<(63-16))
@@ -66,6 +107,9 @@
66#define H_DABRX_KERNEL (1UL<<(63-62)) 107#define H_DABRX_KERNEL (1UL<<(63-62))
67#define H_DABRX_USER (1UL<<(63-63)) 108#define H_DABRX_USER (1UL<<(63-63))
68 109
110/* Each control block has to be on a 4K bondary */
111#define H_CB_ALIGNMENT 4096
112
69/* pSeries hypervisor opcodes */ 113/* pSeries hypervisor opcodes */
70#define H_REMOVE 0x04 114#define H_REMOVE 0x04
71#define H_ENTER 0x08 115#define H_ENTER 0x08
@@ -99,25 +143,52 @@
99#define H_PERFMON 0x7c 143#define H_PERFMON 0x7c
100#define H_MIGRATE_DMA 0x78 144#define H_MIGRATE_DMA 0x78
101#define H_REGISTER_VPA 0xDC 145#define H_REGISTER_VPA 0xDC
102#define H_CEDE 0xE0 146#define H_CEDE 0xE0
103#define H_CONFER 0xE4 147#define H_CONFER 0xE4
104#define H_PROD 0xE8 148#define H_PROD 0xE8
105#define H_GET_PPP 0xEC 149#define H_GET_PPP 0xEC
106#define H_SET_PPP 0xF0 150#define H_SET_PPP 0xF0
107#define H_PURR 0xF4 151#define H_PURR 0xF4
108#define H_PIC 0xF8 152#define H_PIC 0xF8
109#define H_REG_CRQ 0xFC 153#define H_REG_CRQ 0xFC
110#define H_FREE_CRQ 0x100 154#define H_FREE_CRQ 0x100
111#define H_VIO_SIGNAL 0x104 155#define H_VIO_SIGNAL 0x104
112#define H_SEND_CRQ 0x108 156#define H_SEND_CRQ 0x108
113#define H_COPY_RDMA 0x110 157#define H_COPY_RDMA 0x110
114#define H_SET_XDABR 0x134 158#define H_SET_XDABR 0x134
115#define H_STUFF_TCE 0x138 159#define H_STUFF_TCE 0x138
116#define H_PUT_TCE_INDIRECT 0x13C 160#define H_PUT_TCE_INDIRECT 0x13C
117#define H_VTERM_PARTNER_INFO 0x150 161#define H_VTERM_PARTNER_INFO 0x150
118#define H_REGISTER_VTERM 0x154 162#define H_REGISTER_VTERM 0x154
119#define H_FREE_VTERM 0x158 163#define H_FREE_VTERM 0x158
120#define H_POLL_PENDING 0x1D8 164#define H_RESET_EVENTS 0x15C
165#define H_ALLOC_RESOURCE 0x160
166#define H_FREE_RESOURCE 0x164
167#define H_MODIFY_QP 0x168
168#define H_QUERY_QP 0x16C
169#define H_REREGISTER_PMR 0x170
170#define H_REGISTER_SMR 0x174
171#define H_QUERY_MR 0x178
172#define H_QUERY_MW 0x17C
173#define H_QUERY_HCA 0x180
174#define H_QUERY_PORT 0x184
175#define H_MODIFY_PORT 0x188
176#define H_DEFINE_AQP1 0x18C
177#define H_GET_TRACE_BUFFER 0x190
178#define H_DEFINE_AQP0 0x194
179#define H_RESIZE_MR 0x198
180#define H_ATTACH_MCQP 0x19C
181#define H_DETACH_MCQP 0x1A0
182#define H_CREATE_RPT 0x1A4
183#define H_REMOVE_RPT 0x1A8
184#define H_REGISTER_RPAGES 0x1AC
185#define H_DISABLE_AND_GETC 0x1B0
186#define H_ERROR_DATA 0x1B4
187#define H_GET_HCA_INFO 0x1B8
188#define H_GET_PERF_COUNT 0x1BC
189#define H_MANAGE_TRACE 0x1C0
190#define H_QUERY_INT_STATE 0x1E4
191#define H_POLL_PENDING 0x1D8
121#define H_JOIN 0x298 192#define H_JOIN 0x298
122#define H_ENABLE_CRQ 0x2B0 193#define H_ENABLE_CRQ 0x2B0
123 194
@@ -152,7 +223,7 @@ long plpar_hcall_norets(unsigned long opcode, ...);
152 */ 223 */
153long plpar_hcall_8arg_2ret(unsigned long opcode, 224long plpar_hcall_8arg_2ret(unsigned long opcode,
154 unsigned long arg1, 225 unsigned long arg1,
155 unsigned long arg2, 226 unsigned long arg2,
156 unsigned long arg3, 227 unsigned long arg3,
157 unsigned long arg4, 228 unsigned long arg4,
158 unsigned long arg5, 229 unsigned long arg5,
@@ -176,6 +247,42 @@ long plpar_hcall_4out(unsigned long opcode,
176 unsigned long *out3, 247 unsigned long *out3,
177 unsigned long *out4); 248 unsigned long *out4);
178 249
250long plpar_hcall_7arg_7ret(unsigned long opcode,
251 unsigned long arg1,
252 unsigned long arg2,
253 unsigned long arg3,
254 unsigned long arg4,
255 unsigned long arg5,
256 unsigned long arg6,
257 unsigned long arg7,
258 unsigned long *out1,
259 unsigned long *out2,
260 unsigned long *out3,
261 unsigned long *out4,
262 unsigned long *out5,
263 unsigned long *out6,
264 unsigned long *out7);
265
266long plpar_hcall_9arg_9ret(unsigned long opcode,
267 unsigned long arg1,
268 unsigned long arg2,
269 unsigned long arg3,
270 unsigned long arg4,
271 unsigned long arg5,
272 unsigned long arg6,
273 unsigned long arg7,
274 unsigned long arg8,
275 unsigned long arg9,
276 unsigned long *out1,
277 unsigned long *out2,
278 unsigned long *out3,
279 unsigned long *out4,
280 unsigned long *out5,
281 unsigned long *out6,
282 unsigned long *out7,
283 unsigned long *out8,
284 unsigned long *out9);
285
179#endif /* __ASSEMBLY__ */ 286#endif /* __ASSEMBLY__ */
180#endif /* __KERNEL__ */ 287#endif /* __KERNEL__ */
181#endif /* _ASM_POWERPC_HVCALL_H */ 288#endif /* _ASM_POWERPC_HVCALL_H */
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index 65f5a7b2646b..d075725bf444 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -365,8 +365,11 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
365 * powers of 2 writes until it reaches sufficient alignment). 365 * powers of 2 writes until it reaches sufficient alignment).
366 * 366 *
367 * Based on this we disable the IP header alignment in network drivers. 367 * Based on this we disable the IP header alignment in network drivers.
368 * We also modify NET_SKB_PAD to be a cacheline in size, thus maintaining
369 * cacheline alignment of buffers.
368 */ 370 */
369#define NET_IP_ALIGN 0 371#define NET_IP_ALIGN 0
372#define NET_SKB_PAD L1_CACHE_BYTES
370#endif 373#endif
371 374
372#define arch_align_stack(x) (x) 375#define arch_align_stack(x) (x)
diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h
index e10ed87094f0..436d216601e5 100644
--- a/include/asm-s390/percpu.h
+++ b/include/asm-s390/percpu.h
@@ -46,7 +46,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
46#define percpu_modcopy(pcpudst, src, size) \ 46#define percpu_modcopy(pcpudst, src, size) \
47do { \ 47do { \
48 unsigned int __i; \ 48 unsigned int __i; \
49 for_each_cpu(__i) \ 49 for_each_possible_cpu(__i) \
50 memcpy((pcpudst)+__per_cpu_offset[__i], \ 50 memcpy((pcpudst)+__per_cpu_offset[__i], \
51 (src), (size)); \ 51 (src), (size)); \
52} while (0) 52} while (0)
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 64ec640a40ee..264f0ebeaedc 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -180,7 +180,7 @@
180#define __NR_sched_get_affinity 161 /* Linux specific, getfh under SunOS */ 180#define __NR_sched_get_affinity 161 /* Linux specific, getfh under SunOS */
181#define __NR_getdomainname 162 /* SunOS Specific */ 181#define __NR_getdomainname 162 /* SunOS Specific */
182#define __NR_setdomainname 163 /* Common */ 182#define __NR_setdomainname 163 /* Common */
183/* #define __NR_ni_syscall 164 ENOSYS under SunOS */ 183/* #define __NR_utrap_install 164 Linux sparc64 specific */
184#define __NR_quotactl 165 /* Common */ 184#define __NR_quotactl 165 /* Common */
185#define __NR_set_tid_address 166 /* Linux specific, exportfs under SunOS */ 185#define __NR_set_tid_address 166 /* Linux specific, exportfs under SunOS */
186#define __NR_mount 167 /* Common */ 186#define __NR_mount 167 /* Common */
@@ -248,7 +248,7 @@
248#define __NR_setfsgid 229 /* Linux Specific */ 248#define __NR_setfsgid 229 /* Linux Specific */
249#define __NR__newselect 230 /* Linux Specific */ 249#define __NR__newselect 230 /* Linux Specific */
250#define __NR_time 231 /* Linux Specific */ 250#define __NR_time 231 /* Linux Specific */
251/* #define __NR_oldstat 232 Linux Specific */ 251#define __NR_sys_splice 232 /* Linux Specific */
252#define __NR_stime 233 /* Linux Specific */ 252#define __NR_stime 233 /* Linux Specific */
253#define __NR_statfs64 234 /* Linux Specific */ 253#define __NR_statfs64 234 /* Linux Specific */
254#define __NR_fstatfs64 235 /* Linux Specific */ 254#define __NR_fstatfs64 235 /* Linux Specific */
@@ -271,7 +271,7 @@
271#define __NR_getsid 252 271#define __NR_getsid 252
272#define __NR_fdatasync 253 272#define __NR_fdatasync 253
273#define __NR_nfsservctl 254 273#define __NR_nfsservctl 254
274#define __NR_aplib 255 274#define __NR_sys_sync_file_range 255
275#define __NR_clock_settime 256 275#define __NR_clock_settime 256
276#define __NR_clock_gettime 257 276#define __NR_clock_gettime 257
277#define __NR_clock_getres 258 277#define __NR_clock_getres 258
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index a284986b1541..d0544b4f47b7 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -250,7 +250,7 @@
250#ifdef __KERNEL__ 250#ifdef __KERNEL__
251#define __NR_time 231 /* Linux sparc32 */ 251#define __NR_time 231 /* Linux sparc32 */
252#endif 252#endif
253/* #define __NR_oldstat 232 Linux Specific */ 253#define __NR_sys_splice 232 /* Linux Specific */
254#define __NR_stime 233 /* Linux Specific */ 254#define __NR_stime 233 /* Linux Specific */
255#define __NR_statfs64 234 /* Linux Specific */ 255#define __NR_statfs64 234 /* Linux Specific */
256#define __NR_fstatfs64 235 /* Linux Specific */ 256#define __NR_fstatfs64 235 /* Linux Specific */
@@ -273,7 +273,7 @@
273#define __NR_getsid 252 273#define __NR_getsid 252
274#define __NR_fdatasync 253 274#define __NR_fdatasync 253
275#define __NR_nfsservctl 254 275#define __NR_nfsservctl 254
276#define __NR_aplib 255 276#define __NR_sys_sync_file_range 255
277#define __NR_clock_settime 256 277#define __NR_clock_settime 256
278#define __NR_clock_gettime 257 278#define __NR_clock_gettime 257
279#define __NR_clock_getres 258 279#define __NR_clock_getres 258
diff --git a/include/asm-um/desc.h b/include/asm-um/desc.h
index ac1d2a20d178..4ec34a51b62c 100644
--- a/include/asm-um/desc.h
+++ b/include/asm-um/desc.h
@@ -1,6 +1,16 @@
1#ifndef __UM_DESC_H 1#ifndef __UM_DESC_H
2#define __UM_DESC_H 2#define __UM_DESC_H
3 3
4#include "asm/arch/desc.h" 4/* Taken from asm-i386/desc.h, it's the only thing we need. The rest wouldn't
5 * compile, and has never been used. */
6#define LDT_empty(info) (\
7 (info)->base_addr == 0 && \
8 (info)->limit == 0 && \
9 (info)->contents == 0 && \
10 (info)->read_exec_only == 1 && \
11 (info)->seg_32bit == 0 && \
12 (info)->limit_in_pages == 0 && \
13 (info)->seg_not_present == 1 && \
14 (info)->useable == 0 )
5 15
6#endif 16#endif
diff --git a/include/asm-um/host_ldt-i386.h b/include/asm-um/host_ldt-i386.h
new file mode 100644
index 000000000000..b27cb0a9dd30
--- /dev/null
+++ b/include/asm-um/host_ldt-i386.h
@@ -0,0 +1,34 @@
1#ifndef __ASM_HOST_LDT_I386_H
2#define __ASM_HOST_LDT_I386_H
3
4#include "asm/arch/ldt.h"
5
6/*
7 * macros stolen from include/asm-i386/desc.h
8 */
9#define LDT_entry_a(info) \
10 ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff))
11
12#define LDT_entry_b(info) \
13 (((info)->base_addr & 0xff000000) | \
14 (((info)->base_addr & 0x00ff0000) >> 16) | \
15 ((info)->limit & 0xf0000) | \
16 (((info)->read_exec_only ^ 1) << 9) | \
17 ((info)->contents << 10) | \
18 (((info)->seg_not_present ^ 1) << 15) | \
19 ((info)->seg_32bit << 22) | \
20 ((info)->limit_in_pages << 23) | \
21 ((info)->useable << 20) | \
22 0x7000)
23
24#define LDT_empty(info) (\
25 (info)->base_addr == 0 && \
26 (info)->limit == 0 && \
27 (info)->contents == 0 && \
28 (info)->read_exec_only == 1 && \
29 (info)->seg_32bit == 0 && \
30 (info)->limit_in_pages == 0 && \
31 (info)->seg_not_present == 1 && \
32 (info)->useable == 0 )
33
34#endif
diff --git a/include/asm-um/ldt-x86_64.h b/include/asm-um/host_ldt-x86_64.h
index 96b35aada79a..74a63f7d9a90 100644
--- a/include/asm-um/ldt-x86_64.h
+++ b/include/asm-um/host_ldt-x86_64.h
@@ -1,43 +1,8 @@
1/* 1#ifndef __ASM_HOST_LDT_X86_64_H
2 * Copyright (C) 2004 Fujitsu Siemens Computers GmbH 2#define __ASM_HOST_LDT_X86_64_H
3 * Licensed under the GPL
4 *
5 * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
6 */
7 3
8#ifndef __ASM_LDT_X86_64_H
9#define __ASM_LDT_X86_64_H
10
11#include "asm/semaphore.h"
12#include "asm/arch/ldt.h" 4#include "asm/arch/ldt.h"
13 5
14struct mmu_context_skas;
15extern void ldt_host_info(void);
16extern long init_new_ldt(struct mmu_context_skas * to_mm,
17 struct mmu_context_skas * from_mm);
18extern void free_ldt(struct mmu_context_skas * mm);
19
20#define LDT_PAGES_MAX \
21 ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE)
22#define LDT_ENTRIES_PER_PAGE \
23 (PAGE_SIZE/LDT_ENTRY_SIZE)
24#define LDT_DIRECT_ENTRIES \
25 ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE)
26
27struct ldt_entry {
28 __u32 a;
29 __u32 b;
30};
31
32typedef struct uml_ldt {
33 int entry_count;
34 struct semaphore semaphore;
35 union {
36 struct ldt_entry * pages[LDT_PAGES_MAX];
37 struct ldt_entry entries[LDT_DIRECT_ENTRIES];
38 } u;
39} uml_ldt_t;
40
41/* 6/*
42 * macros stolen from include/asm-x86_64/desc.h 7 * macros stolen from include/asm-x86_64/desc.h
43 */ 8 */
diff --git a/include/asm-um/ldt-i386.h b/include/asm-um/ldt-i386.h
deleted file mode 100644
index 175722a91164..000000000000
--- a/include/asm-um/ldt-i386.h
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 * Copyright (C) 2004 Fujitsu Siemens Computers GmbH
3 * Licensed under the GPL
4 *
5 * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
6 */
7
8#ifndef __ASM_LDT_I386_H
9#define __ASM_LDT_I386_H
10
11#include "asm/semaphore.h"
12#include "asm/arch/ldt.h"
13
14struct mmu_context_skas;
15extern void ldt_host_info(void);
16extern long init_new_ldt(struct mmu_context_skas * to_mm,
17 struct mmu_context_skas * from_mm);
18extern void free_ldt(struct mmu_context_skas * mm);
19
20#define LDT_PAGES_MAX \
21 ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE)
22#define LDT_ENTRIES_PER_PAGE \
23 (PAGE_SIZE/LDT_ENTRY_SIZE)
24#define LDT_DIRECT_ENTRIES \
25 ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE)
26
27struct ldt_entry {
28 __u32 a;
29 __u32 b;
30};
31
32typedef struct uml_ldt {
33 int entry_count;
34 struct semaphore semaphore;
35 union {
36 struct ldt_entry * pages[LDT_PAGES_MAX];
37 struct ldt_entry entries[LDT_DIRECT_ENTRIES];
38 } u;
39} uml_ldt_t;
40
41/*
42 * macros stolen from include/asm-i386/desc.h
43 */
44#define LDT_entry_a(info) \
45 ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff))
46
47#define LDT_entry_b(info) \
48 (((info)->base_addr & 0xff000000) | \
49 (((info)->base_addr & 0x00ff0000) >> 16) | \
50 ((info)->limit & 0xf0000) | \
51 (((info)->read_exec_only ^ 1) << 9) | \
52 ((info)->contents << 10) | \
53 (((info)->seg_not_present ^ 1) << 15) | \
54 ((info)->seg_32bit << 22) | \
55 ((info)->limit_in_pages << 23) | \
56 ((info)->useable << 20) | \
57 0x7000)
58
59#define LDT_empty(info) (\
60 (info)->base_addr == 0 && \
61 (info)->limit == 0 && \
62 (info)->contents == 0 && \
63 (info)->read_exec_only == 1 && \
64 (info)->seg_32bit == 0 && \
65 (info)->limit_in_pages == 0 && \
66 (info)->seg_not_present == 1 && \
67 (info)->useable == 0 )
68
69#endif
diff --git a/include/asm-um/ldt.h b/include/asm-um/ldt.h
new file mode 100644
index 000000000000..96f82a456ce6
--- /dev/null
+++ b/include/asm-um/ldt.h
@@ -0,0 +1,41 @@
1/*
2 * Copyright (C) 2004 Fujitsu Siemens Computers GmbH
3 * Licensed under the GPL
4 *
5 * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
6 */
7
8#ifndef __ASM_LDT_H
9#define __ASM_LDT_H
10
11#include "asm/semaphore.h"
12#include "asm/host_ldt.h"
13
14struct mmu_context_skas;
15extern void ldt_host_info(void);
16extern long init_new_ldt(struct mmu_context_skas * to_mm,
17 struct mmu_context_skas * from_mm);
18extern void free_ldt(struct mmu_context_skas * mm);
19
20#define LDT_PAGES_MAX \
21 ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE)
22#define LDT_ENTRIES_PER_PAGE \
23 (PAGE_SIZE/LDT_ENTRY_SIZE)
24#define LDT_DIRECT_ENTRIES \
25 ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE)
26
27struct ldt_entry {
28 __u32 a;
29 __u32 b;
30};
31
32typedef struct uml_ldt {
33 int entry_count;
34 struct semaphore semaphore;
35 union {
36 struct ldt_entry * pages[LDT_PAGES_MAX];
37 struct ldt_entry entries[LDT_DIRECT_ENTRIES];
38 } u;
39} uml_ldt_t;
40
41#endif
diff --git a/include/asm-um/processor-i386.h b/include/asm-um/processor-i386.h
index 4108a579eb92..595f1c3e1e40 100644
--- a/include/asm-um/processor-i386.h
+++ b/include/asm-um/processor-i386.h
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -6,21 +6,48 @@
6#ifndef __UM_PROCESSOR_I386_H 6#ifndef __UM_PROCESSOR_I386_H
7#define __UM_PROCESSOR_I386_H 7#define __UM_PROCESSOR_I386_H
8 8
9#include "linux/string.h"
10#include "asm/host_ldt.h"
11#include "asm/segment.h"
12
9extern int host_has_xmm; 13extern int host_has_xmm;
10extern int host_has_cmov; 14extern int host_has_cmov;
11 15
12/* include faultinfo structure */ 16/* include faultinfo structure */
13#include "sysdep/faultinfo.h" 17#include "sysdep/faultinfo.h"
14 18
19struct uml_tls_struct {
20 struct user_desc tls;
21 unsigned flushed:1;
22 unsigned present:1;
23};
24
15struct arch_thread { 25struct arch_thread {
26 struct uml_tls_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
16 unsigned long debugregs[8]; 27 unsigned long debugregs[8];
17 int debugregs_seq; 28 int debugregs_seq;
18 struct faultinfo faultinfo; 29 struct faultinfo faultinfo;
19}; 30};
20 31
21#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \ 32#define INIT_ARCH_THREAD { \
22 .debugregs_seq = 0, \ 33 .tls_array = { [ 0 ... GDT_ENTRY_TLS_ENTRIES - 1 ] = \
23 .faultinfo = { 0, 0, 0 } } 34 { .present = 0, .flushed = 0 } }, \
35 .debugregs = { [ 0 ... 7 ] = 0 }, \
36 .debugregs_seq = 0, \
37 .faultinfo = { 0, 0, 0 } \
38}
39
40static inline void arch_flush_thread(struct arch_thread *thread)
41{
42 /* Clear any TLS still hanging */
43 memset(&thread->tls_array, 0, sizeof(thread->tls_array));
44}
45
46static inline void arch_copy_thread(struct arch_thread *from,
47 struct arch_thread *to)
48{
49 memcpy(&to->tls_array, &from->tls_array, sizeof(from->tls_array));
50}
24 51
25#include "asm/arch/user.h" 52#include "asm/arch/user.h"
26 53
diff --git a/include/asm-um/processor-x86_64.h b/include/asm-um/processor-x86_64.h
index e1e1255a1d36..10609af376c0 100644
--- a/include/asm-um/processor-x86_64.h
+++ b/include/asm-um/processor-x86_64.h
@@ -28,6 +28,15 @@ extern inline void rep_nop(void)
28 .debugregs_seq = 0, \ 28 .debugregs_seq = 0, \
29 .faultinfo = { 0, 0, 0 } } 29 .faultinfo = { 0, 0, 0 } }
30 30
31static inline void arch_flush_thread(struct arch_thread *thread)
32{
33}
34
35static inline void arch_copy_thread(struct arch_thread *from,
36 struct arch_thread *to)
37{
38}
39
31#include "asm/arch/user.h" 40#include "asm/arch/user.h"
32 41
33#define current_text_addr() \ 42#define current_text_addr() \
diff --git a/include/asm-um/ptrace-generic.h b/include/asm-um/ptrace-generic.h
index 46599ac44037..503484305e67 100644
--- a/include/asm-um/ptrace-generic.h
+++ b/include/asm-um/ptrace-generic.h
@@ -28,7 +28,7 @@ struct pt_regs {
28 union uml_pt_regs regs; 28 union uml_pt_regs regs;
29}; 29};
30 30
31#define EMPTY_REGS { regs : EMPTY_UML_PT_REGS } 31#define EMPTY_REGS { .regs = EMPTY_UML_PT_REGS }
32 32
33#define PT_REGS_IP(r) UPT_IP(&(r)->regs) 33#define PT_REGS_IP(r) UPT_IP(&(r)->regs)
34#define PT_REGS_SP(r) UPT_SP(&(r)->regs) 34#define PT_REGS_SP(r) UPT_SP(&(r)->regs)
@@ -60,17 +60,9 @@ extern void show_regs(struct pt_regs *regs);
60extern void send_sigtrap(struct task_struct *tsk, union uml_pt_regs *regs, 60extern void send_sigtrap(struct task_struct *tsk, union uml_pt_regs *regs,
61 int error_code); 61 int error_code);
62 62
63#endif 63extern int arch_copy_tls(struct task_struct *new);
64extern void clear_flushed_tls(struct task_struct *task);
64 65
65#endif 66#endif
66 67
67/* 68#endif
68 * Overrides for Emacs so that we follow Linus's tabbing style.
69 * Emacs will notice this stuff at the end of the file and automatically
70 * adjust the settings for this buffer only. This must remain at the end
71 * of the file.
72 * ---------------------------------------------------------------------------
73 * Local variables:
74 * c-file-style: "linux"
75 * End:
76 */
diff --git a/include/asm-um/ptrace-i386.h b/include/asm-um/ptrace-i386.h
index fe882b9d917e..30656c962d74 100644
--- a/include/asm-um/ptrace-i386.h
+++ b/include/asm-um/ptrace-i386.h
@@ -8,8 +8,11 @@
8 8
9#define HOST_AUDIT_ARCH AUDIT_ARCH_I386 9#define HOST_AUDIT_ARCH AUDIT_ARCH_I386
10 10
11#include "linux/compiler.h"
11#include "sysdep/ptrace.h" 12#include "sysdep/ptrace.h"
12#include "asm/ptrace-generic.h" 13#include "asm/ptrace-generic.h"
14#include "asm/host_ldt.h"
15#include "choose-mode.h"
13 16
14#define PT_REGS_EAX(r) UPT_EAX(&(r)->regs) 17#define PT_REGS_EAX(r) UPT_EAX(&(r)->regs)
15#define PT_REGS_EBX(r) UPT_EBX(&(r)->regs) 18#define PT_REGS_EBX(r) UPT_EBX(&(r)->regs)
@@ -38,15 +41,31 @@
38 41
39#define user_mode(r) UPT_IS_USER(&(r)->regs) 42#define user_mode(r) UPT_IS_USER(&(r)->regs)
40 43
41#endif 44extern int ptrace_get_thread_area(struct task_struct *child, int idx,
45 struct user_desc __user *user_desc);
42 46
43/* 47extern int ptrace_set_thread_area(struct task_struct *child, int idx,
44 * Overrides for Emacs so that we follow Linus's tabbing style. 48 struct user_desc __user *user_desc);
45 * Emacs will notice this stuff at the end of the file and automatically 49
46 * adjust the settings for this buffer only. This must remain at the end 50extern int do_set_thread_area_skas(struct user_desc *info);
47 * of the file. 51extern int do_get_thread_area_skas(struct user_desc *info);
48 * --------------------------------------------------------------------------- 52
49 * Local variables: 53extern int do_set_thread_area_tt(struct user_desc *info);
50 * c-file-style: "linux" 54extern int do_get_thread_area_tt(struct user_desc *info);
51 * End: 55
52 */ 56extern int arch_switch_tls_skas(struct task_struct *from, struct task_struct *to);
57extern int arch_switch_tls_tt(struct task_struct *from, struct task_struct *to);
58
59static inline int do_get_thread_area(struct user_desc *info)
60{
61 return CHOOSE_MODE_PROC(do_get_thread_area_tt, do_get_thread_area_skas, info);
62}
63
64static inline int do_set_thread_area(struct user_desc *info)
65{
66 return CHOOSE_MODE_PROC(do_set_thread_area_tt, do_set_thread_area_skas, info);
67}
68
69struct task_struct;
70
71#endif
diff --git a/include/asm-um/ptrace-x86_64.h b/include/asm-um/ptrace-x86_64.h
index be51219a8ffe..c894e68b1f96 100644
--- a/include/asm-um/ptrace-x86_64.h
+++ b/include/asm-um/ptrace-x86_64.h
@@ -8,6 +8,8 @@
8#define __UM_PTRACE_X86_64_H 8#define __UM_PTRACE_X86_64_H
9 9
10#include "linux/compiler.h" 10#include "linux/compiler.h"
11#include "asm/errno.h"
12#include "asm/host_ldt.h"
11 13
12#define signal_fault signal_fault_x86_64 14#define signal_fault signal_fault_x86_64
13#define __FRAME_OFFSETS /* Needed to get the R* macros */ 15#define __FRAME_OFFSETS /* Needed to get the R* macros */
@@ -63,15 +65,26 @@ void signal_fault(struct pt_regs_subarch *regs, void *frame, char *where);
63 65
64#define profile_pc(regs) PT_REGS_IP(regs) 66#define profile_pc(regs) PT_REGS_IP(regs)
65 67
66#endif 68static inline int ptrace_get_thread_area(struct task_struct *child, int idx,
69 struct user_desc __user *user_desc)
70{
71 return -ENOSYS;
72}
67 73
68/* 74static inline int ptrace_set_thread_area(struct task_struct *child, int idx,
69 * Overrides for Emacs so that we follow Linus's tabbing style. 75 struct user_desc __user *user_desc)
70 * Emacs will notice this stuff at the end of the file and automatically 76{
71 * adjust the settings for this buffer only. This must remain at the end 77 return -ENOSYS;
72 * of the file. 78}
73 * --------------------------------------------------------------------------- 79
74 * Local variables: 80static inline void arch_switch_to_tt(struct task_struct *from,
75 * c-file-style: "linux" 81 struct task_struct *to)
76 * End: 82{
77 */ 83}
84
85static inline void arch_switch_to_skas(struct task_struct *from,
86 struct task_struct *to)
87{
88}
89
90#endif
diff --git a/include/asm-um/segment.h b/include/asm-um/segment.h
index 55e40301f625..45183fcd10b6 100644
--- a/include/asm-um/segment.h
+++ b/include/asm-um/segment.h
@@ -1,4 +1,10 @@
1#ifndef __UM_SEGMENT_H 1#ifndef __UM_SEGMENT_H
2#define __UM_SEGMENT_H 2#define __UM_SEGMENT_H
3 3
4extern int host_gdt_entry_tls_min;
5
6#define GDT_ENTRY_TLS_ENTRIES 3
7#define GDT_ENTRY_TLS_MIN host_gdt_entry_tls_min
8#define GDT_ENTRY_TLS_MAX (GDT_ENTRY_TLS_MIN + GDT_ENTRY_TLS_ENTRIES - 1)
9
4#endif 10#endif
diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h
index 17b6b07c4332..f166b9837c6a 100644
--- a/include/asm-um/thread_info.h
+++ b/include/asm-um/thread_info.h
@@ -27,14 +27,14 @@ struct thread_info {
27 27
28#define INIT_THREAD_INFO(tsk) \ 28#define INIT_THREAD_INFO(tsk) \
29{ \ 29{ \
30 task: &tsk, \ 30 .task = &tsk, \
31 exec_domain: &default_exec_domain, \ 31 .exec_domain = &default_exec_domain, \
32 flags: 0, \ 32 .flags = 0, \
33 cpu: 0, \ 33 .cpu = 0, \
34 preempt_count: 1, \ 34 .preempt_count = 1, \
35 addr_limit: KERNEL_DS, \ 35 .addr_limit = KERNEL_DS, \
36 restart_block: { \ 36 .restart_block = { \
37 fn: do_no_restart_syscall, \ 37 .fn = do_no_restart_syscall, \
38 }, \ 38 }, \
39} 39}
40 40
diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h
index 4e460d6f5ac8..bea5a015f667 100644
--- a/include/asm-um/uaccess.h
+++ b/include/asm-um/uaccess.h
@@ -57,7 +57,7 @@
57({ \ 57({ \
58 const __typeof__((*(ptr))) __user *private_ptr = (ptr); \ 58 const __typeof__((*(ptr))) __user *private_ptr = (ptr); \
59 (access_ok(VERIFY_READ, private_ptr, sizeof(*private_ptr)) ? \ 59 (access_ok(VERIFY_READ, private_ptr, sizeof(*private_ptr)) ? \
60 __get_user(x, private_ptr) : ((x) = 0, -EFAULT)); \ 60 __get_user(x, private_ptr) : ((x) = (__typeof__(*ptr))0, -EFAULT)); \
61}) 61})
62 62
63#define __put_user(x, ptr) \ 63#define __put_user(x, ptr) \
diff --git a/include/asm-x86_64/local.h b/include/asm-x86_64/local.h
index bf148037d4e5..cd17945bf218 100644
--- a/include/asm-x86_64/local.h
+++ b/include/asm-x86_64/local.h
@@ -5,7 +5,7 @@
5 5
6typedef struct 6typedef struct
7{ 7{
8 volatile unsigned long counter; 8 volatile long counter;
9} local_t; 9} local_t;
10 10
11#define LOCAL_INIT(i) { (i) } 11#define LOCAL_INIT(i) { (i) }
@@ -13,7 +13,7 @@ typedef struct
13#define local_read(v) ((v)->counter) 13#define local_read(v) ((v)->counter)
14#define local_set(v,i) (((v)->counter) = (i)) 14#define local_set(v,i) (((v)->counter) = (i))
15 15
16static __inline__ void local_inc(local_t *v) 16static inline void local_inc(local_t *v)
17{ 17{
18 __asm__ __volatile__( 18 __asm__ __volatile__(
19 "incq %0" 19 "incq %0"
@@ -21,7 +21,7 @@ static __inline__ void local_inc(local_t *v)
21 :"m" (v->counter)); 21 :"m" (v->counter));
22} 22}
23 23
24static __inline__ void local_dec(local_t *v) 24static inline void local_dec(local_t *v)
25{ 25{
26 __asm__ __volatile__( 26 __asm__ __volatile__(
27 "decq %0" 27 "decq %0"
@@ -29,7 +29,7 @@ static __inline__ void local_dec(local_t *v)
29 :"m" (v->counter)); 29 :"m" (v->counter));
30} 30}
31 31
32static __inline__ void local_add(unsigned int i, local_t *v) 32static inline void local_add(long i, local_t *v)
33{ 33{
34 __asm__ __volatile__( 34 __asm__ __volatile__(
35 "addq %1,%0" 35 "addq %1,%0"
@@ -37,7 +37,7 @@ static __inline__ void local_add(unsigned int i, local_t *v)
37 :"ir" (i), "m" (v->counter)); 37 :"ir" (i), "m" (v->counter));
38} 38}
39 39
40static __inline__ void local_sub(unsigned int i, local_t *v) 40static inline void local_sub(long i, local_t *v)
41{ 41{
42 __asm__ __volatile__( 42 __asm__ __volatile__(
43 "subq %1,%0" 43 "subq %1,%0"
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index bb9e54322322..75e91f5b6a04 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -19,20 +19,25 @@ struct fb_info;
19struct backlight_properties { 19struct backlight_properties {
20 /* Owner module */ 20 /* Owner module */
21 struct module *owner; 21 struct module *owner;
22 /* Get the backlight power status (0: full on, 1..3: power saving 22
23 modes; 4: full off), see FB_BLANK_XXX */ 23 /* Notify the backlight driver some property has changed */
24 int (*get_power)(struct backlight_device *); 24 int (*update_status)(struct backlight_device *);
25 /* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */ 25 /* Return the current backlight brightness (accounting for power,
26 int (*set_power)(struct backlight_device *, int power); 26 fb_blank etc.) */
27 /* Maximal value for brightness (read-only) */
28 int max_brightness;
29 /* Get current backlight brightness */
30 int (*get_brightness)(struct backlight_device *); 27 int (*get_brightness)(struct backlight_device *);
31 /* Set backlight brightness (0..max_brightness) */
32 int (*set_brightness)(struct backlight_device *, int brightness);
33 /* Check if given framebuffer device is the one bound to this backlight; 28 /* Check if given framebuffer device is the one bound to this backlight;
34 return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ 29 return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */
35 int (*check_fb)(struct fb_info *); 30 int (*check_fb)(struct fb_info *);
31
32 /* Current User requested brightness (0 - max_brightness) */
33 int brightness;
34 /* Maximal value for brightness (read-only) */
35 int max_brightness;
36 /* Current FB Power mode (0: full on, 1..3: power saving
37 modes; 4: full off), see FB_BLANK_XXX */
38 int power;
39 /* FB Blanking active? (values as for power) */
40 int fb_blank;
36}; 41};
37 42
38struct backlight_device { 43struct backlight_device {
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index d10bd30c337e..836325ee0931 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -275,6 +275,7 @@ extern void d_move(struct dentry *, struct dentry *);
275/* appendix may either be NULL or be used for transname suffixes */ 275/* appendix may either be NULL or be used for transname suffixes */
276extern struct dentry * d_lookup(struct dentry *, struct qstr *); 276extern struct dentry * d_lookup(struct dentry *, struct qstr *);
277extern struct dentry * __d_lookup(struct dentry *, struct qstr *); 277extern struct dentry * __d_lookup(struct dentry *, struct qstr *);
278extern struct dentry * d_hash_and_lookup(struct dentry *, struct qstr *);
278 279
279/* validate "insecure" dentry pointer */ 280/* validate "insecure" dentry pointer */
280extern int d_validate(struct dentry *, struct dentry *); 281extern int d_validate(struct dentry *, struct dentry *);
diff --git a/include/linux/fadvise.h b/include/linux/fadvise.h
index b2913bba35d8..e8e747139b9a 100644
--- a/include/linux/fadvise.h
+++ b/include/linux/fadvise.h
@@ -18,10 +18,4 @@
18#define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ 18#define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
19#endif 19#endif
20 20
21/*
22 * Linux-specific fadvise() extensions:
23 */
24#define LINUX_FADV_ASYNC_WRITE 32 /* Start writeout on range */
25#define LINUX_FADV_WRITE_WAIT 33 /* Wait upon writeout to range */
26
27#endif /* FADVISE_H_INCLUDED */ 21#endif /* FADVISE_H_INCLUDED */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index d03fadfcafe3..315d89740ddf 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -839,12 +839,10 @@ struct fb_info {
839#define FB_LEFT_POS(bpp) (32 - bpp) 839#define FB_LEFT_POS(bpp) (32 - bpp)
840#define FB_SHIFT_HIGH(val, bits) ((val) >> (bits)) 840#define FB_SHIFT_HIGH(val, bits) ((val) >> (bits))
841#define FB_SHIFT_LOW(val, bits) ((val) << (bits)) 841#define FB_SHIFT_LOW(val, bits) ((val) << (bits))
842#define FB_BIT_NR(b) (7 - (b))
843#else 842#else
844#define FB_LEFT_POS(bpp) (0) 843#define FB_LEFT_POS(bpp) (0)
845#define FB_SHIFT_HIGH(val, bits) ((val) << (bits)) 844#define FB_SHIFT_HIGH(val, bits) ((val) << (bits))
846#define FB_SHIFT_LOW(val, bits) ((val) >> (bits)) 845#define FB_SHIFT_LOW(val, bits) ((val) >> (bits))
847#define FB_BIT_NR(b) (b)
848#endif 846#endif
849 847
850 /* 848 /*
diff --git a/include/linux/fs.h b/include/linux/fs.h
index e5ce62e9676d..16be62041bfe 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -757,6 +757,13 @@ extern void send_sigio(struct fown_struct *fown, int fd, int band);
757extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); 757extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
758extern int fcntl_getlease(struct file *filp); 758extern int fcntl_getlease(struct file *filp);
759 759
760/* fs/sync.c */
761#define SYNC_FILE_RANGE_WAIT_BEFORE 1
762#define SYNC_FILE_RANGE_WRITE 2
763#define SYNC_FILE_RANGE_WAIT_AFTER 4
764extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte,
765 int flags);
766
760/* fs/locks.c */ 767/* fs/locks.c */
761extern void locks_init_lock(struct file_lock *); 768extern void locks_init_lock(struct file_lock *);
762extern void locks_copy_lock(struct file_lock *, struct file_lock *); 769extern void locks_copy_lock(struct file_lock *, struct file_lock *);
@@ -857,7 +864,7 @@ struct super_block {
857 */ 864 */
858 struct mutex s_vfs_rename_mutex; /* Kludge */ 865 struct mutex s_vfs_rename_mutex; /* Kludge */
859 866
860 /* Granuality of c/m/atime in ns. 867 /* Granularity of c/m/atime in ns.
861 Cannot be worse than a second */ 868 Cannot be worse than a second */
862 u32 s_time_gran; 869 u32 s_time_gran;
863}; 870};
@@ -1416,6 +1423,7 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *);
1416#endif 1423#endif
1417 1424
1418/* fs/char_dev.c */ 1425/* fs/char_dev.c */
1426#define CHRDEV_MAJOR_HASH_SIZE 255
1419extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); 1427extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
1420extern int register_chrdev_region(dev_t, unsigned, const char *); 1428extern int register_chrdev_region(dev_t, unsigned, const char *);
1421extern int register_chrdev(unsigned int, const char *, 1429extern int register_chrdev(unsigned int, const char *,
@@ -1423,25 +1431,17 @@ extern int register_chrdev(unsigned int, const char *,
1423extern int unregister_chrdev(unsigned int, const char *); 1431extern int unregister_chrdev(unsigned int, const char *);
1424extern void unregister_chrdev_region(dev_t, unsigned); 1432extern void unregister_chrdev_region(dev_t, unsigned);
1425extern int chrdev_open(struct inode *, struct file *); 1433extern int chrdev_open(struct inode *, struct file *);
1426extern int get_chrdev_list(char *); 1434extern void chrdev_show(struct seq_file *,off_t);
1427extern void *acquire_chrdev_list(void);
1428extern int count_chrdev_list(void);
1429extern void *get_next_chrdev(void *);
1430extern int get_chrdev_info(void *, int *, char **);
1431extern void release_chrdev_list(void *);
1432 1435
1433/* fs/block_dev.c */ 1436/* fs/block_dev.c */
1437#define BLKDEV_MAJOR_HASH_SIZE 255
1434#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ 1438#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */
1435extern const char *__bdevname(dev_t, char *buffer); 1439extern const char *__bdevname(dev_t, char *buffer);
1436extern const char *bdevname(struct block_device *bdev, char *buffer); 1440extern const char *bdevname(struct block_device *bdev, char *buffer);
1437extern struct block_device *lookup_bdev(const char *); 1441extern struct block_device *lookup_bdev(const char *);
1438extern struct block_device *open_bdev_excl(const char *, int, void *); 1442extern struct block_device *open_bdev_excl(const char *, int, void *);
1439extern void close_bdev_excl(struct block_device *); 1443extern void close_bdev_excl(struct block_device *);
1440extern void *acquire_blkdev_list(void); 1444extern void blkdev_show(struct seq_file *,off_t);
1441extern int count_blkdev_list(void);
1442extern void *get_next_blkdev(void *);
1443extern int get_blkdev_info(void *, int *, char **);
1444extern void release_blkdev_list(void *);
1445 1445
1446extern void init_special_inode(struct inode *, umode_t, dev_t); 1446extern void init_special_inode(struct inode *, umode_t, dev_t);
1447 1447
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 9c8e6da2393b..71e7b2847cb3 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -11,6 +11,7 @@
11 11
12#include <asm/io.h> 12#include <asm/io.h>
13#include <linux/list.h> 13#include <linux/list.h>
14#include <linux/mutex.h>
14#include <linux/device.h> 15#include <linux/device.h>
15#include <linux/timer.h> 16#include <linux/timer.h>
16 17
@@ -40,7 +41,7 @@ struct gameport {
40 struct gameport *parent, *child; 41 struct gameport *parent, *child;
41 42
42 struct gameport_driver *drv; 43 struct gameport_driver *drv;
43 struct semaphore drv_sem; /* protects serio->drv so attributes can pin driver */ 44 struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
44 45
45 struct device dev; 46 struct device dev;
46 unsigned int registered; /* port has been fully registered with driver core */ 47 unsigned int registered; /* port has been fully registered with driver core */
@@ -137,12 +138,12 @@ static inline void gameport_set_drvdata(struct gameport *gameport, void *data)
137 */ 138 */
138static inline int gameport_pin_driver(struct gameport *gameport) 139static inline int gameport_pin_driver(struct gameport *gameport)
139{ 140{
140 return down_interruptible(&gameport->drv_sem); 141 return mutex_lock_interruptible(&gameport->drv_mutex);
141} 142}
142 143
143static inline void gameport_unpin_driver(struct gameport *gameport) 144static inline void gameport_unpin_driver(struct gameport *gameport)
144{ 145{
145 up(&gameport->drv_sem); 146 mutex_unlock(&gameport->drv_mutex);
146} 147}
147 148
148void __gameport_register_driver(struct gameport_driver *drv, struct module *owner); 149void __gameport_register_driver(struct gameport_driver *drv, struct module *owner);
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 93830158348e..306acf1dc6d5 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -58,6 +58,19 @@ struct hrtimer {
58}; 58};
59 59
60/** 60/**
61 * struct hrtimer_sleeper - simple sleeper structure
62 *
63 * @timer: embedded timer structure
64 * @task: task to wake up
65 *
66 * task is set to NULL, when the timer expires.
67 */
68struct hrtimer_sleeper {
69 struct hrtimer timer;
70 struct task_struct *task;
71};
72
73/**
61 * struct hrtimer_base - the timer base for a specific clock 74 * struct hrtimer_base - the timer base for a specific clock
62 * 75 *
63 * @index: clock type index for per_cpu support when moving a timer 76 * @index: clock type index for per_cpu support when moving a timer
@@ -67,7 +80,7 @@ struct hrtimer {
67 * @first: pointer to the timer node which expires first 80 * @first: pointer to the timer node which expires first
68 * @resolution: the resolution of the clock, in nanoseconds 81 * @resolution: the resolution of the clock, in nanoseconds
69 * @get_time: function to retrieve the current time of the clock 82 * @get_time: function to retrieve the current time of the clock
70 * @get_sofirq_time: function to retrieve the current time from the softirq 83 * @get_softirq_time: function to retrieve the current time from the softirq
71 * @curr_timer: the timer which is executing a callback right now 84 * @curr_timer: the timer which is executing a callback right now
72 * @softirq_time: the time when running the hrtimer queue in the softirq 85 * @softirq_time: the time when running the hrtimer queue in the softirq
73 */ 86 */
@@ -127,6 +140,9 @@ extern long hrtimer_nanosleep(struct timespec *rqtp,
127 const enum hrtimer_mode mode, 140 const enum hrtimer_mode mode,
128 const clockid_t clockid); 141 const clockid_t clockid);
129 142
143extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
144 struct task_struct *tsk);
145
130/* Soft interrupt function to run the hrtimer queues: */ 146/* Soft interrupt function to run the hrtimer queues: */
131extern void hrtimer_run_queues(void); 147extern void hrtimer_run_queues(void);
132 148
diff --git a/include/linux/input.h b/include/linux/input.h
index 1d4e341b72e6..b0e612dda0cf 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -421,7 +421,7 @@ struct input_absinfo {
421#define BTN_GEAR_UP 0x151 421#define BTN_GEAR_UP 0x151
422 422
423#define KEY_OK 0x160 423#define KEY_OK 0x160
424#define KEY_SELECT 0x161 424#define KEY_SELECT 0x161
425#define KEY_GOTO 0x162 425#define KEY_GOTO 0x162
426#define KEY_CLEAR 0x163 426#define KEY_CLEAR 0x163
427#define KEY_POWER2 0x164 427#define KEY_POWER2 0x164
@@ -512,6 +512,15 @@ struct input_absinfo {
512#define KEY_FN_S 0x1e3 512#define KEY_FN_S 0x1e3
513#define KEY_FN_B 0x1e4 513#define KEY_FN_B 0x1e4
514 514
515#define KEY_BRL_DOT1 0x1f1
516#define KEY_BRL_DOT2 0x1f2
517#define KEY_BRL_DOT3 0x1f3
518#define KEY_BRL_DOT4 0x1f4
519#define KEY_BRL_DOT5 0x1f5
520#define KEY_BRL_DOT6 0x1f6
521#define KEY_BRL_DOT7 0x1f7
522#define KEY_BRL_DOT8 0x1f8
523
515/* We avoid low common keys in module aliases so they don't get huge. */ 524/* We avoid low common keys in module aliases so they don't get huge. */
516#define KEY_MIN_INTERESTING KEY_MUTE 525#define KEY_MIN_INTERESTING KEY_MUTE
517#define KEY_MAX 0x1ff 526#define KEY_MAX 0x1ff
@@ -929,7 +938,7 @@ struct input_dev {
929 938
930 struct input_handle *grab; 939 struct input_handle *grab;
931 940
932 struct semaphore sem; /* serializes open and close operations */ 941 struct mutex mutex; /* serializes open and close operations */
933 unsigned int users; 942 unsigned int users;
934 943
935 struct class_device cdev; 944 struct class_device cdev;
@@ -995,11 +1004,6 @@ static inline void init_input_dev(struct input_dev *dev)
995 1004
996struct input_dev *input_allocate_device(void); 1005struct input_dev *input_allocate_device(void);
997 1006
998static inline void input_free_device(struct input_dev *dev)
999{
1000 kfree(dev);
1001}
1002
1003static inline struct input_dev *input_get_device(struct input_dev *dev) 1007static inline struct input_dev *input_get_device(struct input_dev *dev)
1004{ 1008{
1005 return to_input_dev(class_device_get(&dev->cdev)); 1009 return to_input_dev(class_device_get(&dev->cdev));
@@ -1010,6 +1014,11 @@ static inline void input_put_device(struct input_dev *dev)
1010 class_device_put(&dev->cdev); 1014 class_device_put(&dev->cdev);
1011} 1015}
1012 1016
1017static inline void input_free_device(struct input_dev *dev)
1018{
1019 input_put_device(dev);
1020}
1021
1013int input_register_device(struct input_dev *); 1022int input_register_device(struct input_dev *);
1014void input_unregister_device(struct input_dev *); 1023void input_unregister_device(struct input_dev *);
1015 1024
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index 53571288a9fc..6d9c7e4da472 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -82,6 +82,13 @@ struct ipmi_smi_handlers
82{ 82{
83 struct module *owner; 83 struct module *owner;
84 84
85 /* The low-level interface cannot start sending messages to
86 the upper layer until this function is called. This may
87 not be NULL, the lower layer must take the interface from
88 this call. */
89 int (*start_processing)(void *send_info,
90 ipmi_smi_t new_intf);
91
85 /* Called to enqueue an SMI message to be sent. This 92 /* Called to enqueue an SMI message to be sent. This
86 operation is not allowed to fail. If an error occurs, it 93 operation is not allowed to fail. If an error occurs, it
87 should report back the error in a received message. It may 94 should report back the error in a received message. It may
@@ -157,13 +164,16 @@ static inline void ipmi_demangle_device_id(unsigned char *data,
157} 164}
158 165
159/* Add a low-level interface to the IPMI driver. Note that if the 166/* Add a low-level interface to the IPMI driver. Note that if the
160 interface doesn't know its slave address, it should pass in zero. */ 167 interface doesn't know its slave address, it should pass in zero.
168 The low-level interface should not deliver any messages to the
169 upper layer until the start_processing() function in the handlers
170 is called, and the lower layer must get the interface from that
171 call. */
161int ipmi_register_smi(struct ipmi_smi_handlers *handlers, 172int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
162 void *send_info, 173 void *send_info,
163 struct ipmi_device_id *device_id, 174 struct ipmi_device_id *device_id,
164 struct device *dev, 175 struct device *dev,
165 unsigned char slave_addr, 176 unsigned char slave_addr);
166 ipmi_smi_t *intf);
167 177
168/* 178/*
169 * Remove a low-level interface from the IPMI driver. This will 179 * Remove a low-level interface from the IPMI driver. This will
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index e87c32a5c86a..4eb851ece080 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -135,6 +135,8 @@ static inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag)
135 135
136#define U(x) ((x) ^ 0xf000) 136#define U(x) ((x) ^ 0xf000)
137 137
138#define BRL_UC_ROW 0x2800
139
138/* keyboard.c */ 140/* keyboard.c */
139 141
140struct console; 142struct console;
diff --git a/include/linux/keyboard.h b/include/linux/keyboard.h
index 08488042d74a..de76843bbe8a 100644
--- a/include/linux/keyboard.h
+++ b/include/linux/keyboard.h
@@ -44,6 +44,7 @@ extern unsigned short plain_map[NR_KEYS];
44#define KT_ASCII 9 44#define KT_ASCII 9
45#define KT_LOCK 10 45#define KT_LOCK 10
46#define KT_SLOCK 12 46#define KT_SLOCK 12
47#define KT_BRL 14
47 48
48#define K(t,v) (((t)<<8)|(v)) 49#define K(t,v) (((t)<<8)|(v))
49#define KTYP(x) ((x) >> 8) 50#define KTYP(x) ((x) >> 8)
@@ -427,5 +428,17 @@ extern unsigned short plain_map[NR_KEYS];
427 428
428#define NR_LOCK 8 429#define NR_LOCK 8
429 430
431#define K_BRL_BLANK K(KT_BRL, 0)
432#define K_BRL_DOT1 K(KT_BRL, 1)
433#define K_BRL_DOT2 K(KT_BRL, 2)
434#define K_BRL_DOT3 K(KT_BRL, 3)
435#define K_BRL_DOT4 K(KT_BRL, 4)
436#define K_BRL_DOT5 K(KT_BRL, 5)
437#define K_BRL_DOT6 K(KT_BRL, 6)
438#define K_BRL_DOT7 K(KT_BRL, 7)
439#define K_BRL_DOT8 K(KT_BRL, 8)
440
441#define NR_BRL 9
442
430#define MAX_DIACR 256 443#define MAX_DIACR 256
431#endif 444#endif
diff --git a/include/linux/leds.h b/include/linux/leds.h
new file mode 100644
index 000000000000..4617e75903b0
--- /dev/null
+++ b/include/linux/leds.h
@@ -0,0 +1,111 @@
1/*
2 * Driver model for leds and led triggers
3 *
4 * Copyright (C) 2005 John Lenz <lenz@cs.wisc.edu>
5 * Copyright (C) 2005 Richard Purdie <rpurdie@openedhand.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12#ifndef __LINUX_LEDS_H_INCLUDED
13#define __LINUX_LEDS_H_INCLUDED
14
15struct device;
16struct class_device;
17/*
18 * LED Core
19 */
20
21enum led_brightness {
22 LED_OFF = 0,
23 LED_HALF = 127,
24 LED_FULL = 255,
25};
26
27struct led_classdev {
28 const char *name;
29 int brightness;
30 int flags;
31#define LED_SUSPENDED (1 << 0)
32
33 /* A function to set the brightness of the led */
34 void (*brightness_set)(struct led_classdev *led_cdev,
35 enum led_brightness brightness);
36
37 struct class_device *class_dev;
38 /* LED Device linked list */
39 struct list_head node;
40
41 /* Trigger data */
42 char *default_trigger;
43#ifdef CONFIG_LEDS_TRIGGERS
44 rwlock_t trigger_lock;
45 /* Protects the trigger data below */
46
47 struct led_trigger *trigger;
48 struct list_head trig_list;
49 void *trigger_data;
50#endif
51};
52
53extern int led_classdev_register(struct device *parent,
54 struct led_classdev *led_cdev);
55extern void led_classdev_unregister(struct led_classdev *led_cdev);
56extern void led_classdev_suspend(struct led_classdev *led_cdev);
57extern void led_classdev_resume(struct led_classdev *led_cdev);
58
59/*
60 * LED Triggers
61 */
62#ifdef CONFIG_LEDS_TRIGGERS
63
64#define TRIG_NAME_MAX 50
65
66struct led_trigger {
67 /* Trigger Properties */
68 const char *name;
69 void (*activate)(struct led_classdev *led_cdev);
70 void (*deactivate)(struct led_classdev *led_cdev);
71
72 /* LEDs under control by this trigger (for simple triggers) */
73 rwlock_t leddev_list_lock;
74 struct list_head led_cdevs;
75
76 /* Link to next registered trigger */
77 struct list_head next_trig;
78};
79
80/* Registration functions for complex triggers */
81extern int led_trigger_register(struct led_trigger *trigger);
82extern void led_trigger_unregister(struct led_trigger *trigger);
83
84/* Registration functions for simple triggers */
85#define DEFINE_LED_TRIGGER(x) static struct led_trigger *x;
86#define DEFINE_LED_TRIGGER_GLOBAL(x) struct led_trigger *x;
87extern void led_trigger_register_simple(const char *name,
88 struct led_trigger **trigger);
89extern void led_trigger_unregister_simple(struct led_trigger *trigger);
90extern void led_trigger_event(struct led_trigger *trigger,
91 enum led_brightness event);
92
93#else
94
95/* Triggers aren't active - null macros */
96#define DEFINE_LED_TRIGGER(x)
97#define DEFINE_LED_TRIGGER_GLOBAL(x)
98#define led_trigger_register_simple(x, y) do {} while(0)
99#define led_trigger_unregister_simple(x) do {} while(0)
100#define led_trigger_event(x, y) do {} while(0)
101
102#endif
103
104/* Trigger specific functions */
105#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK
106extern void ledtrig_ide_activity(void);
107#else
108#define ledtrig_ide_activity() do {} while(0)
109#endif
110
111#endif /* __LINUX_LEDS_H_INCLUDED */
diff --git a/include/linux/libps2.h b/include/linux/libps2.h
index a710bddda4eb..08a450a9dbf7 100644
--- a/include/linux/libps2.h
+++ b/include/linux/libps2.h
@@ -28,7 +28,7 @@ struct ps2dev {
28 struct serio *serio; 28 struct serio *serio;
29 29
30 /* Ensures that only one command is executing at a time */ 30 /* Ensures that only one command is executing at a time */
31 struct semaphore cmd_sem; 31 struct mutex cmd_mutex;
32 32
33 /* Used to signal completion from interrupt handler */ 33 /* Used to signal completion from interrupt handler */
34 wait_queue_head_t wait; 34 wait_queue_head_t wait;
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 7d09962c3c0b..ff0a64073ebc 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -12,7 +12,7 @@ extern void migrate_page_copy(struct page *, struct page *);
12extern int migrate_page_remove_references(struct page *, struct page *, int); 12extern int migrate_page_remove_references(struct page *, struct page *, int);
13extern int migrate_pages(struct list_head *l, struct list_head *t, 13extern int migrate_pages(struct list_head *l, struct list_head *t,
14 struct list_head *moved, struct list_head *failed); 14 struct list_head *moved, struct list_head *failed);
15int migrate_pages_to(struct list_head *pagelist, 15extern int migrate_pages_to(struct list_head *pagelist,
16 struct vm_area_struct *vma, int dest); 16 struct vm_area_struct *vma, int dest);
17extern int fail_migrate_page(struct page *, struct page *); 17extern int fail_migrate_page(struct page *, struct page *);
18 18
@@ -26,6 +26,9 @@ static inline int putback_lru_pages(struct list_head *l) { return 0; }
26static inline int migrate_pages(struct list_head *l, struct list_head *t, 26static inline int migrate_pages(struct list_head *l, struct list_head *t,
27 struct list_head *moved, struct list_head *failed) { return -ENOSYS; } 27 struct list_head *moved, struct list_head *failed) { return -ENOSYS; }
28 28
29static inline int migrate_pages_to(struct list_head *pagelist,
30 struct vm_area_struct *vma, int dest) { return 0; }
31
29static inline int migrate_prep(void) { return -ENOSYS; } 32static inline int migrate_prep(void) { return -ENOSYS; }
30 33
31/* Possible settings for the migrate_page() method in address_operations */ 34/* Possible settings for the migrate_page() method in address_operations */
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h
index f46afec6fbf8..72fc68c5ee96 100644
--- a/include/linux/mtd/blktrans.h
+++ b/include/linux/mtd/blktrans.h
@@ -10,7 +10,7 @@
10#ifndef __MTD_TRANS_H__ 10#ifndef __MTD_TRANS_H__
11#define __MTD_TRANS_H__ 11#define __MTD_TRANS_H__
12 12
13#include <asm/semaphore.h> 13#include <linux/mutex.h>
14 14
15struct hd_geometry; 15struct hd_geometry;
16struct mtd_info; 16struct mtd_info;
@@ -22,7 +22,7 @@ struct mtd_blktrans_dev {
22 struct mtd_blktrans_ops *tr; 22 struct mtd_blktrans_ops *tr;
23 struct list_head list; 23 struct list_head list;
24 struct mtd_info *mtd; 24 struct mtd_info *mtd;
25 struct semaphore sem; 25 struct mutex lock;
26 int devnum; 26 int devnum;
27 int blksize; 27 int blksize;
28 unsigned long size; 28 unsigned long size;
diff --git a/include/linux/mtd/doc2000.h b/include/linux/mtd/doc2000.h
index 386a52cf8b1b..9addd073bf15 100644
--- a/include/linux/mtd/doc2000.h
+++ b/include/linux/mtd/doc2000.h
@@ -15,7 +15,7 @@
15#define __MTD_DOC2000_H__ 15#define __MTD_DOC2000_H__
16 16
17#include <linux/mtd/mtd.h> 17#include <linux/mtd/mtd.h>
18#include <asm/semaphore.h> 18#include <linux/mutex.h>
19 19
20#define DoC_Sig1 0 20#define DoC_Sig1 0
21#define DoC_Sig2 1 21#define DoC_Sig2 1
@@ -187,7 +187,7 @@ struct DiskOnChip {
187 int numchips; 187 int numchips;
188 struct Nand *chips; 188 struct Nand *chips;
189 struct mtd_info *nextdoc; 189 struct mtd_info *nextdoc;
190 struct semaphore lock; 190 struct mutex lock;
191}; 191};
192 192
193int doc_decode_ecc(unsigned char sector[512], unsigned char ecc1[6]); 193int doc_decode_ecc(unsigned char sector[512], unsigned char ecc1[6]);
diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h
index 0268125a6271..d7eaa40e5ab0 100644
--- a/include/linux/mtd/inftl.h
+++ b/include/linux/mtd/inftl.h
@@ -52,6 +52,11 @@ struct INFTLrecord {
52int INFTL_mount(struct INFTLrecord *s); 52int INFTL_mount(struct INFTLrecord *s);
53int INFTL_formatblock(struct INFTLrecord *s, int block); 53int INFTL_formatblock(struct INFTLrecord *s, int block);
54 54
55extern char inftlmountrev[];
56
57void INFTL_dumptables(struct INFTLrecord *s);
58void INFTL_dumpVUchains(struct INFTLrecord *s);
59
55#endif /* __KERNEL__ */ 60#endif /* __KERNEL__ */
56 61
57#endif /* __MTD_INFTL_H__ */ 62#endif /* __MTD_INFTL_H__ */
diff --git a/include/linux/namei.h b/include/linux/namei.h
index e6698013e4d0..58cb3d3d44b4 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -75,7 +75,6 @@ extern struct file *nameidata_to_filp(struct nameidata *nd, int flags);
75extern void release_open_intent(struct nameidata *); 75extern void release_open_intent(struct nameidata *);
76 76
77extern struct dentry * lookup_one_len(const char *, struct dentry *, int); 77extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
78extern __deprecated_for_modules struct dentry * lookup_hash(struct nameidata *);
79 78
80extern int follow_down(struct vfsmount **, struct dentry **); 79extern int follow_down(struct vfsmount **, struct dentry **);
81extern int follow_up(struct vfsmount **, struct dentry **); 80extern int follow_up(struct vfsmount **, struct dentry **);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 950dc55e5192..40ccf8cc4239 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -598,20 +598,7 @@ DECLARE_PER_CPU(struct softnet_data,softnet_data);
598 598
599#define HAVE_NETIF_QUEUE 599#define HAVE_NETIF_QUEUE
600 600
601static inline void __netif_schedule(struct net_device *dev) 601extern void __netif_schedule(struct net_device *dev);
602{
603 if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) {
604 unsigned long flags;
605 struct softnet_data *sd;
606
607 local_irq_save(flags);
608 sd = &__get_cpu_var(softnet_data);
609 dev->next_sched = sd->output_queue;
610 sd->output_queue = dev;
611 raise_softirq_irqoff(NET_TX_SOFTIRQ);
612 local_irq_restore(flags);
613 }
614}
615 602
616static inline void netif_schedule(struct net_device *dev) 603static inline void netif_schedule(struct net_device *dev)
617{ 604{
@@ -675,13 +662,7 @@ static inline void dev_kfree_skb_irq(struct sk_buff *skb)
675/* Use this variant in places where it could be invoked 662/* Use this variant in places where it could be invoked
676 * either from interrupt or non-interrupt context. 663 * either from interrupt or non-interrupt context.
677 */ 664 */
678static inline void dev_kfree_skb_any(struct sk_buff *skb) 665extern void dev_kfree_skb_any(struct sk_buff *skb);
679{
680 if (in_irq() || irqs_disabled())
681 dev_kfree_skb_irq(skb);
682 else
683 dev_kfree_skb(skb);
684}
685 666
686#define HAVE_NETIF_RX 1 667#define HAVE_NETIF_RX 1
687extern int netif_rx(struct sk_buff *skb); 668extern int netif_rx(struct sk_buff *skb);
@@ -768,22 +749,9 @@ static inline int netif_device_present(struct net_device *dev)
768 return test_bit(__LINK_STATE_PRESENT, &dev->state); 749 return test_bit(__LINK_STATE_PRESENT, &dev->state);
769} 750}
770 751
771static inline void netif_device_detach(struct net_device *dev) 752extern void netif_device_detach(struct net_device *dev);
772{
773 if (test_and_clear_bit(__LINK_STATE_PRESENT, &dev->state) &&
774 netif_running(dev)) {
775 netif_stop_queue(dev);
776 }
777}
778 753
779static inline void netif_device_attach(struct net_device *dev) 754extern void netif_device_attach(struct net_device *dev);
780{
781 if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) &&
782 netif_running(dev)) {
783 netif_wake_queue(dev);
784 __netdev_watchdog_up(dev);
785 }
786}
787 755
788/* 756/*
789 * Network interface message level settings 757 * Network interface message level settings
@@ -851,20 +819,7 @@ static inline int netif_rx_schedule_prep(struct net_device *dev)
851 * already been called and returned 1. 819 * already been called and returned 1.
852 */ 820 */
853 821
854static inline void __netif_rx_schedule(struct net_device *dev) 822extern void __netif_rx_schedule(struct net_device *dev);
855{
856 unsigned long flags;
857
858 local_irq_save(flags);
859 dev_hold(dev);
860 list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list);
861 if (dev->quota < 0)
862 dev->quota += dev->weight;
863 else
864 dev->quota = dev->weight;
865 __raise_softirq_irqoff(NET_RX_SOFTIRQ);
866 local_irq_restore(flags);
867}
868 823
869/* Try to reschedule poll. Called by irq handler. */ 824/* Try to reschedule poll. Called by irq handler. */
870 825
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 1350e47b0234..f6bdef82a322 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -142,6 +142,12 @@ struct xt_counters_info
142#define ASSERT_WRITE_LOCK(x) 142#define ASSERT_WRITE_LOCK(x)
143#include <linux/netfilter_ipv4/listhelp.h> 143#include <linux/netfilter_ipv4/listhelp.h>
144 144
145#ifdef CONFIG_COMPAT
146#define COMPAT_TO_USER 1
147#define COMPAT_FROM_USER -1
148#define COMPAT_CALC_SIZE 0
149#endif
150
145struct xt_match 151struct xt_match
146{ 152{
147 struct list_head list; 153 struct list_head list;
@@ -175,6 +181,9 @@ struct xt_match
175 void (*destroy)(const struct xt_match *match, void *matchinfo, 181 void (*destroy)(const struct xt_match *match, void *matchinfo,
176 unsigned int matchinfosize); 182 unsigned int matchinfosize);
177 183
184 /* Called when userspace align differs from kernel space one */
185 int (*compat)(void *match, void **dstptr, int *size, int convert);
186
178 /* Set this to THIS_MODULE if you are a module, otherwise NULL */ 187 /* Set this to THIS_MODULE if you are a module, otherwise NULL */
179 struct module *me; 188 struct module *me;
180 189
@@ -220,6 +229,9 @@ struct xt_target
220 void (*destroy)(const struct xt_target *target, void *targinfo, 229 void (*destroy)(const struct xt_target *target, void *targinfo,
221 unsigned int targinfosize); 230 unsigned int targinfosize);
222 231
232 /* Called when userspace align differs from kernel space one */
233 int (*compat)(void *target, void **dstptr, int *size, int convert);
234
223 /* Set this to THIS_MODULE if you are a module, otherwise NULL */ 235 /* Set this to THIS_MODULE if you are a module, otherwise NULL */
224 struct module *me; 236 struct module *me;
225 237
@@ -314,6 +326,61 @@ extern void xt_proto_fini(int af);
314extern struct xt_table_info *xt_alloc_table_info(unsigned int size); 326extern struct xt_table_info *xt_alloc_table_info(unsigned int size);
315extern void xt_free_table_info(struct xt_table_info *info); 327extern void xt_free_table_info(struct xt_table_info *info);
316 328
329#ifdef CONFIG_COMPAT
330#include <net/compat.h>
331
332struct compat_xt_entry_match
333{
334 union {
335 struct {
336 u_int16_t match_size;
337 char name[XT_FUNCTION_MAXNAMELEN - 1];
338 u_int8_t revision;
339 } user;
340 u_int16_t match_size;
341 } u;
342 unsigned char data[0];
343};
344
345struct compat_xt_entry_target
346{
347 union {
348 struct {
349 u_int16_t target_size;
350 char name[XT_FUNCTION_MAXNAMELEN - 1];
351 u_int8_t revision;
352 } user;
353 u_int16_t target_size;
354 } u;
355 unsigned char data[0];
356};
357
358/* FIXME: this works only on 32 bit tasks
359 * need to change whole approach in order to calculate align as function of
360 * current task alignment */
361
362struct compat_xt_counters
363{
364 u_int32_t cnt[4];
365};
366
367struct compat_xt_counters_info
368{
369 char name[XT_TABLE_MAXNAMELEN];
370 compat_uint_t num_counters;
371 struct compat_xt_counters counters[0];
372};
373
374#define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \
375 & ~(__alignof__(struct compat_xt_counters)-1))
376
377extern void xt_compat_lock(int af);
378extern void xt_compat_unlock(int af);
379extern int xt_compat_match(void *match, void **dstptr, int *size, int convert);
380extern int xt_compat_target(void *target, void **dstptr, int *size,
381 int convert);
382
383#endif /* CONFIG_COMPAT */
317#endif /* __KERNEL__ */ 384#endif /* __KERNEL__ */
318 385
319#endif /* _X_TABLES_H */ 386#endif /* _X_TABLES_H */
diff --git a/include/linux/netfilter/xt_esp.h b/include/linux/netfilter/xt_esp.h
new file mode 100644
index 000000000000..9380fb1c27da
--- /dev/null
+++ b/include/linux/netfilter/xt_esp.h
@@ -0,0 +1,14 @@
1#ifndef _XT_ESP_H
2#define _XT_ESP_H
3
4struct xt_esp
5{
6 u_int32_t spis[2]; /* Security Parameter Index */
7 u_int8_t invflags; /* Inverse flags */
8};
9
10/* Values for "invflags" field in struct xt_esp. */
11#define XT_ESP_INV_SPI 0x01 /* Invert the sense of spi. */
12#define XT_ESP_INV_MASK 0x01 /* All possible flags. */
13
14#endif /*_XT_ESP_H*/
diff --git a/include/linux/netfilter/xt_multiport.h b/include/linux/netfilter/xt_multiport.h
new file mode 100644
index 000000000000..d49ee4183710
--- /dev/null
+++ b/include/linux/netfilter/xt_multiport.h
@@ -0,0 +1,30 @@
1#ifndef _XT_MULTIPORT_H
2#define _XT_MULTIPORT_H
3
4enum xt_multiport_flags
5{
6 XT_MULTIPORT_SOURCE,
7 XT_MULTIPORT_DESTINATION,
8 XT_MULTIPORT_EITHER
9};
10
11#define XT_MULTI_PORTS 15
12
13/* Must fit inside union xt_matchinfo: 16 bytes */
14struct xt_multiport
15{
16 u_int8_t flags; /* Type of comparison */
17 u_int8_t count; /* Number of ports */
18 u_int16_t ports[XT_MULTI_PORTS]; /* Ports */
19};
20
21struct xt_multiport_v1
22{
23 u_int8_t flags; /* Type of comparison */
24 u_int8_t count; /* Number of ports */
25 u_int16_t ports[XT_MULTI_PORTS]; /* Ports */
26 u_int8_t pflags[XT_MULTI_PORTS]; /* Port flags */
27 u_int8_t invert; /* Invert flag */
28};
29
30#endif /*_XT_MULTIPORT_H*/
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index d5b8c0d6a12b..c0dac16e1902 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -316,5 +316,23 @@ extern unsigned int ipt_do_table(struct sk_buff **pskb,
316 void *userdata); 316 void *userdata);
317 317
318#define IPT_ALIGN(s) XT_ALIGN(s) 318#define IPT_ALIGN(s) XT_ALIGN(s)
319
320#ifdef CONFIG_COMPAT
321#include <net/compat.h>
322
323struct compat_ipt_entry
324{
325 struct ipt_ip ip;
326 compat_uint_t nfcache;
327 u_int16_t target_offset;
328 u_int16_t next_offset;
329 compat_uint_t comefrom;
330 struct compat_xt_counters counters;
331 unsigned char elems[0];
332};
333
334#define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s)
335
336#endif /* CONFIG_COMPAT */
319#endif /*__KERNEL__*/ 337#endif /*__KERNEL__*/
320#endif /* _IPTABLES_H */ 338#endif /* _IPTABLES_H */
diff --git a/include/linux/netfilter_ipv4/ipt_esp.h b/include/linux/netfilter_ipv4/ipt_esp.h
index c782a83e53e0..78296e7eeff9 100644
--- a/include/linux/netfilter_ipv4/ipt_esp.h
+++ b/include/linux/netfilter_ipv4/ipt_esp.h
@@ -1,16 +1,10 @@
1#ifndef _IPT_ESP_H 1#ifndef _IPT_ESP_H
2#define _IPT_ESP_H 2#define _IPT_ESP_H
3 3
4struct ipt_esp 4#include <linux/netfilter/xt_esp.h>
5{
6 u_int32_t spis[2]; /* Security Parameter Index */
7 u_int8_t invflags; /* Inverse flags */
8};
9 5
10 6#define ipt_esp xt_esp
11 7#define IPT_ESP_INV_SPI XT_ESP_INV_SPI
12/* Values for "invflags" field in struct ipt_esp. */ 8#define IPT_ESP_INV_MASK XT_ESP_INV_MASK
13#define IPT_ESP_INV_SPI 0x01 /* Invert the sense of spi. */
14#define IPT_ESP_INV_MASK 0x01 /* All possible flags. */
15 9
16#endif /*_IPT_ESP_H*/ 10#endif /*_IPT_ESP_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_multiport.h b/include/linux/netfilter_ipv4/ipt_multiport.h
index e6b6fff811df..55fe85eca88c 100644
--- a/include/linux/netfilter_ipv4/ipt_multiport.h
+++ b/include/linux/netfilter_ipv4/ipt_multiport.h
@@ -1,30 +1,15 @@
1#ifndef _IPT_MULTIPORT_H 1#ifndef _IPT_MULTIPORT_H
2#define _IPT_MULTIPORT_H 2#define _IPT_MULTIPORT_H
3#include <linux/netfilter_ipv4/ip_tables.h>
4 3
5enum ipt_multiport_flags 4#include <linux/netfilter/xt_multiport.h>
6{
7 IPT_MULTIPORT_SOURCE,
8 IPT_MULTIPORT_DESTINATION,
9 IPT_MULTIPORT_EITHER
10};
11 5
12#define IPT_MULTI_PORTS 15 6#define IPT_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE
7#define IPT_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION
8#define IPT_MULTIPORT_EITHER XT_MULTIPORT_EITHER
13 9
14/* Must fit inside union ipt_matchinfo: 16 bytes */ 10#define IPT_MULTI_PORTS XT_MULTI_PORTS
15struct ipt_multiport 11
16{ 12#define ipt_multiport xt_multiport
17 u_int8_t flags; /* Type of comparison */ 13#define ipt_multiport_v1 xt_multiport_v1
18 u_int8_t count; /* Number of ports */
19 u_int16_t ports[IPT_MULTI_PORTS]; /* Ports */
20};
21 14
22struct ipt_multiport_v1
23{
24 u_int8_t flags; /* Type of comparison */
25 u_int8_t count; /* Number of ports */
26 u_int16_t ports[IPT_MULTI_PORTS]; /* Ports */
27 u_int8_t pflags[IPT_MULTI_PORTS]; /* Port flags */
28 u_int8_t invert; /* Invert flag */
29};
30#endif /*_IPT_MULTIPORT_H*/ 15#endif /*_IPT_MULTIPORT_H*/
diff --git a/include/linux/netfilter_ipv6/ip6t_esp.h b/include/linux/netfilter_ipv6/ip6t_esp.h
index a91b6abc8079..f62eaf53c16c 100644
--- a/include/linux/netfilter_ipv6/ip6t_esp.h
+++ b/include/linux/netfilter_ipv6/ip6t_esp.h
@@ -1,14 +1,10 @@
1#ifndef _IP6T_ESP_H 1#ifndef _IP6T_ESP_H
2#define _IP6T_ESP_H 2#define _IP6T_ESP_H
3 3
4struct ip6t_esp 4#include <linux/netfilter/xt_esp.h>
5{
6 u_int32_t spis[2]; /* Security Parameter Index */
7 u_int8_t invflags; /* Inverse flags */
8};
9 5
10/* Values for "invflags" field in struct ip6t_esp. */ 6#define ip6t_esp xt_esp
11#define IP6T_ESP_INV_SPI 0x01 /* Invert the sense of spi. */ 7#define IP6T_ESP_INV_SPI XT_ESP_INV_SPI
12#define IP6T_ESP_INV_MASK 0x01 /* All possible flags. */ 8#define IP6T_ESP_INV_MASK XT_ESP_INV_MASK
13 9
14#endif /*_IP6T_ESP_H*/ 10#endif /*_IP6T_ESP_H*/
diff --git a/include/linux/netfilter_ipv6/ip6t_multiport.h b/include/linux/netfilter_ipv6/ip6t_multiport.h
index efe4954a8681..042c92661cee 100644
--- a/include/linux/netfilter_ipv6/ip6t_multiport.h
+++ b/include/linux/netfilter_ipv6/ip6t_multiport.h
@@ -1,21 +1,14 @@
1#ifndef _IP6T_MULTIPORT_H 1#ifndef _IP6T_MULTIPORT_H
2#define _IP6T_MULTIPORT_H 2#define _IP6T_MULTIPORT_H
3#include <linux/netfilter_ipv6/ip6_tables.h>
4 3
5enum ip6t_multiport_flags 4#include <linux/netfilter/xt_multiport.h>
6{
7 IP6T_MULTIPORT_SOURCE,
8 IP6T_MULTIPORT_DESTINATION,
9 IP6T_MULTIPORT_EITHER
10};
11 5
12#define IP6T_MULTI_PORTS 15 6#define IP6T_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE
7#define IP6T_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION
8#define IP6T_MULTIPORT_EITHER XT_MULTIPORT_EITHER
13 9
14/* Must fit inside union ip6t_matchinfo: 16 bytes */ 10#define IP6T_MULTI_PORTS XT_MULTI_PORTS
15struct ip6t_multiport 11
16{ 12#define ip6t_multiport xt_multiport
17 u_int8_t flags; /* Type of comparison */ 13
18 u_int8_t count; /* Number of ports */ 14#endif /*_IP6T_MULTIPORT_H*/
19 u_int16_t ports[IP6T_MULTI_PORTS]; /* Ports */
20};
21#endif /*_IPT_MULTIPORT_H*/
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 839f0b3c23aa..9539efd4f7e6 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -72,8 +72,8 @@ extern struct page * find_get_page(struct address_space *mapping,
72 unsigned long index); 72 unsigned long index);
73extern struct page * find_lock_page(struct address_space *mapping, 73extern struct page * find_lock_page(struct address_space *mapping,
74 unsigned long index); 74 unsigned long index);
75extern struct page * find_trylock_page(struct address_space *mapping, 75extern __deprecated_for_modules struct page * find_trylock_page(
76 unsigned long index); 76 struct address_space *mapping, unsigned long index);
77extern struct page * find_or_create_page(struct address_space *mapping, 77extern struct page * find_or_create_page(struct address_space *mapping,
78 unsigned long index, gfp_t gfp_mask); 78 unsigned long index, gfp_t gfp_mask);
79unsigned find_get_pages(struct address_space *mapping, pgoff_t start, 79unsigned find_get_pages(struct address_space *mapping, pgoff_t start,
diff --git a/include/linux/pid.h b/include/linux/pid.h
index 5b9082cc600f..29960b03bef7 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -1,6 +1,8 @@
1#ifndef _LINUX_PID_H 1#ifndef _LINUX_PID_H
2#define _LINUX_PID_H 2#define _LINUX_PID_H
3 3
4#include <linux/rcupdate.h>
5
4enum pid_type 6enum pid_type
5{ 7{
6 PIDTYPE_PID, 8 PIDTYPE_PID,
@@ -9,45 +11,109 @@ enum pid_type
9 PIDTYPE_MAX 11 PIDTYPE_MAX
10}; 12};
11 13
14/*
15 * What is struct pid?
16 *
17 * A struct pid is the kernel's internal notion of a process identifier.
18 * It refers to individual tasks, process groups, and sessions. While
19 * there are processes attached to it the struct pid lives in a hash
20 * table, so it and then the processes that it refers to can be found
21 * quickly from the numeric pid value. The attached processes may be
22 * quickly accessed by following pointers from struct pid.
23 *
24 * Storing pid_t values in the kernel and refering to them later has a
25 * problem. The process originally with that pid may have exited and the
26 * pid allocator wrapped, and another process could have come along
27 * and been assigned that pid.
28 *
29 * Referring to user space processes by holding a reference to struct
30 * task_struct has a problem. When the user space process exits
31 * the now useless task_struct is still kept. A task_struct plus a
32 * stack consumes around 10K of low kernel memory. More precisely
33 * this is THREAD_SIZE + sizeof(struct task_struct). By comparison
34 * a struct pid is about 64 bytes.
35 *
36 * Holding a reference to struct pid solves both of these problems.
37 * It is small so holding a reference does not consume a lot of
38 * resources, and since a new struct pid is allocated when the numeric
39 * pid value is reused we don't mistakenly refer to new processes.
40 */
41
12struct pid 42struct pid
13{ 43{
44 atomic_t count;
14 /* Try to keep pid_chain in the same cacheline as nr for find_pid */ 45 /* Try to keep pid_chain in the same cacheline as nr for find_pid */
15 int nr; 46 int nr;
16 struct hlist_node pid_chain; 47 struct hlist_node pid_chain;
17 /* list of pids with the same nr, only one of them is in the hash */ 48 /* lists of tasks that use this pid */
18 struct list_head pid_list; 49 struct hlist_head tasks[PIDTYPE_MAX];
50 struct rcu_head rcu;
19}; 51};
20 52
21#define pid_task(elem, type) \ 53struct pid_link
22 list_entry(elem, struct task_struct, pids[type].pid_list) 54{
55 struct hlist_node node;
56 struct pid *pid;
57};
58
59static inline struct pid *get_pid(struct pid *pid)
60{
61 if (pid)
62 atomic_inc(&pid->count);
63 return pid;
64}
65
66extern void FASTCALL(put_pid(struct pid *pid));
67extern struct task_struct *FASTCALL(pid_task(struct pid *pid, enum pid_type));
68extern struct task_struct *FASTCALL(get_pid_task(struct pid *pid,
69 enum pid_type));
23 70
24/* 71/*
25 * attach_pid() and detach_pid() must be called with the tasklist_lock 72 * attach_pid() and detach_pid() must be called with the tasklist_lock
26 * write-held. 73 * write-held.
27 */ 74 */
28extern int FASTCALL(attach_pid(struct task_struct *task, enum pid_type type, int nr)); 75extern int FASTCALL(attach_pid(struct task_struct *task,
76 enum pid_type type, int nr));
29 77
30extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type)); 78extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type));
31 79
32/* 80/*
33 * look up a PID in the hash table. Must be called with the tasklist_lock 81 * look up a PID in the hash table. Must be called with the tasklist_lock
34 * held. 82 * or rcu_read_lock() held.
83 */
84extern struct pid *FASTCALL(find_pid(int nr));
85
86/*
87 * Lookup a PID in the hash table, and return with it's count elevated.
35 */ 88 */
36extern struct pid *FASTCALL(find_pid(enum pid_type, int)); 89extern struct pid *find_get_pid(int nr);
37 90
38extern int alloc_pidmap(void); 91extern struct pid *alloc_pid(void);
39extern void FASTCALL(free_pidmap(int)); 92extern void FASTCALL(free_pid(struct pid *pid));
40 93
94#define pid_next(task, type) \
95 ((task)->pids[(type)].node.next)
96
97#define pid_next_task(task, type) \
98 hlist_entry(pid_next(task, type), struct task_struct, \
99 pids[(type)].node)
100
101
102/* We could use hlist_for_each_entry_rcu here but it takes more arguments
103 * than the do_each_task_pid/while_each_task_pid. So we roll our own
104 * to preserve the existing interface.
105 */
41#define do_each_task_pid(who, type, task) \ 106#define do_each_task_pid(who, type, task) \
42 if ((task = find_task_by_pid_type(type, who))) { \ 107 if ((task = find_task_by_pid_type(type, who))) { \
43 prefetch((task)->pids[type].pid_list.next); \ 108 prefetch(pid_next(task, type)); \
44 do { 109 do {
45 110
46#define while_each_task_pid(who, type, task) \ 111#define while_each_task_pid(who, type, task) \
47 } while (task = pid_task((task)->pids[type].pid_list.next,\ 112 } while (pid_next(task, type) && ({ \
48 type), \ 113 task = pid_next_task(task, type); \
49 prefetch((task)->pids[type].pid_list.next), \ 114 rcu_dereference(task); \
50 hlist_unhashed(&(task)->pids[type].pid_chain)); \ 115 prefetch(pid_next(task, type)); \
51 } \ 116 1; }) ); \
117 }
52 118
53#endif /* _LINUX_PID_H */ 119#endif /* _LINUX_PID_H */
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 75c7f55023ab..ec384958d509 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -5,11 +5,14 @@
5 5
6#define PIPE_BUFFERS (16) 6#define PIPE_BUFFERS (16)
7 7
8#define PIPE_BUF_FLAG_STOLEN 0x01
9#define PIPE_BUF_FLAG_LRU 0x02
10
8struct pipe_buffer { 11struct pipe_buffer {
9 struct page *page; 12 struct page *page;
10 unsigned int offset, len; 13 unsigned int offset, len;
11 struct pipe_buf_operations *ops; 14 struct pipe_buf_operations *ops;
12 unsigned int stolen; 15 unsigned int flags;
13}; 16};
14 17
15struct pipe_buf_operations { 18struct pipe_buf_operations {
@@ -60,5 +63,9 @@ void free_pipe_info(struct inode* inode);
60 * add the splice flags here. 63 * add the splice flags here.
61 */ 64 */
62#define SPLICE_F_MOVE (0x01) /* move pages instead of copying */ 65#define SPLICE_F_MOVE (0x01) /* move pages instead of copying */
66#define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */
67 /* we may still block on the fd we splice */
68 /* from/to, of course */
69#define SPLICE_F_MORE (0x04) /* expect more data */
63 70
64#endif 71#endif
diff --git a/include/linux/sched.h b/include/linux/sched.h
index d04186d8cc68..541f4828f5e7 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -100,6 +100,7 @@ DECLARE_PER_CPU(unsigned long, process_counts);
100extern int nr_processes(void); 100extern int nr_processes(void);
101extern unsigned long nr_running(void); 101extern unsigned long nr_running(void);
102extern unsigned long nr_uninterruptible(void); 102extern unsigned long nr_uninterruptible(void);
103extern unsigned long nr_active(void);
103extern unsigned long nr_iowait(void); 104extern unsigned long nr_iowait(void);
104 105
105#include <linux/time.h> 106#include <linux/time.h>
@@ -483,6 +484,7 @@ struct signal_struct {
483#define MAX_PRIO (MAX_RT_PRIO + 40) 484#define MAX_PRIO (MAX_RT_PRIO + 40)
484 485
485#define rt_task(p) (unlikely((p)->prio < MAX_RT_PRIO)) 486#define rt_task(p) (unlikely((p)->prio < MAX_RT_PRIO))
487#define batch_task(p) (unlikely((p)->policy == SCHED_BATCH))
486 488
487/* 489/*
488 * Some day this will be a full-fledged user tracking system.. 490 * Some day this will be a full-fledged user tracking system..
@@ -683,6 +685,13 @@ static inline void prefetch_stack(struct task_struct *t) { }
683struct audit_context; /* See audit.c */ 685struct audit_context; /* See audit.c */
684struct mempolicy; 686struct mempolicy;
685 687
688enum sleep_type {
689 SLEEP_NORMAL,
690 SLEEP_NONINTERACTIVE,
691 SLEEP_INTERACTIVE,
692 SLEEP_INTERRUPTED,
693};
694
686struct task_struct { 695struct task_struct {
687 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ 696 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
688 struct thread_info *thread_info; 697 struct thread_info *thread_info;
@@ -705,7 +714,7 @@ struct task_struct {
705 unsigned long sleep_avg; 714 unsigned long sleep_avg;
706 unsigned long long timestamp, last_ran; 715 unsigned long long timestamp, last_ran;
707 unsigned long long sched_time; /* sched_clock time spent running */ 716 unsigned long long sched_time; /* sched_clock time spent running */
708 int activated; 717 enum sleep_type sleep_type;
709 718
710 unsigned long policy; 719 unsigned long policy;
711 cpumask_t cpus_allowed; 720 cpumask_t cpus_allowed;
@@ -751,7 +760,7 @@ struct task_struct {
751 struct task_struct *group_leader; /* threadgroup leader */ 760 struct task_struct *group_leader; /* threadgroup leader */
752 761
753 /* PID/PID hash table linkage. */ 762 /* PID/PID hash table linkage. */
754 struct pid pids[PIDTYPE_MAX]; 763 struct pid_link pids[PIDTYPE_MAX];
755 struct list_head thread_group; 764 struct list_head thread_group;
756 765
757 struct completion *vfork_done; /* for vfork() */ 766 struct completion *vfork_done; /* for vfork() */
@@ -890,18 +899,19 @@ static inline pid_t process_group(struct task_struct *tsk)
890 */ 899 */
891static inline int pid_alive(struct task_struct *p) 900static inline int pid_alive(struct task_struct *p)
892{ 901{
893 return p->pids[PIDTYPE_PID].nr != 0; 902 return p->pids[PIDTYPE_PID].pid != NULL;
894} 903}
895 904
896extern void free_task(struct task_struct *tsk); 905extern void free_task(struct task_struct *tsk);
897#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) 906#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
898 907
899extern void __put_task_struct_cb(struct rcu_head *rhp); 908extern void __put_task_struct_cb(struct rcu_head *rhp);
909extern void __put_task_struct(struct task_struct *t);
900 910
901static inline void put_task_struct(struct task_struct *t) 911static inline void put_task_struct(struct task_struct *t)
902{ 912{
903 if (atomic_dec_and_test(&t->usage)) 913 if (atomic_dec_and_test(&t->usage))
904 call_rcu(&t->rcu, __put_task_struct_cb); 914 __put_task_struct(t);
905} 915}
906 916
907/* 917/*
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 690aabca8ed0..6348e8330897 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -18,6 +18,7 @@
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/list.h> 19#include <linux/list.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <linux/mutex.h>
21#include <linux/device.h> 22#include <linux/device.h>
22#include <linux/mod_devicetable.h> 23#include <linux/mod_devicetable.h>
23 24
@@ -42,7 +43,7 @@ struct serio {
42 struct serio *parent, *child; 43 struct serio *parent, *child;
43 44
44 struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */ 45 struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */
45 struct semaphore drv_sem; /* protects serio->drv so attributes can pin driver */ 46 struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
46 47
47 struct device dev; 48 struct device dev;
48 unsigned int registered; /* port has been fully registered with driver core */ 49 unsigned int registered; /* port has been fully registered with driver core */
@@ -151,17 +152,17 @@ static inline void serio_continue_rx(struct serio *serio)
151 */ 152 */
152static inline int serio_pin_driver(struct serio *serio) 153static inline int serio_pin_driver(struct serio *serio)
153{ 154{
154 return down_interruptible(&serio->drv_sem); 155 return mutex_lock_interruptible(&serio->drv_mutex);
155} 156}
156 157
157static inline void serio_pin_driver_uninterruptible(struct serio *serio) 158static inline void serio_pin_driver_uninterruptible(struct serio *serio)
158{ 159{
159 down(&serio->drv_sem); 160 mutex_lock(&serio->drv_mutex);
160} 161}
161 162
162static inline void serio_unpin_driver(struct serio *serio) 163static inline void serio_unpin_driver(struct serio *serio)
163{ 164{
164 up(&serio->drv_sem); 165 mutex_unlock(&serio->drv_mutex);
165} 166}
166 167
167 168
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 613b9513f8b9..c4619a428d9b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -941,6 +941,25 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
941#define NET_IP_ALIGN 2 941#define NET_IP_ALIGN 2
942#endif 942#endif
943 943
944/*
945 * The networking layer reserves some headroom in skb data (via
946 * dev_alloc_skb). This is used to avoid having to reallocate skb data when
947 * the header has to grow. In the default case, if the header has to grow
948 * 16 bytes or less we avoid the reallocation.
949 *
950 * Unfortunately this headroom changes the DMA alignment of the resulting
951 * network packet. As for NET_IP_ALIGN, this unaligned DMA is expensive
952 * on some architectures. An architecture can override this value,
953 * perhaps setting it to a cacheline in size (since that will maintain
954 * cacheline alignment of the DMA). It must be a power of 2.
955 *
956 * Various parts of the networking layer expect at least 16 bytes of
957 * headroom, you should not reduce this.
958 */
959#ifndef NET_SKB_PAD
960#define NET_SKB_PAD 16
961#endif
962
944extern int ___pskb_trim(struct sk_buff *skb, unsigned int len, int realloc); 963extern int ___pskb_trim(struct sk_buff *skb, unsigned int len, int realloc);
945 964
946static inline void __skb_trim(struct sk_buff *skb, unsigned int len) 965static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
@@ -1030,9 +1049,9 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
1030static inline struct sk_buff *__dev_alloc_skb(unsigned int length, 1049static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
1031 gfp_t gfp_mask) 1050 gfp_t gfp_mask)
1032{ 1051{
1033 struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); 1052 struct sk_buff *skb = alloc_skb(length + NET_SKB_PAD, gfp_mask);
1034 if (likely(skb)) 1053 if (likely(skb))
1035 skb_reserve(skb, 16); 1054 skb_reserve(skb, NET_SKB_PAD);
1036 return skb; 1055 return skb;
1037} 1056}
1038#else 1057#else
@@ -1070,13 +1089,15 @@ static inline struct sk_buff *dev_alloc_skb(unsigned int length)
1070 */ 1089 */
1071static inline int skb_cow(struct sk_buff *skb, unsigned int headroom) 1090static inline int skb_cow(struct sk_buff *skb, unsigned int headroom)
1072{ 1091{
1073 int delta = (headroom > 16 ? headroom : 16) - skb_headroom(skb); 1092 int delta = (headroom > NET_SKB_PAD ? headroom : NET_SKB_PAD) -
1093 skb_headroom(skb);
1074 1094
1075 if (delta < 0) 1095 if (delta < 0)
1076 delta = 0; 1096 delta = 0;
1077 1097
1078 if (delta || skb_cloned(skb)) 1098 if (delta || skb_cloned(skb))
1079 return pskb_expand_head(skb, (delta + 15) & ~15, 0, GFP_ATOMIC); 1099 return pskb_expand_head(skb, (delta + (NET_SKB_PAD-1)) &
1100 ~(NET_SKB_PAD-1), 0, GFP_ATOMIC);
1080 return 0; 1101 return 0;
1081} 1102}
1082 1103
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index e78ffc7d5b56..5717147596b6 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -571,5 +571,7 @@ asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
571asmlinkage long sys_unshare(unsigned long unshare_flags); 571asmlinkage long sys_unshare(unsigned long unshare_flags);
572asmlinkage long sys_splice(int fdin, int fdout, size_t len, 572asmlinkage long sys_splice(int fdin, int fdout, size_t len,
573 unsigned int flags); 573 unsigned int flags);
574asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes,
575 int flags);
574 576
575#endif 577#endif
diff --git a/include/linux/timer.h b/include/linux/timer.h
index b5caabca553c..0a485beba9f5 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -6,7 +6,7 @@
6#include <linux/spinlock.h> 6#include <linux/spinlock.h>
7#include <linux/stddef.h> 7#include <linux/stddef.h>
8 8
9struct timer_base_s; 9struct tvec_t_base_s;
10 10
11struct timer_list { 11struct timer_list {
12 struct list_head entry; 12 struct list_head entry;
@@ -15,16 +15,16 @@ struct timer_list {
15 void (*function)(unsigned long); 15 void (*function)(unsigned long);
16 unsigned long data; 16 unsigned long data;
17 17
18 struct timer_base_s *base; 18 struct tvec_t_base_s *base;
19}; 19};
20 20
21extern struct timer_base_s __init_timer_base; 21extern struct tvec_t_base_s boot_tvec_bases;
22 22
23#define TIMER_INITIALIZER(_function, _expires, _data) { \ 23#define TIMER_INITIALIZER(_function, _expires, _data) { \
24 .function = (_function), \ 24 .function = (_function), \
25 .expires = (_expires), \ 25 .expires = (_expires), \
26 .data = (_data), \ 26 .data = (_data), \
27 .base = &__init_timer_base, \ 27 .base = &boot_tvec_bases, \
28 } 28 }
29 29
30#define DEFINE_TIMER(_name, _function, _expires, _data) \ 30#define DEFINE_TIMER(_name, _function, _expires, _data) \
diff --git a/include/linux/tiocl.h b/include/linux/tiocl.h
index 2c9e847f6ed1..4756862c4ed4 100644
--- a/include/linux/tiocl.h
+++ b/include/linux/tiocl.h
@@ -34,5 +34,6 @@ struct tiocl_selection {
34#define TIOCL_SCROLLCONSOLE 13 /* scroll console */ 34#define TIOCL_SCROLLCONSOLE 13 /* scroll console */
35#define TIOCL_BLANKSCREEN 14 /* keep screen blank even if a key is pressed */ 35#define TIOCL_BLANKSCREEN 14 /* keep screen blank even if a key is pressed */
36#define TIOCL_BLANKEDSCREEN 15 /* return which vt was blanked */ 36#define TIOCL_BLANKEDSCREEN 15 /* return which vt was blanked */
37#define TIOCL_GETKMSGREDIRECT 17 /* get the vt the kernel messages are restricted to */
37 38
38#endif /* _LINUX_TIOCL_H */ 39#endif /* _LINUX_TIOCL_H */
diff --git a/include/linux/uinput.h b/include/linux/uinput.h
index 0ff7ca68e5c5..7168302f9844 100644
--- a/include/linux/uinput.h
+++ b/include/linux/uinput.h
@@ -20,7 +20,7 @@
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * 21 *
22 * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> 22 * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
23 * 23 *
24 * Changes/Revisions: 24 * Changes/Revisions:
25 * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>) 25 * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>)
26 * - added force feedback support 26 * - added force feedback support
@@ -51,7 +51,7 @@ struct uinput_request {
51 51
52struct uinput_device { 52struct uinput_device {
53 struct input_dev *dev; 53 struct input_dev *dev;
54 struct semaphore sem; 54 struct mutex mutex;
55 enum uinput_state state; 55 enum uinput_state state;
56 wait_queue_head_t waitq; 56 wait_queue_head_t waitq;
57 unsigned char ready; 57 unsigned char ready;
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index af2d6155d3fe..d7670ec1ec1e 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -966,66 +966,17 @@ struct v4l2_sliced_vbi_format
966 966
967/* Teletext World System Teletext 967/* Teletext World System Teletext
968 (WST), defined on ITU-R BT.653-2 */ 968 (WST), defined on ITU-R BT.653-2 */
969#define V4L2_SLICED_TELETEXT_PAL_B (0x000001) 969#define V4L2_SLICED_TELETEXT_B (0x0001)
970#define V4L2_SLICED_TELETEXT_PAL_C (0x000002)
971#define V4L2_SLICED_TELETEXT_NTSC_B (0x000010)
972#define V4L2_SLICED_TELETEXT_SECAM (0x000020)
973
974/* Teletext North American Broadcast Teletext Specification
975 (NABTS), defined on ITU-R BT.653-2 */
976#define V4L2_SLICED_TELETEXT_NTSC_C (0x000040)
977#define V4L2_SLICED_TELETEXT_NTSC_D (0x000080)
978
979/* Video Program System, defined on ETS 300 231*/ 970/* Video Program System, defined on ETS 300 231*/
980#define V4L2_SLICED_VPS (0x000400) 971#define V4L2_SLICED_VPS (0x0400)
981
982/* Closed Caption, defined on EIA-608 */ 972/* Closed Caption, defined on EIA-608 */
983#define V4L2_SLICED_CAPTION_525 (0x001000) 973#define V4L2_SLICED_CAPTION_525 (0x1000)
984#define V4L2_SLICED_CAPTION_625 (0x002000)
985
986/* Wide Screen System, defined on ITU-R BT1119.1 */ 974/* Wide Screen System, defined on ITU-R BT1119.1 */
987#define V4L2_SLICED_WSS_625 (0x004000) 975#define V4L2_SLICED_WSS_625 (0x4000)
988 976
989/* Wide Screen System, defined on IEC 61880 */ 977#define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525)
990#define V4L2_SLICED_WSS_525 (0x008000) 978#define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
991 979
992/* Vertical Interval Timecode (VITC), defined on SMPTE 12M */
993#define V4l2_SLICED_VITC_625 (0x010000)
994#define V4l2_SLICED_VITC_525 (0x020000)
995
996#define V4L2_SLICED_TELETEXT_B (V4L2_SLICED_TELETEXT_PAL_B |\
997 V4L2_SLICED_TELETEXT_NTSC_B)
998
999#define V4L2_SLICED_TELETEXT (V4L2_SLICED_TELETEXT_PAL_B |\
1000 V4L2_SLICED_TELETEXT_PAL_C |\
1001 V4L2_SLICED_TELETEXT_SECAM |\
1002 V4L2_SLICED_TELETEXT_NTSC_B |\
1003 V4L2_SLICED_TELETEXT_NTSC_C |\
1004 V4L2_SLICED_TELETEXT_NTSC_D)
1005
1006#define V4L2_SLICED_CAPTION (V4L2_SLICED_CAPTION_525 |\
1007 V4L2_SLICED_CAPTION_625)
1008
1009#define V4L2_SLICED_WSS (V4L2_SLICED_WSS_525 |\
1010 V4L2_SLICED_WSS_625)
1011
1012#define V4L2_SLICED_VITC (V4L2_SLICED_VITC_525 |\
1013 V4L2_SLICED_VITC_625)
1014
1015#define V4L2_SLICED_VBI_525 (V4L2_SLICED_TELETEXT_NTSC_B |\
1016 V4L2_SLICED_TELETEXT_NTSC_C |\
1017 V4L2_SLICED_TELETEXT_NTSC_D |\
1018 V4L2_SLICED_CAPTION_525 |\
1019 V4L2_SLICED_WSS_525 |\
1020 V4l2_SLICED_VITC_525)
1021
1022#define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_PAL_B |\
1023 V4L2_SLICED_TELETEXT_PAL_C |\
1024 V4L2_SLICED_TELETEXT_SECAM |\
1025 V4L2_SLICED_VPS |\
1026 V4L2_SLICED_CAPTION_625 |\
1027 V4L2_SLICED_WSS_625 |\
1028 V4l2_SLICED_VITC_625)
1029 980
1030struct v4l2_sliced_vbi_cap 981struct v4l2_sliced_vbi_cap
1031{ 982{
diff --git a/include/media/cx25840.h b/include/media/cx25840.h
new file mode 100644
index 000000000000..8e7e52d659a0
--- /dev/null
+++ b/include/media/cx25840.h
@@ -0,0 +1,64 @@
1/*
2 cx25840.h - definition for cx25840/1/2/3 inputs
3
4 Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl)
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
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 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#ifndef _CX25840_H_
22#define _CX25840_H_
23
24enum cx25840_video_input {
25 /* Composite video inputs In1-In8 */
26 CX25840_COMPOSITE1 = 1,
27 CX25840_COMPOSITE2,
28 CX25840_COMPOSITE3,
29 CX25840_COMPOSITE4,
30 CX25840_COMPOSITE5,
31 CX25840_COMPOSITE6,
32 CX25840_COMPOSITE7,
33 CX25840_COMPOSITE8,
34
35 /* S-Video inputs consist of one luma input (In1-In4) ORed with one
36 chroma input (In5-In8) */
37 CX25840_SVIDEO_LUMA1 = 0x10,
38 CX25840_SVIDEO_LUMA2 = 0x20,
39 CX25840_SVIDEO_LUMA3 = 0x30,
40 CX25840_SVIDEO_LUMA4 = 0x40,
41 CX25840_SVIDEO_CHROMA4 = 0x400,
42 CX25840_SVIDEO_CHROMA5 = 0x500,
43 CX25840_SVIDEO_CHROMA6 = 0x600,
44 CX25840_SVIDEO_CHROMA7 = 0x700,
45 CX25840_SVIDEO_CHROMA8 = 0x800,
46
47 /* S-Video aliases for common luma/chroma combinations */
48 CX25840_SVIDEO1 = 0x510,
49 CX25840_SVIDEO2 = 0x620,
50 CX25840_SVIDEO3 = 0x730,
51 CX25840_SVIDEO4 = 0x840,
52};
53
54enum cx25840_audio_input {
55 /* Audio inputs: serial or In4-In8 */
56 CX25840_AUDIO_SERIAL,
57 CX25840_AUDIO4 = 4,
58 CX25840_AUDIO5,
59 CX25840_AUDIO6,
60 CX25840_AUDIO7,
61 CX25840_AUDIO8,
62};
63
64#endif
diff --git a/include/media/msp3400.h b/include/media/msp3400.h
index 0be61a021d45..6ab854931c05 100644
--- a/include/media/msp3400.h
+++ b/include/media/msp3400.h
@@ -80,16 +80,16 @@
80 */ 80 */
81 81
82/* SCART input to DSP selection */ 82/* SCART input to DSP selection */
83#define MSP_IN_SCART_1 0 /* Pin SC1_IN */ 83#define MSP_IN_SCART1 0 /* Pin SC1_IN */
84#define MSP_IN_SCART_2 1 /* Pin SC2_IN */ 84#define MSP_IN_SCART2 1 /* Pin SC2_IN */
85#define MSP_IN_SCART_3 2 /* Pin SC3_IN */ 85#define MSP_IN_SCART3 2 /* Pin SC3_IN */
86#define MSP_IN_SCART_4 3 /* Pin SC4_IN */ 86#define MSP_IN_SCART4 3 /* Pin SC4_IN */
87#define MSP_IN_MONO 6 /* Pin MONO_IN */ 87#define MSP_IN_MONO 6 /* Pin MONO_IN */
88#define MSP_IN_MUTE 7 /* Mute DSP input */ 88#define MSP_IN_MUTE 7 /* Mute DSP input */
89#define MSP_SCART_TO_DSP(in) (in) 89#define MSP_SCART_TO_DSP(in) (in)
90/* Tuner input to demodulator and DSP selection */ 90/* Tuner input to demodulator and DSP selection */
91#define MSP_IN_TUNER_1 0 /* Analog Sound IF input pin ANA_IN1 */ 91#define MSP_IN_TUNER1 0 /* Analog Sound IF input pin ANA_IN1 */
92#define MSP_IN_TUNER_2 1 /* Analog Sound IF input pin ANA_IN2 */ 92#define MSP_IN_TUNER2 1 /* Analog Sound IF input pin ANA_IN2 */
93#define MSP_TUNER_TO_DSP(in) ((in) << 3) 93#define MSP_TUNER_TO_DSP(in) ((in) << 3)
94 94
95/* The msp has up to 5 DSP outputs, each output can independently select 95/* The msp has up to 5 DSP outputs, each output can independently select
@@ -109,14 +109,14 @@
109 DSP. This is currently not implemented. Also not implemented is the 109 DSP. This is currently not implemented. Also not implemented is the
110 multi-channel capable I2S3 input of the 44x0G. If someone can demonstrate 110 multi-channel capable I2S3 input of the 44x0G. If someone can demonstrate
111 a need for one of those features then additional support can be added. */ 111 a need for one of those features then additional support can be added. */
112#define MSP_DSP_OUT_TUNER 0 /* Tuner output */ 112#define MSP_DSP_IN_TUNER 0 /* Tuner DSP input */
113#define MSP_DSP_OUT_SCART 2 /* SCART output */ 113#define MSP_DSP_IN_SCART 2 /* SCART DSP input */
114#define MSP_DSP_OUT_I2S1 5 /* I2S1 output */ 114#define MSP_DSP_IN_I2S1 5 /* I2S1 DSP input */
115#define MSP_DSP_OUT_I2S2 6 /* I2S2 output */ 115#define MSP_DSP_IN_I2S2 6 /* I2S2 DSP input */
116#define MSP_DSP_OUT_I2S3 7 /* I2S3 output */ 116#define MSP_DSP_IN_I2S3 7 /* I2S3 DSP input */
117#define MSP_DSP_OUT_MAIN_AVC 11 /* MAIN AVC processed output */ 117#define MSP_DSP_IN_MAIN_AVC 11 /* MAIN AVC processed DSP input */
118#define MSP_DSP_OUT_MAIN 12 /* MAIN output */ 118#define MSP_DSP_IN_MAIN 12 /* MAIN DSP input */
119#define MSP_DSP_OUT_AUX 13 /* AUX output */ 119#define MSP_DSP_IN_AUX 13 /* AUX DSP input */
120#define MSP_DSP_TO_MAIN(in) ((in) << 4) 120#define MSP_DSP_TO_MAIN(in) ((in) << 4)
121#define MSP_DSP_TO_AUX(in) ((in) << 8) 121#define MSP_DSP_TO_AUX(in) ((in) << 8)
122#define MSP_DSP_TO_SCART1(in) ((in) << 12) 122#define MSP_DSP_TO_SCART1(in) ((in) << 12)
@@ -125,16 +125,16 @@
125 125
126/* Output SCART select: the SCART outputs can select which input 126/* Output SCART select: the SCART outputs can select which input
127 to use. */ 127 to use. */
128#define MSP_OUT_SCART1 0 /* SCART1 input, bypassing the DSP */ 128#define MSP_SC_IN_SCART1 0 /* SCART1 input, bypassing the DSP */
129#define MSP_OUT_SCART2 1 /* SCART2 input, bypassing the DSP */ 129#define MSP_SC_IN_SCART2 1 /* SCART2 input, bypassing the DSP */
130#define MSP_OUT_SCART3 2 /* SCART3 input, bypassing the DSP */ 130#define MSP_SC_IN_SCART3 2 /* SCART3 input, bypassing the DSP */
131#define MSP_OUT_SCART4 3 /* SCART4 input, bypassing the DSP */ 131#define MSP_SC_IN_SCART4 3 /* SCART4 input, bypassing the DSP */
132#define MSP_OUT_SCART1_DA 4 /* DSP SCART1 output */ 132#define MSP_SC_IN_DSP_SCART1 4 /* DSP SCART1 input */
133#define MSP_OUT_SCART2_DA 5 /* DSP SCART2 output */ 133#define MSP_SC_IN_DSP_SCART2 5 /* DSP SCART2 input */
134#define MSP_OUT_MONO 6 /* MONO input, bypassing the DSP */ 134#define MSP_SC_IN_MONO 6 /* MONO input, bypassing the DSP */
135#define MSP_OUT_MUTE 7 /* MUTE output */ 135#define MSP_SC_IN_MUTE 7 /* MUTE output */
136#define MSP_OUT_TO_SCART1(in) (in) 136#define MSP_SC_TO_SCART1(in) (in)
137#define MSP_OUT_TO_SCART2(in) ((in) << 4) 137#define MSP_SC_TO_SCART2(in) ((in) << 4)
138 138
139/* Shortcut macros */ 139/* Shortcut macros */
140#define MSP_INPUT(sc, t, main_aux_src, sc_i2s_src) \ 140#define MSP_INPUT(sc, t, main_aux_src, sc_i2s_src) \
@@ -145,14 +145,14 @@
145 MSP_DSP_TO_SCART1(sc_i2s_src) | \ 145 MSP_DSP_TO_SCART1(sc_i2s_src) | \
146 MSP_DSP_TO_SCART2(sc_i2s_src) | \ 146 MSP_DSP_TO_SCART2(sc_i2s_src) | \
147 MSP_DSP_TO_I2S(sc_i2s_src)) 147 MSP_DSP_TO_I2S(sc_i2s_src))
148#define MSP_INPUT_DEFAULT MSP_INPUT(MSP_IN_SCART_1, MSP_IN_TUNER_1, \ 148#define MSP_INPUT_DEFAULT MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, \
149 MSP_DSP_OUT_TUNER, MSP_DSP_OUT_TUNER) 149 MSP_DSP_IN_TUNER, MSP_DSP_IN_TUNER)
150#define MSP_OUTPUT(sc) \ 150#define MSP_OUTPUT(sc) \
151 (MSP_OUT_TO_SCART1(sc) | \ 151 (MSP_SC_TO_SCART1(sc) | \
152 MSP_OUT_TO_SCART2(sc)) 152 MSP_SC_TO_SCART2(sc))
153/* This equals the RESET position of the msp3400 ACB register */ 153/* This equals the RESET position of the msp3400 ACB register */
154#define MSP_OUTPUT_DEFAULT (MSP_OUT_TO_SCART1(MSP_OUT_SCART3) | \ 154#define MSP_OUTPUT_DEFAULT (MSP_SC_TO_SCART1(MSP_SC_IN_SCART3) | \
155 MSP_OUT_TO_SCART2(MSP_OUT_SCART1_DA)) 155 MSP_SC_TO_SCART2(MSP_SC_IN_DSP_SCART1))
156 156
157/* Tuner inputs vs. msp version */ 157/* Tuner inputs vs. msp version */
158/* Chip TUNER_1 TUNER_2 158/* Chip TUNER_1 TUNER_2
diff --git a/include/media/saa7115.h b/include/media/saa7115.h
new file mode 100644
index 000000000000..6b4836f3f057
--- /dev/null
+++ b/include/media/saa7115.h
@@ -0,0 +1,37 @@
1/*
2 saa7115.h - definition for saa7113/4/5 inputs
3
4 Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl)
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
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 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#ifndef _SAA7115_H_
22#define _SAA7115_H_
23
24/* SAA7113/4/5 HW inputs */
25#define SAA7115_COMPOSITE0 0
26#define SAA7115_COMPOSITE1 1
27#define SAA7115_COMPOSITE2 2
28#define SAA7115_COMPOSITE3 3
29#define SAA7115_COMPOSITE4 4 /* not available for the saa7113 */
30#define SAA7115_COMPOSITE5 5 /* not available for the saa7113 */
31#define SAA7115_SVIDEO0 6
32#define SAA7115_SVIDEO1 7
33#define SAA7115_SVIDEO2 8
34#define SAA7115_SVIDEO3 9
35
36#endif
37
diff --git a/include/media/saa7127.h b/include/media/saa7127.h
new file mode 100644
index 000000000000..bbcf862141af
--- /dev/null
+++ b/include/media/saa7127.h
@@ -0,0 +1,41 @@
1/*
2 saa7127.h - definition for saa7126/7/8/9 inputs/outputs
3
4 Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl)
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
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 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#ifndef _SAA7127_H_
22#define _SAA7127_H_
23
24/* Enumeration for the supported input types */
25enum saa7127_input_type {
26 SAA7127_INPUT_TYPE_NORMAL,
27 SAA7127_INPUT_TYPE_TEST_IMAGE
28};
29
30/* Enumeration for the supported output signal types */
31enum saa7127_output_type {
32 SAA7127_OUTPUT_TYPE_BOTH,
33 SAA7127_OUTPUT_TYPE_COMPOSITE,
34 SAA7127_OUTPUT_TYPE_SVIDEO,
35 SAA7127_OUTPUT_TYPE_RGB,
36 SAA7127_OUTPUT_TYPE_YUV_C,
37 SAA7127_OUTPUT_TYPE_YUV_V
38};
39
40#endif
41
diff --git a/include/media/upd64031a.h b/include/media/upd64031a.h
new file mode 100644
index 000000000000..3ad6a32e1bce
--- /dev/null
+++ b/include/media/upd64031a.h
@@ -0,0 +1,40 @@
1/*
2 * upd64031a - NEC Electronics Ghost Reduction input defines
3 *
4 * 2006 by Hans Verkuil (hverkuil@xs4all.nl)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
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 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef _UPD64031A_H_
22#define _UPD64031A_H_
23
24/* Ghost reduction modes */
25#define UPD64031A_GR_ON 0
26#define UPD64031A_GR_OFF 1
27#define UPD64031A_GR_THROUGH 3
28
29/* Direct 3D/YCS Connection */
30#define UPD64031A_3DYCS_DISABLE (0 << 2)
31#define UPD64031A_3DYCS_COMPOSITE (2 << 2)
32#define UPD64031A_3DYCS_SVIDEO (3 << 2)
33
34/* Composite sync digital separation circuit */
35#define UPD64031A_COMPOSITE_EXTERNAL (1 << 4)
36
37/* Vertical sync digital separation circuit */
38#define UPD64031A_VERTICAL_EXTERNAL (1 << 5)
39
40#endif
diff --git a/include/media/upd64083.h b/include/media/upd64083.h
new file mode 100644
index 000000000000..59b6f32ba300
--- /dev/null
+++ b/include/media/upd64083.h
@@ -0,0 +1,58 @@
1/*
2 * upd6408x - NEC Electronics 3-Dimensional Y/C separation input defines
3 *
4 * 2006 by Hans Verkuil (hverkuil@xs4all.nl)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
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 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef _UPD64083_H_
22#define _UPD64083_H_
23
24/* There are two bits of information that the driver needs in order
25 to select the correct routing: the operating mode and the selection
26 of the Y input (external or internal).
27
28 The first two operating modes expect a composite signal on the Y input,
29 the second two operating modes use both the Y and C inputs.
30
31 Normally YCS_MODE is used for tuner and composite inputs, and the
32 YCNR mode is used for S-Video inputs.
33
34 The external Y-ADC is selected when the composite input comes from a
35 upd64031a ghost reduction device. If this device is not present, or
36 the input is a S-Video signal, then the internal Y-ADC input should
37 be used. */
38
39/* Operating modes: */
40
41/* YCS mode: Y/C separation (burst locked clocking) */
42#define UPD64083_YCS_MODE 0
43/* YCS+ mode: 2D Y/C separation and YCNR (burst locked clocking) */
44#define UPD64083_YCS_PLUS_MODE 1
45
46/* Note: the following two modes cannot be used in combination with the
47 external Y-ADC. */
48/* MNNR mode: frame comb type YNR+C delay (line locked clocking) */
49#define UPD64083_MNNR_MODE 2
50/* YCNR mode: frame recursive YCNR (burst locked clocking) */
51#define UPD64083_YCNR_MODE 3
52
53/* Select external Y-ADC: this should be set if this device is used in
54 combination with the upd64031a ghost reduction device.
55 Otherwise leave at 0 (use internal Y-ADC). */
56#define UPD64083_EXT_Y_ADC (1 << 2)
57
58#endif
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 9418f4d1afbb..3c989db8a7aa 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -405,9 +405,6 @@ extern int tcp_disconnect(struct sock *sk, int flags);
405 405
406extern void tcp_unhash(struct sock *sk); 406extern void tcp_unhash(struct sock *sk);
407 407
408extern int tcp_v4_hash_connecting(struct sock *sk);
409
410
411/* From syncookies.c */ 408/* From syncookies.c */
412extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, 409extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
413 struct ip_options *opt); 410 struct ip_options *opt);
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index e100291e43f4..0d5529c382e8 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -242,7 +242,6 @@ extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo);
242 242
243extern void xfrm_state_delete_tunnel(struct xfrm_state *x); 243extern void xfrm_state_delete_tunnel(struct xfrm_state *x);
244 244
245struct xfrm_decap_state;
246struct xfrm_type 245struct xfrm_type
247{ 246{
248 char *description; 247 char *description;
@@ -251,7 +250,7 @@ struct xfrm_type
251 250
252 int (*init_state)(struct xfrm_state *x); 251 int (*init_state)(struct xfrm_state *x);
253 void (*destructor)(struct xfrm_state *); 252 void (*destructor)(struct xfrm_state *);
254 int (*input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb); 253 int (*input)(struct xfrm_state *, struct sk_buff *skb);
255 int (*output)(struct xfrm_state *, struct sk_buff *pskb); 254 int (*output)(struct xfrm_state *, struct sk_buff *pskb);
256 /* Estimate maximal size of result of transformation of a dgram */ 255 /* Estimate maximal size of result of transformation of a dgram */
257 u32 (*get_max_size)(struct xfrm_state *, int size); 256 u32 (*get_max_size)(struct xfrm_state *, int size);
@@ -606,25 +605,11 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
606 605
607extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); 606extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev);
608 607
609/* Decapsulation state, used by the input to store data during
610 * decapsulation procedure, to be used later (during the policy
611 * check
612 */
613struct xfrm_decap_state {
614 char decap_data[20];
615 __u16 decap_type;
616};
617
618struct sec_decap_state {
619 struct xfrm_state *xvec;
620 struct xfrm_decap_state decap;
621};
622
623struct sec_path 608struct sec_path
624{ 609{
625 atomic_t refcnt; 610 atomic_t refcnt;
626 int len; 611 int len;
627 struct sec_decap_state x[XFRM_MAX_DEPTH]; 612 struct xfrm_state *xvec[XFRM_MAX_DEPTH];
628}; 613};
629 614
630static inline struct sec_path * 615static inline struct sec_path *
diff --git a/include/pcmcia/bulkmem.h b/include/pcmcia/bulkmem.h
index b53b78d497ba..6bc7472293b2 100644
--- a/include/pcmcia/bulkmem.h
+++ b/include/pcmcia/bulkmem.h
@@ -35,7 +35,7 @@ typedef struct region_info_t {
35#define REGION_BAR_MASK 0xe000 35#define REGION_BAR_MASK 0xe000
36#define REGION_BAR_SHIFT 13 36#define REGION_BAR_SHIFT 13
37 37
38int pcmcia_get_first_region(client_handle_t handle, region_info_t *rgn); 38int pcmcia_get_first_region(struct pcmcia_device *handle, region_info_t *rgn);
39int pcmcia_get_next_region(client_handle_t handle, region_info_t *rgn); 39int pcmcia_get_next_region(struct pcmcia_device *handle, region_info_t *rgn);
40 40
41#endif /* _LINUX_BULKMEM_H */ 41#endif /* _LINUX_BULKMEM_H */
diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h
index da19c297dd65..c1da8558339a 100644
--- a/include/pcmcia/ciscode.h
+++ b/include/pcmcia/ciscode.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * ciscode.h -- Definitions for bulk memory services 2 * ciscode.h
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 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 5 * it under the terms of the GNU General Public License version 2 as
@@ -122,4 +122,7 @@
122 122
123#define MANFID_XIRCOM 0x0105 123#define MANFID_XIRCOM 0x0105
124 124
125#define MANFID_POSSIO 0x030c
126#define PRODID_POSSIO_GCC 0x0003
127
125#endif /* _LINUX_CISCODE_H */ 128#endif /* _LINUX_CISCODE_H */
diff --git a/include/pcmcia/cistpl.h b/include/pcmcia/cistpl.h
index c6a069554fd7..d3bbb19caf81 100644
--- a/include/pcmcia/cistpl.h
+++ b/include/pcmcia/cistpl.h
@@ -586,12 +586,7 @@ typedef struct cisdump_t {
586 cisdata_t Data[CISTPL_MAX_CIS_SIZE]; 586 cisdata_t Data[CISTPL_MAX_CIS_SIZE];
587} cisdump_t; 587} cisdump_t;
588 588
589int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple);
590int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple);
591int pcmcia_get_tuple_data(client_handle_t handle, tuple_t *tuple);
592int pcmcia_parse_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse);
593 589
594int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info);
595int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis); 590int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis);
596 591
597/* don't use outside of PCMCIA core yet */ 592/* don't use outside of PCMCIA core yet */
@@ -602,4 +597,20 @@ int pccard_parse_tuple(tuple_t *tuple, cisparse_t *parse);
602 597
603int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info); 598int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info);
604 599
600/* ... but use these wrappers instead */
601#define pcmcia_get_first_tuple(p_dev, tuple) \
602 pccard_get_first_tuple(p_dev->socket, p_dev->func, tuple)
603
604#define pcmcia_get_next_tuple(p_dev, tuple) \
605 pccard_get_next_tuple(p_dev->socket, p_dev->func, tuple)
606
607#define pcmcia_get_tuple_data(p_dev, tuple) \
608 pccard_get_tuple_data(p_dev->socket, tuple)
609
610#define pcmcia_parse_tuple(p_dev, tuple, parse) \
611 pccard_parse_tuple(tuple, parse)
612
613#define pcmcia_validate_cis(p_dev, info) \
614 pccard_validate_cis(p_dev->socket, p_dev->func, info)
615
605#endif /* LINUX_CISTPL_H */ 616#endif /* LINUX_CISTPL_H */
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index 52660f32663d..d5838c30d20f 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -109,17 +109,6 @@ typedef struct client_req_t {
109 109
110#define CLIENT_THIS_SOCKET 0x01 110#define CLIENT_THIS_SOCKET 0x01
111 111
112/* For RegisterClient */
113typedef struct client_reg_t {
114 dev_info_t *dev_info;
115 u_int Attributes; /* UNUSED */
116 u_int EventMask;
117 int (*event_handler)(event_t event, int priority,
118 event_callback_args_t *);
119 event_callback_args_t event_callback_args;
120 u_int Version;
121} client_reg_t;
122
123/* ModifyConfiguration */ 112/* ModifyConfiguration */
124typedef struct modconf_t { 113typedef struct modconf_t {
125 u_int Attributes; 114 u_int Attributes;
@@ -127,15 +116,16 @@ typedef struct modconf_t {
127} modconf_t; 116} modconf_t;
128 117
129/* Attributes for ModifyConfiguration */ 118/* Attributes for ModifyConfiguration */
130#define CONF_IRQ_CHANGE_VALID 0x100 119#define CONF_IRQ_CHANGE_VALID 0x0100
131#define CONF_VCC_CHANGE_VALID 0x200 120#define CONF_VCC_CHANGE_VALID 0x0200
132#define CONF_VPP1_CHANGE_VALID 0x400 121#define CONF_VPP1_CHANGE_VALID 0x0400
133#define CONF_VPP2_CHANGE_VALID 0x800 122#define CONF_VPP2_CHANGE_VALID 0x0800
123#define CONF_IO_CHANGE_WIDTH 0x1000
134 124
135/* For RequestConfiguration */ 125/* For RequestConfiguration */
136typedef struct config_req_t { 126typedef struct config_req_t {
137 u_int Attributes; 127 u_int Attributes;
138 u_int Vcc, Vpp1, Vpp2; 128 u_int Vpp; /* both Vpp1 and Vpp2 */
139 u_int IntType; 129 u_int IntType;
140 u_int ConfigBase; 130 u_int ConfigBase;
141 u_char Status, Pin, Copy, ExtStatus; 131 u_char Status, Pin, Copy, ExtStatus;
@@ -389,23 +379,27 @@ int pcmcia_get_status(struct pcmcia_device *p_dev, cs_status_t *status);
389int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); 379int pcmcia_get_mem_page(window_handle_t win, memreq_t *req);
390int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); 380int pcmcia_map_mem_page(window_handle_t win, memreq_t *req);
391int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); 381int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
392int pcmcia_release_configuration(struct pcmcia_device *p_dev);
393int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req);
394int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req);
395int pcmcia_release_window(window_handle_t win); 382int pcmcia_release_window(window_handle_t win);
396int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req); 383int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req);
397int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); 384int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req);
398int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req); 385int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req);
399int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh); 386int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh);
400int pcmcia_reset_card(struct pcmcia_device *p_dev, client_req_t *req);
401int pcmcia_suspend_card(struct pcmcia_socket *skt); 387int pcmcia_suspend_card(struct pcmcia_socket *skt);
402int pcmcia_resume_card(struct pcmcia_socket *skt); 388int pcmcia_resume_card(struct pcmcia_socket *skt);
403int pcmcia_eject_card(struct pcmcia_socket *skt); 389int pcmcia_eject_card(struct pcmcia_socket *skt);
404int pcmcia_insert_card(struct pcmcia_socket *skt); 390int pcmcia_insert_card(struct pcmcia_socket *skt);
391int pccard_reset_card(struct pcmcia_socket *skt);
392
393struct pcmcia_device * pcmcia_dev_present(struct pcmcia_device *p_dev);
394void pcmcia_disable_device(struct pcmcia_device *p_dev);
405 395
406struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt); 396struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt);
407void pcmcia_put_socket(struct pcmcia_socket *skt); 397void pcmcia_put_socket(struct pcmcia_socket *skt);
408 398
399/* compatibility functions */
400#define pcmcia_reset_card(p_dev, req) \
401 pccard_reset_card(p_dev->socket)
402
409#endif /* __KERNEL__ */ 403#endif /* __KERNEL__ */
410 404
411#endif /* _LINUX_CS_H */ 405#endif /* _LINUX_CS_H */
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 8e2a96396478..8c339f5678cf 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -39,7 +39,7 @@ typedef struct win_info_t {
39typedef struct bind_info_t { 39typedef struct bind_info_t {
40 dev_info_t dev_info; 40 dev_info_t dev_info;
41 u_char function; 41 u_char function;
42 struct dev_link_t *instance; 42 struct pcmcia_device *instance;
43 char name[DEV_NAME_LEN]; 43 char name[DEV_NAME_LEN];
44 u_short major, minor; 44 u_short major, minor;
45 void *next; 45 void *next;
@@ -96,6 +96,7 @@ typedef union ds_ioctl_arg_t {
96 96
97#ifdef __KERNEL__ 97#ifdef __KERNEL__
98#include <linux/device.h> 98#include <linux/device.h>
99#include <pcmcia/ss.h>
99 100
100typedef struct dev_node_t { 101typedef struct dev_node_t {
101 char dev_name[DEV_NAME_LEN]; 102 char dev_name[DEV_NAME_LEN];
@@ -103,34 +104,9 @@ typedef struct dev_node_t {
103 struct dev_node_t *next; 104 struct dev_node_t *next;
104} dev_node_t; 105} dev_node_t;
105 106
106typedef struct dev_link_t {
107 dev_node_t *dev;
108 u_int state, open;
109 wait_queue_head_t pending;
110 client_handle_t handle;
111 io_req_t io;
112 irq_req_t irq;
113 config_req_t conf;
114 window_handle_t win;
115 void *priv;
116 struct dev_link_t *next;
117} dev_link_t;
118
119/* Flags for device state */
120#define DEV_PRESENT 0x01
121#define DEV_CONFIG 0x02
122#define DEV_STALE_CONFIG 0x04 /* release on close */
123#define DEV_STALE_LINK 0x08 /* detach on release */
124#define DEV_CONFIG_PENDING 0x10
125#define DEV_RELEASE_PENDING 0x20
126#define DEV_SUSPEND 0x40
127#define DEV_BUSY 0x80
128
129#define DEV_OK(l) \
130 ((l) && ((l->state & ~DEV_BUSY) == (DEV_CONFIG|DEV_PRESENT)))
131
132 107
133struct pcmcia_socket; 108struct pcmcia_socket;
109struct config_t;
134 110
135struct pcmcia_driver { 111struct pcmcia_driver {
136 int (*probe) (struct pcmcia_device *dev); 112 int (*probe) (struct pcmcia_device *dev);
@@ -148,6 +124,7 @@ struct pcmcia_driver {
148int pcmcia_register_driver(struct pcmcia_driver *driver); 124int pcmcia_register_driver(struct pcmcia_driver *driver);
149void pcmcia_unregister_driver(struct pcmcia_driver *driver); 125void pcmcia_unregister_driver(struct pcmcia_driver *driver);
150 126
127
151struct pcmcia_device { 128struct pcmcia_device {
152 /* the socket and the device_no [for multifunction devices] 129 /* the socket and the device_no [for multifunction devices]
153 uniquely define a pcmcia_device */ 130 uniquely define a pcmcia_device */
@@ -160,21 +137,40 @@ struct pcmcia_device {
160 /* the hardware "function" device; certain subdevices can 137 /* the hardware "function" device; certain subdevices can
161 * share one hardware "function" device. */ 138 * share one hardware "function" device. */
162 u8 func; 139 u8 func;
140 struct config_t* function_config;
163 141
164 struct list_head socket_device_list; 142 struct list_head socket_device_list;
165 143
166 /* deprecated, a cleaned up version will be moved into this 144 /* deprecated, will be cleaned up soon */
167 struct soon */ 145 dev_node_t *dev_node;
168 dev_link_t *instance; 146 u_int open;
169 u_int state; 147 io_req_t io;
148 irq_req_t irq;
149 config_req_t conf;
150 window_handle_t win;
151
152 /* Is the device suspended, or in the process of
153 * being removed? */
154 u16 suspended:1;
155 u16 _removed:1;
156
157 /* Flags whether io, irq, win configurations were
158 * requested, and whether the configuration is "locked" */
159 u16 _irq:1;
160 u16 _io:1;
161 u16 _win:4;
162 u16 _locked:1;
163
164 /* Flag whether a "fuzzy" func_id based match is
165 * allowed. */
166 u16 allow_func_id_match:1;
170 167
171 /* information about this device */ 168 /* information about this device */
172 u8 has_manf_id:1; 169 u16 has_manf_id:1;
173 u8 has_card_id:1; 170 u16 has_card_id:1;
174 u8 has_func_id:1; 171 u16 has_func_id:1;
175 172
176 u8 allow_func_id_match:1; 173 u16 reserved:3;
177 u8 reserved:4;
178 174
179 u8 func_id; 175 u8 func_id;
180 u16 manf_id; 176 u16 manf_id;
@@ -182,22 +178,24 @@ struct pcmcia_device {
182 178
183 char * prod_id[4]; 179 char * prod_id[4];
184 180
181 struct device dev;
182
183#ifdef CONFIG_PCMCIA_IOCTL
185 /* device driver wanted by cardmgr */ 184 /* device driver wanted by cardmgr */
186 struct pcmcia_driver * cardmgr; 185 struct pcmcia_driver * cardmgr;
186#endif
187 187
188 struct device dev; 188 /* data private to drivers */
189 void *priv;
189}; 190};
190 191
191#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) 192#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev)
192#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) 193#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv)
193 194
194#define handle_to_pdev(handle) (handle)
195#define handle_to_dev(handle) (handle->dev) 195#define handle_to_dev(handle) (handle->dev)
196 196
197#define dev_to_instance(dev) (dev->instance)
198
199/* error reporting */ 197/* error reporting */
200void cs_error(client_handle_t handle, int func, int ret); 198void cs_error(struct pcmcia_device *handle, int func, int ret);
201 199
202#endif /* __KERNEL__ */ 200#endif /* __KERNEL__ */
203#endif /* _LINUX_DS_H */ 201#endif /* _LINUX_DS_H */
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 2889a69a7a8f..5e0a01ab2216 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -18,6 +18,7 @@
18#include <linux/config.h> 18#include <linux/config.h>
19#include <linux/device.h> 19#include <linux/device.h>
20#include <linux/sched.h> /* task_struct, completion */ 20#include <linux/sched.h> /* task_struct, completion */
21#include <linux/mutex.h>
21 22
22#include <pcmcia/cs_types.h> 23#include <pcmcia/cs_types.h>
23#include <pcmcia/cs.h> 24#include <pcmcia/cs.h>
@@ -146,14 +147,15 @@ extern struct pccard_resource_ops pccard_static_ops;
146/* !SS_CAP_STATIC_MAP */ 147/* !SS_CAP_STATIC_MAP */
147extern struct pccard_resource_ops pccard_nonstatic_ops; 148extern struct pccard_resource_ops pccard_nonstatic_ops;
148 149
150/* static mem, dynamic IO sockets */
151extern struct pccard_resource_ops pccard_iodyn_ops;
152
149/* 153/*
150 * Calls to set up low-level "Socket Services" drivers 154 * Calls to set up low-level "Socket Services" drivers
151 */ 155 */
152struct pcmcia_socket; 156struct pcmcia_socket;
153 157
154typedef struct io_window_t { 158typedef struct io_window_t {
155 u_int Attributes;
156 kio_addr_t BasePort, NumPorts;
157 kio_addr_t InUse, Config; 159 kio_addr_t InUse, Config;
158 struct resource *res; 160 struct resource *res;
159} io_window_t; 161} io_window_t;
@@ -162,7 +164,7 @@ typedef struct io_window_t {
162typedef struct window_t { 164typedef struct window_t {
163 u_short magic; 165 u_short magic;
164 u_short index; 166 u_short index;
165 client_handle_t handle; 167 struct pcmcia_device *handle;
166 struct pcmcia_socket *sock; 168 struct pcmcia_socket *sock;
167 pccard_mem_map ctl; 169 pccard_mem_map ctl;
168} window_t; 170} window_t;
@@ -186,7 +188,6 @@ struct pcmcia_socket {
186 u_short lock_count; 188 u_short lock_count;
187 pccard_mem_map cis_mem; 189 pccard_mem_map cis_mem;
188 void __iomem *cis_virt; 190 void __iomem *cis_virt;
189 struct config_t *config;
190 struct { 191 struct {
191 u_int AssignedIRQ; 192 u_int AssignedIRQ;
192 u_int Config; 193 u_int Config;
@@ -241,7 +242,7 @@ struct pcmcia_socket {
241#endif 242#endif
242 243
243 /* state thread */ 244 /* state thread */
244 struct semaphore skt_sem; /* protects socket h/w state */ 245 struct mutex skt_mutex; /* protects socket h/w state */
245 246
246 struct task_struct *thread; 247 struct task_struct *thread;
247 struct completion thread_done; 248 struct completion thread_done;
diff --git a/include/sound/core.h b/include/sound/core.h
index 7f32c12b4a0a..5135147f20e8 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -170,13 +170,13 @@ static inline void snd_power_change_state(struct snd_card *card, unsigned int st
170} 170}
171 171
172/* init.c */ 172/* init.c */
173int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file *file); 173int snd_power_wait(struct snd_card *card, unsigned int power_state);
174 174
175#else /* ! CONFIG_PM */ 175#else /* ! CONFIG_PM */
176 176
177#define snd_power_lock(card) do { (void)(card); } while (0) 177#define snd_power_lock(card) do { (void)(card); } while (0)
178#define snd_power_unlock(card) do { (void)(card); } while (0) 178#define snd_power_unlock(card) do { (void)(card); } while (0)
179static inline int snd_power_wait(struct snd_card *card, unsigned int state, struct file *file) { return 0; } 179static inline int snd_power_wait(struct snd_card *card, unsigned int state) { return 0; }
180#define snd_power_get_state(card) SNDRV_CTL_POWER_D0 180#define snd_power_get_state(card) SNDRV_CTL_POWER_D0
181#define snd_power_change_state(card, state) do { (void)(card); } while (0) 181#define snd_power_change_state(card, state) do { (void)(card); } while (0)
182 182
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 15b885660bf0..66b1f08b42b9 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -369,6 +369,7 @@ struct snd_pcm_substream {
369 /* -- assigned files -- */ 369 /* -- assigned files -- */
370 struct snd_pcm_file *file; 370 struct snd_pcm_file *file;
371 struct file *ffile; 371 struct file *ffile;
372 void (*pcm_release)(struct snd_pcm_substream *);
372#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 373#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
373 /* -- OSS things -- */ 374 /* -- OSS things -- */
374 struct snd_pcm_oss_substream oss; 375 struct snd_pcm_oss_substream oss;
@@ -381,13 +382,10 @@ struct snd_pcm_substream {
381 struct snd_info_entry *proc_prealloc_entry; 382 struct snd_info_entry *proc_prealloc_entry;
382 /* misc flags */ 383 /* misc flags */
383 unsigned int no_mmap_ctrl: 1; 384 unsigned int no_mmap_ctrl: 1;
385 unsigned int hw_opened: 1;
384}; 386};
385 387
386#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
387#define SUBSTREAM_BUSY(substream) ((substream)->file != NULL || ((substream)->oss.file != NULL))
388#else
389#define SUBSTREAM_BUSY(substream) ((substream)->file != NULL) 388#define SUBSTREAM_BUSY(substream) ((substream)->file != NULL)
390#endif
391 389
392 390
393struct snd_pcm_str { 391struct snd_pcm_str {
@@ -460,7 +458,6 @@ int snd_pcm_info_user(struct snd_pcm_substream *substream,
460 struct snd_pcm_info __user *info); 458 struct snd_pcm_info __user *info);
461int snd_pcm_status(struct snd_pcm_substream *substream, 459int snd_pcm_status(struct snd_pcm_substream *substream,
462 struct snd_pcm_status *status); 460 struct snd_pcm_status *status);
463int snd_pcm_prepare(struct snd_pcm_substream *substream);
464int snd_pcm_start(struct snd_pcm_substream *substream); 461int snd_pcm_start(struct snd_pcm_substream *substream);
465int snd_pcm_stop(struct snd_pcm_substream *substream, int status); 462int snd_pcm_stop(struct snd_pcm_substream *substream, int status);
466int snd_pcm_drain_done(struct snd_pcm_substream *substream); 463int snd_pcm_drain_done(struct snd_pcm_substream *substream);
@@ -468,11 +465,13 @@ int snd_pcm_drain_done(struct snd_pcm_substream *substream);
468int snd_pcm_suspend(struct snd_pcm_substream *substream); 465int snd_pcm_suspend(struct snd_pcm_substream *substream);
469int snd_pcm_suspend_all(struct snd_pcm *pcm); 466int snd_pcm_suspend_all(struct snd_pcm *pcm);
470#endif 467#endif
471int snd_pcm_kernel_playback_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg);
472int snd_pcm_kernel_capture_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg);
473int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg); 468int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg);
474int snd_pcm_open_substream(struct snd_pcm *pcm, int stream, struct snd_pcm_substream **rsubstream); 469int snd_pcm_open_substream(struct snd_pcm *pcm, int stream, struct file *file,
470 struct snd_pcm_substream **rsubstream);
475void snd_pcm_release_substream(struct snd_pcm_substream *substream); 471void snd_pcm_release_substream(struct snd_pcm_substream *substream);
472int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream, struct file *file,
473 struct snd_pcm_substream **rsubstream);
474void snd_pcm_detach_substream(struct snd_pcm_substream *substream);
476void snd_pcm_vma_notify_data(void *client, void *data); 475void snd_pcm_vma_notify_data(void *client, void *data);
477int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); 476int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area);
478 477
diff --git a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h
index bff0778e1969..39df2baca18a 100644
--- a/include/sound/pcm_oss.h
+++ b/include/sound/pcm_oss.h
@@ -69,8 +69,7 @@ struct snd_pcm_oss_file {
69 69
70struct snd_pcm_oss_substream { 70struct snd_pcm_oss_substream {
71 unsigned oss: 1; /* oss mode */ 71 unsigned oss: 1; /* oss mode */
72 struct snd_pcm_oss_setup *setup; /* active setup */ 72 struct snd_pcm_oss_setup setup; /* active setup */
73 struct snd_pcm_oss_file *file;
74}; 73};
75 74
76struct snd_pcm_oss_stream { 75struct snd_pcm_oss_stream {