#include <linux/kernel.h>
#include <linux/regulator/driver.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <linux/module.h>
#include "dbx500-prcmu.h"
static int power_state_active_cnt;
static DEFINE_SPINLOCK(power_state_active_lock);
void power_state_active_enable(void)
spin_lock_irqsave(&power_state_active_lock, flags);
power_state_active_cnt++;
spin_unlock_irqrestore(&power_state_active_lock, flags);
int power_state_active_disable(void)
spin_lock_irqsave(&power_state_active_lock, flags);
if (power_state_active_cnt <= 0) {
pr_err("power state: unbalanced enable/disable calls\n");
power_state_active_cnt--;
spin_unlock_irqrestore(&power_state_active_lock, flags);
#ifdef CONFIG_REGULATOR_DEBUG
static int power_state_active_get(void)
spin_lock_irqsave(&power_state_active_lock, flags);
cnt = power_state_active_cnt;
spin_unlock_irqrestore(&power_state_active_lock, flags);