1
2
3
4
5
6
7
8
9#include <linux/init.h>
10#include <linux/kernel.h>
11#include <linux/platform_device.h>
12
13#include <bcm63xx_cpu.h>
14#include <bcm63xx_dev_hsspi.h>
15#include <bcm63xx_regs.h>
16
17static struct resource spi_resources[] = {
18 {
19 .start = -1,
20 .end = -1,
21 .flags = IORESOURCE_MEM,
22 },
23 {
24 .start = -1,
25 .flags = IORESOURCE_IRQ,
26 },
27};
28
29static struct platform_device bcm63xx_hsspi_device = {
30 .name = "bcm63xx-hsspi",
31 .id = 0,
32 .num_resources = ARRAY_SIZE(spi_resources),
33 .resource = spi_resources,
34};
35
36int __init bcm63xx_hsspi_register(void)
37{
38 if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362())
39 return -ENODEV;
40
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);
45
46 return platform_device_register(&bcm63xx_hsspi_device);
47}
48