#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
ACPI_MODULE_NAME("cm_sbs");
#define ACPI_AC_CLASS "ac_adapter"
#define ACPI_BATTERY_CLASS "battery"
#define _COMPONENT ACPI_SBS_COMPONENT
static struct proc_dir_entry *acpi_ac_dir;
static struct proc_dir_entry *acpi_battery_dir;
static DEFINE_MUTEX(cm_sbs_mutex);
static int lock_ac_dir_cnt;
static int lock_battery_dir_cnt;
struct proc_dir_entry *acpi_lock_ac_dir(void)
mutex_lock(&cm_sbs_mutex);
acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir);
"Cannot create %s\n", ACPI_AC_CLASS);
mutex_unlock(&cm_sbs_mutex);
EXPORT_SYMBOL(acpi_lock_ac_dir);
void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir_param)
mutex_lock(&cm_sbs_mutex);
if (lock_ac_dir_cnt == 0 && acpi_ac_dir_param && acpi_ac_dir) {
remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);