diff options
author | Hans-Christian Egtvedt <hcegtvedt@atmel.com> | 2007-07-16 10:13:33 -0400 |
---|---|---|
committer | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2007-10-23 05:19:14 -0400 |
commit | 1c2f173796e4d692b71d1305adb833a104713cd8 (patch) | |
tree | 6546cca331f6bc563e0cb304a947b15646eff998 /arch/avr32/boards | |
parent | 48021bd93ca339fcafe9b043d05f5d3a58be7c0a (diff) |
[AVR32] Wire up AT73C213 sound driver on ATSTK1000 board
Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32/boards')
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1002.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 6b9e466104ad..5be0d13f4b03 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | #include <linux/spi/spi.h> | 18 | #include <linux/spi/spi.h> |
19 | #include <linux/spi/at73c213.h> | ||
19 | 20 | ||
20 | #include <video/atmel_lcdc.h> | 21 | #include <video/atmel_lcdc.h> |
21 | 22 | ||
@@ -49,7 +50,26 @@ static struct eth_platform_data __initdata eth_data[2] = { | |||
49 | }; | 50 | }; |
50 | 51 | ||
51 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | 52 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM |
53 | #ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM | ||
54 | static struct at73c213_board_info at73c213_data = { | ||
55 | .ssc_id = 0, | ||
56 | .shortname = "AVR32 STK1000 external DAC", | ||
57 | }; | ||
58 | #endif | ||
59 | #endif | ||
60 | |||
61 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | ||
52 | static struct spi_board_info spi0_board_info[] __initdata = { | 62 | static struct spi_board_info spi0_board_info[] __initdata = { |
63 | #ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM | ||
64 | { | ||
65 | /* AT73C213 */ | ||
66 | .modalias = "at73c213", | ||
67 | .max_speed_hz = 200000, | ||
68 | .chip_select = 0, | ||
69 | .mode = SPI_MODE_1, | ||
70 | .platform_data = &at73c213_data, | ||
71 | }, | ||
72 | #endif | ||
53 | { | 73 | { |
54 | /* QVGA display */ | 74 | /* QVGA display */ |
55 | .modalias = "ltv350qv", | 75 | .modalias = "ltv350qv", |
@@ -180,6 +200,38 @@ static void setup_j2_leds(void) | |||
180 | } | 200 | } |
181 | #endif | 201 | #endif |
182 | 202 | ||
203 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | ||
204 | #ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM | ||
205 | static void __init at73c213_set_clk(struct at73c213_board_info *info) | ||
206 | { | ||
207 | struct clk *gclk; | ||
208 | struct clk *pll; | ||
209 | |||
210 | gclk = clk_get(NULL, "gclk0"); | ||
211 | if (IS_ERR(gclk)) | ||
212 | goto err_gclk; | ||
213 | pll = clk_get(NULL, "pll0"); | ||
214 | if (IS_ERR(pll)) | ||
215 | goto err_pll; | ||
216 | |||
217 | if (clk_set_parent(gclk, pll)) { | ||
218 | pr_debug("STK1000: failed to set pll0 as parent for DAC clock\n"); | ||
219 | goto err_set_clk; | ||
220 | } | ||
221 | |||
222 | at32_select_periph(GPIO_PIN_PA(30), GPIO_PERIPH_A, 0); | ||
223 | info->dac_clk = gclk; | ||
224 | |||
225 | err_set_clk: | ||
226 | clk_put(pll); | ||
227 | err_pll: | ||
228 | clk_put(gclk); | ||
229 | err_gclk: | ||
230 | return; | ||
231 | } | ||
232 | #endif | ||
233 | #endif | ||
234 | |||
183 | void __init setup_board(void) | 235 | void __init setup_board(void) |
184 | { | 236 | { |
185 | #ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM | 237 | #ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM |
@@ -248,6 +300,12 @@ static int __init atstk1002_init(void) | |||
248 | 300 | ||
249 | setup_j2_leds(); | 301 | setup_j2_leds(); |
250 | 302 | ||
303 | #ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM | ||
304 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | ||
305 | at73c213_set_clk(&at73c213_data); | ||
306 | #endif | ||
307 | #endif | ||
308 | |||
251 | return 0; | 309 | return 0; |
252 | } | 310 | } |
253 | postcore_initcall(atstk1002_init); | 311 | postcore_initcall(atstk1002_init); |