summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2010-07-22 13:47:09 +0000
committerBertrik Sikken <bertrik@sikken.nl>2010-07-22 13:47:09 +0000
commit4d6c8167214082b8f7d0c5415668680e15a20801 (patch)
treed1d19b75e8db83e407f8a7c880335a08f5063e57
parent1ebdb8988f1e029828fdfd9523fc5fb6022613ea (diff)
downloadrockbox-4d6c8167214082b8f7d0c5415668680e15a20801.tar.gz
rockbox-4d6c8167214082b8f7d0c5415668680e15a20801.zip
Sansa Clip+: detect AMSv2 variant (just like was already done for fuze v2), this makes SD transfers work for newer clip+ players ("COMBO4E" type). Variable fuzev2_variant has been renamed to amsv2_variant.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27520 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/debug-as3525.c6
-rw-r--r--firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c6
-rw-r--r--firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c2
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c26
-rw-r--r--firmware/target/arm/as3525/system-as3525.c6
-rw-r--r--firmware/target/arm/as3525/system-target.h4
6 files changed, 25 insertions, 25 deletions
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c
index 6e52d1d653..391dabe3b0 100644
--- a/firmware/target/arm/as3525/debug-as3525.c
+++ b/firmware/target/arm/as3525/debug-as3525.c
@@ -268,14 +268,14 @@ bool __dbg_hw_info(void)
268 { 268 {
269 while(1) 269 while(1)
270 { 270 {
271#if defined(SANSA_C200V2) || defined(SANSA_FUZEV2) 271#if defined(SANSA_C200V2) || defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
272 lcd_clear_display(); 272 lcd_clear_display();
273 line = 0; 273 line = 0;
274 lcd_puts(0, line++, "[Submodel:]"); 274 lcd_puts(0, line++, "[Submodel:]");
275#if defined(SANSA_C200V2) 275#if defined(SANSA_C200V2)
276 lcd_putsf(0, line++, "C200v2 variant %d", c200v2_variant); 276 lcd_putsf(0, line++, "C200v2 variant %d", c200v2_variant);
277#elif defined(SANSA_FUZEV2) 277#elif defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
278 lcd_putsf(0, line++, "Fuzev2 variant %d", fuzev2_variant); 278 lcd_putsf(0, line++, "AMSv2 variant %d", amsv2_variant);
279#endif 279#endif
280 lcd_update(); 280 lcd_update();
281 int btn = button_get_w_tmo(HZ/10); 281 int btn = button_get_w_tmo(HZ/10);
diff --git a/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c
index eebe9b945f..617f7095f4 100644
--- a/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c
+++ b/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c
@@ -39,7 +39,7 @@ bool _backlight_init(void)
39 ascodec_write_pmu(AS3543_BACKLIGHT, 2, backlight_brightness * 10); 39 ascodec_write_pmu(AS3543_BACKLIGHT, 2, backlight_brightness * 10);
40 40
41 /* needed for button light */ 41 /* needed for button light */
42 if (fuzev2_variant == 1) 42 if (amsv2_variant == 1)
43 ascodec_write_pmu(0x1a, 1, 0x30); /* MUX_PWGD = PWM */ 43 ascodec_write_pmu(0x1a, 1, 0x30); /* MUX_PWGD = PWM */
44 44
45 return true; 45 return true;
@@ -63,7 +63,7 @@ void _backlight_off(void)
63 63
64void _buttonlight_on(void) 64void _buttonlight_on(void)
65{ 65{
66 if (fuzev2_variant == 0) 66 if (amsv2_variant == 0)
67 { 67 {
68 GPIOB_DIR |= 1<<5; 68 GPIOB_DIR |= 1<<5;
69 GPIOB_PIN(5) = (1<<5); 69 GPIOB_PIN(5) = (1<<5);
@@ -77,7 +77,7 @@ void _buttonlight_on(void)
77 77
78void _buttonlight_off(void) 78void _buttonlight_off(void)
79{ 79{
80 if (fuzev2_variant == 0) 80 if (amsv2_variant == 0)
81 { 81 {
82 GPIOB_PIN(5) = 0; 82 GPIOB_PIN(5) = 0;
83 GPIOB_DIR &= ~(1<<5); 83 GPIOB_DIR &= ~(1<<5);
diff --git a/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c
index 5ec2025667..7920bff80e 100644
--- a/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c
+++ b/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c
@@ -257,7 +257,7 @@ int button_read_device(void)
257 btn |= BUTTON_RIGHT; 257 btn |= BUTTON_RIGHT;
258 if (GPIOB_PIN(1) & 1<<1) 258 if (GPIOB_PIN(1) & 1<<1)
259 btn |= BUTTON_HOME; 259 btn |= BUTTON_HOME;
260 if (fuzev2_variant == 1) 260 if (amsv2_variant == 1)
261 btn ^= BUTTON_HOME; 261 btn ^= BUTTON_HOME;
262 262
263 if (gpiod6 & 1<<6) 263 if (gpiod6 & 1<<6)
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index 836981f321..3f78a61bbd 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -45,7 +45,7 @@
45#include "disk.h" 45#include "disk.h"
46#endif 46#endif
47 47
48#ifdef SANSA_FUZEV2 48#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
49#include "backlight-target.h" 49#include "backlight-target.h"
50#endif 50#endif
51 51
@@ -403,8 +403,8 @@ static bool send_cmd(const int drive, const int cmd, const int arg, const int fl
403 403
404 MCI_ARGUMENT = arg; 404 MCI_ARGUMENT = arg;
405 405
406#ifdef SANSA_FUZEV2 406#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
407 if (fuzev2_variant == 1) 407 if (amsv2_variant == 1)
408 card_no = 1 << 16; 408 card_no = 1 << 16;
409 else 409 else
410#endif 410#endif
@@ -429,8 +429,8 @@ static bool send_cmd(const int drive, const int cmd, const int arg, const int fl
429 /*b23 | CMD_CCS_EXPECTED unused */ 429 /*b23 | CMD_CCS_EXPECTED unused */
430 /*b31 */ | CMD_DONE_BIT; 430 /*b31 */ | CMD_DONE_BIT;
431 431
432#ifdef SANSA_FUZEV2 432#if defined(SANSA_FUZEV2)
433 if (fuzev2_variant == 0) 433 if (amsv2_variant == 0)
434 { 434 {
435 extern int buttonlight_is_on; 435 extern int buttonlight_is_on;
436 if(buttonlight_is_on) 436 if(buttonlight_is_on)
@@ -594,8 +594,8 @@ static int sd_init_card(const int drive)
594 return -17; 594 return -17;
595 595
596 /* Now that card is widebus make controller aware */ 596 /* Now that card is widebus make controller aware */
597#ifdef SANSA_FUZEV2 597#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
598 if (fuzev2_variant == 1) 598 if (amsv2_variant == 1)
599 MCI_CTYPE |= 1<<1; 599 MCI_CTYPE |= 1<<1;
600 else 600 else
601#endif 601#endif
@@ -604,8 +604,8 @@ static int sd_init_card(const int drive)
604#endif /* ! BOOTLOADER */ 604#endif /* ! BOOTLOADER */
605 605
606 /* Set low power mode */ 606 /* Set low power mode */
607#ifdef SANSA_FUZEV2 607#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
608 if (fuzev2_variant == 1) 608 if (amsv2_variant == 1)
609 MCI_CLKENA |= 1<<16; 609 MCI_CLKENA |= 1<<16;
610 else 610 else
611#endif 611#endif
@@ -709,8 +709,8 @@ static void init_controller(void)
709 int card_mask = (1 << hcon_numcards) - 1; 709 int card_mask = (1 << hcon_numcards) - 1;
710 int pwr_mask; 710 int pwr_mask;
711 711
712#ifdef SANSA_FUZEV2 712#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
713 if (fuzev2_variant == 1) 713 if (amsv2_variant == 1)
714 pwr_mask = 1 << 1; 714 pwr_mask = 1 << 1;
715 else 715 else
716#endif 716#endif
@@ -774,8 +774,8 @@ int sd_init(void)
774 wakeup_init(&transfer_completion_signal); 774 wakeup_init(&transfer_completion_signal);
775 wakeup_init(&command_completion_signal); 775 wakeup_init(&command_completion_signal);
776 776
777#ifdef SANSA_FUZEV2 777#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
778 if (fuzev2_variant == 1) 778 if (amsv2_variant == 1)
779 GPIOB_DIR |= 1 << 5; 779 GPIOB_DIR |= 1 << 5;
780#endif 780#endif
781 781
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c
index f822819f4c..ef5eef090f 100644
--- a/firmware/target/arm/as3525/system-as3525.c
+++ b/firmware/target/arm/as3525/system-as3525.c
@@ -189,13 +189,13 @@ static void check_model_variant(void)
189 c200v2_variant = !GPIOA_PIN(7); 189 c200v2_variant = !GPIOA_PIN(7);
190 GPIOA_DIR = saved_dir; 190 GPIOA_DIR = saved_dir;
191} 191}
192#elif defined(SANSA_FUZEV2) 192#elif defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
193int fuzev2_variant; 193int amsv2_variant;
194 194
195static void check_model_variant(void) 195static void check_model_variant(void)
196{ 196{
197 GPIOB_DIR &= ~(1<<5); 197 GPIOB_DIR &= ~(1<<5);
198 fuzev2_variant = !!GPIOB_PIN(5); 198 amsv2_variant = !!GPIOB_PIN(5);
199} 199}
200#else 200#else
201static inline void check_model_variant(void) 201static inline void check_model_variant(void)
diff --git a/firmware/target/arm/as3525/system-target.h b/firmware/target/arm/as3525/system-target.h
index 249e062fec..6db16af040 100644
--- a/firmware/target/arm/as3525/system-target.h
+++ b/firmware/target/arm/as3525/system-target.h
@@ -46,8 +46,8 @@
46 ? (((uintptr_t)(a)) - IRAM_ORIG) \ 46 ? (((uintptr_t)(a)) - IRAM_ORIG) \
47 : ((uintptr_t)(a)))) 47 : ((uintptr_t)(a))))
48 48
49#ifdef SANSA_FUZEV2 49#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
50extern int fuzev2_variant; 50extern int amsv2_variant;
51#endif 51#endif
52 52
53#ifdef SANSA_C200V2 53#ifdef SANSA_C200V2