mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Merge target/arm/as3525/as3525-codec.h into target/arm/ascodec-target.h
The AMS Sansa use the same AS3514 registers (except USB_UTIL which was added) Use the register defines in AMS Sansa code instead of hardcoded values git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19073 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
81b2ffb63e
commit
22c450a7f4
7 changed files with 20 additions and 44 deletions
|
|
@ -37,11 +37,9 @@
|
|||
interrupt bit 7 is raised and DACNT is not decremented after the transfer.
|
||||
*/
|
||||
|
||||
#include "as3525-codec.h"
|
||||
#include "ascodec-target.h"
|
||||
#include "as3525.h"
|
||||
|
||||
#define AUDIO_I2C_ADDR 0x46
|
||||
|
||||
#define I2C2_DATA *((volatile unsigned int *)(I2C_AUDIO_BASE + 0x00))
|
||||
#define I2C2_SLAD0 *((volatile unsigned int *)(I2C_AUDIO_BASE + 0x04))
|
||||
#define I2C2_CNTRL *((volatile unsigned int *)(I2C_AUDIO_BASE + 0x0C))
|
||||
|
|
@ -72,7 +70,7 @@ void ascodec_init(void)
|
|||
I2C2_CPSR1 = 0; /* MSB */
|
||||
|
||||
/* set i2c slave address of codec part */
|
||||
I2C2_SLAD0 = AUDIO_I2C_ADDR << 1;
|
||||
I2C2_SLAD0 = AS3514_I2C_ADDR << 1;
|
||||
|
||||
I2C2_CNTRL = 0x51;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2008 by Bertrik Sikken
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void ascodec_init(void);
|
||||
|
||||
int ascodec_write(int index, int value);
|
||||
int ascodec_read(int index);
|
||||
|
||||
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
#include "system.h"
|
||||
#include "lcd.h"
|
||||
#include "backlight.h"
|
||||
#include "as3525-codec.h"
|
||||
#include "ascodec-target.h"
|
||||
#include "as3514.h"
|
||||
|
||||
static unsigned short backlight_brightness = DEFAULT_BRIGHTNESS_SETTING;
|
||||
|
|
|
|||
|
|
@ -20,13 +20,14 @@
|
|||
****************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
#include "as3525-codec.h"
|
||||
#include "ascodec-target.h"
|
||||
#include "as3514.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
void power_off(void)
|
||||
{
|
||||
/* clear bit 0 of system register */
|
||||
ascodec_write(0x20, ascodec_read(0x20) & ~1);
|
||||
ascodec_write(AS3514_SYSTEM, ascodec_read(AS3514_SYSTEM) & ~1);
|
||||
|
||||
/* TODO : turn off peripherals properly ? */
|
||||
|
||||
|
|
@ -40,7 +41,7 @@ void power_init(void)
|
|||
#if CONFIG_CHARGING
|
||||
bool charger_inserted(void)
|
||||
{
|
||||
if(ascodec_read(0x25) & (1<<5))
|
||||
if(ascodec_read(AS3514_IRQ_ENRD0) & (1<<5))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include "kernel.h"
|
||||
#include "system.h"
|
||||
#include "panic.h"
|
||||
#include "as3525-codec.h"
|
||||
#include "ascodec-target.h"
|
||||
|
||||
#define default_interrupt(name) \
|
||||
extern __attribute__((weak,alias("UIRQ"))) void name (void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue