diff options
Diffstat (limited to 'firmware/target/hosted/ypr0/ascodec-target.h')
-rw-r--r-- | firmware/target/hosted/ypr0/ascodec-target.h | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/firmware/target/hosted/ypr0/ascodec-target.h b/firmware/target/hosted/ypr0/ascodec-target.h deleted file mode 100644 index 2274d5f073..0000000000 --- a/firmware/target/hosted/ypr0/ascodec-target.h +++ /dev/null | |||
@@ -1,80 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id: ascodec-target.h 26116 2010-05-17 20:53:25Z funman $ | ||
9 | * | ||
10 | * Module wrapper for AS3543 audio codec, using /dev/afe (afe.ko) of Samsung YP-R0 | ||
11 | * | ||
12 | * Copyright (c) 2011 Lorenzo Miori | ||
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 | #ifndef _ASCODEC_TARGET_H | ||
25 | #define _ASCODEC_TARGET_H | ||
26 | |||
27 | #include "as3514.h" | ||
28 | #include "kernel.h" | ||
29 | #include "adc.h" | ||
30 | #include "ascodec.h" | ||
31 | |||
32 | int ascodec_init(void); | ||
33 | void ascodec_close(void); | ||
34 | int ascodec_write(unsigned int reg, unsigned int value); | ||
35 | int ascodec_read(unsigned int reg); | ||
36 | void ascodec_write_pmu(unsigned int index, unsigned int subreg, unsigned int value); | ||
37 | int ascodec_read_pmu(unsigned int index, unsigned int subreg); | ||
38 | int ascodec_readbytes(unsigned int index, unsigned int len, unsigned char *data); | ||
39 | unsigned short adc_read(int channel); | ||
40 | void ascodec_lock(void); | ||
41 | void ascodec_unlock(void); | ||
42 | |||
43 | static inline bool ascodec_chg_status(void) | ||
44 | { | ||
45 | return ascodec_read(AS3514_IRQ_ENRD0) & CHG_STATUS; | ||
46 | } | ||
47 | |||
48 | static inline bool ascodec_endofch(void) | ||
49 | { | ||
50 | return ascodec_read(AS3514_IRQ_ENRD0) & CHG_ENDOFCH; | ||
51 | } | ||
52 | |||
53 | static inline void ascodec_monitor_endofch(void) | ||
54 | { | ||
55 | ascodec_write(AS3514_IRQ_ENRD0, IRQ_ENDOFCH); | ||
56 | } | ||
57 | |||
58 | static inline void ascodec_wait_adc_finished(void) | ||
59 | { | ||
60 | /* | ||
61 | * FIXME: not implemented | ||
62 | * | ||
63 | * If irqs are not available on the target platform, | ||
64 | * this should be most likely implemented by polling | ||
65 | * AS3514_IRQ_ENRD2 in the same way powermgmt-ascodec.c | ||
66 | * is polling IRQ_ENDOFCH. | ||
67 | */ | ||
68 | } | ||
69 | |||
70 | static inline void ascodec_write_charger(int value) | ||
71 | { | ||
72 | ascodec_write_pmu(AS3543_CHARGER, 1, value); | ||
73 | } | ||
74 | |||
75 | static inline int ascodec_read_charger(void) | ||
76 | { | ||
77 | return ascodec_read_pmu(AS3543_CHARGER, 1); | ||
78 | } | ||
79 | |||
80 | #endif /* !_ASCODEC_TARGET_H */ | ||