diff options
Diffstat (limited to 'arch/avr32/mach-at32ap/at32ap700x.c')
-rw-r--r-- | arch/avr32/mach-at32ap/at32ap700x.c | 105 |
1 files changed, 73 insertions, 32 deletions
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c index 34b56de4ea60..08115f9243fb 100644 --- a/arch/avr32/mach-at32ap/at32ap700x.c +++ b/arch/avr32/mach-at32ap/at32ap700x.c | |||
@@ -1257,7 +1257,8 @@ static struct clk atmel_lcdfb0_pixclk = { | |||
1257 | 1257 | ||
1258 | struct platform_device *__init | 1258 | struct platform_device *__init |
1259 | at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, | 1259 | at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, |
1260 | unsigned long fbmem_start, unsigned long fbmem_len) | 1260 | unsigned long fbmem_start, unsigned long fbmem_len, |
1261 | unsigned int pin_config) | ||
1261 | { | 1262 | { |
1262 | struct platform_device *pdev; | 1263 | struct platform_device *pdev; |
1263 | struct atmel_lcdfb_info *info; | 1264 | struct atmel_lcdfb_info *info; |
@@ -1284,37 +1285,77 @@ at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, | |||
1284 | switch (id) { | 1285 | switch (id) { |
1285 | case 0: | 1286 | case 0: |
1286 | pdev = &atmel_lcdfb0_device; | 1287 | pdev = &atmel_lcdfb0_device; |
1287 | select_peripheral(PC(19), PERIPH_A, 0); /* CC */ | 1288 | |
1288 | select_peripheral(PC(20), PERIPH_A, 0); /* HSYNC */ | 1289 | switch (pin_config) { |
1289 | select_peripheral(PC(21), PERIPH_A, 0); /* PCLK */ | 1290 | case 0: |
1290 | select_peripheral(PC(22), PERIPH_A, 0); /* VSYNC */ | 1291 | select_peripheral(PC(19), PERIPH_A, 0); /* CC */ |
1291 | select_peripheral(PC(23), PERIPH_A, 0); /* DVAL */ | 1292 | select_peripheral(PC(20), PERIPH_A, 0); /* HSYNC */ |
1292 | select_peripheral(PC(24), PERIPH_A, 0); /* MODE */ | 1293 | select_peripheral(PC(21), PERIPH_A, 0); /* PCLK */ |
1293 | select_peripheral(PC(25), PERIPH_A, 0); /* PWR */ | 1294 | select_peripheral(PC(22), PERIPH_A, 0); /* VSYNC */ |
1294 | select_peripheral(PC(26), PERIPH_A, 0); /* DATA0 */ | 1295 | select_peripheral(PC(23), PERIPH_A, 0); /* DVAL */ |
1295 | select_peripheral(PC(27), PERIPH_A, 0); /* DATA1 */ | 1296 | select_peripheral(PC(24), PERIPH_A, 0); /* MODE */ |
1296 | select_peripheral(PC(28), PERIPH_A, 0); /* DATA2 */ | 1297 | select_peripheral(PC(25), PERIPH_A, 0); /* PWR */ |
1297 | select_peripheral(PC(29), PERIPH_A, 0); /* DATA3 */ | 1298 | select_peripheral(PC(26), PERIPH_A, 0); /* DATA0 */ |
1298 | select_peripheral(PC(30), PERIPH_A, 0); /* DATA4 */ | 1299 | select_peripheral(PC(27), PERIPH_A, 0); /* DATA1 */ |
1299 | select_peripheral(PC(31), PERIPH_A, 0); /* DATA5 */ | 1300 | select_peripheral(PC(28), PERIPH_A, 0); /* DATA2 */ |
1300 | select_peripheral(PD(0), PERIPH_A, 0); /* DATA6 */ | 1301 | select_peripheral(PC(29), PERIPH_A, 0); /* DATA3 */ |
1301 | select_peripheral(PD(1), PERIPH_A, 0); /* DATA7 */ | 1302 | select_peripheral(PC(30), PERIPH_A, 0); /* DATA4 */ |
1302 | select_peripheral(PD(2), PERIPH_A, 0); /* DATA8 */ | 1303 | select_peripheral(PC(31), PERIPH_A, 0); /* DATA5 */ |
1303 | select_peripheral(PD(3), PERIPH_A, 0); /* DATA9 */ | 1304 | select_peripheral(PD(0), PERIPH_A, 0); /* DATA6 */ |
1304 | select_peripheral(PD(4), PERIPH_A, 0); /* DATA10 */ | 1305 | select_peripheral(PD(1), PERIPH_A, 0); /* DATA7 */ |
1305 | select_peripheral(PD(5), PERIPH_A, 0); /* DATA11 */ | 1306 | select_peripheral(PD(2), PERIPH_A, 0); /* DATA8 */ |
1306 | select_peripheral(PD(6), PERIPH_A, 0); /* DATA12 */ | 1307 | select_peripheral(PD(3), PERIPH_A, 0); /* DATA9 */ |
1307 | select_peripheral(PD(7), PERIPH_A, 0); /* DATA13 */ | 1308 | select_peripheral(PD(4), PERIPH_A, 0); /* DATA10 */ |
1308 | select_peripheral(PD(8), PERIPH_A, 0); /* DATA14 */ | 1309 | select_peripheral(PD(5), PERIPH_A, 0); /* DATA11 */ |
1309 | select_peripheral(PD(9), PERIPH_A, 0); /* DATA15 */ | 1310 | select_peripheral(PD(6), PERIPH_A, 0); /* DATA12 */ |
1310 | select_peripheral(PD(10), PERIPH_A, 0); /* DATA16 */ | 1311 | select_peripheral(PD(7), PERIPH_A, 0); /* DATA13 */ |
1311 | select_peripheral(PD(11), PERIPH_A, 0); /* DATA17 */ | 1312 | select_peripheral(PD(8), PERIPH_A, 0); /* DATA14 */ |
1312 | select_peripheral(PD(12), PERIPH_A, 0); /* DATA18 */ | 1313 | select_peripheral(PD(9), PERIPH_A, 0); /* DATA15 */ |
1313 | select_peripheral(PD(13), PERIPH_A, 0); /* DATA19 */ | 1314 | select_peripheral(PD(10), PERIPH_A, 0); /* DATA16 */ |
1314 | select_peripheral(PD(14), PERIPH_A, 0); /* DATA20 */ | 1315 | select_peripheral(PD(11), PERIPH_A, 0); /* DATA17 */ |
1315 | select_peripheral(PD(15), PERIPH_A, 0); /* DATA21 */ | 1316 | select_peripheral(PD(12), PERIPH_A, 0); /* DATA18 */ |
1316 | select_peripheral(PD(16), PERIPH_A, 0); /* DATA22 */ | 1317 | select_peripheral(PD(13), PERIPH_A, 0); /* DATA19 */ |
1317 | select_peripheral(PD(17), PERIPH_A, 0); /* DATA23 */ | 1318 | select_peripheral(PD(14), PERIPH_A, 0); /* DATA20 */ |
1319 | select_peripheral(PD(15), PERIPH_A, 0); /* DATA21 */ | ||
1320 | select_peripheral(PD(16), PERIPH_A, 0); /* DATA22 */ | ||
1321 | select_peripheral(PD(17), PERIPH_A, 0); /* DATA23 */ | ||
1322 | break; | ||
1323 | case 1: | ||
1324 | select_peripheral(PE(0), PERIPH_B, 0); /* CC */ | ||
1325 | select_peripheral(PC(20), PERIPH_A, 0); /* HSYNC */ | ||
1326 | select_peripheral(PC(21), PERIPH_A, 0); /* PCLK */ | ||
1327 | select_peripheral(PC(22), PERIPH_A, 0); /* VSYNC */ | ||
1328 | select_peripheral(PE(1), PERIPH_B, 0); /* DVAL */ | ||
1329 | select_peripheral(PE(2), PERIPH_B, 0); /* MODE */ | ||
1330 | select_peripheral(PC(25), PERIPH_A, 0); /* PWR */ | ||
1331 | select_peripheral(PE(3), PERIPH_B, 0); /* DATA0 */ | ||
1332 | select_peripheral(PE(4), PERIPH_B, 0); /* DATA1 */ | ||
1333 | select_peripheral(PE(5), PERIPH_B, 0); /* DATA2 */ | ||
1334 | select_peripheral(PE(6), PERIPH_B, 0); /* DATA3 */ | ||
1335 | select_peripheral(PE(7), PERIPH_B, 0); /* DATA4 */ | ||
1336 | select_peripheral(PC(31), PERIPH_A, 0); /* DATA5 */ | ||
1337 | select_peripheral(PD(0), PERIPH_A, 0); /* DATA6 */ | ||
1338 | select_peripheral(PD(1), PERIPH_A, 0); /* DATA7 */ | ||
1339 | select_peripheral(PE(8), PERIPH_B, 0); /* DATA8 */ | ||
1340 | select_peripheral(PE(9), PERIPH_B, 0); /* DATA9 */ | ||
1341 | select_peripheral(PE(10), PERIPH_B, 0); /* DATA10 */ | ||
1342 | select_peripheral(PE(11), PERIPH_B, 0); /* DATA11 */ | ||
1343 | select_peripheral(PE(12), PERIPH_B, 0); /* DATA12 */ | ||
1344 | select_peripheral(PD(7), PERIPH_A, 0); /* DATA13 */ | ||
1345 | select_peripheral(PD(8), PERIPH_A, 0); /* DATA14 */ | ||
1346 | select_peripheral(PD(9), PERIPH_A, 0); /* DATA15 */ | ||
1347 | select_peripheral(PE(13), PERIPH_B, 0); /* DATA16 */ | ||
1348 | select_peripheral(PE(14), PERIPH_B, 0); /* DATA17 */ | ||
1349 | select_peripheral(PE(15), PERIPH_B, 0); /* DATA18 */ | ||
1350 | select_peripheral(PE(16), PERIPH_B, 0); /* DATA19 */ | ||
1351 | select_peripheral(PE(17), PERIPH_B, 0); /* DATA20 */ | ||
1352 | select_peripheral(PE(18), PERIPH_B, 0); /* DATA21 */ | ||
1353 | select_peripheral(PD(16), PERIPH_A, 0); /* DATA22 */ | ||
1354 | select_peripheral(PD(17), PERIPH_A, 0); /* DATA23 */ | ||
1355 | break; | ||
1356 | default: | ||
1357 | goto err_invalid_id; | ||
1358 | } | ||
1318 | 1359 | ||
1319 | clk_set_parent(&atmel_lcdfb0_pixclk, &pll0); | 1360 | clk_set_parent(&atmel_lcdfb0_pixclk, &pll0); |
1320 | clk_set_rate(&atmel_lcdfb0_pixclk, clk_get_rate(&pll0)); | 1361 | clk_set_rate(&atmel_lcdfb0_pixclk, clk_get_rate(&pll0)); |