2008-05-21 03:55:17 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 by Daniel Ankers
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* 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.
|
2008-05-21 03:55:17 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "system.h"
|
|
|
|
#include "cpu.h"
|
|
|
|
#include "i2c-pp.h"
|
|
|
|
#include "tuner.h"
|
2008-11-10 23:20:19 +00:00
|
|
|
#include "ascodec.h"
|
2008-05-21 03:55:17 +00:00
|
|
|
#include "as3514.h"
|
|
|
|
#include "power.h"
|
|
|
|
|
|
|
|
void power_init(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void power_off(void)
|
|
|
|
{
|
|
|
|
char byte;
|
|
|
|
|
|
|
|
/* Send shutdown command to PMU */
|
2008-10-31 00:16:42 +00:00
|
|
|
byte = ascodec_read(AS3514_SYSTEM);
|
2008-05-21 03:55:17 +00:00
|
|
|
byte &= ~0x1;
|
2008-10-31 00:16:42 +00:00
|
|
|
ascodec_write(AS3514_SYSTEM, byte);
|
2008-05-21 03:55:17 +00:00
|
|
|
|
|
|
|
/* Stop interrupts on both cores */
|
|
|
|
disable_interrupt(IRQ_FIQ_STATUS);
|
2008-06-03 05:08:24 +00:00
|
|
|
COP_INT_DIS = -1;
|
|
|
|
CPU_INT_DIS = -1;
|
2008-05-21 03:55:17 +00:00
|
|
|
|
|
|
|
/* Halt everything and wait for device to power off */
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
COP_CTL = 0x40000000;
|
|
|
|
CPU_CTL = 0x40000000;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-03 19:54:25 +00:00
|
|
|
unsigned int power_input_status(void)
|
2008-05-21 03:55:17 +00:00
|
|
|
{
|
2008-12-03 19:54:25 +00:00
|
|
|
return POWER_INPUT_NONE;
|
2008-05-21 03:55:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ide_power_enable(bool on)
|
|
|
|
{
|
|
|
|
(void)on;
|
|
|
|
}
|