diff options
| author | Andy Grover <agrover@groveronline.com> | 2003-02-02 19:02:47 -0800 |
|---|---|---|
| committer | Andy Grover <agrover@groveronline.com> | 2003-02-02 19:02:47 -0800 |
| commit | 992f378dede07e0c8836226f12e0e7b74c17de24 (patch) | |
| tree | bcacf2eff545873dd5c3bc08db5d12f8800f9f55 /include | |
| parent | 576228539931d1ad1cd63d8b354e1eaeb9ba9ed5 (diff) | |
| parent | c92cacc2cc8d72a750fc0a5c2aed67f21eadc72b (diff) | |
Merge groveronline.com:/root/bk/linux-2.5
into groveronline.com:/root/bk/linux-acpi
Diffstat (limited to 'include')
49 files changed, 691 insertions, 162 deletions
diff --git a/include/asm-arm/arch-ebsa110/param.h b/include/asm-arm/arch-ebsa110/param.h index f077b717193d..13a9fc1b7a25 100644 --- a/include/asm-arm/arch-ebsa110/param.h +++ b/include/asm-arm/arch-ebsa110/param.h @@ -1,3 +1,4 @@ /* * linux/include/asm-arm/arch-ebsa110/param.h */ +#define __KERNEL_HZ 200 diff --git a/include/asm-arm/arch-ebsa110/time.h b/include/asm-arm/arch-ebsa110/time.h index 278c8e3632a1..30c90e607546 100644 --- a/include/asm-arm/arch-ebsa110/time.h +++ b/include/asm-arm/arch-ebsa110/time.h @@ -17,17 +17,80 @@ */ #include <asm/leds.h> +#include <asm/io.h> -extern int ebsa110_reset_timer(void); -extern void ebsa110_setup_timer(void); +extern unsigned long (*gettimeoffset)(void); + +#define PIT_CTRL (PIT_BASE + 0x0d) +#define PIT_T2 (PIT_BASE + 0x09) +#define PIT_T1 (PIT_BASE + 0x05) +#define PIT_T0 (PIT_BASE + 0x01) + +/* + * This is the rate at which your MCLK signal toggles (in Hz) + * This was measured on a 10 digit frequency counter sampling + * over 1 second. + */ +#define MCLK 47894000 + +/* + * This is the rate at which the PIT timers get clocked + */ +#define CLKBY7 (MCLK / 7) + +/* + * This is the counter value. We tick at 200Hz on this platform. + */ +#define COUNT ((CLKBY7 + (HZ / 2)) / HZ) + +/* + * Get the time offset from the system PIT. Note that if we have missed an + * interrupt, then the PIT counter will roll over (ie, be negative). + * This actually works out to be convenient. + */ +static unsigned long ebsa110_gettimeoffset(void) +{ + unsigned long offset, count; + + __raw_writeb(0x40, PIT_CTRL); + count = __raw_readb(PIT_T1); + count |= __raw_readb(PIT_T1) << 8; + + /* + * If count > COUNT, make the number negative. + */ + if (count > COUNT) + count |= 0xffff0000; + + offset = COUNT; + offset -= count; + + /* + * `offset' is in units of timer counts. Convert + * offset to units of microseconds. + */ + offset = offset * (1000000 / HZ) / COUNT; + + return offset; +} static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - if (ebsa110_reset_timer()) { - do_leds(); - do_timer(regs); - do_profile(regs); - } + u32 count; + + /* latch and read timer 1 */ + __raw_writeb(0x40, PIT_CTRL); + count = __raw_readb(PIT_T1); + count |= __raw_readb(PIT_T1) << 8; + + count += COUNT; + + __raw_writeb(count & 0xff, PIT_T1); + __raw_writeb(count >> 8, PIT_T1); + + do_leds(); + do_timer(regs); + do_profile(regs); } /* @@ -35,7 +98,14 @@ static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) */ void __init time_init(void) { - ebsa110_setup_timer(); + /* + * Timer 1, mode 2, LSB/MSB + */ + __raw_writeb(0x70, PIT_CTRL); + __raw_writeb(COUNT & 0xff, PIT_T1); + __raw_writeb(COUNT >> 8, PIT_T1); + + gettimeoffset = ebsa110_gettimeoffset; timer_irq.handler = timer_interrupt; diff --git a/include/asm-arm/arch-rpc/hardware.h b/include/asm-arm/arch-rpc/hardware.h index a25d8394ffc5..9dc5f5d4b912 100644 --- a/include/asm-arm/arch-rpc/hardware.h +++ b/include/asm-arm/arch-rpc/hardware.h @@ -63,6 +63,17 @@ #define IO_EC_MEMC8_BASE 0x8000ac00 #define IO_EC_MEMC_BASE 0x80000000 +#define NETSLOT_BASE 0x0302b000 +#define NETSLOT_SIZE 0x00001000 + +#define PODSLOT_IOC0_BASE 0x03240000 +#define PODSLOT_IOC4_BASE 0x03270000 +#define PODSLOT_IOC_SIZE (1 << 14) +#define PODSLOT_MEMC_BASE 0x03000000 +#define PODSLOT_MEMC_SIZE (1 << 14) +#define PODSLOT_EASI_BASE 0x08000000 +#define PODSLOT_EASI_SIZE (1 << 24) + #define EXPMASK_STATUS (EXPMASK_BASE + 0x00) #define EXPMASK_ENABLE (EXPMASK_BASE + 0x04) diff --git a/include/asm-arm/arch-rpc/io.h b/include/asm-arm/arch-rpc/io.h index 3a1c18ad63bb..3f7a2366cad3 100644 --- a/include/asm-arm/arch-rpc/io.h +++ b/include/asm-arm/arch-rpc/io.h @@ -247,4 +247,9 @@ DECLARE_IO(int,l,"") #define outsb(p,d,l) __raw_writesb(__ioaddr(p),d,l) #define outsw(p,d,l) __raw_writesw(__ioaddr(p),d,l) +/* + * 1:1 mapping for ioremapped regions. + */ +#define __mem_pci(x) (x) + #endif diff --git a/include/asm-arm/arch-sa1100/ide.h b/include/asm-arm/arch-sa1100/ide.h index a5f392d1dd8d..9c8e1c7644aa 100644 --- a/include/asm-arm/arch-sa1100/ide.h +++ b/include/asm-arm/arch-sa1100/ide.h @@ -49,8 +49,9 @@ ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int *irq) *irq = 0; } - - +#ifdef CONFIG_SA1100_TRIZEPS +#include <asm/arch/trizeps.h> +#endif /* * This registers the standard ports for this architecture with the IDE @@ -124,6 +125,23 @@ ide_init_default_hwifs(void) ide_register_hw(&hw); #endif } -} + else if( machine_is_trizeps() ){ +#ifdef CONFIG_SA1100_TRIZEPS + hw_regs_t hw; + /* Enable appropriate GPIOs as interrupt lines */ + GPDR &= ~GPIO_GPIO(TRIZEPS_IRQ_IDE); + set_irq_type( TRIZEPS_IRQ_IDE, IRQT_RISING ); + /* set the pcmcia interface timing */ + //MECR = 0x00060006; // Done on trizeps init + + /* Take hard drives out of reset */ + GPSR = GPIO_GPIO(TRIZEPS_IRQ_IDE); + + ide_init_hwif_ports(&hw, TRIZEPS_IDE_CS0 + 0, TRIZEPS_IDE_CS1 + 6, NULL); + hw.irq = TRIZEPS_IRQ_IDE; + ide_register_hw(&hw, NULL); +#endif + } +} diff --git a/include/asm-arm/arch-sa1100/mftb2.h b/include/asm-arm/arch-sa1100/mftb2.h new file mode 100644 index 000000000000..1d4c9f7dcdf0 --- /dev/null +++ b/include/asm-arm/arch-sa1100/mftb2.h @@ -0,0 +1,210 @@ +#ifndef _ARCH_ARM_MFTB2_h_ +#define _ARCH_ARM_MFTB2_h_ + +// Defines for arch/arm/mm/mm-sa1100.h +#define TRIZEPS_PHYS_VIRT_MAP_SIZE 0x00800000l + +// physical address (only for mm-sa1100.h) +#define TRIZEPS_PHYS_IO_BASE 0x30000000l +#define TRIZEPS_PHYS_MEM_BASE 0x38000000l + +// virtual +#define TRIZEPS_IO_BASE 0xF0000000l +#define TRIZEPS_MEM_BASE 0xF2000000l + +// Offsets for phys and virtual +#define TRIZEPS_OFFSET_REG0 0x00300000l +#define TRIZEPS_OFFSET_REG1 0x00380000l +#define TRIZEPS_OFFSET_IDE_CS0 0x00000000l +#define TRIZEPS_OFFSET_IDE_CS1 0x00080000l +#define TRIZEPS_OFFSET_UART5 0x00100000l +#define TRIZEPS_OFFSET_UART6 0x00180000l +#define TRIZEPS_PHYS_REG0 (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_REG0) +#define TRIZEPS_PHYS_REG1 (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_REG1) +#define TRIZEPS_PHYS_IDE_CS0 (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_IDE_CS0) +#define TRIZEPS_PHYS_IDE_CS1 (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_IDE_CS1) +#define TRIZEPS_PHYS_UART5 (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_UART5) +#define TRIZEPS_PHYS_UART6 (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_UART6) + +// Use follow defines in devices +// virtual address +#define TRIZEPS_REG0 (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_REG0) +#define TRIZEPS_REG1 (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_REG1) +#define TRIZEPS_IDE_CS0 (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_IDE_CS0) +#define TRIZEPS_IDE_CS1 (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_IDE_CS1) +#define TRIZEPS_UART5 (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_UART5) +#define TRIZEPS_UART6 (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_UART6) + +#define TRIZEPS_BAUD_BASE 1500000 + +//#if 0 //temporarily disabled +#ifndef __ASSEMBLY__ +struct tri_uart_cts_data_t { + int cts_gpio; + int cts_prev_state; + struct uart_info *info; + struct uart_port *port; + const char *name; +}; +#endif /* __ASSEMBLY__ */ + +/* Defines for MFTB2 serial_sa1100.c hardware handshaking lines */ +#define SERIAL_FULL +#define NOT_CONNECTED 0 +#ifdef SERIAL_FULL +#define TRIZEPS_GPIO_UART1_RTS GPIO_GPIO14 +#define TRIZEPS_GPIO_UART1_DTR NOT_CONNECTED //GPIO_GPIO9 +#define TRIZEPS_GPIO_UART1_CTS GPIO_GPIO15 +#define TRIZEPS_GPIO_UART1_DCD NOT_CONNECTED //GPIO_GPIO2 +#define TRIZEPS_GPIO_UART1_DSR NOT_CONNECTED //GPIO_GPIO3 +#define TRIZEPS_GPIO_UART3_RTS NOT_CONNECTED //GPIO_GPIO7 +#define TRIZEPS_GPIO_UART3_DTR NOT_CONNECTED //GPIO_GPIO8 +#define TRIZEPS_GPIO_UART3_CTS NOT_CONNECTED //GPIO_GPIO4 +#define TRIZEPS_GPIO_UART3_DCD NOT_CONNECTED //GPIO_GPIO5 +#define TRIZEPS_GPIO_UART3_DSR NOT_CONNECTED //GPIO_GPIO6 + +#define TRIZEPS_GPIO_UART2_RTS NOT_CONNECTED //GPIO_GPIO7 +#define TRIZEPS_GPIO_UART2_DTR NOT_CONNECTED //GPIO_GPIO8 +#define TRIZEPS_GPIO_UART2_CTS NOT_CONNECTED //GPIO_GPIO4 +#define TRIZEPS_GPIO_UART2_DCD NOT_CONNECTED //GPIO_GPIO5 +#define TRIZEPS_GPIO_UART2_DSR NOT_CONNECTED //GPIO_GPIO6 + +#define TRIZEPS_IRQ_UART1_CTS IRQ_GPIO15 +#define TRIZEPS_IRQ_UART1_DCD NO_IRQ //IRQ_GPIO2 +#define TRIZEPS_IRQ_UART1_DSR NO_IRQ //IRQ_GPIO3 +#define TRIZEPS_IRQ_UART3_CTS NO_IRQ //IRQ_GPIO4 +#define TRIZEPS_IRQ_UART3_DCD NO_IRQ //IRQ_GPIO5 +#define TRIZEPS_IRQ_UART3_DSR NO_IRQ //IRQ_GPIO6 + +#define TRIZEPS_IRQ_UART2_CTS NO_IRQ //IRQ_GPIO4 +#define TRIZEPS_IRQ_UART2_DCD NO_IRQ //IRQ_GPIO5 +#define TRIZEPS_IRQ_UART2_DSR NO_IRQ //IRQ_GPIO6 + +#endif /* SERIAL_FULL */ +//#endif //0 + +/* + * This section contains the defines for the MFTB2 implementation + * of drivers/ide/hd.c. HD_IOBASE_0 and HD_IOBASE_1 have to be + * adjusted if hardware changes. + */ +#define TRIZEPS_IRQ_IDE 10 /* MFTB2 specific */ + +/*--- ROOT ---*/ +#define TRIZEPS_GPIO_ROOT_NFS 0 +#define TRIZEPS_GPIO_ROOT_HD 21 +/*--- PCMCIA ---*/ +#define TRIZEPS_GPIO_PCMCIA_IRQ0 1 +#define TRIZEPS_GPIO_PCMCIA_CD0 24 +#define TRIZEPS_IRQ_PCMCIA_IRQ0 TRIZEPS_GPIO_PCMCIA_IRQ0 +#define TRIZEPS_IRQ_PCMCIA_CD0 TRIZEPS_GPIO_PCMCIA_CD0 + 32 - 11 + +// REGISTER 0 -> 0x0XXXX (16bit access) +// read only +#define TRIZEPS_A_STAT 0x8000l +#define TRIZEPS_F_STAT 0x4000l +#define TRIZEPS_BATT_FAULT_EN 0x2000l +#define TRIZEPS_nDQ 0x1000l +#define TRIZEPS_MFT_OFF 0x0800l +#define TRIZEPS_D_APWOFF 0x0400l +#define TRIZEPS_F_CTRL 0x0200l +#define TRIZEPS_F_STOP 0x0100l + +// read / write +#define TRIZEPS_KP_IR_EN 0x0080l +#define TRIZEPS_FIR 0x0040l +#define TRIZEPS_BAR_ON 0x0020l +#define TRIZEPS_VCI_ON 0x0010l +#define TRIZEPS_LED4 0x0008l +#define TRIZEPS_LED3 0x0004l +#define TRIZEPS_LED2 0x0002l +#define TRIZEPS_LED1 0x0001l + +// REGISTER 1 -> 0x1XXXX (16bit access) +// read only +#define TRIZEPS_nVCI2 0x8000l +#define TRIZEPS_nAB_LOW 0x4000l +#define TRIZEPS_nMB_DEAD 0x2000l +#define TRIZEPS_nMB_LOW 0x1000l +#define TRIZEPS_nPCM_VS2 0x0800l +#define TRIZEPS_nPCM_VS1 0x0400l +#define TRIZEPS_PCM_BVD2 0x0200l +#define TRIZEPS_PCM_BVD1 0x0100l + +// read / write +#define TRIZEPS_nROOT_NFS 0x0080l +#define TRIZEPS_nROOT_HD 0x0040l +#define TRIZEPS_nPCM_ENA_REG 0x0020l +#define TRIZEPS_nPCM_RESET_DISABLE 0x0010l +#define TRIZEPS_PCM_EN0_REG 0x0008l +#define TRIZEPS_PCM_EN1_REG 0x0004l +#define TRIZEPS_PCM_V3_EN_REG 0x0002l +#define TRIZEPS_PCM_V5_EN_REG 0x0001l + +/* Access to Board Control Register */ +#define TRIZEPS_BCR0 (*(volatile unsigned short *)(TRIZEPS_REG0)) +#define TRIZEPS_BCR1 (*(volatile unsigned short *)(TRIZEPS_REG1)) + +#define TRIZEPS_BCR_set( reg, x ) do { \ + unsigned long flags; \ + local_irq_save(flags); \ + (reg) |= (x); \ + local_irq_restore(flags); \ +} while (0) + +#define TRIZEPS_BCR_clear( reg, x ) do { \ + unsigned long flags; \ + local_irq_save(flags); \ + (reg) &= ~(x); \ + local_irq_restore(flags); \ +} while (0) + +#define TRIZEPS_OFFSET_KP_REG 0x00200000l +#define TRIZEPS_OFFSET_VCI2 0x00280000l +#define TRIZEPS_OFFSET_VCI4 0x00400000l + +#define TRIZEPS_OFFSET_VCI2_1_DPR (TRIZEPS_OFFSET_VCI2 + 0x00010000l) +#define TRIZEPS_OFFSET_VCI2_2_DPR (TRIZEPS_OFFSET_VCI2 + 0x00018000l) +#define TRIZEPS_OFFSET_VCI2_1_SEMA (TRIZEPS_OFFSET_VCI2 + 0x00020000l) +#define TRIZEPS_OFFSET_VCI2_2_SEMA (TRIZEPS_OFFSET_VCI2 + 0x00028000l) + +#define TRIZEPS_OFFSET_VCI4_1_DPR (TRIZEPS_OFFSET_VCI4 + 0x00000000l) +#define TRIZEPS_OFFSET_VCI4_2_DPR (TRIZEPS_OFFSET_VCI4 + 0x00008000l) +#define TRIZEPS_OFFSET_VCI4_1_SEMA (TRIZEPS_OFFSET_VCI4 + 0x00000380l) +#define TRIZEPS_OFFSET_VCI4_2_SEMA (TRIZEPS_OFFSET_VCI4 + 0x00000388l) +#define TRIZEPS_OFFSET_VCI4_1_CNTR (TRIZEPS_OFFSET_VCI4 + 0x00000390l) +#define TRIZEPS_OFFSET_VCI4_2_CNTR (TRIZEPS_OFFSET_VCI4 + 0x00000392l) + +#define TRIZEPS_PHYS_KP_REG (PHYS_TRIZEPS_IO_BASE + TRIZEPS_OFFSET_KP_REG) + +// VCI address +#define TRIZEPS_PHYS_VCI2_1_DPR (TRIZEPS_PHYS_MEM_BASE + TRIZEPS_OFFSET_VCI2_1_DPR) +#define TRIZEPS_PHYS_VCI2_2_DPR (TRIZEPS_PHYS_MEM_BASE + TRIZEPS_OFFSET_VCI2_2_DPR) +#define TRIZEPS_PHYS_VCI2_1_SEMA (TRIZEPS_PHYS_MEM_BASE + TRIZEPS_OFFSET_VCI2_1_SEMA) +#define TRIZEPS_PHYS_VCI2_2_SEMA (TRIZEPS_PHYS_MEM_BASE + TRIZEPS_OFFSET_VCI2_2_SEMA) + +// VCI4 address +#define TRIZEPS_PHYS_VCI4_1_DPR (TRIZEPS_PHYS_MEM_BASE + TRIZEPS_OFFSET_VCI4_1_DPR) +#define TRIZEPS_PHYS_VCI4_2_DPR (TRIZEPS_PHYS_MEM_BASE + TRIZEPS_OFFSET_VCI4_2_DPR) +#define TRIZEPS_PHYS_VCI4_1_SEMA (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_VCI4_1_SEMA) +#define TRIZEPS_PHYS_VCI4_2_SEMA (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_VCI4_2_SEMA) +#define TRIZEPS_PHYS_VCI4_1_CNTR (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_VCI4_1_CNTR) +#define TRIZEPS_PHYS_VCI4_2_CNTR (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_VCI4_2_CNTR) + +#define TRIZEPS_KP_REG (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_KP_REG) + +// VCI address +#define TRIZEPS_VCI2_1_DPR (TRIZEPS_MEM_BASE + TRIZEPS_OFFSET_VCI2_1_DPR) +#define TRIZEPS_VCI2_2_DPR (TRIZEPS_MEM_BASE + TRIZEPS_OFFSET_VCI2_2_DPR) +#define TRIZEPS_VCI2_1_SEMA (TRIZEPS_MEM_BASE + TRIZEPS_OFFSET_VCI2_1_SEMA) +#define TRIZEPS_VCI2_2_SEMA (TRIZEPS_MEM_BASE + TRIZEPS_OFFSET_VCI2_2_SEMA) + +// VCI4 address +#define TRIZEPS_VCI4_1_DPR (TRIZEPS_MEM_BASE + TRIZEPS_OFFSET_VCI4_1_DPR) +#define TRIZEPS_VCI4_2_DPR (TRIZEPS_MEM_BASE + TRIZEPS_OFFSET_VCI4_2_DPR) +#define TRIZEPS_VCI4_1_SEMA (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_VCI4_1_SEMA) +#define TRIZEPS_VCI4_2_SEMA (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_VCI4_2_SEMA) +#define TRIZEPS_VCI4_1_CNTR (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_VCI4_1_CNTR) +#define TRIZEPS_VCI4_2_CNTR (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_VCI4_2_CNTR) + +#endif diff --git a/include/asm-arm/arch-sa1100/trizeps.h b/include/asm-arm/arch-sa1100/trizeps.h new file mode 100644 index 000000000000..b9cc02bac5d9 --- /dev/null +++ b/include/asm-arm/arch-sa1100/trizeps.h @@ -0,0 +1,20 @@ +/* + * linux/include/asm-arm/arch-sa1100/trizeps.h + * + * This file contains the hardware specific definitions for Trizeps + * + * Authors: + * Andreas Hofer <ho@dsa-ac.de>, + * Peter Lueg <pl@dsa-ac.de>, + * Guennadi Liakhovetski <gl@dsa-ac.de> + * + */ + +#ifndef _ASM_ARCH_TRIZEPS_H_ +#define _ASM_ARCH_TRIZEPS_H_ + +#ifdef CONFIG_TRIZEPS_MFTB2 +#include "mftb2.h" +#endif + +#endif // _INCLUDE_TRIZEPS_ diff --git a/include/asm-arm/bug.h b/include/asm-arm/bug.h index c9b6e7f6b317..326400b2b83f 100644 --- a/include/asm-arm/bug.h +++ b/include/asm-arm/bug.h @@ -18,3 +18,4 @@ extern volatile void __bug(const char *file, int line, void *data); #endif +#endif diff --git a/include/asm-arm/ecard.h b/include/asm-arm/ecard.h index 602dc63b9dfa..89c1d1db4b7b 100644 --- a/include/asm-arm/ecard.h +++ b/include/asm-arm/ecard.h @@ -130,6 +130,20 @@ typedef struct { /* Card handler routines */ int (*fiqpending)(ecard_t *ec); } expansioncard_ops_t; +#define ECARD_NUM_RESOURCES (6) + +#define ECARD_RES_IOCSLOW (0) +#define ECARD_RES_IOCMEDIUM (1) +#define ECARD_RES_IOCFAST (2) +#define ECARD_RES_IOCSYNC (3) +#define ECARD_RES_MEMC (4) +#define ECARD_RES_EASI (5) + +#define ecard_resource_start(ec,nr) ((ec)->resource[nr].start) +#define ecard_resource_end(ec,nr) ((ec)->resource[nr].end) +#define ecard_resource_len(ec,nr) ((ec)->resource[nr].end - \ + (ec)->resource[nr].start + 1) + /* * This contains all the info needed on an expansion card */ @@ -137,6 +151,7 @@ struct expansion_card { struct expansion_card *next; struct device dev; + struct resource resource[ECARD_NUM_RESOURCES]; /* Public data */ volatile unsigned char *irqaddr; /* address of IRQ register */ @@ -147,7 +162,7 @@ struct expansion_card { void *irq_data; /* Data for use for IRQ by card */ void *fiq_data; /* Data for use for FIQ by card */ - expansioncard_ops_t *ops; /* Enable/Disable Ops for card */ + const expansioncard_ops_t *ops; /* Enable/Disable Ops for card */ CONST unsigned int slot_no; /* Slot number */ CONST unsigned int dma; /* DMA number (for request_dma) */ diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index 1dc1dd5d611a..8bb0d5e1cc9a 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h @@ -150,10 +150,18 @@ extern void _memset_io(unsigned long, int, size_t); #define readw(c) ({ unsigned int __v = le16_to_cpu(__raw_readw(__mem_pci(c))); __v; }) #define readl(c) ({ unsigned int __v = le32_to_cpu(__raw_readl(__mem_pci(c))); __v; }) +#define readsb(p,d,l) __raw_readsb((unsigned int)__mem_pci(p),d,l) +#define readsw(p,d,l) __raw_readsw((unsigned int)__mem_pci(p),d,l) +#define readsl(p,d,l) __raw_readsl((unsigned int)__mem_pci(p),d,l) + #define writeb(v,c) __raw_writeb(v,__mem_pci(c)) #define writew(v,c) __raw_writew(cpu_to_le16(v),__mem_pci(c)) #define writel(v,c) __raw_writel(cpu_to_le32(v),__mem_pci(c)) +#define writesb(p,d,l) __raw_writesb((unsigned int)__mem_pci(p),d,l) +#define writesw(p,d,l) __raw_writesw((unsigned int)__mem_pci(p),d,l) +#define writesl(p,d,l) __raw_writesl((unsigned int)__mem_pci(p),d,l) + #define memset_io(c,v,l) _memset_io(__mem_pci(c),(v),(l)) #define memcpy_fromio(a,c,l) _memcpy_fromio((a),__mem_pci(c),(l)) #define memcpy_toio(c,a,l) _memcpy_toio(__mem_pci(c),(a),(l)) diff --git a/include/asm-arm/mach/irq.h b/include/asm-arm/mach/irq.h index 60ce4643c027..5a3007b97324 100644 --- a/include/asm-arm/mach/irq.h +++ b/include/asm-arm/mach/irq.h @@ -50,8 +50,8 @@ struct irqdesc { irq_handler_t handle; struct irqchip *chip; struct irqaction *action; + unsigned int disable_depth; - unsigned int enabled : 1; /* IRQ is currently enabled */ unsigned int triggered: 1; /* IRQ has occurred */ unsigned int running : 1; /* IRQ is running */ unsigned int pending : 1; /* IRQ is pending */ @@ -59,8 +59,7 @@ struct irqdesc { unsigned int probe_ok : 1; /* IRQ can be used for probe */ unsigned int valid : 1; /* IRQ claimable */ unsigned int noautoenable : 1; /* don't automatically enable IRQ */ - unsigned int unused :23; - unsigned int depth; /* disable depth */ + unsigned int unused :25; /* * IRQ lock detection diff --git a/include/asm-arm/module.h b/include/asm-arm/module.h index 5b4d1a3f3679..24b168dc31a3 100644 --- a/include/asm-arm/module.h +++ b/include/asm-arm/module.h @@ -10,4 +10,9 @@ struct mod_arch_specific #define Elf_Sym Elf32_Sym #define Elf_Ehdr Elf32_Ehdr +/* + * Include the ARM architecture version. + */ +#define MODULE_ARCH_VERMAGIC "ARMv" __stringify(__LINUX_ARM_ARCH__) " " + #endif /* _ASM_ARM_MODULE_H */ diff --git a/include/asm-arm/proc-armv/processor.h b/include/asm-arm/proc-armv/processor.h index 853f411083db..390e887d2037 100644 --- a/include/asm-arm/proc-armv/processor.h +++ b/include/asm-arm/proc-armv/processor.h @@ -23,7 +23,7 @@ #define KERNEL_STACK_SIZE PAGE_SIZE #define INIT_EXTRA_THREAD_INFO \ - cpu_domain: domain_val(DOMAIN_USER, DOMAIN_CLIENT) | \ + .cpu_domain = domain_val(DOMAIN_USER, DOMAIN_CLIENT) | \ domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ domain_val(DOMAIN_IO, DOMAIN_CLIENT) @@ -45,7 +45,7 @@ regs->ARM_r0 = stack[0]; /* r0 (argc) */ \ }) -#define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1019]) -#define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1017]) +#define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1019]) +#define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1017]) #endif diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 3d97aae1c3e6..7563b5730aaa 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -13,18 +13,18 @@ } \ \ /* Kernel symbol table: Normal symbols */ \ - __start___ksymtab = .; \ __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ + __start___ksymtab = .; \ *(__ksymtab) \ + __stop___ksymtab = .; \ } \ - __stop___ksymtab = .; \ \ /* Kernel symbol table: GPL-only symbols */ \ - __start___gpl_ksymtab = .; \ __gpl_ksymtab : AT(ADDR(__gpl_ksymtab) - LOAD_OFFSET) { \ + __start___gpl_ksymtab = .; \ *(__gpl_ksymtab) \ + __stop___gpl_ksymtab = .; \ } \ - __stop___gpl_ksymtab = .; \ \ /* Kernel symbol table: strings */ \ __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h index a69e4be257fc..0751ebf5d340 100644 --- a/include/asm-i386/pgtable-3level.h +++ b/include/asm-i386/pgtable-3level.h @@ -89,8 +89,17 @@ static inline int pte_same(pte_t a, pte_t b) } #define pte_page(x) pfn_to_page(pte_pfn(x)) -#define pte_none(x) (!(x).pte_low && !(x).pte_high) -#define pte_pfn(x) (((x).pte_low >> PAGE_SHIFT) | ((x).pte_high << (32 - PAGE_SHIFT))) + +static inline int pte_none(pte_t pte) +{ + return !pte.pte_low && !pte.pte_high; +} + +static inline unsigned long pte_pfn(pte_t pte) +{ + return (pte.pte_low >> PAGE_SHIFT) | + (pte.pte_high << (32 - PAGE_SHIFT)); +} static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) { diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index ed061b5fe6af..0213fa88c792 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h @@ -242,7 +242,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) ((pmd_val(pmd) & (_PAGE_PSE|_PAGE_PRESENT)) == (_PAGE_PSE|_PAGE_PRESENT)) /* to find an entry in a page-table-directory. */ -#define pgd_index(address) ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) +#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) #define __pgd_offset(address) pgd_index(address) diff --git a/include/asm-sparc/mman.h b/include/asm-sparc/mman.h index fe0976a9df24..7fc6075d358e 100644 --- a/include/asm-sparc/mman.h +++ b/include/asm-sparc/mman.h @@ -21,7 +21,7 @@ #define MAP_LOCKED 0x100 /* lock the mapping */ #define _MAP_NEW 0x80000000 /* Binary compatibility is fun... */ -#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ +#define MAP_GROWSDOWN 0x0200 /* stack-like segment */ #define MAP_DENYWRITE 0x0800 /* ETXTBSY */ #define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ diff --git a/include/asm-sparc/smp.h b/include/asm-sparc/smp.h index c283f5157617..f32a11f8a113 100644 --- a/include/asm-sparc/smp.h +++ b/include/asm-sparc/smp.h @@ -48,7 +48,6 @@ extern unsigned long cpu_offset[NR_CPUS]; * Private routines/data */ -extern int smp_found_cpus; extern unsigned char boot_cpu_id; extern unsigned long cpu_present_map; #define cpu_online_map cpu_present_map diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h index 6e6111e478fe..0d56a2a0cde1 100644 --- a/include/asm-sparc64/compat.h +++ b/include/asm-sparc64/compat.h @@ -77,4 +77,11 @@ struct compat_statfs { int f_spare[6]; }; +typedef u32 compat_old_sigset_t; + +#define _COMPAT_NSIG 64 +#define _COMPAT_NSIG_BPW 32 + +typedef u32 compat_sigset_word; + #endif /* _ASM_SPARC64_COMPAT_H */ diff --git a/include/asm-sparc64/elf.h b/include/asm-sparc64/elf.h index 4ca2b010eac3..458f56b0095a 100644 --- a/include/asm-sparc64/elf.h +++ b/include/asm-sparc64/elf.h @@ -111,6 +111,8 @@ do { unsigned long new_flags = current_thread_info()->flags; \ if ((current_thread_info()->flags & _TIF_32BIT) \ != new_flags) \ set_thread_flag(TIF_ABI_PENDING); \ + else \ + clear_thread_flag(TIF_ABI_PENDING); \ /* flush_thread will update pgd cache */ \ if (ibcs2) \ set_personality(PER_SVR4); \ diff --git a/include/asm-sparc64/mman.h b/include/asm-sparc64/mman.h index ec42f85b2bb8..f5980a152936 100644 --- a/include/asm-sparc64/mman.h +++ b/include/asm-sparc64/mman.h @@ -21,7 +21,7 @@ #define MAP_LOCKED 0x100 /* lock the mapping */ #define _MAP_NEW 0x80000000 /* Binary compatibility is fun... */ -#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ +#define MAP_GROWSDOWN 0x0200 /* stack-like segment */ #define MAP_DENYWRITE 0x0800 /* ETXTBSY */ #define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h index ae08da1d6ec7..c6b6feba590c 100644 --- a/include/asm-sparc64/signal.h +++ b/include/asm-sparc64/signal.h @@ -88,27 +88,21 @@ #define _NSIG_BPW 64 #define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW) -#define _NSIG_BPW32 32 -#define _NSIG_WORDS32 (__NEW_NSIG / _NSIG_BPW32) - #define SIGRTMIN 32 #define SIGRTMAX (__NEW_NSIG - 1) #if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__) #define _NSIG __NEW_NSIG #define __new_sigset_t sigset_t -#define __new_sigset_t32 sigset_t32 #define __new_sigaction sigaction #define __new_sigaction32 sigaction32 #define __old_sigset_t old_sigset_t -#define __old_sigset_t32 old_sigset_t32 #define __old_sigaction old_sigaction #define __old_sigaction32 old_sigaction32 #else #define _NSIG __OLD_NSIG #define NSIG _NSIG #define __old_sigset_t sigset_t -#define __old_sigset_t32 sigset_t32 #define __old_sigaction sigaction #define __old_sigaction32 sigaction32 #endif @@ -116,16 +110,11 @@ #ifndef __ASSEMBLY__ typedef unsigned long __old_sigset_t; /* at least 32 bits */ -typedef unsigned int __old_sigset_t32; typedef struct { unsigned long sig[_NSIG_WORDS]; } __new_sigset_t; -typedef struct { - unsigned int sig[_NSIG_WORDS32]; -} __new_sigset_t32; - /* A SunOS sigstack */ struct sigstack { /* XXX 32-bit pointers pinhead XXX */ @@ -213,14 +202,14 @@ struct __new_sigaction { __new_sigset_t sa_mask; }; +#ifdef __KERNEL__ struct __new_sigaction32 { unsigned sa_handler; unsigned int sa_flags; unsigned sa_restorer; /* not used by Linux/SPARC yet */ - __new_sigset_t32 sa_mask; + compat_sigset_t sa_mask; }; -#ifdef __KERNEL__ struct k_sigaction { struct __new_sigaction sa; void *ka_restorer; @@ -234,12 +223,14 @@ struct __old_sigaction { void (*sa_restorer)(void); /* not used by Linux/SPARC yet */ }; +#ifdef __KERNEL__ struct __old_sigaction32 { unsigned sa_handler; - __old_sigset_t32 sa_mask; + compat_old_sigset_t sa_mask; unsigned int sa_flags; unsigned sa_restorer; /* not used by Linux/SPARC yet */ }; +#endif typedef struct sigaltstack { void *ss_sp; diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index aae9dc3d7d25..33808908dfa9 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h @@ -252,8 +252,8 @@ #endif /* #define __NR_oldstat 232 Linux Specific */ #define __NR_stime 233 /* Linux Specific */ -#define __NR_alloc_hugepages 234 /* Linux Specific */ -#define __NR_free_hugepages 235 /* Linux Specific */ +/* #define __NR_UNUSED 234 */ +/* #define __NR_UNUSED 235 */ #define __NR__llseek 236 /* Linux Specific */ #define __NR_mlock 237 #define __NR_munlock 238 diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 6730edd230e0..90171e65e989 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -287,8 +287,8 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn; * BLK_BOUNCE_ANY : don't bounce anything * BLK_BOUNCE_ISA : bounce pages above ISA DMA boundary */ -#define BLK_BOUNCE_HIGH (blk_max_low_pfn << PAGE_SHIFT) -#define BLK_BOUNCE_ANY (blk_max_pfn << PAGE_SHIFT) +#define BLK_BOUNCE_HIGH ((u64)blk_max_low_pfn << PAGE_SHIFT) +#define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT) #define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD) extern int init_emergency_isa_pool(void); diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 7fc917c13f32..aaefe4e964b7 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -10,6 +10,7 @@ #include <linux/types.h> #include <linux/fs.h> #include <linux/linkage.h> +#include <linux/wait.h> #include <asm/atomic.h> enum bh_state_bits { @@ -154,7 +155,7 @@ void invalidate_bdev(struct block_device *, int); void __invalidate_buffers(kdev_t dev, int); int sync_blockdev(struct block_device *bdev); void __wait_on_buffer(struct buffer_head *); -void sleep_on_buffer(struct buffer_head *bh); +wait_queue_head_t *bh_waitq_head(struct buffer_head *bh); void wake_up_buffer(struct buffer_head *bh); int fsync_bdev(struct block_device *); int fsync_super(struct super_block *); diff --git a/include/linux/fs.h b/include/linux/fs.h index 595ea1af33fd..76b32526394f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -371,9 +371,10 @@ struct inode { struct timespec i_ctime; unsigned int i_blkbits; unsigned long i_blksize; - unsigned long i_blocks; unsigned long i_version; + unsigned long i_blocks; unsigned short i_bytes; + spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ struct semaphore i_sem; struct inode_operations *i_op; struct file_operations *i_fop; /* former ->i_op->default_file_ops */ @@ -400,7 +401,7 @@ struct inode { void *i_security; __u32 i_generation; union { - void *generic_ip; + void *generic_ip; } u; }; @@ -412,39 +413,6 @@ struct fown_struct { void *security; }; -static inline void inode_add_bytes(struct inode *inode, loff_t bytes) -{ - inode->i_blocks += bytes >> 9; - bytes &= 511; - inode->i_bytes += bytes; - if (inode->i_bytes >= 512) { - inode->i_blocks++; - inode->i_bytes -= 512; - } -} - -static inline void inode_sub_bytes(struct inode *inode, loff_t bytes) -{ - inode->i_blocks -= bytes >> 9; - bytes &= 511; - if (inode->i_bytes < bytes) { - inode->i_blocks--; - inode->i_bytes += 512; - } - inode->i_bytes -= bytes; -} - -static inline loff_t inode_get_bytes(struct inode *inode) -{ - return (((loff_t)inode->i_blocks) << 9) + inode->i_bytes; -} - -static inline void inode_set_bytes(struct inode *inode, loff_t bytes) -{ - inode->i_blocks = bytes >> 9; - inode->i_bytes = bytes & 511; -} - /* * Track a single file's readahead state */ @@ -1277,6 +1245,10 @@ extern int page_symlink(struct inode *inode, const char *symname, int len); extern struct inode_operations page_symlink_inode_operations; extern void generic_fillattr(struct inode *, struct kstat *); extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); +void inode_add_bytes(struct inode *inode, loff_t bytes); +void inode_sub_bytes(struct inode *inode, loff_t bytes); +loff_t inode_get_bytes(struct inode *inode); +void inode_set_bytes(struct inode *inode, loff_t bytes); extern int vfs_readdir(struct file *, filldir_t, void *); diff --git a/include/linux/module.h b/include/linux/module.h index 6dad1479105f..5b2fb9d19be3 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -344,7 +344,7 @@ static inline int module_text_address(unsigned long addr) } /* Get/put a kernel symbol (calls should be symmetric) */ -#define symbol_get(x) (&(x)) +#define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); }) #define symbol_put(x) do { } while(0) #define symbol_put_addr(x) do { } while(0) diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 013ccd61fb30..94f9d488c2f7 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1661,6 +1661,9 @@ #define PCI_DEVICE_ID_TIGON3_5702FE 0x164d #define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 #define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 +#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 +#define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 +#define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 #define PCI_DEVICE_ID_BCM4401 0x4401 #define PCI_VENDOR_ID_SYBA 0x1592 diff --git a/include/linux/quota.h b/include/linux/quota.h index e5b1e2187156..e1c097e338d9 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h @@ -280,7 +280,8 @@ struct quota_format_type { struct quota_info { unsigned int flags; /* Flags for diskquotas on this device */ struct semaphore dqio_sem; /* lock device while I/O in progress */ - struct rw_semaphore dqoff_sem; /* serialize quota_off() and quota_on() on device and ops using quota_info struct, pointers from inode to dquots */ + struct semaphore dqonoff_sem; /* Serialize quotaon & quotaoff */ + struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */ struct file *files[MAXQUOTAS]; /* fp's to quotafiles */ struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index b115623159e9..780c78ac1c5b 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -305,7 +305,8 @@ enum NET_IPV4_ICMP_RATELIMIT=89, NET_IPV4_ICMP_RATEMASK=90, NET_TCP_TW_REUSE=91, - NET_TCP_FRTO=92 + NET_TCP_FRTO=92, + NET_TCP_LOW_LATENCY=93 }; enum { diff --git a/include/net/ip.h b/include/net/ip.h index f3c975e75409..1f5be0ecf807 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -96,7 +96,7 @@ extern int ip_mc_output(struct sk_buff *skb); extern int ip_fragment(struct sk_buff *skb, int (*out)(struct sk_buff*)); extern int ip_do_nat(struct sk_buff *skb); extern void ip_send_check(struct iphdr *ip); -extern int ip_queue_xmit(struct sk_buff *skb); +extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok); extern void ip_init(void); extern int ip_append_data(struct sock *sk, int getfrag(void *from, char *to, int offset, int len, diff --git a/include/net/route.h b/include/net/route.h index ba15b5140798..ae62dc4e5683 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -167,7 +167,7 @@ static inline int ip_route_connect(struct rtable **rp, u32 dst, ip_rt_put(*rp); *rp = NULL; } - return ip_route_output_flow(rp, &fl, sk, 0); + return ip_route_output_flow(rp, &fl, sk, 1); } static inline int ip_route_newports(struct rtable **rp, u16 sport, u16 dport, diff --git a/include/net/tcp.h b/include/net/tcp.h index 2f564c25c4bd..7c12128650d6 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -474,6 +474,7 @@ extern int sysctl_tcp_app_win; extern int sysctl_tcp_adv_win_scale; extern int sysctl_tcp_tw_reuse; extern int sysctl_tcp_frto; +extern int sysctl_tcp_low_latency; extern atomic_t tcp_memory_allocated; extern atomic_t tcp_sockets_allocated; @@ -566,7 +567,8 @@ static inline void tcp_openreq_free(struct open_request *req) */ struct tcp_func { - int (*queue_xmit) (struct sk_buff *skb); + int (*queue_xmit) (struct sk_buff *skb, + int ipfragok); void (*send_check) (struct sock *sk, struct tcphdr *th, @@ -1348,7 +1350,7 @@ static __inline__ int tcp_prequeue(struct sock *sk, struct sk_buff *skb) { struct tcp_opt *tp = tcp_sk(sk); - if (tp->ucopy.task) { + if (!sysctl_tcp_low_latency && tp->ucopy.task) { __skb_queue_tail(&tp->ucopy.prequeue, skb); tp->ucopy.memory += skb->truesize; if (tp->ucopy.memory > sk->rcvbuf) { diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 137609a3cf0a..1f4c535362c3 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -104,7 +104,26 @@ extern const unsigned char scsi_command_size[8]; /* - * Status codes + * SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft + * T10/1561-D Revision 4 Draft dated 7th November 2002. + */ +#define SAM_STAT_GOOD 0x00 +#define SAM_STAT_CHECK_CONDITION 0x02 +#define SAM_STAT_CONDITION_MET 0x04 +#define SAM_STAT_BUSY 0x08 +#define SAM_STAT_IMMEDIATE 0x10 +#define SAM_STAT_IMMEDIATE_CONDITION_MET 0x14 +#define SAM_STAT_RESERVATION_CONFLICT 0x18 +#define SAM_STAT_COMMAND_TERMINATED 0x22 /* obsolete in SAM-3 */ +#define SAM_STAT_TASK_SET_FULL 0x28 +#define SAM_STAT_ACA_ACTIVE 0x30 +#define SAM_STAT_TASK_ABORTED 0x40 + +/* + * Status codes. These are deprecated as they are shifted 1 bit right + * from those found in the SCSI standards. This causes confusion for + * applications that are ported to several OSes. Prefer SAM Status codes + * above. */ #define GOOD 0x00 diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index fd6c403d0828..47e5e67e990e 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h @@ -196,6 +196,8 @@ #define AC97_CXR_SPDIF_AC3 0x2 /* specific - ALC */ +#define AC97_ALC650_SURR_DAC_VOL 0x64 +#define AC97_ALC650_LFE_DAC_VOL 0x66 #define AC97_ALC650_MULTICH 0x6a #define AC97_ALC650_CLOCK 0x7a @@ -235,8 +237,6 @@ struct _snd_ac97 { unsigned short (*read) (ac97_t *ac97, unsigned short reg); void (*wait) (ac97_t *ac97); void (*init) (ac97_t *ac97); - snd_info_entry_t *proc_entry; - snd_info_entry_t *proc_regs_entry; void *private_data; void (*private_free) (ac97_t *ac97); /* --- */ diff --git a/include/sound/ad1848.h b/include/sound/ad1848.h index 9ae8eb32db5f..155fa2b6ec0f 100644 --- a/include/sound/ad1848.h +++ b/include/sound/ad1848.h @@ -22,7 +22,6 @@ * */ -#include "control.h" #include "pcm.h" /* IO ports */ @@ -162,28 +161,44 @@ int snd_ad1848_create(snd_card_t * card, ad1848_t ** chip); int snd_ad1848_pcm(ad1848_t * chip, int device, snd_pcm_t **rpcm); +const snd_pcm_ops_t *snd_ad1848_get_pcm_ops(int direction); int snd_ad1848_mixer(ad1848_t * chip); void snd_ad1848_interrupt(int irq, void *dev_id, struct pt_regs *regs); -#define AD1848_SINGLE(xname, xindex, reg, shift, mask, invert) \ -{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ - .info = snd_ad1848_info_single, \ - .get = snd_ad1848_get_single, .put = snd_ad1848_put_single, \ - .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } +/* exported mixer stuffs */ +enum { AD1848_MIX_SINGLE, AD1848_MIX_DOUBLE, AD1848_MIX_CAPTURE }; + +#define AD1848_MIXVAL_SINGLE(reg, shift, mask, invert) \ + ((reg) | ((shift) << 8) | ((mask) << 16) | ((invert) << 24)) +#define AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) \ + ((left_reg) | ((right_reg) << 8) | ((shift_left) << 16) | ((shift_right) << 19) | ((mask) << 24) | ((invert) << 22)) + +int snd_ad1848_add_ctl(ad1848_t *chip, const char *name, int index, int type, unsigned long value); -int snd_ad1848_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo); -int snd_ad1848_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); -int snd_ad1848_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); +/* for ease of use */ +struct ad1848_mix_elem { + const char *name; + int index; + int type; + unsigned long private_value; +}; + +#define AD1848_SINGLE(xname, xindex, reg, shift, mask, invert) \ +{ .name = xname, \ + .index = xindex, \ + .type = AD1848_MIX_SINGLE, \ + .private_value = AD1848_MIXVAL_SINGLE(reg, shift, mask, invert) } #define AD1848_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ -{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ - .info = snd_ad1848_info_double, \ - .get = snd_ad1848_get_double, .put = snd_ad1848_put_double, \ - .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } - -int snd_ad1848_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo); -int snd_ad1848_get_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); -int snd_ad1848_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); +{ .name = xname, \ + .index = xindex, \ + .type = AD1848_MIX_DOUBLE, \ + .private_value = AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) } + +static inline int snd_ad1848_add_ctl_elem(ad1848_t *chip, const struct ad1848_mix_elem *c) +{ + return snd_ad1848_add_ctl(chip, c->name, c->index, c->type, c->private_value); +} #ifdef CONFIG_SND_DEBUG void snd_ad1848_debug(ad1848_t *chip); diff --git a/include/sound/ak4531_codec.h b/include/sound/ak4531_codec.h index bf8294d6722c..ad7b52bc2627 100644 --- a/include/sound/ak4531_codec.h +++ b/include/sound/ak4531_codec.h @@ -68,7 +68,6 @@ typedef struct _snd_ak4531 ak4531_t; struct _snd_ak4531 { void (*write) (ak4531_t *ak4531, unsigned short reg, unsigned short val); - snd_info_entry_t *proc_entry; void *private_data; void (*private_free) (ak4531_t *ak4531); /* --- */ diff --git a/include/sound/core.h b/include/sound/core.h index 9d705453eca1..7a3e4676d2c3 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -55,6 +55,7 @@ typedef enum { SNDRV_DEV_TIMER, SNDRV_DEV_SEQUENCER, SNDRV_DEV_HWDEP, + SNDRV_DEV_INFO, SNDRV_DEV_LOWLEVEL = (2*SNDRV_DEV_TYPE_RANGE_SIZE) } snd_device_type_t; @@ -281,6 +282,8 @@ void snd_free_pages(void *ptr, unsigned long size); void *snd_malloc_pci_pages(struct pci_dev *pci, unsigned long size, dma_addr_t *dma_addr); void *snd_malloc_pci_pages_fallback(struct pci_dev *pci, unsigned long size, dma_addr_t *dma_addr, unsigned long *res_size); void snd_free_pci_pages(struct pci_dev *pci, unsigned long size, void *ptr, dma_addr_t dma_addr); +void *snd_malloc_pci_page(struct pci_dev *pci, dma_addr_t *dma_addr); +#define snd_free_pci_page(pci,ptr,addr) snd_free_pci_pages(pci,PAGE_SIZE,ptr,addr) #endif #ifdef CONFIG_SBUS void *snd_malloc_sbus_pages(struct sbus_dev *sdev, unsigned long size, dma_addr_t *dma_addr); @@ -354,13 +357,17 @@ void snd_verbose_printk(const char *file, int line, const char *format, ...); #if defined(CONFIG_SND_DEBUG) && defined(CONFIG_SND_VERBOSE_PRINTK) void snd_verbose_printd(const char *file, int line, const char *format, ...); #endif -#if defined(CONFIG_SND_DEBUG) && !defined(CONFIG_SND_VERBOSE_PRINTK) -void snd_printd(const char *format, ...); -#endif /* --- */ #ifdef CONFIG_SND_VERBOSE_PRINTK +/** + * snd_printk - printk wrapper + * @fmt: format string + * + * Works like print() but prints the file and the line of the caller + * when configured with CONFIG_SND_VERBOSE_PRINTK. + */ #define snd_printk(fmt, args...) \ snd_verbose_printk(__FILE__, __LINE__, fmt ,##args) #else @@ -373,15 +380,45 @@ void snd_printd(const char *format, ...); #define __ASTRING__(x) #x #ifdef CONFIG_SND_VERBOSE_PRINTK +/** + * snd_printd - debug printk + * @format: format string + * + * Compiled only when Works like snd_printk() for debugging purpose. + * Ignored when CONFIG_SND_DEBUG is not set. + */ #define snd_printd(fmt, args...) \ snd_verbose_printd(__FILE__, __LINE__, fmt ,##args) +#else +#define snd_printd(fmt, args...) \ + printk(fmt ,##args) #endif +/** + * snd_assert - run-time assersion macro + * @expr: expression + * @args...: the action + * + * This macro checks the expression in run-time and invokes the commands + * given in the rest arguments if the assertion is failed. + * When CONFIG_SND_DEBUG is not set, the expression is executed but + * not checked. + */ #define snd_assert(expr, args...) do {\ if (!(expr)) {\ snd_printk("BUG? (%s) (called from %p)\n", __ASTRING__(expr), __builtin_return_address(0));\ args;\ }\ } while (0) +/** + * snd_runtime_check - run-time assersion macro + * @expr: expression + * @args...: the action + * + * This macro checks the expression in run-time and invokes the commands + * given in the rest arguments if the assertion is failed. + * Unlike snd_assert(), the action commands are executed even if + * CONFIG_SND_DEBUG is not set but without any error messages. + */ #define snd_runtime_check(expr, args...) do {\ if (!(expr)) {\ snd_printk("ERROR (%s) (called from %p)\n", __ASTRING__(expr), __builtin_return_address(0));\ @@ -398,6 +435,13 @@ void snd_printd(const char *format, ...); #endif /* CONFIG_SND_DEBUG */ #ifdef CONFIG_SND_DEBUG_DETECT +/** + * snd_printdd - debug printk + * @format: format string + * + * Compiled only when Works like snd_printk() for debugging purpose. + * Ignored when CONFIG_SND_DEBUG_DETECT is not set. + */ #define snd_printdd(format, args...) snd_printk(format, ##args) #else #define snd_printdd(format, args...) /* nothing */ diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h index dc849a634aec..f60ea070bacd 100644 --- a/include/sound/cs46xx.h +++ b/include/sound/cs46xx.h @@ -1673,7 +1673,6 @@ typedef struct { unsigned long remap_addr; unsigned long size; struct resource *resource; - void *proc_entry; } snd_cs46xx_region_t; struct _snd_cs46xx { @@ -1726,7 +1725,6 @@ struct _snd_cs46xx { spinlock_t reg_lock; unsigned int midcr; unsigned int uartm; - snd_info_entry_t *proc_entry; int amplifier; void (*amplifier_ctrl)(cs46xx_t *, int); diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index 7d6b34144c0d..d5b57b2ccbdb 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h @@ -25,12 +25,11 @@ #ifdef __KERNEL__ -#include "pcm.h" -#include "pcm_sgbuf.h" -#include "rawmidi.h" -#include "hwdep.h" -#include "ac97_codec.h" -#include "util_mem.h" +#include <sound/pcm.h> +#include <sound/rawmidi.h> +#include <sound/hwdep.h> +#include <sound/ac97_codec.h> +#include <sound/util_mem.h> #include <asm/io.h> #ifndef PCI_VENDOR_ID_CREATIVE @@ -232,7 +231,7 @@ #define A_IOCFG 0x18 /* GPIO on Audigy card (16bits) */ #define A_GPINPUT_MASK 0xff00 #define A_GPOUTPUT_MASK 0x00ff -#define A_IOCFG_GPOUT0 0x0040 /* analog/digital? */ +#define A_IOCFG_GPOUT0 0x0044 /* analog/digital? */ #define TIMER 0x1a /* Timer terminal count register */ /* NOTE: After the rate is changed, a maximum */ @@ -993,13 +992,6 @@ struct _snd_emu10k1 { emu10k1_midi_t midi2; /* for audigy */ unsigned int efx_voices_mask[2]; - - snd_info_entry_t *proc_entry; - snd_info_entry_t *proc_entry_fx8010_gpr; - snd_info_entry_t *proc_entry_fx8010_tram_data; - snd_info_entry_t *proc_entry_fx8010_tram_addr; - snd_info_entry_t *proc_entry_fx8010_code; - snd_info_entry_t *proc_entry_fx8010_iblocks; }; int snd_emu10k1_create(snd_card_t * card, @@ -1045,7 +1037,7 @@ unsigned int snd_emu10k1_rate_to_pitch(unsigned int rate); unsigned char snd_emu10k1_sum_vol_attn(unsigned int value); /* memory allocation */ -snd_util_memblk_t *snd_emu10k1_alloc_pages(emu10k1_t *emu, struct snd_sg_buf *sgbuf); +snd_util_memblk_t *snd_emu10k1_alloc_pages(emu10k1_t *emu, snd_pcm_substream_t *substream); int snd_emu10k1_free_pages(emu10k1_t *emu, snd_util_memblk_t *blk); snd_util_memblk_t *snd_emu10k1_synth_alloc(emu10k1_t *emu, unsigned int size); int snd_emu10k1_synth_free(emu10k1_t *emu, snd_util_memblk_t *blk); @@ -1063,7 +1055,6 @@ int snd_emu10k1_audigy_midi(emu10k1_t * emu); /* proc interface */ int snd_emu10k1_proc_init(emu10k1_t * emu); -int snd_emu10k1_proc_done(emu10k1_t * emu); #endif /* __KERNEL__ */ diff --git a/include/sound/gus.h b/include/sound/gus.h index 2e84f2687588..a896bf9ff626 100644 --- a/include/sound/gus.h +++ b/include/sound/gus.h @@ -210,7 +210,6 @@ typedef struct _snd_gf1_mem { snd_gf1_bank_info_t banks_16[4]; snd_gf1_mem_block_t *first; snd_gf1_mem_block_t *last; - snd_info_entry_t *info_entry; struct semaphore memory_mutex; } snd_gf1_mem_t; @@ -332,8 +331,6 @@ struct _snd_gf1 { unsigned int rom_banks; /* GUS's ROM banks */ snd_gf1_mem_t mem_alloc; - snd_info_entry_t *ram_entries[4]; - snd_info_entry_t *rom_entries[4]; /* registers */ unsigned short reg_page; @@ -452,9 +449,6 @@ struct _snd_gus_card { int timer_dev; /* timer device */ struct _snd_gf1 gf1; /* gf1 specific variables */ -#ifdef CONFIG_SND_DEBUG - snd_info_entry_t *irq_entry; -#endif snd_pcm_t *pcm; snd_pcm_substream_t *pcm_cap_substream; unsigned int c_dma_size; @@ -601,7 +595,6 @@ int snd_gf1_mem_done(snd_gus_card_t * gus); /* gus_mem_proc.c */ int snd_gf1_mem_proc_init(snd_gus_card_t * gus); -int snd_gf1_mem_proc_done(snd_gus_card_t * gus); /* gus_dma.c */ @@ -676,7 +669,6 @@ int snd_gus_initialize(snd_gus_card_t * gus); void snd_gus_interrupt(int irq, void *dev_id, struct pt_regs *regs); #ifdef CONFIG_SND_DEBUG void snd_gus_irq_profile_init(snd_gus_card_t *gus); -void snd_gus_irq_profile_done(snd_gus_card_t *gus); #endif /* gus_uart.c */ diff --git a/include/sound/info.h b/include/sound/info.h index 6984c6e736dc..34126e7985e6 100644 --- a/include/sound/info.h +++ b/include/sound/info.h @@ -141,6 +141,19 @@ struct proc_dir_entry *snd_create_proc_entry(const char *name, mode_t mode, void snd_remove_proc_entry(struct proc_dir_entry *parent, struct proc_dir_entry *de); +/* for card drivers */ +int snd_card_proc_new(snd_card_t *card, const char *name, snd_info_entry_t **entryp); + +inline static void snd_info_set_text_ops(snd_info_entry_t *entry, + void *private_data, + void (*read)(snd_info_entry_t *, snd_info_buffer_t *)) +{ + entry->private_data = private_data; + entry->c.text.read_size = 1024; + entry->c.text.read = read; +} + + #else #define snd_seq_root NULL @@ -160,8 +173,9 @@ static inline snd_info_entry_t *snd_info_create_device(const char *name, unsigned int mode) { return NULL; } static inline void snd_info_free_device(snd_info_entry_t * entry) { ; } +static inline int snd_info_card_create(snd_card_t * card) { return 0; } static inline int snd_info_card_register(snd_card_t * card) { return 0; } -static inline int snd_info_card_unregister(snd_card_t * card) { return 0; } +static inline int snd_info_card_free(snd_card_t * card) { return 0; } static inline int snd_info_register(snd_info_entry_t * entry) { return 0; } static inline int snd_info_unregister(snd_info_entry_t * entry) { return 0; } @@ -169,6 +183,9 @@ static inline struct proc_dir_entry *snd_create_proc_entry(const char *name, mod static inline void snd_remove_proc_entry(struct proc_dir_entry *parent, struct proc_dir_entry *de) { ; } +#define snd_card_proc_new(card,name,entryp) 0 /* always success */ +#define snd_info_set_text_ops(entry,private_data,read) /*NOP*/ + #endif /* diff --git a/include/sound/pcm.h b/include/sound/pcm.h index d97f7e751d9a..2f81279b633f 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -50,7 +50,7 @@ typedef struct sndrv_pcm_mmap_status snd_pcm_mmap_status_t; typedef struct sndrv_pcm_mmap_control snd_pcm_mmap_control_t; typedef struct sndrv_mask snd_mask_t; -#define _snd_pcm_substream_chip(substream) ((substream)->pcm->private_data) +#define _snd_pcm_substream_chip(substream) ((substream)->private_data) #define snd_pcm_substream_chip(substream) snd_magic_cast1(chip_t, _snd_pcm_substream_chip(substream), return -ENXIO) #define _snd_pcm_chip(pcm) ((pcm)->private_data) #define snd_pcm_chip(pcm) snd_magic_cast1(chip_t, _snd_pcm_chip(pcm), return -ENXIO) @@ -120,10 +120,12 @@ typedef struct _snd_pcm_ops { #define SNDRV_PCM_TRIGGER_SUSPEND 5 #define SNDRV_PCM_TRIGGER_RESUME 6 -#define SNDRV_PCM_DMA_TYPE_CONTINUOUS 0 /* continuous no-DMA memory */ -#define SNDRV_PCM_DMA_TYPE_ISA 1 /* ISA continuous */ -#define SNDRV_PCM_DMA_TYPE_PCI 2 /* PCI continuous */ -#define SNDRV_PCM_DMA_TYPE_SBUS 3 /* SBUS continuous */ +#define SNDRV_PCM_DMA_TYPE_UNKNOWN 0 /* not defined */ +#define SNDRV_PCM_DMA_TYPE_CONTINUOUS 1 /* continuous no-DMA memory */ +#define SNDRV_PCM_DMA_TYPE_ISA 2 /* ISA continuous */ +#define SNDRV_PCM_DMA_TYPE_PCI 3 /* PCI continuous */ +#define SNDRV_PCM_DMA_TYPE_SBUS 4 /* SBUS continuous */ +#define SNDRV_PCM_DMA_TYPE_PCI_SG 5 /* PCI SG-buffer */ /* If you change this don't forget to change rates[] table in pcm_native.c */ #define SNDRV_PCM_RATE_5512 (1<<0) /* 5512Hz */ @@ -363,6 +365,7 @@ struct _snd_pcm_runtime { struct _snd_pcm_substream { snd_pcm_t *pcm; snd_pcm_str_t *pstr; + void *private_data; /* copied from pcm->private_data */ int number; char name[32]; /* substream name */ int stream; /* stream (direction) */ @@ -741,6 +744,10 @@ int snd_pcm_hw_param_near(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var, unsigned int val, int *dir); +int snd_pcm_hw_param_set(snd_pcm_substream_t *pcm, + snd_pcm_hw_params_t *params, + snd_pcm_hw_param_t var, + unsigned int val, int dir); int snd_pcm_hw_params_choose(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); int snd_pcm_hw_refine(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); diff --git a/include/sound/pcm_sgbuf.h b/include/sound/pcm_sgbuf.h index bc6474559c57..c05bd90606a9 100644 --- a/include/sound/pcm_sgbuf.h +++ b/include/sound/pcm_sgbuf.h @@ -32,6 +32,7 @@ struct snd_sg_buf { int pages; /* allocated pages */ int tblsize; /* allocated table size */ struct snd_sg_page *table; + struct page **page_table; struct pci_dev *pci; }; @@ -53,15 +54,17 @@ static inline dma_addr_t snd_pcm_sgbuf_get_addr(struct snd_sg_buf *sgbuf, size_t return sgbuf->table[offset >> PAGE_SHIFT].addr + offset % PAGE_SIZE; } -int snd_pcm_sgbuf_init(snd_pcm_substream_t *substream, struct pci_dev *pci, int tblsize); -int snd_pcm_sgbuf_delete(snd_pcm_substream_t *substream); -int snd_pcm_sgbuf_alloc(snd_pcm_substream_t *substream, size_t size); -int snd_pcm_sgbuf_free(snd_pcm_substream_t *substream); +struct snd_sg_buf *snd_pcm_sgbuf_init(struct pci_dev *pci); +void snd_pcm_sgbuf_delete(struct snd_sg_buf *sgbuf); +void *snd_pcm_sgbuf_alloc_pages(struct snd_sg_buf *sgbuf, size_t size); +int snd_pcm_sgbuf_free_pages(struct snd_sg_buf *sgbuf, void *vmaddr); -int snd_pcm_sgbuf_ops_copy_playback(snd_pcm_substream_t *substream, int channel, snd_pcm_uframes_t hwoff, void *buf, snd_pcm_uframes_t count); -int snd_pcm_sgbuf_ops_copy_capture(snd_pcm_substream_t *substream, int channel, snd_pcm_uframes_t hwoff, void *buf, snd_pcm_uframes_t count); -int snd_pcm_sgbuf_ops_silence(snd_pcm_substream_t *substream, int channel, snd_pcm_uframes_t hwoff, snd_pcm_uframes_t count); -struct page *snd_pcm_sgbuf_ops_page(snd_pcm_substream_t *substream, unsigned long offset); +int snd_pcm_lib_preallocate_sg_pages(struct pci_dev *pci, snd_pcm_substream_t *substream); +int snd_pcm_lib_preallocate_sg_pages_for_all(struct pci_dev *pci, snd_pcm_t *pcm); + +#define _snd_pcm_substream_sgbuf(substream) ((substream)->dma_private) +#define snd_pcm_substream_sgbuf(substream) snd_magic_cast(snd_pcm_sgbuf_t, _snd_pcm_substream_sgbuf(substream), return -ENXIO) +struct page *snd_pcm_sgbuf_ops_page(snd_pcm_substream_t *substream, unsigned long offset); #endif /* __SOUND_PCM_SGBUF_H */ diff --git a/include/sound/sb.h b/include/sound/sb.h index 53f243b7bf64..7815b9200d35 100644 --- a/include/sound/sb.h +++ b/include/sound/sb.h @@ -305,6 +305,7 @@ int snd_sb8dsp_midi(sb_t *chip, int device, snd_rawmidi_t ** rrawmidi); /* sb16_init.c */ int snd_sb16dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm); +const snd_pcm_ops_t *snd_sb16dsp_get_pcm_ops(int direction); int snd_sb16dsp_configure(sb_t *chip); /* sb16.c */ void snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs); @@ -313,4 +314,49 @@ int snd_sb16_capture_open(snd_pcm_substream_t *substream); int snd_sb16_playback_close(snd_pcm_substream_t *substream); int snd_sb16_capture_close(snd_pcm_substream_t *substream); +/* exported mixer stuffs */ +enum { + SB_MIX_SINGLE, + SB_MIX_DOUBLE, + SB_MIX_INPUT_SW, + SB_MIX_CAPTURE_PRO, + SB_MIX_CAPTURE_DT019X +}; + +#define SB_MIXVAL_DOUBLE(left_reg, right_reg, left_shift, right_shift, mask) \ + ((left_reg) | ((right_reg) << 8) | ((left_shift) << 16) | ((right_shift) << 19) | ((mask) << 24)) +#define SB_MIXVAL_SINGLE(reg, shift, mask) \ + ((reg) | ((shift) << 16) | ((mask) << 24)) +#define SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) \ + ((reg1) | ((reg2) << 8) | ((left_shift) << 16) | ((right_shift) << 24)) + +int snd_sbmixer_add_ctl(sb_t *chip, const char *name, int index, int type, unsigned long value); + +/* for ease of use */ +struct sbmix_elem { + const char *name; + int type; + unsigned long private_value; +}; + +#define SB_SINGLE(xname, reg, shift, mask) \ +{ .name = xname, \ + .type = SB_MIX_SINGLE, \ + .private_value = SB_MIXVAL_SINGLE(reg, shift, mask) } + +#define SB_DOUBLE(xname, left_reg, right_reg, left_shift, right_shift, mask) \ +{ .name = xname, \ + .type = SB_MIX_DOUBLE, \ + .private_value = SB_MIXVAL_DOUBLE(left_reg, right_reg, left_shift, right_shift, mask) } + +#define SB16_INPUT_SW(xname, reg1, reg2, left_shift, right_shift) \ +{ .name = xname, \ + .type = SB_MIX_INPUT_SW, \ + .private_value = SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) } + +static inline int snd_sbmixer_add_ctl_elem(sb_t *chip, const struct sbmix_elem *c) +{ + return snd_sbmixer_add_ctl(chip, c->name, 0, c->type, c->private_value); +} + #endif /* __SOUND_SB_H */ diff --git a/include/sound/sb16_csp.h b/include/sound/sb16_csp.h index dfdb71dc6a7d..eb8368b56b16 100644 --- a/include/sound/sb16_csp.h +++ b/include/sound/sb16_csp.h @@ -159,7 +159,6 @@ struct snd_sb_csp { snd_kcontrol_t *qsound_space; struct semaphore access_mutex; /* locking */ - snd_info_entry_t *proc; /* proc interface */ }; int snd_sb_csp_new(sb_t *chip, int device, snd_hwdep_t ** rhwdep); diff --git a/include/sound/sndmagic.h b/include/sound/sndmagic.h index 83495c4ce9e5..560f248b9cdf 100644 --- a/include/sound/sndmagic.h +++ b/include/sound/sndmagic.h @@ -27,10 +27,45 @@ void *_snd_magic_kcalloc(unsigned long magic, size_t size, int flags); void *_snd_magic_kmalloc(unsigned long magic, size_t size, int flags); -void snd_magic_kfree(void *ptr); -#define snd_magic_kcalloc(type, extra, flags) (type *) _snd_magic_kcalloc(type##_magic, sizeof(type) + extra, flags) -#define snd_magic_kmalloc(type, extra, flags) (type *) _snd_magic_kmalloc(type##_magic, sizeof(type) + extra, flags) +/** + * snd_magic_kmalloc - allocate a record with a magic-prefix + * @type: the type to allocate a record (like xxx_t) + * @extra: the extra size to allocate in bytes + * @flags: the allocation condition (GFP_XXX) + * + * Allocates a record of the given type with the extra space and + * returns its pointer. The allocated record has a secret magic-key + * to be checked via snd_magic_cast() for safe casts. + * + * The allocated pointer must be released via snd_magic_kfree(). + * + * The "struct xxx" style cannot be used as the type argument + * because the magic-key constant is generated from the type-name + * string. + */ +#define snd_magic_kmalloc(type, extra, flags) \ + (type *) _snd_magic_kmalloc(type##_magic, sizeof(type) + extra, flags) +/** + * snd_magic_kcalloc - allocate a record with a magic-prefix and initialize + * @type: the type to allocate a record (like xxx_t) + * @extra: the extra size to allocate in bytes + * @flags: the allocation condition (GFP_XXX) + * + * Works like snd_magic_kmalloc() but this clears the area with zero + * automatically. + */ +#define snd_magic_kcalloc(type, extra, flags) \ + (type *) _snd_magic_kcalloc(type##_magic, sizeof(type) + extra, flags) + +/** + * snd_magic_kfree - release the allocated area + * @ptr: the pointer allocated via snd_magic_kmalloc() or snd_magic_kcalloc() + * + * Releases the memory area allocated via snd_magic_kmalloc() or + * snd_magic_kcalloc() function. + */ +void snd_magic_kfree(void *ptr); static inline unsigned long _snd_magic_value(void *obj) { @@ -44,7 +79,19 @@ static inline int _snd_magic_bad(void *obj, unsigned long magic) #define snd_magic_cast1(t, expr, cmd) snd_magic_cast(t, expr, cmd) -#define snd_magic_cast(type, ptr, action...) (type *) ({\ +/** + * snd_magic_cast - check and cast the magic-allocated pointer + * @type: the type of record to cast + * @ptr: the magic-allocated pointer + * @action...: the action to do if failed + * + * This macro provides a safe cast for the given type, which was + * allocated via snd_magic_kmalloc() or snd_magic_kcallc(). + * If the pointer is invalid, i.e. the cast-type doesn't match, + * the action arguments are called with a debug message. + */ +#define snd_magic_cast(type, ptr, action...) \ + (type *) ({\ void *__ptr = ptr;\ unsigned long __magic = _snd_magic_value(__ptr);\ if (__magic != type##_magic) {\ @@ -64,6 +111,7 @@ static inline int _snd_magic_bad(void *obj, unsigned long magic) #define snd_pcm_sgbuf_t_magic 0xa15a0107 #define snd_info_private_data_t_magic 0xa15a0201 +#define snd_info_entry_t_magic 0xa15a0202 #define snd_ctl_file_t_magic 0xa15a0301 #define snd_kcontrol_t_magic 0xa15a0302 #define snd_rawmidi_t_magic 0xa15a0401 diff --git a/include/sound/trident.h b/include/sound/trident.h index bf4ed45f1a63..f4f4042f6e7f 100644 --- a/include/sound/trident.h +++ b/include/sound/trident.h @@ -431,7 +431,8 @@ struct _snd_trident { int ChanPCM; /* max number of PCM channels */ int ChanPCMcnt; /* actual number of PCM channels */ - int ac97_detect; /* 1 = AC97 in detection phase */ + unsigned int ac97_detect: 1; /* 1 = AC97 in detection phase */ + unsigned int in_suspend: 1; /* 1 during suspend/resume */ struct _snd_4dwave synth; /* synth specific variables */ @@ -452,7 +453,6 @@ struct _snd_trident { snd_trident_pcm_mixer_t pcm_mixer[32]; spinlock_t reg_lock; - snd_info_entry_t *proc_entry; struct snd_trident_gameport *gameport; }; @@ -479,7 +479,7 @@ void snd_trident_write_voice_regs(trident_t * trident, snd_trident_voice_t *voic void snd_trident_clear_voices(trident_t * trident, unsigned short v_min, unsigned short v_max); /* TLB memory allocation */ -snd_util_memblk_t *snd_trident_alloc_pages(trident_t *trident, void *pages, dma_addr_t addr, unsigned long size); +snd_util_memblk_t *snd_trident_alloc_pages(trident_t *trident, snd_pcm_substream_t *substream); int snd_trident_free_pages(trident_t *trident, snd_util_memblk_t *blk); snd_util_memblk_t *snd_trident_synth_alloc(trident_t *trident, unsigned int size); int snd_trident_synth_free(trident_t *trident, snd_util_memblk_t *blk); diff --git a/include/sound/version.h b/include/sound/version.h index a0166739358d..77c9885943eb 100644 --- a/include/sound/version.h +++ b/include/sound/version.h @@ -1,3 +1,3 @@ /* include/version.h. Generated automatically by configure. */ #define CONFIG_SND_VERSION "0.9.0rc6" -#define CONFIG_SND_DATE " (Tue Dec 17 19:01:13 2002 UTC)" +#define CONFIG_SND_DATE " (Tue Jan 28 12:17:23 2003 UTC)" |
