diff options
| author | Catalin Patulea <cat@vv.carleton.ca> | 2007-11-02 05:07:52 +0000 |
|---|---|---|
| committer | Catalin Patulea <cat@vv.carleton.ca> | 2007-11-02 05:07:52 +0000 |
| commit | 574b1009a64f8cb53a16aa43c28694486efb8455 (patch) | |
| tree | d60c268c3bd6d416bc12329be2631e0134a29f10 | |
| parent | 5f36e5a35396cf82590cbef8765310f5ece425fa (diff) | |
| download | rockbox-574b1009a64f8cb53a16aa43c28694486efb8455.zip rockbox-574b1009a64f8cb53a16aa43c28694486efb8455.tar.gz rockbox-574b1009a64f8cb53a16aa43c28694486efb8455.tar.bz2 rockbox-574b1009a64f8cb53a16aa43c28694486efb8455.tar.xz | |
m:robe 500i port: Add support for the backlight client in the SPI subsystem
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15402 a1c6a512-1295-4272-9138-f99709370657
| -rwxr-xr-x | bootloader/mrobe500.c | 7 | ||||
| -rw-r--r-- | firmware/target/arm/tms320dm320/spi-dm320.c | 10 | ||||
| -rw-r--r-- | firmware/target/arm/tms320dm320/spi-target.h | 1 |
3 files changed, 14 insertions, 4 deletions
diff --git a/bootloader/mrobe500.c b/bootloader/mrobe500.c index 5817052..34814ba 100755 --- a/bootloader/mrobe500.c +++ b/bootloader/mrobe500.c @@ -98,6 +98,9 @@ void touchpad_calibrate_screen(void) set_calibration_points(&tl, &br);
}
#endif
+static const uint8_t bl_low [] = {0xa4, 0x00, 0x55, 0xbb};
+static const uint8_t bl_high[] = {0xa4, 0x00, 0x19, 0xbb};
+
void mrdebug(void)
{
int button=0, *address=0x0;
@@ -127,6 +130,10 @@ void mrdebug(void) address+=0x1000;
else if (button==BUTTON_RC_REW)
address-=0x1000;
+ else if (button==BUTTON_RC_VOL_DOWN)
+ spi_block_transfer(SPI_target_BACKLIGHT, bl_low, 4, 0, 0);
+ else if (button==BUTTON_RC_VOL_UP)
+ spi_block_transfer(SPI_target_BACKLIGHT, bl_high, 4, 0, 0);
// {
// short x,y,z1,z2;
// tsc2100_read_values(&x, &y, &z1, &z2);
diff --git a/firmware/target/arm/tms320dm320/spi-dm320.c b/firmware/target/arm/tms320dm320/spi-dm320.c index f80c388..f3b41ad 100644 --- a/firmware/target/arm/tms320dm320/spi-dm320.c +++ b/firmware/target/arm/tms320dm320/spi-dm320.c @@ -30,6 +30,7 @@ #define GIO_TS_ENABLE (1<<2) #define GIO_RTC_ENABLE (1<<12) +#define GIO_BL_ENABLE (1<<13) struct spinlock spi_lock; @@ -41,8 +42,9 @@ struct SPI_info { #define reg(a) ((volatile unsigned short *)(PHY_IO_BASE+a)) struct SPI_info spi_targets[] = { - [SPI_target_TSC2100] = { reg(0x0594), reg(0x058E), GIO_TS_ENABLE }, - [SPI_target_RX5X348AB] = { reg(0x058C), reg(0x0592), GIO_RTC_ENABLE }, + [SPI_target_TSC2100] = { &IO_GIO_BITCLR1, &IO_GIO_BITSET1, GIO_TS_ENABLE }, + [SPI_target_RX5X348AB] = { &IO_GIO_BITSET0, &IO_GIO_BITCLR0, GIO_RTC_ENABLE }, + [SPI_target_BACKLIGHT] = { &IO_GIO_BITCLR1, &IO_GIO_BITSET1, GIO_BL_ENABLE }, }; static void spi_disable_all_targets(void) @@ -92,8 +94,8 @@ int spi_block_transfer(enum SPI_target target, void spi_init(void) { spinlock_init(&spi_lock); - /* Set SCLK idle level = 1 */ - IO_SERIAL0_MODE &= ~(1<<10); + /* Set SCLK idle level = 0 */ + IO_SERIAL0_MODE |= 1<<10; /* Enable TX */ IO_SERIAL0_TX_ENABLE = 0x0001; diff --git a/firmware/target/arm/tms320dm320/spi-target.h b/firmware/target/arm/tms320dm320/spi-target.h index 7123fc1..fe229d8 100644 --- a/firmware/target/arm/tms320dm320/spi-target.h +++ b/firmware/target/arm/tms320dm320/spi-target.h @@ -26,6 +26,7 @@ enum SPI_target { SPI_target_TSC2100 = 0, SPI_target_RX5X348AB, + SPI_target_BACKLIGHT, SPI_MAX_TARGETS, }; |