diff options
author | Nils Wallménius <nils@rockbox.org> | 2008-12-09 20:48:04 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2008-12-09 20:48:04 +0000 |
commit | 65f61d6cce4a5d3b52860d38a922b01fcddc70cd (patch) | |
tree | 03f8167279828845dcd4923d8184bc58d0e165da /firmware/target/arm/imx31/gigabeat-s/fmradio-i2c-gigabeat-s.c | |
parent | a13c16271911be641539cace3ea5ea0c1440eeaf (diff) | |
download | rockbox-65f61d6cce4a5d3b52860d38a922b01fcddc70cd.tar.gz rockbox-65f61d6cce4a5d3b52860d38a922b01fcddc70cd.zip |
FS#9609 FM radio support for the Gigabeat S, seeking/scanning is not yet
implemented but manual tuning works nicely. Thanks to Rafaël Carré,
Bertrik Sikken and Robert Menes for suggestions and debugging help.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19372 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/fmradio-i2c-gigabeat-s.c')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/fmradio-i2c-gigabeat-s.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/fmradio-i2c-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/fmradio-i2c-gigabeat-s.c new file mode 100644 index 0000000000..5e5c4853dd --- /dev/null +++ b/firmware/target/arm/imx31/gigabeat-s/fmradio-i2c-gigabeat-s.c | |||
@@ -0,0 +1,49 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * Physical interface of the SI4700 in the Gigabeat S | ||
10 | * | ||
11 | * Copyright (C) 2008 by Nils Wallménius | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License | ||
15 | * as published by the Free Software Foundation; either version 2 | ||
16 | * of the License, or (at your option) any later version. | ||
17 | * | ||
18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
19 | * KIND, either express or implied. | ||
20 | * | ||
21 | ****************************************************************************/ | ||
22 | #include "config.h" | ||
23 | #include "system.h" | ||
24 | #include "i2c-imx31.h" | ||
25 | #include "fmradio_i2c.h" | ||
26 | |||
27 | struct i2c_node si4700_i2c_node = | ||
28 | { | ||
29 | .num = I2C2_NUM, | ||
30 | .ifdr = I2C_IFDR_DIV192, /* 66MHz/.4MHz = 165, closest = 192 = 343750Hz */ | ||
31 | /* Just hard-code for now - scaling may require | ||
32 | * updating */ | ||
33 | .addr = (0x20), | ||
34 | }; | ||
35 | |||
36 | int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count) | ||
37 | { | ||
38 | (void)address; | ||
39 | i2c_write(&si4700_i2c_node, buf, count); | ||
40 | return 0; | ||
41 | } | ||
42 | |||
43 | int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count) | ||
44 | { | ||
45 | (void)address; | ||
46 | i2c_read(&si4700_i2c_node, -1, buf, count); | ||
47 | return 0; | ||
48 | } | ||
49 | |||