mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
Sansa ClipZip set lcd SSP properly
Change-Id: Ice62dfa7f266ee4369793777a39e675bceae1831
This commit is contained in:
parent
ce29bec89b
commit
084aa9c1fd
1 changed files with 16 additions and 1 deletions
|
|
@ -35,12 +35,26 @@ static int lcd_type;
|
||||||
static bool lcd_enabled;
|
static bool lcd_enabled;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void ssp_set_prescaler(unsigned int prescaler)
|
||||||
|
{
|
||||||
|
int oldlevel = disable_interrupt_save(IRQ_FIQ_STATUS);
|
||||||
|
/* must be on to write regs */
|
||||||
|
bool ssp_enabled = bitset32(&CGU_PERI, CGU_SSP_CLOCK_ENABLE) &
|
||||||
|
CGU_SSP_CLOCK_ENABLE;
|
||||||
|
SSP_CPSR = prescaler;
|
||||||
|
|
||||||
|
if (!ssp_enabled) /* put it back how we found it */
|
||||||
|
bitclr32(&CGU_PERI, CGU_SSP_CLOCK_ENABLE);
|
||||||
|
|
||||||
|
restore_irq(oldlevel);
|
||||||
|
}
|
||||||
|
|
||||||
/* initialises the host lcd hardware, returns the lcd type */
|
/* initialises the host lcd hardware, returns the lcd type */
|
||||||
static int lcd_hw_init(void)
|
static int lcd_hw_init(void)
|
||||||
{
|
{
|
||||||
/* configure SSP */
|
/* configure SSP */
|
||||||
bitset32(&CGU_PERI, CGU_SSP_CLOCK_ENABLE);
|
bitset32(&CGU_PERI, CGU_SSP_CLOCK_ENABLE);
|
||||||
SSP_CPSR = 4; /* TODO: use AS3525_SSP_PRESCALER, OF uses 8 */
|
ssp_set_prescaler(AS3525_SSP_PRESCALER); /* OF = 0x8 */
|
||||||
SSP_CR0 = (0 << 8) | /* SCR, serial clock rate divider = 1 */
|
SSP_CR0 = (0 << 8) | /* SCR, serial clock rate divider = 1 */
|
||||||
(1 << 7) | /* SPH, phase = 1 */
|
(1 << 7) | /* SPH, phase = 1 */
|
||||||
(1 << 6) | /* SPO, polarity = 1 */
|
(1 << 6) | /* SPO, polarity = 1 */
|
||||||
|
|
@ -437,3 +451,4 @@ void lcd_update(void)
|
||||||
{
|
{
|
||||||
lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
|
lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue