summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/audiohw.h13
-rw-r--r--firmware/export/config-gigabeat-s.h6
-rwxr-xr-xfirmware/export/imx31l.h108
-rw-r--r--firmware/export/wm8978.h17
4 files changed, 131 insertions, 13 deletions
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h
index 73c50b8412..190fcca7a8 100644
--- a/firmware/export/audiohw.h
+++ b/firmware/export/audiohw.h
@@ -27,7 +27,9 @@
27#include "uda1380.h" 27#include "uda1380.h"
28#elif defined(HAVE_WM8751) 28#elif defined(HAVE_WM8751)
29#include "wm8751.h" 29#include "wm8751.h"
30#elif defined(HAVE_WM8975) || defined(HAVE_WM8978) 30#elif defined(HAVE_WM8978)
31#include "wm8978.h"
32#elif defined(HAVE_WM8975)
31#include "wm8975.h" 33#include "wm8975.h"
32#elif defined(HAVE_WM8985) 34#elif defined(HAVE_WM8985)
33#include "wm8985.h" 35#include "wm8985.h"
@@ -109,7 +111,14 @@ extern const struct sound_settings_info audiohw_settings[];
109void audiohw_init(void); 111void audiohw_init(void);
110 112
111/** 113/**
112 * Do some stuff (codec related) after audiohw_init. 114 * Do initial audio codec setup.
115 */
116void audiohw_preinit(void);
117
118/**
119 * Do some stuff (codec related) after audiohw_init that needs to be
120 * delayed such as enabling outputs to prevent popping. This lets
121 * other inits in the system complete in the meantime.
113 */ 122 */
114void audiohw_postinit(void); 123void audiohw_postinit(void);
115 124
diff --git a/firmware/export/config-gigabeat-s.h b/firmware/export/config-gigabeat-s.h
index 6eb57b219c..3e36e0c7ea 100644
--- a/firmware/export/config-gigabeat-s.h
+++ b/firmware/export/config-gigabeat-s.h
@@ -66,10 +66,9 @@
66/* The number of bytes reserved for loadable plugins */ 66/* The number of bytes reserved for loadable plugins */
67#define PLUGIN_BUFFER_SIZE 0x80000 67#define PLUGIN_BUFFER_SIZE 0x80000
68 68
69/* Define this if you have the WM8975 audio codec */ 69/* Define this if you have the WM8978 audio codec */
70#define HAVE_WM8978 70#define HAVE_WM8978
71 71
72
73#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | \ 72#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | \
74 SAMPR_CAP_11) 73 SAMPR_CAP_11)
75 74
@@ -85,8 +84,9 @@
85/* Define this if you want to use coldfire's i2c interface */ 84/* Define this if you want to use coldfire's i2c interface */
86#define CONFIG_I2C I2C_IMX31L 85#define CONFIG_I2C I2C_IMX31L
87 86
88/* Define the bitmask of serial interface modules (CSPI) used */ 87/* Define the bitmask of modules used */
89#define SPI_MODULE_MASK (USE_CSPI2_MODULE) 88#define SPI_MODULE_MASK (USE_CSPI2_MODULE)
89#define I2C_MODULE_MASK (USE_I2C1_MODULE)
90 90
91/* Define this if target has an additional number of threads specific to it */ 91/* Define this if target has an additional number of threads specific to it */
92#define TARGET_EXTRA_THREADS 1 92#define TARGET_EXTRA_THREADS 1
diff --git a/firmware/export/imx31l.h b/firmware/export/imx31l.h
index aea4b9e151..777fa6981c 100755
--- a/firmware/export/imx31l.h
+++ b/firmware/export/imx31l.h
@@ -49,7 +49,7 @@
49#define ETB_SLOT4_BASE_ADDR 0x43F10000 49#define ETB_SLOT4_BASE_ADDR 0x43F10000
50#define ETB_SLOT5_BASE_ADDR 0x43F14000 50#define ETB_SLOT5_BASE_ADDR 0x43F14000
51#define ECT_CTIO_BASE_ADDR 0x43F18000 51#define ECT_CTIO_BASE_ADDR 0x43F18000
52#define I2C_BASE_ADDR 0x43F80000 52#define I2C1_BASE_ADDR 0x43F80000
53#define I2C3_BASE_ADDR 0x43F84000 53#define I2C3_BASE_ADDR 0x43F84000
54#define OTG_BASE_ADDR 0x43F88000 54#define OTG_BASE_ADDR 0x43F88000
55#define ATA_BASE_ADDR 0x43F8C000 55#define ATA_BASE_ADDR 0x43F8C000
@@ -628,6 +628,112 @@
628#define CSPI_TESTREG_SWAP (1 << 15) 628#define CSPI_TESTREG_SWAP (1 << 15)
629#define CSPI_TESTREG_LBC (1 << 14) 629#define CSPI_TESTREG_LBC (1 << 14)
630 630
631/* I2C */
632#define I2C_IADR1 (*(REG16_PTR_T)(I2C1_BASE_ADDR+0x0))
633#define I2C_IFDR1 (*(REG16_PTR_T)(I2C1_BASE_ADDR+0x4))
634#define I2C_I2CR1 (*(REG16_PTR_T)(I2C1_BASE_ADDR+0x8))
635#define I2C_I2SR1 (*(REG16_PTR_T)(I2C1_BASE_ADDR+0xC))
636#define I2C_I2DR1 (*(REG16_PTR_T)(I2C1_BASE_ADDR+0x10))
637
638#define I2C_IADR2 (*(REG16_PTR_T)(I2C2_BASE_ADDR+0x0))
639#define I2C_IFDR2 (*(REG16_PTR_T)(I2C2_BASE_ADDR+0x4))
640#define I2C_I2CR2 (*(REG16_PTR_T)(I2C2_BASE_ADDR+0x8))
641#define I2C_I2SR2 (*(REG16_PTR_T)(I2C2_BASE_ADDR+0xC))
642#define I2C_I2DR2 (*(REG16_PTR_T)(I2C2_BASE_ADDR+0x10))
643
644#define I2C_IADR3 (*(REG16_PTR_T)(I2C3_BASE_ADDR+0x0))
645#define I2C_IFDR3 (*(REG16_PTR_T)(I2C3_BASE_ADDR+0x4))
646#define I2C_I2CR3 (*(REG16_PTR_T)(I2C3_BASE_ADDR+0x8))
647#define I2C_I2SR3 (*(REG16_PTR_T)(I2C3_BASE_ADDR+0xC))
648#define I2C_I2DR3 (*(REG16_PTR_T)(I2C3_BASE_ADDR+0x10))
649
650 /* IADR - [7:1] Address */
651
652 /* IFDR */
653#define I2C_IFDR_DIV30 0x00
654#define I2C_IFDR_DIV32 0x01
655#define I2C_IFDR_DIV36 0x02
656#define I2C_IFDR_DIV42 0x03
657#define I2C_IFDR_DIV48 0x04
658#define I2C_IFDR_DIV52 0x05
659#define I2C_IFDR_DIV60 0x06
660#define I2C_IFDR_DIV72 0x07
661#define I2C_IFDR_DIV80 0x08
662#define I2C_IFDR_DIV88 0x09
663#define I2C_IFDR_DIV104 0x0a
664#define I2C_IFDR_DIV128 0x0b
665#define I2C_IFDR_DIV144 0x0c
666#define I2C_IFDR_DIV160 0x0d
667#define I2C_IFDR_DIV192 0x0e
668#define I2C_IFDR_DIV240 0x0f
669#define I2C_IFDR_DIV288 0x10
670#define I2C_IFDR_DIV320 0x11
671#define I2C_IFDR_DIV384 0x12
672#define I2C_IFDR_DIV480 0x13
673#define I2C_IFDR_DIV576 0x14
674#define I2C_IFDR_DIV640 0x15
675#define I2C_IFDR_DIV768 0x16
676#define I2C_IFDR_DIV960 0x17
677#define I2C_IFDR_DIV1152 0x18
678#define I2C_IFDR_DIV1280 0x19
679#define I2C_IFDR_DIV1536 0x1a
680#define I2C_IFDR_DIV1920 0x1b
681#define I2C_IFDR_DIV2304 0x1c
682#define I2C_IFDR_DIV2560 0x1d
683#define I2C_IFDR_DIV3072 0x1e
684#define I2C_IFDR_DIV3840 0x1f
685#define I2C_IFDR_DIV22 0x20
686#define I2C_IFDR_DIV24 0x21
687#define I2C_IFDR_DIV26 0x22
688#define I2C_IFDR_DIV28 0x23
689#define I2C_IFDR_DIV32_2 0x24
690#define I2C_IFDR_DIV36_2 0x25
691#define I2C_IFDR_DIV40 0x26
692#define I2C_IFDR_DIV44 0x27
693#define I2C_IFDR_DIV48_2 0x28
694#define I2C_IFDR_DIV56 0x29
695#define I2C_IFDR_DIV64 0x2a
696#define I2C_IFDR_DIV72_2 0x2b
697#define I2C_IFDR_DIV80_2 0x2c
698#define I2C_IFDR_DIV96 0x2d
699#define I2C_IFDR_DIV112 0x2e
700#define I2C_IFDR_DIV128_2 0x2f
701#define I2C_IFDR_DIV160_2 0x30
702#define I2C_IFDR_DIV192_2 0x31
703#define I2C_IFDR_DIV224 0x32
704#define I2C_IFDR_DIV256 0x33
705#define I2C_IFDR_DIV320_2 0x34
706#define I2C_IFDR_DIV384_2 0x35
707#define I2C_IFDR_DIV448 0x36
708#define I2C_IFDR_DIV512 0x37
709#define I2C_IFDR_DIV640_2 0x38
710#define I2C_IFDR_DIV768_2 0x39
711#define I2C_IFDR_DIV896 0x3a
712#define I2C_IFDR_DIV1024 0x3b
713#define I2C_IFDR_DIV1280_2 0x3c
714#define I2C_IFDR_DIV1536_2 0x3d
715#define I2C_IFDR_DIV1792 0x3e
716#define I2C_IFDR_DIV2048 0x3f
717
718 /* I2CR */
719#define I2C_I2CR_IEN (1 << 7)
720#define I2C_I2CR_IIEN (1 << 6)
721#define I2C_I2CR_MSTA (1 << 5)
722#define I2C_I2CR_MTX (1 << 4)
723#define I2C_I2CR_TXAK (1 << 3)
724#define I2C_I2CR_RSATA (1 << 2)
725
726 /* I2SR */
727#define I2C_I2SR_ICF (1 << 7)
728#define I2C_I2SR_IAAS (1 << 6)
729#define I2C_I2SR_IBB (1 << 5)
730#define I2C_I2SR_IAL (1 << 4)
731#define I2C_I2SR_SRW (1 << 2)
732#define I2C_I2SR_IIF (1 << 1)
733#define I2C_I2SR_RXAK (1 << 0)
734
735 /* I2DR - [7:0] Data */
736
631/* RTC */ 737/* RTC */
632#define RTC_HOURMIN (*(REG32_PTR_T)(RTC_BASE_ADDR+0x00)) 738#define RTC_HOURMIN (*(REG32_PTR_T)(RTC_BASE_ADDR+0x00))
633#define RTC_SECONDS (*(REG32_PTR_T)(RTC_BASE_ADDR+0x04)) 739#define RTC_SECONDS (*(REG32_PTR_T)(RTC_BASE_ADDR+0x04))
diff --git a/firmware/export/wm8978.h b/firmware/export/wm8978.h
index 3a1eb627df..aca1250665 100644
--- a/firmware/export/wm8978.h
+++ b/firmware/export/wm8978.h
@@ -21,6 +21,9 @@
21#ifndef _WM8978_H 21#ifndef _WM8978_H
22#define _WM8978_H 22#define _WM8978_H
23 23
24#define VOLUME_MIN -570
25#define VOLUME_MAX 60
26
24#define WM8978_I2C_ADDR 0x34 27#define WM8978_I2C_ADDR 0x34
25 28
26/* Registers */ 29/* Registers */
@@ -142,7 +145,7 @@
142 #define WM8978_DAC_COMP_U_LAW (2 << 3) 145 #define WM8978_DAC_COMP_U_LAW (2 << 3)
143 #define WM8978_DAC_COMP_A_LAW (3 << 3) 146 #define WM8978_DAC_COMP_A_LAW (3 << 3)
144#define WM8978_ADC_COMP (3 << 1) 147#define WM8978_ADC_COMP (3 << 1)
145 #define WM8978_DAC_COMP_OFF (0 << 1) 148 #define WM8978_ADC_COMP_OFF (0 << 1)
146 #define WM8978_ADC_COMP_U_LAW (2 << 1) 149 #define WM8978_ADC_COMP_U_LAW (2 << 1)
147 #define WM8978_ADC_COMP_A_LAW (3 << 1) 150 #define WM8978_ADC_COMP_A_LAW (3 << 1)
148#define WM8978_LOOPBACK (1 << 0) 151#define WM8978_LOOPBACK (1 << 0)
@@ -159,12 +162,12 @@
159 #define WM8978_MCLKDIV_8 (6 << 5) 162 #define WM8978_MCLKDIV_8 (6 << 5)
160 #define WM8978_MCLKDIV_12 (7 << 5) 163 #define WM8978_MCLKDIV_12 (7 << 5)
161#define WM8978_BCLKDIV (7 << 2) 164#define WM8978_BCLKDIV (7 << 2)
162 #define WM8978_MCLKDIV_1 (0 << 2) 165 #define WM8978_BCLKDIV_1 (0 << 2)
163 #define WM8978_MCLKDIV_2 (1 << 2) 166 #define WM8978_BCLKDIV_2 (1 << 2)
164 #define WM8978_MCLKDIV_4 (2 << 2) 167 #define WM8978_BCLKDIV_4 (2 << 2)
165 #define WM8978_MCLKDIV_8 (3 << 2) 168 #define WM8978_BCLKDIV_8 (3 << 2)
166 #define WM8978_MCLKDIV_16 (4 << 2) 169 #define WM8978_BCLKDIV_16 (4 << 2)
167 #define WM8978_MCLKDIV_32 (5 << 2) 170 #define WM8978_BCLKDIV_32 (5 << 2)
168#define WM8978_MS (1 << 0) 171#define WM8978_MS (1 << 0)
169 172
170/* WM8978_ADDITIONAL_CTRL (0x07) */ 173/* WM8978_ADDITIONAL_CTRL (0x07) */