diff options
Diffstat (limited to 'firmware/target/arm/s5l8702/ipod6g/cscodec-6g.c')
-rw-r--r-- | firmware/target/arm/s5l8702/ipod6g/cscodec-6g.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/firmware/target/arm/s5l8702/ipod6g/cscodec-6g.c b/firmware/target/arm/s5l8702/ipod6g/cscodec-6g.c new file mode 100644 index 0000000000..41531de4e3 --- /dev/null +++ b/firmware/target/arm/s5l8702/ipod6g/cscodec-6g.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id: wmcodec-s5l8700.c 22025 2009-07-25 00:49:13Z dave $ | ||
9 | * | ||
10 | * S5L8702-specific code for Cirrus codecs | ||
11 | * | ||
12 | * Copyright (c) 2010 Michael Sparmann | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or | ||
15 | * modify it under the terms of the GNU General Public License | ||
16 | * as published by the Free Software Foundation; either version 2 | ||
17 | * of the License, or (at your option) any later version. | ||
18 | * | ||
19 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
20 | * KIND, either express or implied. | ||
21 | * | ||
22 | ****************************************************************************/ | ||
23 | |||
24 | #include "system.h" | ||
25 | #include "audiohw.h" | ||
26 | #include "i2c-s5l8702.h" | ||
27 | #include "s5l8702.h" | ||
28 | #include "cscodec.h" | ||
29 | |||
30 | void audiohw_init(void) | ||
31 | { | ||
32 | #ifdef HAVE_CS42L55 | ||
33 | audiohw_preinit(); | ||
34 | #endif | ||
35 | } | ||
36 | |||
37 | unsigned char cscodec_read(int reg) | ||
38 | { | ||
39 | unsigned char data; | ||
40 | i2c_read(0, 0x94, reg, 1, &data); | ||
41 | return data; | ||
42 | } | ||
43 | |||
44 | void cscodec_write(int reg, unsigned char data) | ||
45 | { | ||
46 | i2c_write(0, 0x94, reg, 1, &data); | ||
47 | } | ||
48 | |||
49 | void cscodec_power(bool state) | ||
50 | { | ||
51 | (void)state; //TODO: Figure out which LDO this is | ||
52 | } | ||
53 | |||
54 | void cscodec_reset(bool state) | ||
55 | { | ||
56 | if (state) PDAT(3) &= ~8; | ||
57 | else PDAT(3) |= 8; | ||
58 | } | ||
59 | |||
60 | void cscodec_clock(bool state) | ||
61 | { | ||
62 | if (state) CLKCON3 &= ~0xffff; | ||
63 | else CLKCON3 |= 0x8000; | ||
64 | } | ||