summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/gigabeat-s/fmradio-i2c-gigabeat-s.c
diff options
context:
space:
mode:
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.c49
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
27struct 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
36int 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
43int 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