From 55a4520f076ffa5190aac1f24f584e759ffc62cf Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Thu, 22 Jul 2010 15:31:24 +0000 Subject: Sansa clip+: fix display brightness for players with newer OLED controller type (and reorganise the variant detection a bit in the process) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27522 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/sansa-clip/lcd-clip.c | 15 ++++++++---- firmware/target/arm/as3525/sansa-clip/lcd-clip.h | 29 ------------------------ 2 files changed, 11 insertions(+), 33 deletions(-) delete mode 100644 firmware/target/arm/as3525/sansa-clip/lcd-clip.h (limited to 'firmware/target/arm/as3525/sansa-clip') diff --git a/firmware/target/arm/as3525/sansa-clip/lcd-clip.c b/firmware/target/arm/as3525/sansa-clip/lcd-clip.c index 775988cc0e..21d8902739 100644 --- a/firmware/target/arm/as3525/sansa-clip/lcd-clip.c +++ b/firmware/target/arm/as3525/sansa-clip/lcd-clip.c @@ -25,8 +25,11 @@ #include "lcd-clip.h" #include "system.h" #include "cpu.h" +#include "ascodec.h" -void lcd_hw_init(int *offset) +#define LCD_DELAY 1 + +int lcd_hw_init(void) { /* DBOP initialisation, do what OF does */ CGU_DBOP = (1<<3) | AS3525_DBOP_DIV; @@ -46,11 +49,9 @@ void lcd_hw_init(int *offset) GPIOA_PIN(4) = 0; GPIOB_PIN(6) = (1<<6); - *offset = 2; + return 0; } -#define LCD_DELAY 1 - void lcd_write_command(int byte) { volatile int i = 0; @@ -90,3 +91,9 @@ void lcd_write_data(const fb_data* p_bytes, int count) /* While push fifo is not empty */ while ((DBOP_STAT & (1<<10)) == 0); } + +void lcd_enable_power(bool onoff) +{ + ascodec_write(AS3514_DCDC15, onoff ? 1 : 0); +} + diff --git a/firmware/target/arm/as3525/sansa-clip/lcd-clip.h b/firmware/target/arm/as3525/sansa-clip/lcd-clip.h deleted file mode 100644 index 3d4fe60311..0000000000 --- a/firmware/target/arm/as3525/sansa-clip/lcd-clip.h +++ /dev/null @@ -1,29 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008-2009 Rafaël Carré - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ - -#include "config.h" -#include "ascodec.h" - -void lcd_hw_init(int *offset) INIT_ATTR; -static inline void lcd_enable_power(bool onoff) -{ - ascodec_write(AS3514_DCDC15, onoff ? 1 : 0); -} -- cgit v1.2.3