summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r--firmware/target/arm/as3525/as3525-codec.c6
-rw-r--r--firmware/target/arm/as3525/as3525-codec.h27
-rw-r--r--firmware/target/arm/as3525/backlight-e200v2-fuze.c2
-rw-r--r--firmware/target/arm/as3525/power-as3525.c7
-rw-r--r--firmware/target/arm/as3525/system-as3525.c2
5 files changed, 8 insertions, 36 deletions
diff --git a/firmware/target/arm/as3525/as3525-codec.c b/firmware/target/arm/as3525/as3525-codec.c
index 76e5071197..4d8598eaf1 100644
--- a/firmware/target/arm/as3525/as3525-codec.c
+++ b/firmware/target/arm/as3525/as3525-codec.c
@@ -37,11 +37,9 @@
37 interrupt bit 7 is raised and DACNT is not decremented after the transfer. 37 interrupt bit 7 is raised and DACNT is not decremented after the transfer.
38 */ 38 */
39 39
40#include "as3525-codec.h" 40#include "ascodec-target.h"
41#include "as3525.h" 41#include "as3525.h"
42 42
43#define AUDIO_I2C_ADDR 0x46
44
45#define I2C2_DATA *((volatile unsigned int *)(I2C_AUDIO_BASE + 0x00)) 43#define I2C2_DATA *((volatile unsigned int *)(I2C_AUDIO_BASE + 0x00))
46#define I2C2_SLAD0 *((volatile unsigned int *)(I2C_AUDIO_BASE + 0x04)) 44#define I2C2_SLAD0 *((volatile unsigned int *)(I2C_AUDIO_BASE + 0x04))
47#define I2C2_CNTRL *((volatile unsigned int *)(I2C_AUDIO_BASE + 0x0C)) 45#define I2C2_CNTRL *((volatile unsigned int *)(I2C_AUDIO_BASE + 0x0C))
@@ -72,7 +70,7 @@ void ascodec_init(void)
72 I2C2_CPSR1 = 0; /* MSB */ 70 I2C2_CPSR1 = 0; /* MSB */
73 71
74 /* set i2c slave address of codec part */ 72 /* set i2c slave address of codec part */
75 I2C2_SLAD0 = AUDIO_I2C_ADDR << 1; 73 I2C2_SLAD0 = AS3514_I2C_ADDR << 1;
76 74
77 I2C2_CNTRL = 0x51; 75 I2C2_CNTRL = 0x51;
78} 76}
diff --git a/firmware/target/arm/as3525/as3525-codec.h b/firmware/target/arm/as3525/as3525-codec.h
deleted file mode 100644
index 6e6145bb77..0000000000
--- a/firmware/target/arm/as3525/as3525-codec.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 by Bertrik Sikken
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
22void ascodec_init(void);
23
24int ascodec_write(int index, int value);
25int ascodec_read(int index);
26
27
diff --git a/firmware/target/arm/as3525/backlight-e200v2-fuze.c b/firmware/target/arm/as3525/backlight-e200v2-fuze.c
index 9bc78a4118..2b724b34a3 100644
--- a/firmware/target/arm/as3525/backlight-e200v2-fuze.c
+++ b/firmware/target/arm/as3525/backlight-e200v2-fuze.c
@@ -23,7 +23,7 @@
23#include "system.h" 23#include "system.h"
24#include "lcd.h" 24#include "lcd.h"
25#include "backlight.h" 25#include "backlight.h"
26#include "as3525-codec.h" 26#include "ascodec-target.h"
27#include "as3514.h" 27#include "as3514.h"
28 28
29static unsigned short backlight_brightness = DEFAULT_BRIGHTNESS_SETTING; 29static unsigned short backlight_brightness = DEFAULT_BRIGHTNESS_SETTING;
diff --git a/firmware/target/arm/as3525/power-as3525.c b/firmware/target/arm/as3525/power-as3525.c
index 53b95e354d..13330aa465 100644
--- a/firmware/target/arm/as3525/power-as3525.c
+++ b/firmware/target/arm/as3525/power-as3525.c
@@ -20,13 +20,14 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include "config.h" 22#include "config.h"
23#include "as3525-codec.h" 23#include "ascodec-target.h"
24#include "as3514.h"
24#include <stdbool.h> 25#include <stdbool.h>
25 26
26void power_off(void) 27void power_off(void)
27{ 28{
28 /* clear bit 0 of system register */ 29 /* clear bit 0 of system register */
29 ascodec_write(0x20, ascodec_read(0x20) & ~1); 30 ascodec_write(AS3514_SYSTEM, ascodec_read(AS3514_SYSTEM) & ~1);
30 31
31 /* TODO : turn off peripherals properly ? */ 32 /* TODO : turn off peripherals properly ? */
32 33
@@ -40,7 +41,7 @@ void power_init(void)
40#if CONFIG_CHARGING 41#if CONFIG_CHARGING
41bool charger_inserted(void) 42bool charger_inserted(void)
42{ 43{
43 if(ascodec_read(0x25) & (1<<5)) 44 if(ascodec_read(AS3514_IRQ_ENRD0) & (1<<5))
44 return true; 45 return true;
45 else 46 else
46 return false; 47 return false;
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c
index 07832f1a49..7653985d19 100644
--- a/firmware/target/arm/as3525/system-as3525.c
+++ b/firmware/target/arm/as3525/system-as3525.c
@@ -23,7 +23,7 @@
23#include "kernel.h" 23#include "kernel.h"
24#include "system.h" 24#include "system.h"
25#include "panic.h" 25#include "panic.h"
26#include "as3525-codec.h" 26#include "ascodec-target.h"
27 27
28#define default_interrupt(name) \ 28#define default_interrupt(name) \
29 extern __attribute__((weak,alias("UIRQ"))) void name (void) 29 extern __attribute__((weak,alias("UIRQ"))) void name (void)