diff options
Diffstat (limited to 'firmware/target/arm/as3525/system-as3525.c')
-rw-r--r-- | firmware/target/arm/as3525/system-as3525.c | 70 |
1 files changed, 1 insertions, 69 deletions
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c index 2cd9145567..83ccb55f79 100644 --- a/firmware/target/arm/as3525/system-as3525.c +++ b/firmware/target/arm/as3525/system-as3525.c | |||
@@ -52,29 +52,6 @@ struct mutex cpufreq_mtx; | |||
52 | #define default_interrupt(name) \ | 52 | #define default_interrupt(name) \ |
53 | extern __attribute__((weak,alias("UIRQ"))) void name (void) | 53 | extern __attribute__((weak,alias("UIRQ"))) void name (void) |
54 | 54 | ||
55 | #ifdef CONFIG_POWER_SAVING | ||
56 | /* Powersave functions either manipulate the system directly | ||
57 | or pass enabled flag on to these specific functions | ||
58 | dis/enabling powersaving for the selected subsystem | ||
59 | */ | ||
60 | #if (CONFIG_POWER_SAVING & POWERSV_CPU) | ||
61 | /*cpu_set_powersave*/ | ||
62 | #include "settings.h" | ||
63 | #endif | ||
64 | #if (CONFIG_POWER_SAVING & POWERSV_DISP) | ||
65 | /*disp_set_powersave*/ | ||
66 | void ams_ssp_set_low_speed(bool slow); /*lcd-clip-plus.c & lcd-clipzip.c*/ | ||
67 | #endif | ||
68 | #if (CONFIG_POWER_SAVING & POWERSV_DISK) | ||
69 | /*disk_set_powersave*/ | ||
70 | void ams_sd_set_low_speed(bool slow); /* sd-as3525.c & sd-as3525v2.c */ | ||
71 | #endif | ||
72 | #if (CONFIG_POWER_SAVING & POWERSV_I2C) | ||
73 | /*i2c_set_powersave*/ | ||
74 | void ams_i2c_set_low_speed(bool slow); /* ascodec-as3525.c*/ | ||
75 | #endif | ||
76 | #endif /*CONFIG_POWER_SAVING*/ | ||
77 | |||
78 | #if CONFIG_USBOTG != USBOTG_DESIGNWARE | 55 | #if CONFIG_USBOTG != USBOTG_DESIGNWARE |
79 | static void UIRQ (void) __attribute__((interrupt ("IRQ"))); | 56 | static void UIRQ (void) __attribute__((interrupt ("IRQ"))); |
80 | #endif | 57 | #endif |
@@ -445,39 +422,6 @@ void udelay(unsigned usecs) | |||
445 | ); | 422 | ); |
446 | } | 423 | } |
447 | 424 | ||
448 | #ifdef CONFIG_POWER_SAVING | ||
449 | #if (CONFIG_POWER_SAVING & POWERSV_CPU) | ||
450 | void cpu_set_powersave(bool enabled) | ||
451 | { | ||
452 | /*global_settings.cpu_powersave*/ | ||
453 | /*handled in: set_cpu_frequency()*/ | ||
454 | (void) enabled; | ||
455 | } | ||
456 | #endif | ||
457 | #if (CONFIG_POWER_SAVING & POWERSV_DISK) | ||
458 | void disk_set_powersave(bool enabled) | ||
459 | { | ||
460 | /*global_settings.disk_powersave*/ | ||
461 | ams_sd_set_low_speed(enabled); | ||
462 | } | ||
463 | #endif | ||
464 | #if (CONFIG_POWER_SAVING & POWERSV_DISP) | ||
465 | void disp_set_powersave(bool enabled) | ||
466 | { | ||
467 | /*global_settings.disp_powersave*/ | ||
468 | ams_ssp_set_low_speed(enabled); | ||
469 | } | ||
470 | #endif | ||
471 | #if (CONFIG_POWER_SAVING & POWERSV_I2C) | ||
472 | void i2c_set_powersave(bool enabled) | ||
473 | { | ||
474 | /*global_settings.i2c_powersave*/ | ||
475 | ams_i2c_set_low_speed(enabled); | ||
476 | } | ||
477 | #endif | ||
478 | #endif /*defined(CONFIG_POWER_SAVING)*/ | ||
479 | |||
480 | |||
481 | #ifndef BOOTLOADER | 425 | #ifndef BOOTLOADER |
482 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 426 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
483 | bool set_cpu_frequency__lock(void) | 427 | bool set_cpu_frequency__lock(void) |
@@ -537,12 +481,7 @@ void set_cpu_frequency(long frequency) | |||
537 | CGU_PROC = ((0xf << 4) | (0x3 << 2) | AS3525_CLK_MAIN); | 481 | CGU_PROC = ((0xf << 4) | (0x3 << 2) | AS3525_CLK_MAIN); |
538 | 482 | ||
539 | #ifdef HAVE_ADJUSTABLE_CPU_VOLTAGE | 483 | #ifdef HAVE_ADJUSTABLE_CPU_VOLTAGE |
540 | /* Decreasing frequency so reduce voltage after change */ | 484 | /* Decreasing frequency so reduce voltage after change */ |
541 | #if defined(CONFIG_POWER_SAVING) && (CONFIG_POWER_SAVING & POWERSV_CPU) | ||
542 | if (!global_settings.cpu_powersave) | ||
543 | ascodec_write(AS3514_CVDD_DCDC3, (AS314_CP_DCDC3_SETTING | CVDD_1_15)); | ||
544 | else | ||
545 | #endif | ||
546 | ascodec_write(AS3514_CVDD_DCDC3, (AS314_CP_DCDC3_SETTING | CVDD_1_10)); | 485 | ascodec_write(AS3514_CVDD_DCDC3, (AS314_CP_DCDC3_SETTING | CVDD_1_10)); |
547 | #endif /* HAVE_ADJUSTABLE_CPU_VOLTAGE */ | 486 | #endif /* HAVE_ADJUSTABLE_CPU_VOLTAGE */ |
548 | 487 | ||
@@ -580,13 +519,6 @@ void set_cpu_frequency(long frequency) | |||
580 | 519 | ||
581 | /* Set CVDD1 power supply */ | 520 | /* Set CVDD1 power supply */ |
582 | #ifdef HAVE_ADJUSTABLE_CPU_VOLTAGE | 521 | #ifdef HAVE_ADJUSTABLE_CPU_VOLTAGE |
583 | #if defined(CONFIG_POWER_SAVING) && (CONFIG_POWER_SAVING & POWERSV_CPU) | ||
584 | if (!global_settings.cpu_powersave) | ||
585 | { | ||
586 | ascodec_write_pmu(0x17, 1, 0x80 | 26); | ||
587 | return; | ||
588 | } | ||
589 | #endif | ||
590 | #if defined(SANSA_CLIPZIP) | 522 | #if defined(SANSA_CLIPZIP) |
591 | ascodec_write_pmu(0x17, 1, 0x80 | 20); | 523 | ascodec_write_pmu(0x17, 1, 0x80 | 20); |
592 | #elif defined(SANSA_CLIPPLUS) | 524 | #elif defined(SANSA_CLIPPLUS) |