diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2010-04-13 14:12:17 +0200 | 
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2010-04-13 14:12:17 +0200 | 
| commit | 7c7145f6acc68100dbdc5d3c5c64fe3af1c99c89 (patch) | |
| tree | 5e93e3eb4787229032f1df222fa490112f4b0c32 /arch/mips/bcm63xx/dev-uart.c | |
| parent | 92d6b71ab906be706f3679353b30a8d2c3831144 (diff) | |
| parent | 0d0fb0f9c5fddef4a10242fe3337f00f528a3099 (diff) | |
| download | olio-linux-3.10-7c7145f6acc68100dbdc5d3c5c64fe3af1c99c89.tar.xz olio-linux-3.10-7c7145f6acc68100dbdc5d3c5c64fe3af1c99c89.zip  | |
Merge branch 'linus' into irq/core
Reason: Get the upstream IRQF_DISABLED related changes.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/mips/bcm63xx/dev-uart.c')
| -rw-r--r-- | arch/mips/bcm63xx/dev-uart.c | 66 | 
1 files changed, 50 insertions, 16 deletions
diff --git a/arch/mips/bcm63xx/dev-uart.c b/arch/mips/bcm63xx/dev-uart.c index b0519461ad9..c2963da0253 100644 --- a/arch/mips/bcm63xx/dev-uart.c +++ b/arch/mips/bcm63xx/dev-uart.c @@ -11,31 +11,65 @@  #include <linux/platform_device.h>  #include <bcm63xx_cpu.h> -static struct resource uart_resources[] = { +static struct resource uart0_resources[] = {  	{ -		.start		= -1, /* filled at runtime */ -		.end		= -1, /* filled at runtime */ +		/* start & end filled at runtime */  		.flags		= IORESOURCE_MEM,  	},  	{ -		.start		= -1, /* filled at runtime */ +		/* start filled at runtime */  		.flags		= IORESOURCE_IRQ,  	},  }; -static struct platform_device bcm63xx_uart_device = { -	.name		= "bcm63xx_uart", -	.id		= 0, -	.num_resources	= ARRAY_SIZE(uart_resources), -	.resource	= uart_resources, +static struct resource uart1_resources[] = { +	{ +		/* start & end filled at runtime */ +		.flags		= IORESOURCE_MEM, +	}, +	{ +		/* start filled at runtime */ +		.flags		= IORESOURCE_IRQ, +	}, +}; + +static struct platform_device bcm63xx_uart_devices[] = { +	{ +		.name		= "bcm63xx_uart", +		.id		= 0, +		.num_resources	= ARRAY_SIZE(uart0_resources), +		.resource	= uart0_resources, +	}, + +	{ +		.name		= "bcm63xx_uart", +		.id		= 1, +		.num_resources	= ARRAY_SIZE(uart1_resources), +		.resource	= uart1_resources, +	}  }; -int __init bcm63xx_uart_register(void) +int __init bcm63xx_uart_register(unsigned int id)  { -	uart_resources[0].start = bcm63xx_regset_address(RSET_UART0); -	uart_resources[0].end = uart_resources[0].start; -	uart_resources[0].end += RSET_UART_SIZE - 1; -	uart_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0); -	return platform_device_register(&bcm63xx_uart_device); +	if (id >= ARRAY_SIZE(bcm63xx_uart_devices)) +		return -ENODEV; + +	if (id == 1 && !BCMCPU_IS_6358()) +		return -ENODEV; + +	if (id == 0) { +		uart0_resources[0].start = bcm63xx_regset_address(RSET_UART0); +		uart0_resources[0].end = uart0_resources[0].start + +			RSET_UART_SIZE - 1; +		uart0_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0); +	} + +	if (id == 1) { +		uart1_resources[0].start = bcm63xx_regset_address(RSET_UART1); +		uart1_resources[0].end = uart1_resources[0].start + +			RSET_UART_SIZE - 1; +		uart1_resources[1].start = bcm63xx_get_irq_number(IRQ_UART1); +	} + +	return platform_device_register(&bcm63xx_uart_devices[id]);  } -arch_initcall(bcm63xx_uart_register);  |