mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 21:25:19 -05:00
Commit second part of FS#9663 by Thomas Martitz. Enable button light on fuze and e200v2.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19792 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7278163087
commit
3db7893911
4 changed files with 14 additions and 4 deletions
|
|
@ -273,6 +273,7 @@ interface */
|
||||||
#define UART_LNSTATUS_REG (*(volatile unsigned long*)(UART0_BASE + 0x14)) /* Line status register */
|
#define UART_LNSTATUS_REG (*(volatile unsigned long*)(UART0_BASE + 0x14)) /* Line status register */
|
||||||
|
|
||||||
|
|
||||||
|
#define SD_MCI_POWER (*(volatile unsigned long*)(SD_MCI_BASE + 0x0))
|
||||||
|
|
||||||
|
|
||||||
#define TIMER1_LOAD (*(volatile unsigned long*)(TIMER_BASE + 0x00)) /* 32-bit width */
|
#define TIMER1_LOAD (*(volatile unsigned long*)(TIMER_BASE + 0x00)) /* 32-bit width */
|
||||||
|
|
|
||||||
|
|
@ -476,10 +476,10 @@ static void init_pl180_controller(const int drive)
|
||||||
int sd_init(void)
|
int sd_init(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
CGU_IDE = (1<<7) /* AHB interface enable */ |
|
CGU_IDE = (1<<7) /* AHB interface enable */ |
|
||||||
(1<<6) /* interface enable */ |
|
(1<<6) /* interface enable */ |
|
||||||
((CLK_DIV(AS3525_PLLA_FREQ, AS3525_IDE_FREQ) - 1) << 2) |
|
((CLK_DIV(AS3525_PLLA_FREQ, AS3525_IDE_FREQ) - 1) << 2) |
|
||||||
1 /* clock source = PLLA */;
|
1; /* clock source = PLLA */
|
||||||
|
|
||||||
|
|
||||||
CGU_PERI |= CGU_NAF_CLOCK_ENABLE;
|
CGU_PERI |= CGU_NAF_CLOCK_ENABLE;
|
||||||
|
|
@ -741,6 +741,10 @@ void sd_enable(bool on)
|
||||||
CGU_PERI |= CGU_NAF_CLOCK_ENABLE;
|
CGU_PERI |= CGU_NAF_CLOCK_ENABLE;
|
||||||
#ifdef HAVE_MULTIVOLUME
|
#ifdef HAVE_MULTIVOLUME
|
||||||
CGU_PERI |= CGU_MCI_CLOCK_ENABLE;
|
CGU_PERI |= CGU_MCI_CLOCK_ENABLE;
|
||||||
|
/* Needed for buttonlight and MicroSD to work at the same time */
|
||||||
|
/* Turn ROD control on, as the OF does */
|
||||||
|
SD_MCI_POWER |= (1<<7);
|
||||||
|
CCU_IO |= (1<<2);
|
||||||
#endif
|
#endif
|
||||||
CGU_IDE |= (1<<7) /* AHB interface enable */ |
|
CGU_IDE |= (1<<7) /* AHB interface enable */ |
|
||||||
(1<<6) /* interface enable */;
|
(1<<6) /* interface enable */;
|
||||||
|
|
@ -751,6 +755,10 @@ void sd_enable(bool on)
|
||||||
CGU_PERI &= ~CGU_NAF_CLOCK_ENABLE;
|
CGU_PERI &= ~CGU_NAF_CLOCK_ENABLE;
|
||||||
#ifdef HAVE_MULTIVOLUME
|
#ifdef HAVE_MULTIVOLUME
|
||||||
CGU_PERI &= ~CGU_MCI_CLOCK_ENABLE;
|
CGU_PERI &= ~CGU_MCI_CLOCK_ENABLE;
|
||||||
|
/* Needed for buttonlight and MicroSD to work at the same time */
|
||||||
|
/* Turn ROD control off, as the OF does */
|
||||||
|
SD_MCI_POWER &= ~(1<<7);
|
||||||
|
CCU_IO &= ~(1<<2);
|
||||||
#endif
|
#endif
|
||||||
CGU_IDE &= ~((1<<7)|(1<<6));
|
CGU_IDE &= ~((1<<7)|(1<<6));
|
||||||
sd_enabled = false;
|
sd_enabled = false;
|
||||||
|
|
|
||||||
|
|
@ -57,12 +57,12 @@ void _backlight_off(void)
|
||||||
|
|
||||||
void _buttonlight_on(void)
|
void _buttonlight_on(void)
|
||||||
{
|
{
|
||||||
GPIOD_PIN(7) = (1<<7);
|
|
||||||
GPIOD_DIR |= (1<<7);
|
GPIOD_DIR |= (1<<7);
|
||||||
|
GPIOD_PIN(7) = (1<<7);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _buttonlight_off(void)
|
void _buttonlight_off(void)
|
||||||
{
|
{
|
||||||
GPIOD_PIN(7) = 0;
|
GPIOD_PIN(7) = 0;
|
||||||
GPIOD_DIR |= (1<<7);
|
GPIOD_DIR &= ~(1<<7);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,7 @@ static void get_wheel(void)
|
||||||
* the rockbox menus */
|
* the rockbox menus */
|
||||||
if (queue_empty(&button_queue) && ++counter >= 4)
|
if (queue_empty(&button_queue) && ++counter >= 4)
|
||||||
{
|
{
|
||||||
|
buttonlight_on();
|
||||||
backlight_on();
|
backlight_on();
|
||||||
/* 1<<24 is rather arbitary, seems to work well */
|
/* 1<<24 is rather arbitary, seems to work well */
|
||||||
queue_post(&button_queue, btn, 1<<24);
|
queue_post(&button_queue, btn, 1<<24);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue