From ae351903a65393477f061a2eb934c8d8a6a605a6 Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Wed, 21 Jan 2009 20:51:43 +0000 Subject: Commit stable parts of FS#9611 - Sansa Clip radio code git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19813 a1c6a512-1295-4272-9138-f99709370657 --- apps/keymaps/keymap-clip.c | 19 +++++++++++++------ firmware/export/config-clip.h | 5 +---- firmware/export/config-e200v2.h | 4 ++-- firmware/export/config-fuze.h | 4 ++-- firmware/target/arm/as3525/system-as3525.c | 5 +++++ 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/apps/keymaps/keymap-clip.c b/apps/keymaps/keymap-clip.c index 5a4c990fe7..d7970a7984 100644 --- a/apps/keymaps/keymap-clip.c +++ b/apps/keymaps/keymap-clip.c @@ -218,12 +218,19 @@ static const struct button_mapping button_context_recscreen[] = { /** FM Radio Screen **/ static const struct button_mapping button_context_radio[] = { - { ACTION_FM_MENU, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_FM_PRESET, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, - { ACTION_FM_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_NONE }, - { ACTION_FM_MODE, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP }, - { ACTION_FM_EXIT, BUTTON_DOWN|BUTTON_REL, BUTTON_NONE }, - { ACTION_FM_PLAY, BUTTON_UP|BUTTON_REL, BUTTON_UP }, + /* Copied from keymap-c200.c 20081207. Feel free to suggest a better one.*/ + { ACTION_NONE, BUTTON_UP, BUTTON_NONE }, + { ACTION_FM_MENU, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_FM_PRESET, BUTTON_SELECT, BUTTON_NONE }, + { ACTION_FM_STOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP }, + { ACTION_FM_MODE, BUTTON_HOME, BUTTON_NONE }, + { ACTION_FM_EXIT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, + { ACTION_FM_PLAY, BUTTON_UP|BUTTON_REL, BUTTON_UP }, + { ACTION_SETTINGS_INC, BUTTON_VOL_UP, BUTTON_NONE }, + { ACTION_SETTINGS_INCREPEAT,BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_DEC, BUTTON_VOL_DOWN, BUTTON_NONE }, + { ACTION_SETTINGS_DECREPEAT,BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) }; /* button_context_radio */ diff --git a/firmware/export/config-clip.h b/firmware/export/config-clip.h index 63b4fd8617..da8acf2fdf 100644 --- a/firmware/export/config-clip.h +++ b/firmware/export/config-clip.h @@ -20,13 +20,12 @@ #define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */ #define REC_SAMPR_DEFAULT SAMPR_22 +#endif /* Define bitmask of input sources - recordable bitmask can be defined explicitly if different */ #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) -#endif - /* define this if you have a bitmap LCD display */ #define HAVE_LCD_BITMAP @@ -106,10 +105,8 @@ #define AB_REPEAT_ENABLE 1 /* FM Tuner */ -#if 0 /* disabled since there is no driver (yet) */ #define CONFIG_TUNER SI4700 /* in fact SI4702 but let's hope it's compatible */ //#define HAVE_TUNER_PWR_CTRL -#endif /* Define this for LCD backlight available */ #define HAVE_BACKLIGHT diff --git a/firmware/export/config-e200v2.h b/firmware/export/config-e200v2.h index 5b6ac5ff48..564916aea0 100644 --- a/firmware/export/config-e200v2.h +++ b/firmware/export/config-e200v2.h @@ -17,10 +17,10 @@ #define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */ #define REC_SAMPR_DEFAULT SAMPR_22 +#endif /* Define bitmask of input sources - recordable bitmask can be defined explicitly if different */ #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) -#endif /* define this if you have a bitmap LCD display */ #define HAVE_LCD_BITMAP @@ -99,7 +99,7 @@ #define AB_REPEAT_ENABLE 1 /* FM Tuner - suspected to be the SI4702 */ -//#define CONFIG_TUNER SI4700 +#define CONFIG_TUNER SI4700 /* #define HAVE_TUNER_PWR_CTRL */ /* Define this for LCD backlight available */ diff --git a/firmware/export/config-fuze.h b/firmware/export/config-fuze.h index e79abb19f2..3e5880775b 100644 --- a/firmware/export/config-fuze.h +++ b/firmware/export/config-fuze.h @@ -19,8 +19,8 @@ /* Define bitmask of input sources - recordable bitmask can be defined explicitly if different */ -#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) #endif +#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) /* define this if you have a bitmap LCD display */ #define HAVE_LCD_BITMAP @@ -99,7 +99,7 @@ #define AB_REPEAT_ENABLE 1 /* FM Tuner - suspected to be the SI4702 */ -//#define CONFIG_TUNER SI4700 +#define CONFIG_TUNER SI4700 /* #define HAVE_TUNER_PWR_CTRL */ /* Define this for LCD backlight available */ diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c index 9b075feb8f..26c806efc7 100644 --- a/firmware/target/arm/as3525/system-as3525.c +++ b/firmware/target/arm/as3525/system-as3525.c @@ -26,6 +26,7 @@ #include "ascodec-target.h" #include "dma-target.h" #include "clock-target.h" +#include "fmradio_i2c.h" #define default_interrupt(name) \ extern __attribute__((weak,alias("UIRQ"))) void name (void) @@ -263,6 +264,10 @@ void system_init(void) * We don't need the power button in the bootloader. */ ascodec_init(); ascodec_write(AS3514_CVDD_DCDC3, ascodec_read(AS3514_CVDD_DCDC3) & (1<<2)); + +#ifdef CONFIG_TUNER + fmradio_i2c_init(); +#endif #endif /* !BOOTLOADER */ #ifdef HAVE_ADJUSTABLE_CPU_FREQ -- cgit v1.2.3