diff options
Diffstat (limited to 'firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c')
-rw-r--r-- | firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c index 8a3df517fb..e17bfc421b 100644 --- a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c +++ b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c | |||
@@ -35,26 +35,12 @@ static int lcd_type; | |||
35 | static bool lcd_enabled; | 35 | static bool lcd_enabled; |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | static void ssp_set_prescaler(unsigned int prescaler) | ||
39 | { | ||
40 | int oldlevel = disable_interrupt_save(IRQ_FIQ_STATUS); | ||
41 | /* must be on to write regs */ | ||
42 | bool ssp_enabled = bitset32(&CGU_PERI, CGU_SSP_CLOCK_ENABLE) & | ||
43 | CGU_SSP_CLOCK_ENABLE; | ||
44 | SSP_CPSR = prescaler; | ||
45 | |||
46 | if (!ssp_enabled) /* put it back how we found it */ | ||
47 | bitclr32(&CGU_PERI, CGU_SSP_CLOCK_ENABLE); | ||
48 | |||
49 | restore_irq(oldlevel); | ||
50 | } | ||
51 | |||
52 | /* initialises the host lcd hardware, returns the lcd type */ | 38 | /* initialises the host lcd hardware, returns the lcd type */ |
53 | static int lcd_hw_init(void) | 39 | static int lcd_hw_init(void) |
54 | { | 40 | { |
55 | /* configure SSP */ | 41 | /* configure SSP */ |
56 | bitset32(&CGU_PERI, CGU_SSP_CLOCK_ENABLE); | 42 | bitset32(&CGU_PERI, CGU_SSP_CLOCK_ENABLE); |
57 | ssp_set_prescaler(AS3525_SSP_PRESCALER); /* OF = 0x8 */ | 43 | SSP_CPSR = 4; /* TODO: use AS3525_SSP_PRESCALER, OF uses 8 */ |
58 | SSP_CR0 = (0 << 8) | /* SCR, serial clock rate divider = 1 */ | 44 | SSP_CR0 = (0 << 8) | /* SCR, serial clock rate divider = 1 */ |
59 | (1 << 7) | /* SPH, phase = 1 */ | 45 | (1 << 7) | /* SPH, phase = 1 */ |
60 | (1 << 6) | /* SPO, polarity = 1 */ | 46 | (1 << 6) | /* SPO, polarity = 1 */ |
@@ -451,11 +437,3 @@ void lcd_update(void) | |||
451 | { | 437 | { |
452 | lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT); | 438 | lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT); |
453 | } | 439 | } |
454 | |||
455 | #if defined(CONFIG_POWER_SAVING) && (CONFIG_POWER_SAVING & POWERSV_DISP) | ||
456 | /* declared in system-as3525.c */ | ||
457 | void ams_ssp_set_low_speed(bool slow) | ||
458 | { | ||
459 | ssp_set_prescaler(slow ? AS3525_SSP_PRESCALER_MAX : AS3525_SSP_PRESCALER); | ||
460 | } | ||
461 | #endif | ||