summaryrefslogtreecommitdiffstats
path: root/firmware
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 /firmware
parent1ebdb8988f1e029828fdfd9523fc5fb6022613ea (diff)
downloadrockbox-4d6c8167214082b8f7d0c5415668680e15a20801.tar.gz
rockbox-4d6c8167214082b8f7d0c5415668680e15a20801.tar.bz2
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
Diffstat (limited to 'firmware')
-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)
{
while(1)
{
-#if defined(SANSA_C200V2) || defined(SANSA_FUZEV2)
+#if defined(SANSA_C200V2) || defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
lcd_clear_display();
line = 0;
lcd_puts(0, line++, "[Submodel:]");
#if defined(SANSA_C200V2)
lcd_putsf(0, line++, "C200v2 variant %d", c200v2_variant);
-#elif defined(SANSA_FUZEV2)
- lcd_putsf(0, line++, "Fuzev2 variant %d", fuzev2_variant);
+#elif defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
+ lcd_putsf(0, line++, "AMSv2 variant %d", amsv2_variant);
#endif
lcd_update();
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)
ascodec_write_pmu(AS3543_BACKLIGHT, 2, backlight_brightness * 10);
/* needed for button light */
- if (fuzev2_variant == 1)
+ if (amsv2_variant == 1)
ascodec_write_pmu(0x1a, 1, 0x30); /* MUX_PWGD = PWM */
return true;
@@ -63,7 +63,7 @@ void _backlight_off(void)
void _buttonlight_on(void)
{
- if (fuzev2_variant == 0)
+ if (amsv2_variant == 0)
{
GPIOB_DIR |= 1<<5;
GPIOB_PIN(5) = (1<<5);
@@ -77,7 +77,7 @@ void _buttonlight_on(void)
void _buttonlight_off(void)
{
- if (fuzev2_variant == 0)
+ if (amsv2_variant == 0)
{
GPIOB_PIN(5) = 0;
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)
btn |= BUTTON_RIGHT;
if (GPIOB_PIN(1) & 1<<1)
btn |= BUTTON_HOME;
- if (fuzev2_variant == 1)
+ if (amsv2_variant == 1)
btn ^= BUTTON_HOME;
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 @@
#include "disk.h"
#endif
-#ifdef SANSA_FUZEV2
+#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
#include "backlight-target.h"
#endif
@@ -403,8 +403,8 @@ static bool send_cmd(const int drive, const int cmd, const int arg, const int fl
MCI_ARGUMENT = arg;
-#ifdef SANSA_FUZEV2
- if (fuzev2_variant == 1)
+#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
+ if (amsv2_variant == 1)
card_no = 1 << 16;
else
#endif
@@ -429,8 +429,8 @@ static bool send_cmd(const int drive, const int cmd, const int arg, const int fl
/*b23 | CMD_CCS_EXPECTED unused */
/*b31 */ | CMD_DONE_BIT;
-#ifdef SANSA_FUZEV2
- if (fuzev2_variant == 0)
+#if defined(SANSA_FUZEV2)
+ if (amsv2_variant == 0)
{
extern int buttonlight_is_on;
if(buttonlight_is_on)
@@ -594,8 +594,8 @@ static int sd_init_card(const int drive)
return -17;
/* Now that card is widebus make controller aware */
-#ifdef SANSA_FUZEV2
- if (fuzev2_variant == 1)
+#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
+ if (amsv2_variant == 1)
MCI_CTYPE |= 1<<1;
else
#endif
@@ -604,8 +604,8 @@ static int sd_init_card(const int drive)
#endif /* ! BOOTLOADER */
/* Set low power mode */
-#ifdef SANSA_FUZEV2
- if (fuzev2_variant == 1)
+#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
+ if (amsv2_variant == 1)
MCI_CLKENA |= 1<<16;
else
#endif
@@ -709,8 +709,8 @@ static void init_controller(void)
int card_mask = (1 << hcon_numcards) - 1;
int pwr_mask;
-#ifdef SANSA_FUZEV2
- if (fuzev2_variant == 1)
+#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
+ if (amsv2_variant == 1)
pwr_mask = 1 << 1;
else
#endif
@@ -774,8 +774,8 @@ int sd_init(void)
wakeup_init(&transfer_completion_signal);
wakeup_init(&command_completion_signal);
-#ifdef SANSA_FUZEV2
- if (fuzev2_variant == 1)
+#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
+ if (amsv2_variant == 1)
GPIOB_DIR |= 1 << 5;
#endif
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)
c200v2_variant = !GPIOA_PIN(7);
GPIOA_DIR = saved_dir;
}
-#elif defined(SANSA_FUZEV2)
-int fuzev2_variant;
+#elif defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
+int amsv2_variant;
static void check_model_variant(void)
{
GPIOB_DIR &= ~(1<<5);
- fuzev2_variant = !!GPIOB_PIN(5);
+ amsv2_variant = !!GPIOB_PIN(5);
}
#else
static 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 @@
? (((uintptr_t)(a)) - IRAM_ORIG) \
: ((uintptr_t)(a))))
-#ifdef SANSA_FUZEV2
-extern int fuzev2_variant;
+#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
+extern int amsv2_variant;
#endif
#ifdef SANSA_C200V2