diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-01-27 00:38:58 +0000 |
---|---|---|
committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-01-27 00:38:58 +0000 |
commit | a4e7bc383ed296b532a648a02db62a06c99c9ad8 (patch) | |
tree | 97ab9a2d4441aebeae7a76ef1c448f10883daadf /firmware/target/mips/ingenic_jz47xx/onda_vx747 | |
parent | 95577c7996e7a79a71a12e27433cbd5126c0ccd8 (diff) | |
download | rockbox-a4e7bc383ed296b532a648a02db62a06c99c9ad8.tar.gz rockbox-a4e7bc383ed296b532a648a02db62a06c99c9ad8.zip |
Onda VX747:
* Implement lcd_flip()
* Add support for multiple banks in NAND driver
* Add basic I²C driver (untested)
* Get audio back working
* Add power driver
* Other minor fixes and cleanups
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19863 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/onda_vx747')
4 files changed, 73 insertions, 19 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/ata-sd-target.h b/firmware/target/mips/ingenic_jz47xx/onda_vx747/ata-sd-target.h index ba324c1dcb..aed2b9cfea 100644 --- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/ata-sd-target.h +++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/ata-sd-target.h @@ -39,29 +39,12 @@ int _sd_write_sectors(unsigned long start, int count, const void* buf); int _sd_init(void); #define MMC_CD_PIN (29 + 1 * 32) /* Pin to check card insertion */ -//#define MMC_POWER_PIN (22 + 2 * 32) /* Pin to enable/disable card power */ - -#ifdef MMC_POWER_PIN -#define MMC_POWER_OFF() \ -do { \ - __gpio_clear_pin(MMC_POWER_PIN); \ -} while (0) - -#define MMC_POWER_ON() \ -do { \ - __gpio_set_pin(MMC_POWER_PIN); \ -} while (0) -#endif static inline void mmc_init_gpio(void) { __gpio_as_msc(); __gpio_as_input(MMC_CD_PIN); -#ifdef MMC_POWER_PIN - __gpio_as_func0(MMC_POWER_PIN); - __gpio_as_output(MMC_POWER_PIN); -#endif - __gpio_enable_pull(32*3+29); + //__gpio_enable_pull(32*3+29); __gpio_enable_pull(32*3+10); __gpio_enable_pull(32*3+11); __gpio_enable_pull(32*3+12); diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c index faed5ecda2..c07a191bbe 100644 --- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c +++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c @@ -240,6 +240,34 @@ void lcd_set_target(short x, short y, short width, short height) SLCD_SET_COMMAND(REG_RW_GRAM); /* write data to GRAM */ } +void lcd_set_flip(bool yesno) +{ + int i; + + __cpm_start_lcd(); +#if CONFIG_ORIENTATION == SCREEN_PORTRAIT + if(yesno) + { + SLCD_SEND_COMMAND(REG_ENTRY_MODE, (ENTRY_MODE_BGR | ENTRY_MODE_HWM)); + } + else + { + SLCD_SEND_COMMAND(REG_ENTRY_MODE, (ENTRY_MODE_BGR | ENTRY_MODE_VID | ENTRY_MODE_HID | ENTRY_MODE_HWM)); + } +#else + if(yesno) + { + SLCD_SEND_COMMAND(REG_ENTRY_MODE, (ENTRY_MODE_BGR | ENTRY_MODE_HID | ENTRY_MODE_AM)); + } + else + { + SLCD_SEND_COMMAND(REG_ENTRY_MODE, (ENTRY_MODE_BGR | ENTRY_MODE_VID | ENTRY_MODE_AM)); + } +#endif + DELAY; + __cpm_stop_lcd(); +} + void lcd_on(void) { _display_on(); diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/power-onda_vx747.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/power-onda_vx747.c new file mode 100644 index 0000000000..374bc110d6 --- /dev/null +++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/power-onda_vx747.c @@ -0,0 +1,43 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2009 by Maurus Cuelenaere + * + * 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 "power.h" +#include "jz4740.h" + +/* TQ7051 chip */ +#define USB_CHARGER_GPIO (32*1+30) /* STAT port */ + +/* Detect which power sources are present. */ +unsigned int power_input_status(void) +{ + unsigned int status = 0; + + if (__gpio_get_pin(USB_CHARGER_GPIO)) + status |= POWER_INPUT_USB_CHARGER; + + return status; +} + +void power_init(void) +{ + __gpio_as_input(USB_CHARGER_GPIO); +} diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h b/firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h index fbb14b7ac4..0b17bebfc2 100644 --- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h +++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h @@ -24,7 +24,7 @@ #include "config.h" -#define GPIO_UDC_DETE (32 * 3 + 28) +#define GPIO_UDC_DETE (32 * 3 + 28) /* A18 = ADP_CHK */ #define IRQ_GPIO_UDC_DETE (IRQ_GPIO_0 + GPIO_UDC_DETE) #define USB_GPIO_IRQ GPIO124 |