diff options
author | Jonas Gorski <jogo@openwrt.org> | 2013-03-21 10:03:14 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-05-07 19:19:02 -0400 |
commit | 8a398d757dd0f56c8ac621104b198ff66eef7a7a (patch) | |
tree | f23295a91f571c1a4ff303b086b94addb4fac0de /arch/mips/bcm63xx | |
parent | 41ef2d5678d83af030125550329b6ae8b74618fa (diff) |
MIPS: BCM63XX: remove duplicate spi register definitions
BCM6338 and BCM6348, and BCM6358 and everything after that share the
same register layout. To not have to redefine them for each new chip
and keep the code size small, only use the definitions for the first
chip with the certain layout.
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5006/
Acked-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'arch/mips/bcm63xx')
-rw-r--r-- | arch/mips/bcm63xx/dev-spi.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/arch/mips/bcm63xx/dev-spi.c b/arch/mips/bcm63xx/dev-spi.c index f1c9c3e2f678..2a43825f7f21 100644 --- a/arch/mips/bcm63xx/dev-spi.c +++ b/arch/mips/bcm63xx/dev-spi.c | |||
@@ -22,10 +22,6 @@ | |||
22 | /* | 22 | /* |
23 | * register offsets | 23 | * register offsets |
24 | */ | 24 | */ |
25 | static const unsigned long bcm6338_regs_spi[] = { | ||
26 | __GEN_SPI_REGS_TABLE(6338) | ||
27 | }; | ||
28 | |||
29 | static const unsigned long bcm6348_regs_spi[] = { | 25 | static const unsigned long bcm6348_regs_spi[] = { |
30 | __GEN_SPI_REGS_TABLE(6348) | 26 | __GEN_SPI_REGS_TABLE(6348) |
31 | }; | 27 | }; |
@@ -34,23 +30,15 @@ static const unsigned long bcm6358_regs_spi[] = { | |||
34 | __GEN_SPI_REGS_TABLE(6358) | 30 | __GEN_SPI_REGS_TABLE(6358) |
35 | }; | 31 | }; |
36 | 32 | ||
37 | static const unsigned long bcm6368_regs_spi[] = { | ||
38 | __GEN_SPI_REGS_TABLE(6368) | ||
39 | }; | ||
40 | |||
41 | const unsigned long *bcm63xx_regs_spi; | 33 | const unsigned long *bcm63xx_regs_spi; |
42 | EXPORT_SYMBOL(bcm63xx_regs_spi); | 34 | EXPORT_SYMBOL(bcm63xx_regs_spi); |
43 | 35 | ||
44 | static __init void bcm63xx_spi_regs_init(void) | 36 | static __init void bcm63xx_spi_regs_init(void) |
45 | { | 37 | { |
46 | if (BCMCPU_IS_6338()) | 38 | if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) |
47 | bcm63xx_regs_spi = bcm6338_regs_spi; | ||
48 | if (BCMCPU_IS_6348()) | ||
49 | bcm63xx_regs_spi = bcm6348_regs_spi; | 39 | bcm63xx_regs_spi = bcm6348_regs_spi; |
50 | if (BCMCPU_IS_6358()) | 40 | if (BCMCPU_IS_6358() || BCMCPU_IS_6368()) |
51 | bcm63xx_regs_spi = bcm6358_regs_spi; | 41 | bcm63xx_regs_spi = bcm6358_regs_spi; |
52 | if (BCMCPU_IS_6368()) | ||
53 | bcm63xx_regs_spi = bcm6368_regs_spi; | ||
54 | } | 42 | } |
55 | #else | 43 | #else |
56 | static __init void bcm63xx_spi_regs_init(void) { } | 44 | static __init void bcm63xx_spi_regs_init(void) { } |
@@ -104,10 +92,10 @@ int __init bcm63xx_spi_register(void) | |||
104 | spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI); | 92 | spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI); |
105 | 93 | ||
106 | if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) { | 94 | if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) { |
107 | spi_resources[0].end += BCM_6338_RSET_SPI_SIZE - 1; | 95 | spi_resources[0].end += BCM_6348_RSET_SPI_SIZE - 1; |
108 | spi_pdata.fifo_size = SPI_6338_MSG_DATA_SIZE; | 96 | spi_pdata.fifo_size = SPI_6348_MSG_DATA_SIZE; |
109 | spi_pdata.msg_type_shift = SPI_6338_MSG_TYPE_SHIFT; | 97 | spi_pdata.msg_type_shift = SPI_6348_MSG_TYPE_SHIFT; |
110 | spi_pdata.msg_ctl_width = SPI_6338_MSG_CTL_WIDTH; | 98 | spi_pdata.msg_ctl_width = SPI_6348_MSG_CTL_WIDTH; |
111 | } | 99 | } |
112 | 100 | ||
113 | if (BCMCPU_IS_6358() || BCMCPU_IS_6368()) { | 101 | if (BCMCPU_IS_6358() || BCMCPU_IS_6368()) { |