FS#11250: Hotkey setting method changed to menu item vs button pres in context menu...
[kugel-rb.git] / firmware / target / arm / ascodec-target.h
blobc87d869ebb85fa31f7e6b35bd86a942527216caf
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Driver for AS3514 audio codec
12 * Copyright (c) 2007 Daniel Ankers
13 * Copyright (c) 2007 Christian Gmeiner
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
23 ****************************************************************************/
25 #ifndef _ASCODEC_TARGET_H
26 #define _ASCODEC_TARGET_H
28 #include "config.h"
30 #ifdef CPU_PP
31 /* TODO: This header is actually portalplayer specific, and should be
32 * moved into an appropriate subdir */
34 #include "as3514.h"
35 #include "i2c-pp.h"
37 static inline int ascodec_write(unsigned int reg, unsigned int value)
39 return pp_i2c_send(AS3514_I2C_ADDR, reg, value);
42 static inline int ascodec_read(unsigned int reg)
44 return i2c_readbyte(AS3514_I2C_ADDR, reg);
47 static inline int ascodec_readbytes(int addr, int len, unsigned char *data)
49 return i2c_readbytes(AS3514_I2C_ADDR, addr, len, data);
52 static inline void ascodec_lock(void)
54 i2c_lock();
57 static inline void ascodec_unlock(void)
59 i2c_unlock();
62 static inline void ascodec_enable_endofch_irq(void)
64 ascodec_write(AS3514_IRQ_ENRD0, IRQ_ENDOFCH);
67 static inline void ascodec_disable_endofch_irq(void)
69 ascodec_write(AS3514_IRQ_ENRD0, 0);
72 static inline void ascodec_wait_adc_finished(void)
75 * FIXME: not implemented
77 * If irqs are not available on the target platform,
78 * this should be most likely implemented by polling
79 * AS3514_IRQ_ENRD2 in the same way powermgmt-ascodec.c
80 * is polling IRQ_ENDOFCH.
84 extern void ascodec_suppressor_on(bool on);
86 #endif /* CPU_PP */
88 #endif /* !_ASCODEC_TARGET_H */