forked from len0rd/rockbox
Ingenic players:
* Enable clocks when needed * Fix VX747+ button_hold() git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19505 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
977bab5348
commit
e4c09799a0
5 changed files with 17 additions and 10 deletions
|
@ -297,9 +297,11 @@ int rtc_ioctl(unsigned int cmd,struct rtc_time *val,unsigned int epo)
|
|||
|
||||
void rtc_init(void)
|
||||
{
|
||||
__cpm_start_rtc();
|
||||
REG_RTC_RCR = RTC_RCR_RTCE;
|
||||
udelay(70);
|
||||
while( !(REG_RTC_RCR & RTC_RCR_WRDY) );
|
||||
REG_RTC_RGR = (0x7fff | RTC_RGR_LOCK);
|
||||
udelay(70);
|
||||
__cpm_stop_rtc();
|
||||
}
|
||||
|
|
|
@ -3282,7 +3282,7 @@ do { \
|
|||
#define __cpm_sleep_mode() \
|
||||
(REG_CPM_LCR = (REG_CPM_LCR & ~CPM_LCR_LPM_MASK) | CPM_LCR_LPM_SLEEP)
|
||||
|
||||
#define __cpm_stop_all() (REG_CPM_CLKGR = 0x7fff)
|
||||
#define __cpm_stop_all() (REG_CPM_CLKGR = 0xffff)
|
||||
#define __cpm_stop_uart1() (REG_CPM_CLKGR |= CPM_CLKGR_UART1)
|
||||
#define __cpm_stop_uhc() (REG_CPM_CLKGR |= CPM_CLKGR_UHC)
|
||||
#define __cpm_stop_ipu() (REG_CPM_CLKGR |= CPM_CLKGR_IPU)
|
||||
|
|
|
@ -39,6 +39,7 @@ static struct wakeup lcd_wkup;
|
|||
/* LCD init */
|
||||
void lcd_init_device(void)
|
||||
{
|
||||
__cpm_start_lcd();
|
||||
lcd_init_controller();
|
||||
__cpm_stop_lcd();
|
||||
lcd_is_on = true;
|
||||
|
|
|
@ -126,11 +126,11 @@ unsigned int battery_adc_voltage(void)
|
|||
|
||||
void button_init_device(void)
|
||||
{
|
||||
__cpm_start_sadc();
|
||||
REG_SADC_ENA = 0;
|
||||
REG_SADC_STATE &= (~REG_SADC_STATE);
|
||||
REG_SADC_CTRL = 0x1F;
|
||||
|
||||
__cpm_start_sadc();
|
||||
REG_SADC_CFG = SADC_CFG_INIT;
|
||||
|
||||
system_enable_irq(IRQ_SADC);
|
||||
|
@ -184,7 +184,14 @@ static int touch_to_pixels(short x, short y)
|
|||
|
||||
bool button_hold(void)
|
||||
{
|
||||
return ((~REG_GPIO_PXPIN(3)) & BTN_HOLD ? true : false);
|
||||
return (
|
||||
#ifdef ONDA_VX747
|
||||
(~REG_GPIO_PXPIN(3)) & BTN_HOLD
|
||||
#elif defined(ONDA_VX747P)
|
||||
(~REG_GPIO_PXPIN(2)) & BTN_HOLD
|
||||
#endif
|
||||
? true : false
|
||||
);
|
||||
}
|
||||
|
||||
int button_read_device(int *data)
|
||||
|
@ -192,13 +199,7 @@ int button_read_device(int *data)
|
|||
int ret = 0, tmp;
|
||||
|
||||
/* Filter button events out if HOLD button is pressed at firmware/ level */
|
||||
if(
|
||||
#ifdef ONDA_VX747
|
||||
(~REG_GPIO_PXPIN(3)) & BTN_HOLD
|
||||
#elif defined(ONDA_VX747P)
|
||||
(~REG_GPIO_PXPIN(2)) & BTN_HOLD
|
||||
#endif
|
||||
)
|
||||
if(button_hold())
|
||||
return 0;
|
||||
|
||||
tmp = (~REG_GPIO_PXPIN(3)) & BTN_MASK;
|
||||
|
|
|
@ -694,6 +694,9 @@ void system_main(void)
|
|||
|
||||
detect_clock();
|
||||
|
||||
/* Disable unneeded clocks, clocks are enabled when needed */
|
||||
__cpm_stop_all();
|
||||
|
||||
/* Enable interrupts at core level */
|
||||
sti();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue