diff options
Diffstat (limited to 'arch/avr32/boards/atstk1000/atstk1002.c')
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1002.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 2481d2389873..57f610ea30df 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
@@ -48,18 +48,16 @@ static struct eth_platform_data __initdata eth_data[2] = { | |||
48 | }, | 48 | }, |
49 | }; | 49 | }; |
50 | 50 | ||
51 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | 51 | #ifdef CONFIG_BOARD_ATSTK1000_EXTDAC |
52 | #ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM | ||
53 | static struct at73c213_board_info at73c213_data = { | 52 | static struct at73c213_board_info at73c213_data = { |
54 | .ssc_id = 0, | 53 | .ssc_id = 0, |
55 | .shortname = "AVR32 STK1000 external DAC", | 54 | .shortname = "AVR32 STK1000 external DAC", |
56 | }; | 55 | }; |
57 | #endif | 56 | #endif |
58 | #endif | ||
59 | 57 | ||
60 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | 58 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM |
61 | static struct spi_board_info spi0_board_info[] __initdata = { | 59 | static struct spi_board_info spi0_board_info[] __initdata = { |
62 | #ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM | 60 | #ifdef CONFIG_BOARD_ATSTK1000_EXTDAC |
63 | { | 61 | { |
64 | /* AT73C213 */ | 62 | /* AT73C213 */ |
65 | .modalias = "at73c213", | 63 | .modalias = "at73c213", |
@@ -140,9 +138,8 @@ static void __init set_hw_addr(struct platform_device *pdev) | |||
140 | clk_put(pclk); | 138 | clk_put(pclk); |
141 | } | 139 | } |
142 | 140 | ||
143 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | 141 | #ifdef CONFIG_BOARD_ATSTK1000_EXTDAC |
144 | #ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM | 142 | static void __init atstk1002_setup_extdac(void) |
145 | static void __init at73c213_set_clk(struct at73c213_board_info *info) | ||
146 | { | 143 | { |
147 | struct clk *gclk; | 144 | struct clk *gclk; |
148 | struct clk *pll; | 145 | struct clk *pll; |
@@ -160,7 +157,7 @@ static void __init at73c213_set_clk(struct at73c213_board_info *info) | |||
160 | } | 157 | } |
161 | 158 | ||
162 | at32_select_periph(GPIO_PIN_PA(30), GPIO_PERIPH_A, 0); | 159 | at32_select_periph(GPIO_PIN_PA(30), GPIO_PERIPH_A, 0); |
163 | info->dac_clk = gclk; | 160 | at73c213_data.dac_clk = gclk; |
164 | 161 | ||
165 | err_set_clk: | 162 | err_set_clk: |
166 | clk_put(pll); | 163 | clk_put(pll); |
@@ -169,8 +166,12 @@ err_pll: | |||
169 | err_gclk: | 166 | err_gclk: |
170 | return; | 167 | return; |
171 | } | 168 | } |
172 | #endif | 169 | #else |
173 | #endif | 170 | static void __init atstk1002_setup_extdac(void) |
171 | { | ||
172 | |||
173 | } | ||
174 | #endif /* CONFIG_BOARD_ATSTK1000_EXTDAC */ | ||
174 | 175 | ||
175 | void __init setup_board(void) | 176 | void __init setup_board(void) |
176 | { | 177 | { |
@@ -239,12 +240,7 @@ static int __init atstk1002_init(void) | |||
239 | #endif | 240 | #endif |
240 | 241 | ||
241 | atstk1000_setup_j2_leds(); | 242 | atstk1000_setup_j2_leds(); |
242 | 243 | atstk1002_setup_extdac(); | |
243 | #ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM | ||
244 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | ||
245 | at73c213_set_clk(&at73c213_data); | ||
246 | #endif | ||
247 | #endif | ||
248 | 244 | ||
249 | return 0; | 245 | return 0; |
250 | } | 246 | } |