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.tar.gz rockbox-574b1009a64f8cb53a16aa43c28694486efb8455.zip |
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 5817052499..34814ba8d5 100755 --- a/bootloader/mrobe500.c +++ b/bootloader/mrobe500.c | |||
@@ -98,6 +98,9 @@ void touchpad_calibrate_screen(void) | |||
98 | set_calibration_points(&tl, &br); | 98 | set_calibration_points(&tl, &br); |
99 | } | 99 | } |
100 | #endif | 100 | #endif |
101 | static const uint8_t bl_low [] = {0xa4, 0x00, 0x55, 0xbb}; | ||
102 | static const uint8_t bl_high[] = {0xa4, 0x00, 0x19, 0xbb}; | ||
103 | |||
101 | void mrdebug(void) | 104 | void mrdebug(void) |
102 | { | 105 | { |
103 | int button=0, *address=0x0; | 106 | int button=0, *address=0x0; |
@@ -127,6 +130,10 @@ void mrdebug(void) | |||
127 | address+=0x1000; | 130 | address+=0x1000; |
128 | else if (button==BUTTON_RC_REW) | 131 | else if (button==BUTTON_RC_REW) |
129 | address-=0x1000; | 132 | address-=0x1000; |
133 | else if (button==BUTTON_RC_VOL_DOWN) | ||
134 | spi_block_transfer(SPI_target_BACKLIGHT, bl_low, 4, 0, 0); | ||
135 | else if (button==BUTTON_RC_VOL_UP) | ||
136 | spi_block_transfer(SPI_target_BACKLIGHT, bl_high, 4, 0, 0); | ||
130 | // { | 137 | // { |
131 | // short x,y,z1,z2; | 138 | // short x,y,z1,z2; |
132 | // tsc2100_read_values(&x, &y, &z1, &z2); | 139 | // 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 f80c3884fc..f3b41add54 100644 --- a/firmware/target/arm/tms320dm320/spi-dm320.c +++ b/firmware/target/arm/tms320dm320/spi-dm320.c | |||
@@ -30,6 +30,7 @@ | |||
30 | 30 | ||
31 | #define GIO_TS_ENABLE (1<<2) | 31 | #define GIO_TS_ENABLE (1<<2) |
32 | #define GIO_RTC_ENABLE (1<<12) | 32 | #define GIO_RTC_ENABLE (1<<12) |
33 | #define GIO_BL_ENABLE (1<<13) | ||
33 | 34 | ||
34 | struct spinlock spi_lock; | 35 | struct spinlock spi_lock; |
35 | 36 | ||
@@ -41,8 +42,9 @@ struct SPI_info { | |||
41 | #define reg(a) ((volatile unsigned short *)(PHY_IO_BASE+a)) | 42 | #define reg(a) ((volatile unsigned short *)(PHY_IO_BASE+a)) |
42 | struct SPI_info spi_targets[] = | 43 | struct SPI_info spi_targets[] = |
43 | { | 44 | { |
44 | [SPI_target_TSC2100] = { reg(0x0594), reg(0x058E), GIO_TS_ENABLE }, | 45 | [SPI_target_TSC2100] = { &IO_GIO_BITCLR1, &IO_GIO_BITSET1, GIO_TS_ENABLE }, |
45 | [SPI_target_RX5X348AB] = { reg(0x058C), reg(0x0592), GIO_RTC_ENABLE }, | 46 | [SPI_target_RX5X348AB] = { &IO_GIO_BITSET0, &IO_GIO_BITCLR0, GIO_RTC_ENABLE }, |
47 | [SPI_target_BACKLIGHT] = { &IO_GIO_BITCLR1, &IO_GIO_BITSET1, GIO_BL_ENABLE }, | ||
46 | }; | 48 | }; |
47 | 49 | ||
48 | static void spi_disable_all_targets(void) | 50 | static void spi_disable_all_targets(void) |
@@ -92,8 +94,8 @@ int spi_block_transfer(enum SPI_target target, | |||
92 | void spi_init(void) | 94 | void spi_init(void) |
93 | { | 95 | { |
94 | spinlock_init(&spi_lock); | 96 | spinlock_init(&spi_lock); |
95 | /* Set SCLK idle level = 1 */ | 97 | /* Set SCLK idle level = 0 */ |
96 | IO_SERIAL0_MODE &= ~(1<<10); | 98 | IO_SERIAL0_MODE |= 1<<10; |
97 | /* Enable TX */ | 99 | /* Enable TX */ |
98 | IO_SERIAL0_TX_ENABLE = 0x0001; | 100 | IO_SERIAL0_TX_ENABLE = 0x0001; |
99 | 101 | ||
diff --git a/firmware/target/arm/tms320dm320/spi-target.h b/firmware/target/arm/tms320dm320/spi-target.h index 7123fc1c05..fe229d8bda 100644 --- a/firmware/target/arm/tms320dm320/spi-target.h +++ b/firmware/target/arm/tms320dm320/spi-target.h | |||
@@ -26,6 +26,7 @@ | |||
26 | enum SPI_target { | 26 | enum SPI_target { |
27 | SPI_target_TSC2100 = 0, | 27 | SPI_target_TSC2100 = 0, |
28 | SPI_target_RX5X348AB, | 28 | SPI_target_RX5X348AB, |
29 | SPI_target_BACKLIGHT, | ||
29 | SPI_MAX_TARGETS, | 30 | SPI_MAX_TARGETS, |
30 | }; | 31 | }; |
31 | 32 | ||