summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-05-19 13:48:43 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2012-05-19 16:10:52 +0200
commitb422be9bd0ddf517c6e7b804cb161f843939b1e0 (patch)
tree0cbf796f6e2f69a3792a9057655389686bdeb2e6
parentdeb61e0622f58b58b6f61d1822054df04cf09456 (diff)
downloadrockbox-b422be9bd0ddf517c6e7b804cb161f843939b1e0.tar.gz
rockbox-b422be9bd0ddf517c6e7b804cb161f843939b1e0.zip
Add stub STFM1000 tuner driver
Change-Id: I7f82f7b8971de75c92f84d12aaddccc50f3e47b1
-rw-r--r--firmware/drivers/tuner/stfm1000.c49
-rw-r--r--firmware/export/config.h2
-rw-r--r--firmware/export/stfm1000.h42
-rw-r--r--firmware/export/tuner.h5
-rw-r--r--firmware/tuner.c6
5 files changed, 104 insertions, 0 deletions
diff --git a/firmware/drivers/tuner/stfm1000.c b/firmware/drivers/tuner/stfm1000.c
new file mode 100644
index 0000000000..ae96993285
--- /dev/null
+++ b/firmware/drivers/tuner/stfm1000.c
@@ -0,0 +1,49 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2012 by amaury Pouly
11 *
12 * Based on Rockbox iriver bootloader by Linus Nielsen Feltzing
13 * and the ipodlinux bootloader by Daniel Palffy and Bernard Leach
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 ****************************************************************************/
24#include "config.h"
25#include "system.h"
26#include <string.h>
27#include "kernel.h"
28#include "power.h"
29#include "tuner.h" /* tuner abstraction interface */
30#include "fmradio.h"
31#include "fmradio_i2c.h" /* physical interface driver */
32#include "stfm1000.h"
33
34void stfm1000_init(void)
35{
36}
37
38int stfm1000_set(int setting, int value)
39{
40 (void) setting;
41 (void) value;
42 return -1;
43}
44
45int stfm1000_get(int setting)
46{
47 (void) setting;
48 return -1;
49} \ No newline at end of file
diff --git a/firmware/export/config.h b/firmware/export/config.h
index edd3bb2ba5..e17b152e39 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -42,6 +42,7 @@
42#define LV240000 0x20 /* Sanyo */ 42#define LV240000 0x20 /* Sanyo */
43#define IPOD_REMOTE_TUNER 0x40 /* Apple */ 43#define IPOD_REMOTE_TUNER 0x40 /* Apple */
44#define RDA5802 0x80 /* RDA Microelectronics */ 44#define RDA5802 0x80 /* RDA Microelectronics */
45#define STFM1000 0x100 /* Sigmatel */
45 46
46/* CONFIG_CODEC */ 47/* CONFIG_CODEC */
47#define MAS3587F 3587 48#define MAS3587F 3587
@@ -294,6 +295,7 @@ Lyre prototype 1 */
294#define NAND_SAMSUNG 3 295#define NAND_SAMSUNG 3
295#define NAND_CC 4 /* ChinaChip */ 296#define NAND_CC 4 /* ChinaChip */
296#define NAND_RK27XX 5 297#define NAND_RK27XX 5
298#define NAND_IMX233 6
297 299
298/* CONFIG_RTC */ 300/* CONFIG_RTC */
299#define RTC_M41ST84W 1 /* Archos Recorder */ 301#define RTC_M41ST84W 1 /* Archos Recorder */
diff --git a/firmware/export/stfm1000.h b/firmware/export/stfm1000.h
new file mode 100644
index 0000000000..2143a81ad4
--- /dev/null
+++ b/firmware/export/stfm1000.h
@@ -0,0 +1,42 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * $Id$
10 *
11 * Tuner header for the STFM1000
12 *
13 * Copyright (C) 2012 Amaury Pouly
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 ****************************************************************************/
24
25#ifndef __STFM1000__
26#define __STFM1000__
27#include <stdint.h>
28
29#define HAVE_RADIO_REGION
30#define HAVE_RADIO_RSSI
31
32bool stfm1000_detect(void);
33void stfm1000_init(void);
34int stfm1000_set(int setting, int value);
35int stfm1000_get(int setting);
36
37#ifndef CONFIG_TUNER_MULTI
38#define tuner_set stfm1000_set
39#define tuner_get stfm1000_get
40#endif
41
42#endif /* __STFM1000__ */
diff --git a/firmware/export/tuner.h b/firmware/export/tuner.h
index 694da7cc6c..050bbd0f33 100644
--- a/firmware/export/tuner.h
+++ b/firmware/export/tuner.h
@@ -139,6 +139,11 @@ extern int (*tuner_get)(int setting);
139#include "ipod_remote_tuner.h" 139#include "ipod_remote_tuner.h"
140#endif 140#endif
141 141
142/* SigmaTel/Freescale STFM1000 */
143#if (CONFIG_TUNER & STFM1000)
144#include "stfm1000.h"
145#endif
146
142#if defined(SIMULATOR) 147#if defined(SIMULATOR)
143#undef tuner_set 148#undef tuner_set
144int tuner_set(int setting, int value); 149int tuner_set(int setting, int value);
diff --git a/firmware/tuner.c b/firmware/tuner.c
index 278584264b..c9c5bc0639 100644
--- a/firmware/tuner.c
+++ b/firmware/tuner.c
@@ -94,6 +94,12 @@ void tuner_init(void)
94 rda5802_get, 94 rda5802_get,
95 rda5802_init()) 95 rda5802_init())
96 #endif 96 #endif
97 #if (CONFIG_TUNER & STFM1000)
98 TUNER_TYPE_CASE(STFM1000,
99 stfm1000_set,
100 stfm1000_get,
101 stfm1000_init())
102 #endif
97 } 103 }
98} 104}
99#endif /* SIMULATOR */ 105#endif /* SIMULATOR */