summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-03-02 18:18:24 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-03-02 18:18:24 +0000
commit6c252a67519c49f365b354e00625a521c86dd29d (patch)
treedba18bcdfb4493a589392f34408eb3509babf210
parent69ffd7c84ffae0999d2a4f10b840f33f67d67a60 (diff)
downloadrockbox-6c252a67519c49f365b354e00625a521c86dd29d.tar.gz
rockbox-6c252a67519c49f365b354e00625a521c86dd29d.zip
Onda VX747:
* Add speaker en-/disable driver * Add apps/ setting to en-/disable the speaker git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20174 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/lang/english.lang14
-rw-r--r--apps/lang/nederlands.lang14
-rw-r--r--apps/menus/sound_menu.c7
-rw-r--r--apps/settings.c4
-rw-r--r--apps/settings.h4
-rw-r--r--apps/settings_list.c4
-rw-r--r--firmware/export/audiohw.h6
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx747/speaker-onda_vx747.c34
8 files changed, 87 insertions, 0 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 25cab34430..dbe2be079a 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -12401,3 +12401,17 @@
12401 *: "As whole numbers" 12401 *: "As whole numbers"
12402 </voice> 12402 </voice>
12403</phrase> 12403</phrase>
12404<phrase>
12405 id: LANG_ENABLE_SPEAKER
12406 desc: in Settings -> Sound Settings
12407 user:
12408 <source>
12409 *: "Enable Speaker"
12410 </source>
12411 <dest>
12412 *: "Enable Speaker"
12413 </dest>
12414 <voice>
12415 *: "Enable Speaker"
12416 </voice>
12417</phrase>
diff --git a/apps/lang/nederlands.lang b/apps/lang/nederlands.lang
index 833ae3df5b..489a31b66d 100644
--- a/apps/lang/nederlands.lang
+++ b/apps/lang/nederlands.lang
@@ -12288,3 +12288,17 @@
12288 serial_port: "Automatisch" 12288 serial_port: "Automatisch"
12289 </voice> 12289 </voice>
12290</phrase> 12290</phrase>
12291<phrase>
12292 id: LANG_ENABLE_SPEAKER
12293 desc: in Settings -> Sound Settings
12294 user:
12295 <source>
12296 *: "Enable Speaker"
12297 </source>
12298 <dest>
12299 *: "Luidspreker inschakelen"
12300 </dest>
12301 <voice>
12302 *: "Luidspreker inschakelen"
12303 </voice>
12304</phrase>
diff --git a/apps/menus/sound_menu.c b/apps/menus/sound_menu.c
index d953db93b3..70730a1e5a 100644
--- a/apps/menus/sound_menu.c
+++ b/apps/menus/sound_menu.c
@@ -102,6 +102,10 @@ MENUITEM_SETTING(stereo_width, &global_settings.stereo_width,
102 MENUITEM_SETTING(mdb_shape, &global_settings.mdb_shape, NULL); 102 MENUITEM_SETTING(mdb_shape, &global_settings.mdb_shape, NULL);
103#endif 103#endif
104 104
105#ifdef HAVE_SPEAKER
106 MENUITEM_SETTING(speaker_enabled, &global_settings.speaker_enabled, NULL);
107#endif
108
105 109
106 110
107MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio, 111MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio,
@@ -122,5 +126,8 @@ MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio,
122 ,&loudness,&avc,&superbass,&mdb_enable,&mdb_strength 126 ,&loudness,&avc,&superbass,&mdb_enable,&mdb_strength
123 ,&mdb_harmonics,&mdb_center,&mdb_shape 127 ,&mdb_harmonics,&mdb_center,&mdb_shape
124#endif 128#endif
129#ifdef HAVE_SPEAKER
130 ,&speaker_enabled
131#endif
125 ); 132 );
126 133
diff --git a/apps/settings.c b/apps/settings.c
index 30b056da53..71c29f67c4 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -806,6 +806,10 @@ void settings_apply(bool read_disk)
806 global_settings.peak_meter_clip_hold); 806 global_settings.peak_meter_clip_hold);
807#endif 807#endif
808 808
809#ifdef HAVE_SPEAKER
810 audiohw_enable_speaker(global_settings.speaker_enabled);
811#endif
812
809 if (read_disk) 813 if (read_disk)
810 { 814 {
811 815
diff --git a/apps/settings.h b/apps/settings.h
index 669000ea42..201cd8f772 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -730,6 +730,10 @@ struct user_settings
730 bool accessory_supply; /* 0=off 1=on, accessory power supply for iPod */ 730 bool accessory_supply; /* 0=off 1=on, accessory power supply for iPod */
731#endif 731#endif
732 732
733#ifdef HAVE_SPEAKER
734 bool speaker_enabled;
735#endif
736
733 /* If values are just added to the end, no need to bump plugin API 737 /* If values are just added to the end, no need to bump plugin API
734 version. */ 738 version. */
735 /* new stuff to be added at the end */ 739 /* new stuff to be added at the end */
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 5729cdcf4a..f5b49f3447 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -1458,6 +1458,10 @@ const struct settings_list settings[] = {
1458 qs_load_from_cfg, qs_write_to_cfg, 1458 qs_load_from_cfg, qs_write_to_cfg,
1459 qs_is_changed, qs_set_default), 1459 qs_is_changed, qs_set_default),
1460#endif 1460#endif
1461#ifdef HAVE_SPEAKER
1462 OFFON_SETTING(0, speaker_enabled, LANG_ENABLE_SPEAKER, false, "speaker",
1463 audiohw_enable_speaker),
1464#endif
1461}; 1465};
1462 1466
1463const int nb_settings = sizeof(settings)/sizeof(*settings); 1467const int nb_settings = sizeof(settings)/sizeof(*settings);
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h
index 423b520dc5..e53db7e7b9 100644
--- a/firmware/export/audiohw.h
+++ b/firmware/export/audiohw.h
@@ -305,4 +305,10 @@ void audiohw_set_stereo_width(int val);
305 305
306#endif /* CONFIG_CODEC != SWCODEC */ 306#endif /* CONFIG_CODEC != SWCODEC */
307 307
308#ifdef HAVE_SPEAKER
309
310void audiohw_enable_speaker(bool on);
311
312#endif /* HAVE_SPEAKER */
313
308#endif /* _AUDIOHW_H_ */ 314#endif /* _AUDIOHW_H_ */
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/speaker-onda_vx747.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/speaker-onda_vx747.c
new file mode 100644
index 0000000000..12dd03e8c7
--- /dev/null
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/speaker-onda_vx747.c
@@ -0,0 +1,34 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2009 by Maurus Cuelenaere
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include "jz4740.h"
23#include "audiohw.h"
24
25#define SPEAKER_PIN (32*2 + 27)
26
27void audiohw_enable_speaker(bool on)
28{
29 __gpio_as_output(SPEAKER_PIN);
30 if(on)
31 __gpio_set_pin(SPEAKER_PIN);
32 else
33 __gpio_clear_pin(SPEAKER_PIN);
34}