From 173d854e7f10c51969ccf237074aa8dfcc083c7f Mon Sep 17 00:00:00 2001 From: Karl Kurbjun Date: Sun, 11 Oct 2009 06:08:14 +0000 Subject: M:Robe 500: Add support for more audio frequencies, initialize and set the touchscreen PWD pin. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23089 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/audio/tsc2100.c | 20 +++++++++++++++++++- firmware/export/config-mrobe500.h | 2 +- .../target/arm/tms320dm320/mrobe-500/adc-mr500.c | 9 +++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/firmware/drivers/audio/tsc2100.c b/firmware/drivers/audio/tsc2100.c index 8a71d57e78..a926b4464b 100644 --- a/firmware/drivers/audio/tsc2100.c +++ b/firmware/drivers/audio/tsc2100.c @@ -116,5 +116,23 @@ void audiohw_close(void) void audiohw_set_frequency(int fsel) { - (void)fsel; + int reg_val; + reg_val = tsc2100_readreg(TSAC1_PAGE, TSAC1_ADDRESS); + + reg_val &= ~(0x07<<3); + + switch(fsel) + { + case HW_FREQ_8: + reg_val |= (0x06<<3); + break; + case HW_FREQ_11: + reg_val |= (0x04<<3); + break; + case HW_FREQ_44: + default: + break; + } + + tsc2100_writereg(TSAC1_PAGE, TSAC1_ADDRESS, reg_val); } diff --git a/firmware/export/config-mrobe500.h b/firmware/export/config-mrobe500.h index 1ad521f864..5ce1926713 100644 --- a/firmware/export/config-mrobe500.h +++ b/firmware/export/config-mrobe500.h @@ -180,7 +180,7 @@ #define PLUGIN_BUFFER_SIZE 0x200000 #endif -#define HW_SAMPR_CAPS SAMPR_CAP_44 +#define HW_SAMPR_CAPS SAMPR_CAP_44 | SAMPR_CAP_22 | SAMPR_CAP_11 | SAMPR_CAP_8 #define BATTERY_CAPACITY_DEFAULT 1500 /* default battery capacity */ #define BATTERY_CAPACITY_MIN 1000 /* min. capacity selectable */ diff --git a/firmware/target/arm/tms320dm320/mrobe-500/adc-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/adc-mr500.c index 7d073f4fda..5df764620d 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/adc-mr500.c +++ b/firmware/target/arm/tms320dm320/mrobe-500/adc-mr500.c @@ -28,6 +28,15 @@ void adc_init(void) { + /* Pin 15 appears to be the nPWD pin - make sure it is high otherwise the + * touchscreen does not work, audio has not been tested, but it is + * expected that is will also not work when low. + */ + IO_GIO_DIR0 &= ~(1<<15); /* output */ + IO_GIO_INV0 &= ~(1<<15); /* non-inverted */ + IO_GIO_FSEL0 &= ~(0x03<<12); /* normal pin */ + IO_GIO_BITSET0 = (1<<15); + /* Initialize the touchscreen and the battery readout */ tsc2100_adc_init(); -- cgit v1.2.3