summaryrefslogtreecommitdiff
path: root/firmware/export/wm8740.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/wm8740.h')
-rw-r--r--firmware/export/wm8740.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/firmware/export/wm8740.h b/firmware/export/wm8740.h
new file mode 100644
index 0000000000..ff27a7e41e
--- /dev/null
+++ b/firmware/export/wm8740.h
@@ -0,0 +1,83 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2016 by Roman Stolyarov
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _WM8740_H
23#define _WM8740_H
24
25#define WM8740_VOLUME_MIN -1270
26#define WM8740_VOLUME_MAX 0
27
28#define AUDIOHW_CAPS (FILTER_ROLL_OFF_CAP)
29AUDIOHW_SETTING(VOLUME, "dB", 0, 1, WM8740_VOLUME_MIN/10, WM8740_VOLUME_MAX/10, 0)
30AUDIOHW_SETTING(FILTER_ROLL_OFF, "", 0, 1, 0, 1, 0)
31
32#define WM8740_REG0 0x0000
33#define WM8740_REG1 0x0200
34#define WM8740_REG2 0x0400
35#define WM8740_REG3 0x0600
36#define WM8740_REG4 0x0C00
37
38/**
39 * Register #0
40 */
41#define WM8740_LDL (1<<8)
42
43/**
44 * Register #1
45 */
46#define WM8740_LDR (1<<8)
47
48/**
49 * Register #2
50 */
51#define WM8740_MUT (1<<0)
52#define WM8740_DEM (1<<1)
53#define WM8740_OPE (1<<2)
54#define WM8740_IW0 (1<<3)
55#define WM8740_IW1 (1<<4)
56
57/**
58 * Register #3
59 */
60#define WM8740_I2S (1<<0)
61#define WM8740_LRP (1<<1)
62#define WM8740_ATC (1<<2)
63#define WM8740_SR0 (1<<3)
64#define WM8740_REV (1<<4)
65#define WM8740_SF0 (1<<6)
66#define WM8740_SF1 (1<<7)
67#define WM8740_IZD (1<<8)
68
69/**
70 * Register #4
71 */
72#define WM8740_DIFF0 (1<<4)
73#define WM8740_DIFF1 (1<<5)
74#define WM8740_CDD (1<<6)
75
76void audiohw_mute(void);
77void audiohw_unmute(void);
78
79void wm8740_set_ml(const int);
80void wm8740_set_mc(const int);
81void wm8740_set_md(const int);
82
83#endif