summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/sansa-clipzip
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2011-10-29 17:08:05 +0000
committerBertrik Sikken <bertrik@sikken.nl>2011-10-29 17:08:05 +0000
commite90f961593e92fa5d98efa67b569e7efe5f4fbe0 (patch)
tree70f01d2ac811ba161c22903824590d2690850efd /firmware/target/arm/as3525/sansa-clipzip
parenta8cde851fbcefdd33d826cf4b1f0daa8c0b48dc2 (diff)
downloadrockbox-e90f961593e92fa5d98efa67b569e7efe5f4fbe0.tar.gz
rockbox-e90f961593e92fa5d98efa67b569e7efe5f4fbe0.zip
Sansa clip zip: update mkamsboot and fix various drivers to make it boot to the main firmware
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30853 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sansa-clipzip')
-rw-r--r--firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c18
-rw-r--r--firmware/target/arm/as3525/sansa-clipzip/button-clipzip.c10
-rw-r--r--firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c10
3 files changed, 20 insertions, 18 deletions
diff --git a/firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c b/firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c
index 758aa875cc..589f80436e 100644
--- a/firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c
+++ b/firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c
@@ -25,11 +25,14 @@
25#include "lcd.h" 25#include "lcd.h"
26#include "as3525v2.h" 26#include "as3525v2.h"
27#include "ascodec-target.h" 27#include "ascodec-target.h"
28#include "lcd-target.h"
28 29
29bool _backlight_init() 30bool _backlight_init()
30{ 31{
31 /* GPIO B1 controls backlight */ 32 /* GPIO B1 controls backlight */
32 GPIOB_DIR |= (1 << 1); 33 GPIOB_DIR |= (1 << 1);
34 ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x91);
35 GPIOB_PIN(1) = (1 << 1);
33 36
34 return true; 37 return true;
35} 38}
@@ -37,13 +40,6 @@ bool _backlight_init()
37void _backlight_on(void) 40void _backlight_on(void)
38{ 41{
39 GPIOB_PIN(1) = (1 << 1); 42 GPIOB_PIN(1) = (1 << 1);
40
41 ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x91);
42 sleep(1);
43 ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x91);
44 sleep(1);
45 ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x91);
46
47#ifdef HAVE_LCD_ENABLE 43#ifdef HAVE_LCD_ENABLE
48 lcd_enable(true); 44 lcd_enable(true);
49#endif 45#endif
@@ -54,9 +50,11 @@ void _backlight_off(void)
54#ifdef HAVE_LCD_ENABLE 50#ifdef HAVE_LCD_ENABLE
55 lcd_enable(false); 51 lcd_enable(false);
56#endif 52#endif
57
58 GPIOB_PIN(1) = 0; 53 GPIOB_PIN(1) = 0;
59 54}
60 ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x91); 55
56void _backlight_set_brightness(int brightness)
57{
58 oled_brightness(brightness);
61} 59}
62 60
diff --git a/firmware/target/arm/as3525/sansa-clipzip/button-clipzip.c b/firmware/target/arm/as3525/sansa-clipzip/button-clipzip.c
index 104c227378..e960b49b77 100644
--- a/firmware/target/arm/as3525/sansa-clipzip/button-clipzip.c
+++ b/firmware/target/arm/as3525/sansa-clipzip/button-clipzip.c
@@ -71,13 +71,13 @@ int button_read_device(void)
71 udelay(500); 71 udelay(500);
72 72
73 if (GPIOC_PIN(3)) { 73 if (GPIOC_PIN(3)) {
74 buttons |= BUTTON_LEFT; 74 buttons |= BUTTON_RIGHT;
75 } 75 }
76 if (GPIOC_PIN(4)) { 76 if (GPIOC_PIN(4)) {
77 buttons |= BUTTON_SELECT; 77 buttons |= BUTTON_SELECT;
78 } 78 }
79 if (GPIOC_PIN(5)) { 79 if (GPIOC_PIN(5)) {
80 buttons |= BUTTON_RIGHT; 80 buttons |= BUTTON_UP;
81 } 81 }
82 82
83 /* key matrix buttons, second row */ 83 /* key matrix buttons, second row */
@@ -86,13 +86,13 @@ int button_read_device(void)
86 udelay(500); 86 udelay(500);
87 87
88 if (GPIOC_PIN(3)) { 88 if (GPIOC_PIN(3)) {
89 buttons |= BUTTON_UP; 89 buttons |= BUTTON_HOME;
90 } 90 }
91 if (GPIOC_PIN(4)) { 91 if (GPIOC_PIN(4)) {
92 buttons |= BUTTON_HOME; 92 buttons |= BUTTON_DOWN;
93 } 93 }
94 if (GPIOC_PIN(5)) { 94 if (GPIOC_PIN(5)) {
95 buttons |= BUTTON_DOWN; 95 buttons |= BUTTON_LEFT;
96 } 96 }
97 97
98 /* deselect scan rows */ 98 /* deselect scan rows */
diff --git a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
index 899eb538ea..0ae049b6ff 100644
--- a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
+++ b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
@@ -51,12 +51,16 @@ static int lcd_hw_init(void)
51 SSP_IMSC &= ~0xF; /* disable interrupts */ 51 SSP_IMSC &= ~0xF; /* disable interrupts */
52 SSP_DMACR &= ~0x3; /* disable DMA */ 52 SSP_DMACR &= ~0x3; /* disable DMA */
53 53
54 /* GPIO A3 is ??? but needs to be set */
55 GPIOA_DIR |= (1 << 3);
56 GPIOA_PIN(3) = (1 << 3);
57
54 /* configure GPIO B2 (lcd D/C#) as output */ 58 /* configure GPIO B2 (lcd D/C#) as output */
55 GPIOB_DIR |= (1<<2); 59 GPIOB_DIR |= (1<<2);
56 60
57 /* configure GPIO B3 (lcd type detect) as input */ 61 /* configure GPIO B3 (lcd type detect) as input */
58 GPIOB_DIR &= ~(1<<3); 62 GPIOB_DIR &= ~(1<<3);
59 63
60 /* configure GPIO A5 (lcd reset#) as output and perform lcd reset */ 64 /* configure GPIO A5 (lcd reset#) as output and perform lcd reset */
61 GPIOA_DIR |= (1 << 5); 65 GPIOA_DIR |= (1 << 5);
62 GPIOA_PIN(5) = 0; 66 GPIOA_PIN(5) = 0;
@@ -154,7 +158,7 @@ static void lcd_write_nibbles(uint8_t val)
154/* initialises lcd type 1 */ 158/* initialises lcd type 1 */
155static void lcd_init_type1(void) 159static void lcd_init_type1(void)
156{ 160{
157 static const uint8_t curve[256] = { 161 static const uint8_t curve[128] = {
158 /* 5-bit curve */ 162 /* 5-bit curve */
159 0, 5, 10, 15, 20, 25, 30, 35, 39, 43, 47, 51, 55, 59, 63, 67, 163 0, 5, 10, 15, 20, 25, 30, 35, 39, 43, 47, 51, 55, 59, 63, 67,
160 71, 75, 79, 83, 87, 91, 95, 99, 103, 105, 109, 113, 117, 121, 123, 127, 164 71, 75, 79, 83, 87, 91, 95, 99, 103, 105, 109, 113, 117, 121, 123, 127,
@@ -242,7 +246,7 @@ static void lcd_init_type1(void)
242 lcd_write_dat(0x10); 246 lcd_write_dat(0x10);
243 247
244 lcd_write_cmd(0x3A); 248 lcd_write_cmd(0x3A);
245 for (i = 0; i < 256; i++) { 249 for (i = 0; i < 128; i++) {
246 lcd_write_nibbles(curve[i]); 250 lcd_write_nibbles(curve[i]);
247 } 251 }
248 252