aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm63xx/dev-spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/bcm63xx/dev-spi.c')
-rw-r--r--arch/mips/bcm63xx/dev-spi.c42
1 files changed, 2 insertions, 40 deletions
diff --git a/arch/mips/bcm63xx/dev-spi.c b/arch/mips/bcm63xx/dev-spi.c
index ad448e41e3bd..232385441e46 100644
--- a/arch/mips/bcm63xx/dev-spi.c
+++ b/arch/mips/bcm63xx/dev-spi.c
@@ -18,29 +18,6 @@
18#include <bcm63xx_dev_spi.h> 18#include <bcm63xx_dev_spi.h>
19#include <bcm63xx_regs.h> 19#include <bcm63xx_regs.h>
20 20
21/*
22 * register offsets
23 */
24static const unsigned long bcm6348_regs_spi[] = {
25 __GEN_SPI_REGS_TABLE(6348)
26};
27
28static const unsigned long bcm6358_regs_spi[] = {
29 __GEN_SPI_REGS_TABLE(6358)
30};
31
32const unsigned long *bcm63xx_regs_spi;
33EXPORT_SYMBOL(bcm63xx_regs_spi);
34
35static __init void bcm63xx_spi_regs_init(void)
36{
37 if (BCMCPU_IS_6338() || BCMCPU_IS_6348())
38 bcm63xx_regs_spi = bcm6348_regs_spi;
39 if (BCMCPU_IS_3368() || BCMCPU_IS_6358() ||
40 BCMCPU_IS_6362() || BCMCPU_IS_6368())
41 bcm63xx_regs_spi = bcm6358_regs_spi;
42}
43
44static struct resource spi_resources[] = { 21static struct resource spi_resources[] = {
45 { 22 {
46 .start = -1, /* filled at runtime */ 23 .start = -1, /* filled at runtime */
@@ -53,19 +30,10 @@ static struct resource spi_resources[] = {
53 }, 30 },
54}; 31};
55 32
56static struct bcm63xx_spi_pdata spi_pdata = {
57 .bus_num = 0,
58 .num_chipselect = 8,
59};
60
61static struct platform_device bcm63xx_spi_device = { 33static struct platform_device bcm63xx_spi_device = {
62 .name = "bcm63xx-spi",
63 .id = -1, 34 .id = -1,
64 .num_resources = ARRAY_SIZE(spi_resources), 35 .num_resources = ARRAY_SIZE(spi_resources),
65 .resource = spi_resources, 36 .resource = spi_resources,
66 .dev = {
67 .platform_data = &spi_pdata,
68 },
69}; 37};
70 38
71int __init bcm63xx_spi_register(void) 39int __init bcm63xx_spi_register(void)
@@ -78,21 +46,15 @@ int __init bcm63xx_spi_register(void)
78 spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI); 46 spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI);
79 47
80 if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) { 48 if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) {
49 bcm63xx_spi_device.name = "bcm6348-spi",
81 spi_resources[0].end += BCM_6348_RSET_SPI_SIZE - 1; 50 spi_resources[0].end += BCM_6348_RSET_SPI_SIZE - 1;
82 spi_pdata.fifo_size = SPI_6348_MSG_DATA_SIZE;
83 spi_pdata.msg_type_shift = SPI_6348_MSG_TYPE_SHIFT;
84 spi_pdata.msg_ctl_width = SPI_6348_MSG_CTL_WIDTH;
85 } 51 }
86 52
87 if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6362() || 53 if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6362() ||
88 BCMCPU_IS_6368()) { 54 BCMCPU_IS_6368()) {
55 bcm63xx_spi_device.name = "bcm6358-spi",
89 spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1; 56 spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1;
90 spi_pdata.fifo_size = SPI_6358_MSG_DATA_SIZE;
91 spi_pdata.msg_type_shift = SPI_6358_MSG_TYPE_SHIFT;
92 spi_pdata.msg_ctl_width = SPI_6358_MSG_CTL_WIDTH;
93 } 57 }
94 58
95 bcm63xx_spi_regs_init();
96
97 return platform_device_register(&bcm63xx_spi_device); 59 return platform_device_register(&bcm63xx_spi_device);
98} 60}