2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 2012 Jonas Gorski <jonas.gorski@gmail.com>
9 #include <linux/init.h>
10 #include <linux/kernel.h>
11 #include <linux/platform_device.h>
13 #include <bcm63xx_cpu.h>
14 #include <bcm63xx_dev_hsspi.h>
15 #include <bcm63xx_regs.h>
17 static struct resource spi_resources
[] = {
19 .start
= -1, /* filled at runtime */
20 .end
= -1, /* filled at runtime */
21 .flags
= IORESOURCE_MEM
,
24 .start
= -1, /* filled at runtime */
25 .flags
= IORESOURCE_IRQ
,
29 static struct platform_device bcm63xx_hsspi_device
= {
30 .name
= "bcm63xx-hsspi",
32 .num_resources
= ARRAY_SIZE(spi_resources
),
33 .resource
= spi_resources
,
36 int __init
bcm63xx_hsspi_register(void)
38 if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362())
41 spi_resources
[0].start
= bcm63xx_regset_address(RSET_HSSPI
);
42 spi_resources
[0].end
= spi_resources
[0].start
;
43 spi_resources
[0].end
+= RSET_HSSPI_SIZE
- 1;
44 spi_resources
[1].start
= bcm63xx_get_irq_number(IRQ_HSSPI
);
46 return platform_device_register(&bcm63xx_hsspi_device
);