Subversion Repositories freemyipod

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
881 theseven 1
#include "global.h"
2
#include "soc/s5l87xx/regs.h"
3
#include "sys/util.h"
4
 
5
bool clockgate_get_state(int gate)
6
{
7
    return !(PWRCON(gate >> 5) & (1 << (gate & 0x1f)));
8
}
9
 
10
void clockgate_enable(int gate, bool enable)
11
{
12
    enter_critical_section();
13
    if (enable) PWRCON(gate >> 5) &= ~(1 << (gate & 0x1f));
14
    else PWRCON(gate >> 5) |= 1 << (gate & 0x1f);
15
    leave_critical_section();
16
}