diff options
Diffstat (limited to 'firmware/target/arm/ipod')
-rw-r--r-- | firmware/target/arm/ipod/button-clickwheel.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/firmware/target/arm/ipod/button-clickwheel.c b/firmware/target/arm/ipod/button-clickwheel.c index 3af50b5112..5f138aaf1b 100644 --- a/firmware/target/arm/ipod/button-clickwheel.c +++ b/firmware/target/arm/ipod/button-clickwheel.c | |||
@@ -271,6 +271,12 @@ static inline int ipod_4g_button_read(void) | |||
271 | semaphore_release(&button_init_wakeup); | 271 | semaphore_release(&button_init_wakeup); |
272 | } | 272 | } |
273 | #endif | 273 | #endif |
274 | #if CONFIG_CPU==S5L8702 | ||
275 | else if (status == 0xAAAAAAAA) | ||
276 | { | ||
277 | GPIOCMD = 0xe040f; /* DOUT = Output High */ | ||
278 | } | ||
279 | #endif | ||
274 | 280 | ||
275 | #ifdef CPU_PP | 281 | #ifdef CPU_PP |
276 | } | 282 | } |
@@ -362,9 +368,11 @@ static void s5l_clickwheel_init(void) | |||
362 | WHEEL04 |= 1; | 368 | WHEEL04 |= 1; |
363 | PDAT10 &= ~2; | 369 | PDAT10 &= ~2; |
364 | #elif CONFIG_CPU==S5L8702 | 370 | #elif CONFIG_CPU==S5L8702 |
365 | /* enable and init internal (s5l8702) wheel controller */ | 371 | PWRCON(1) &= ~(1 << 1); /* unmask clockgate */ |
366 | PWRCON(1) &= ~(1 << 1); | 372 | WHEEL00 = 0; /* stop s5l8702 controller */ |
367 | PCON(14) = (PCON(14) & ~0xffff0000) | 0x22220000; | 373 | PUNB(14) &= ~(1 << 2); /* disable pull-up for GPIO E2 */ |
374 | udelay(100); | ||
375 | PCON(14) = (PCON(14) & ~0x00ffff00) | 0x00222200; | ||
368 | WHEELINT = 7; | 376 | WHEELINT = 7; |
369 | WHEEL10 = 1; | 377 | WHEEL10 = 1; |
370 | WHEEL00 = 0x380000; | 378 | WHEEL00 = 0x380000; |
@@ -379,12 +387,15 @@ void button_init_device(void) | |||
379 | semaphore_init(&button_init_wakeup, 1, 0); | 387 | semaphore_init(&button_init_wakeup, 1, 0); |
380 | #if CONFIG_CPU==S5L8701 | 388 | #if CONFIG_CPU==S5L8701 |
381 | INTMSK |= (1<<26); | 389 | INTMSK |= (1<<26); |
382 | #elif CONFIG_CPU==S5L8702 | ||
383 | /* configure GPIO E2 as pull-up input */ | ||
384 | PUNB(14) |= (1 << 2); | ||
385 | #endif | 390 | #endif |
386 | s5l_clickwheel_init(); | 391 | s5l_clickwheel_init(); |
387 | semaphore_wait(&button_init_wakeup, HZ / 10); | 392 | semaphore_wait(&button_init_wakeup, HZ / 10); |
393 | #if CONFIG_CPU==S5L8702 | ||
394 | /* configure GPIO E2 as pull-up input */ | ||
395 | PUNB(14) |= (1 << 2); | ||
396 | udelay(100); | ||
397 | GPIOCMD = 0xe0200; | ||
398 | #endif | ||
388 | } | 399 | } |
389 | 400 | ||
390 | bool button_hold(void) | 401 | bool button_hold(void) |
@@ -439,13 +450,7 @@ int button_read_device(void) | |||
439 | WHEEL10 = 0; | 450 | WHEEL10 = 0; |
440 | PWRCONEXT |= 1; | 451 | PWRCONEXT |= 1; |
441 | #elif CONFIG_CPU==S5L8702 | 452 | #elif CONFIG_CPU==S5L8702 |
442 | /* disable external (CY8C21x34) wheel controller */ | 453 | GPIOCMD = 0xe040e; /* DOUT = Output Low */ |
443 | GPIOCMD = 0xe040e; | ||
444 | |||
445 | /* disable internal (s5l8702) wheel controller */ | ||
446 | WHEEL00 = 0; | ||
447 | WHEEL10 = 0; | ||
448 | PWRCON(1) |= (1 << 1); | ||
449 | #endif | 454 | #endif |
450 | } | 455 | } |
451 | else | 456 | else |
@@ -458,7 +463,7 @@ int button_read_device(void) | |||
458 | pmu_ldo_power_on(1); /* enable clickwheel power supply */ | 463 | pmu_ldo_power_on(1); /* enable clickwheel power supply */ |
459 | s5l_clickwheel_init(); | 464 | s5l_clickwheel_init(); |
460 | #elif CONFIG_CPU==S5L8702 | 465 | #elif CONFIG_CPU==S5L8702 |
461 | s5l_clickwheel_init(); | 466 | GPIOCMD = 0xe040f; /* DOUT = Output High */ |
462 | #endif | 467 | #endif |
463 | } | 468 | } |
464 | } | 469 | } |