summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s5l8702/ipod6g/cscodec-6g.c
diff options
context:
space:
mode:
authorCástor Muñoz <cmvidal@gmail.com>2017-03-03 22:46:57 +0100
committerCástor Muñoz <cmvidal@gmail.com>2017-03-03 22:50:38 +0100
commit1ba5ef716d37a9fe7f0863caed2fab8570b2c7c4 (patch)
tree2e209052bc802183b73a705f77ebc552250c9353 /firmware/target/arm/s5l8702/ipod6g/cscodec-6g.c
parent8ff1b6b6033aad55fadf076f066da5d8b7d2e631 (diff)
downloadrockbox-1ba5ef716d37a9fe7f0863caed2fab8570b2c7c4.tar.gz
rockbox-1ba5ef716d37a9fe7f0863caed2fab8570b2c7c4.zip
ipod6g: rename some target files
As preparation to add new targets to the s5l8702 directory, rename files as: s5l8702/ipod6g/*-ipod6g.c -> s5l8702/ipod6g/*-6g.c Change-Id: I0cd03d6bcf39b2aa198235f9014cb6948bbafcd5
Diffstat (limited to 'firmware/target/arm/s5l8702/ipod6g/cscodec-6g.c')
-rw-r--r--firmware/target/arm/s5l8702/ipod6g/cscodec-6g.c64
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
30void audiohw_init(void)
31{
32#ifdef HAVE_CS42L55
33 audiohw_preinit();
34#endif
35}
36
37unsigned char cscodec_read(int reg)
38{
39 unsigned char data;
40 i2c_read(0, 0x94, reg, 1, &data);
41 return data;
42}
43
44void cscodec_write(int reg, unsigned char data)
45{
46 i2c_write(0, 0x94, reg, 1, &data);
47}
48
49void cscodec_power(bool state)
50{
51 (void)state; //TODO: Figure out which LDO this is
52}
53
54void cscodec_reset(bool state)
55{
56 if (state) PDAT(3) &= ~8;
57 else PDAT(3) |= 8;
58}
59
60void cscodec_clock(bool state)
61{
62 if (state) CLKCON3 &= ~0xffff;
63 else CLKCON3 |= 0x8000;
64}