summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/creative-zen
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-11-18 20:07:02 +0000
committerAmaury Pouly <amaury.pouly@gmail.com>2013-11-18 21:44:06 +0000
commit977a6c3ce7a2ab960590e9d997388cca2e4c29ee (patch)
tree092ef21d5f2123fee784de7d1ee719270c30c6de /firmware/target/arm/imx233/creative-zen
parenta8b816ae9cc00fe216e43d9bd9276b5d8cf12b25 (diff)
downloadrockbox-977a6c3ce7a2ab960590e9d997388cca2e4c29ee.tar.gz
rockbox-977a6c3ce7a2ab960590e9d997388cca2e4c29ee.zip
Initial commit for the Creative ZEN V
Change-Id: I3408cfdf742ea5995d5c87bf76653f436e1ec2b0
Diffstat (limited to 'firmware/target/arm/imx233/creative-zen')
-rw-r--r--firmware/target/arm/imx233/creative-zen/backlight-zen.c6
-rw-r--r--firmware/target/arm/imx233/creative-zen/button-target.h6
-rw-r--r--firmware/target/arm/imx233/creative-zen/button-zen.c16
-rw-r--r--firmware/target/arm/imx233/creative-zen/power-zen.c12
4 files changed, 37 insertions, 3 deletions
diff --git a/firmware/target/arm/imx233/creative-zen/backlight-zen.c b/firmware/target/arm/imx233/creative-zen/backlight-zen.c
index 0d223b52e9..74e1e91a49 100644
--- a/firmware/target/arm/imx233/creative-zen/backlight-zen.c
+++ b/firmware/target/arm/imx233/creative-zen/backlight-zen.c
@@ -29,6 +29,9 @@
void _backlight_set_brightness(int level)
{
+#ifdef CREATIVE_ZENV
+ lcd_set_contrast(level);
+#else
unsigned val = (level + 200) * level / 1000;
if(level != 0)
{
@@ -39,14 +42,17 @@ void _backlight_set_brightness(int level)
}
else
imx233_pinctrl_set_gpio(1, 12, false);
+#endif
}
bool _backlight_init(void)
{
+#ifndef CREATIVE_ZENV
imx233_pinctrl_acquire(1, 12, "backlight_enable");
imx233_pinctrl_set_function(1, 12, PINCTRL_FUNCTION_GPIO);
imx233_pinctrl_enable_gpio(1, 12, true);
imx233_uartdbg_init(BAUD_38400);
+#endif
return true;
}
diff --git a/firmware/target/arm/imx233/creative-zen/button-target.h b/firmware/target/arm/imx233/creative-zen/button-target.h
index cddff4d9cc..7974ae42ad 100644
--- a/firmware/target/arm/imx233/creative-zen/button-target.h
+++ b/firmware/target/arm/imx233/creative-zen/button-target.h
@@ -47,8 +47,12 @@ bool button_debug_screen(void);
#define BUTTON_TOPLEFT 0x00001000
#define BUTTON_TOPRIGHT 0x00002000
#endif
+#ifdef CREATIVE_ZENV
+#define BUTTON_VOL_UP 0x00004000
+#define BUTTON_VOL_DOWN 0x00008000
+#endif
-#define BUTTON_MAIN 0x00003fff
+#define BUTTON_MAIN 0x0000ffff
/* Software power-off */
#define POWEROFF_BUTTON BUTTON_POWER
diff --git a/firmware/target/arm/imx233/creative-zen/button-zen.c b/firmware/target/arm/imx233/creative-zen/button-zen.c
index 1997f91357..8f20961a57 100644
--- a/firmware/target/arm/imx233/creative-zen/button-zen.c
+++ b/firmware/target/arm/imx233/creative-zen/button-zen.c
@@ -57,6 +57,20 @@ struct imx233_button_lradc_mapping_t imx233_button_lradc_mapping[] =
{2945, BUTTON_PLAYPAUSE},
{3400, 0},
{0, IMX233_BUTTON_LRADC_END},
+#elif defined(CREATIVE_ZENV)
+ {190, IMX233_BUTTON_LRADC_HOLD},
+ {250, BUTTON_PLAYPAUSE},
+ {530, BUTTON_BACK},
+ {785, BUTTON_VOL_UP},
+ {1040, BUTTON_VOL_DOWN},
+ {1295, BUTTON_MENU},
+ {1540, BUTTON_UP},
+ {1800, BUTTON_SELECT},
+ {2070, BUTTON_LEFT},
+ {2315, BUTTON_RIGHT},
+ {2550, BUTTON_DOWN},
+ {3450, 0},
+ {0, IMX233_BUTTON_LRADC_END},
#elif defined(CREATIVE_ZENMOZAIC)
{0, IMX233_BUTTON_LRADC_HOLD},
{200, BUTTON_MENU},
@@ -100,7 +114,7 @@ bool headphones_inserted(void)
int button_read_device(void)
{
int btn = 0;
- if(BF_RD(POWER_STS, PSWITCH) == 1)
+ if(imx233_power_read_pswitch() == 1)
btn |= BUTTON_POWER;
return imx233_button_lradc_read(btn);
}
diff --git a/firmware/target/arm/imx233/creative-zen/power-zen.c b/firmware/target/arm/imx233/creative-zen/power-zen.c
index 2c68325432..c1ad5989c0 100644
--- a/firmware/target/arm/imx233/creative-zen/power-zen.c
+++ b/firmware/target/arm/imx233/creative-zen/power-zen.c
@@ -58,4 +58,14 @@ bool tuner_power(bool enable)
bool tuner_powered(void)
{
return tuner_enable;
-} \ No newline at end of file
+}
+
+void ide_power_enable(bool on)
+{
+ (void) on;
+}
+
+bool ide_powered(void)
+{
+ return true;
+}